Commit 09d10207 authored by Tristan Read's avatar Tristan Read

Convert underscore to lodash for error_tracking_settings

parent bbcd604f
import _ from 'underscore'; import { isMatch } from 'lodash';
import { __, s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import { getDisplayName } from '../utils'; import { getDisplayName } from '../utils';
...@@ -7,7 +7,7 @@ export const hasProjects = state => Boolean(state.projects) && state.projects.le ...@@ -7,7 +7,7 @@ export const hasProjects = state => Boolean(state.projects) && state.projects.le
export const isProjectInvalid = (state, getters) => export const isProjectInvalid = (state, getters) =>
Boolean(state.selectedProject) && Boolean(state.selectedProject) &&
getters.hasProjects && getters.hasProjects &&
!state.projects.some(project => _.isMatch(state.selectedProject, project)); !state.projects.some(project => isMatch(state.selectedProject, project));
export const dropdownLabel = (state, getters) => { export const dropdownLabel = (state, getters) => {
if (state.selectedProject !== null) { if (state.selectedProject !== null) {
......
import _ from 'underscore'; import { pick } from 'lodash';
import { convertObjectPropsToCamelCase, parseBoolean } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase, parseBoolean } from '~/lib/utils/common_utils';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { projectKeys } from '../utils'; import { projectKeys } from '../utils';
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
.map(convertObjectPropsToCamelCase) .map(convertObjectPropsToCamelCase)
// The `pick` strips out extra properties returned from Sentry. // The `pick` strips out extra properties returned from Sentry.
// Such properties could be problematic later, e.g. when checking whether `projects` contains `selectedProject` // Such properties could be problematic later, e.g. when checking whether `projects` contains `selectedProject`
.map(project => _.pick(project, projectKeys)); .map(project => pick(project, projectKeys));
}, },
[types.RESET_CONNECT](state) { [types.RESET_CONNECT](state) {
state.connectSuccessful = false; state.connectSuccessful = false;
...@@ -29,10 +29,7 @@ export default { ...@@ -29,10 +29,7 @@ export default {
state.operationsSettingsEndpoint = operationsSettingsEndpoint; state.operationsSettingsEndpoint = operationsSettingsEndpoint;
if (project) { if (project) {
state.selectedProject = _.pick( state.selectedProject = pick(convertObjectPropsToCamelCase(JSON.parse(project)), projectKeys);
convertObjectPropsToCamelCase(JSON.parse(project)),
projectKeys,
);
} }
}, },
[types.UPDATE_API_HOST](state, apiHost) { [types.UPDATE_API_HOST](state, apiHost) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment