Convert hide_dismissed to camelCase

parent da173583
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
<gl-toggle-vuex <gl-toggle-vuex
class="d-block mt-1 js-toggle" class="d-block mt-1 js-toggle"
store-module="filters" store-module="filters"
state-property="hide_dismissed" state-property="hideDismissed"
set-action="setToggleValue" set-action="setToggleValue"
/> />
</div> </div>
......
...@@ -27,7 +27,7 @@ export const lockFilter = ({ commit }, payload) => { ...@@ -27,7 +27,7 @@ export const lockFilter = ({ commit }, payload) => {
export const setHideDismissedToggleInitialState = ({ commit }) => { export const setHideDismissedToggleInitialState = ({ commit }) => {
const [urlParam] = getParameterValues('scope'); const [urlParam] = getParameterValues('scope');
const showDismissed = urlParam === 'all'; const showDismissed = urlParam === 'all';
commit(types.SET_TOGGLE_VALUE, { key: 'hide_dismissed', value: !showDismissed }); commit(types.SET_TOGGLE_VALUE, { key: 'hideDismissed', value: !showDismissed });
}; };
export const setToggleValue = ({ commit }, { key, value }) => { export const setToggleValue = ({ commit }, { key, value }) => {
......
...@@ -32,10 +32,10 @@ export const activeFilters = state => { ...@@ -32,10 +32,10 @@ export const activeFilters = state => {
acc[filter.id] = [...Array.from(filter.selection)].filter(id => !isBaseFilterOption(id)); acc[filter.id] = [...Array.from(filter.selection)].filter(id => !isBaseFilterOption(id));
return acc; return acc;
}, {}); }, {});
// hide_dismissed is hardcoded as it currently is an edge-case, more info in the MR: // hideDismissed is hardcoded as it currently is an edge-case, more info in the MR:
// https://gitlab.com/gitlab-org/gitlab/merge_requests/15333#note_208301144 // https://gitlab.com/gitlab-org/gitlab/merge_requests/15333#note_208301144
if (gon.features && gon.features.hideDismissedVulnerabilities) { if (gon.features && gon.features.hideDismissedVulnerabilities) {
filters.scope = state.hide_dismissed ? 'dismissed' : 'all'; filters.scope = state.hideDismissed ? 'dismissed' : 'all';
} }
return filters; return filters;
}; };
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
return { ...filter, selection }; return { ...filter, selection };
}); });
state.hide_dismissed = payload.scope !== 'all'; state.hideDismissed = payload.scope !== 'all';
}, },
[types.SET_FILTER](state, payload) { [types.SET_FILTER](state, payload) {
const { filterId, optionId } = payload; const { filterId, optionId } = payload;
......
...@@ -34,5 +34,5 @@ export default () => ({ ...@@ -34,5 +34,5 @@ export default () => ({
selection: new Set([BASE_FILTERS.project_id.id]), selection: new Set([BASE_FILTERS.project_id.id]),
}, },
], ],
hide_dismissed: true, hideDismissed: true,
}); });
...@@ -154,7 +154,7 @@ export const dismissVulnerability = ( ...@@ -154,7 +154,7 @@ export const dismissVulnerability = (
) => { ) => {
const page = state.pageInfo && state.pageInfo.page ? state.pageInfo.page : 1; const page = state.pageInfo && state.pageInfo.page ? state.pageInfo.page : 1;
const dismissedVulnerabilitiesHidden = Boolean( const dismissedVulnerabilitiesHidden = Boolean(
rootState.filters && rootState.filters.hide_dismissed, rootState.filters && rootState.filters.hideDismissed,
); );
dispatch('requestDismissVulnerability'); dispatch('requestDismissVulnerability');
......
...@@ -175,7 +175,7 @@ describe('Security Dashboard app', () => { ...@@ -175,7 +175,7 @@ describe('Security Dashboard app', () => {
`('$description', ({ getParameterValuesReturnValue, expected }) => { `('$description', ({ getParameterValuesReturnValue, expected }) => {
getParameterValues.mockImplementation(() => getParameterValuesReturnValue); getParameterValues.mockImplementation(() => getParameterValuesReturnValue);
createComponent(); createComponent();
expect(wrapper.vm.$store.state.filters.hide_dismissed).toBe(expected); expect(wrapper.vm.$store.state.filters.hideDismissed).toBe(expected);
}); });
}); });
}); });
...@@ -75,17 +75,17 @@ describe('filters actions', () => { ...@@ -75,17 +75,17 @@ describe('filters actions', () => {
describe('setHideDismissedToggleInitialState', () => { describe('setHideDismissedToggleInitialState', () => {
[ [
{ {
description: 'should set hide_dismissed to true if scope param is not present', description: 'should set hideDismissed to true if scope param is not present',
returnValue: [], returnValue: [],
hideDismissedValue: true, hideDismissedValue: true,
}, },
{ {
description: 'should set hide_dismissed to false if scope param is "all"', description: 'should set hideDismissed to false if scope param is "all"',
returnValue: ['all'], returnValue: ['all'],
hideDismissedValue: false, hideDismissedValue: false,
}, },
{ {
description: 'should set hide_dismissed to true if scope param is "dismissed"', description: 'should set hideDismissed to true if scope param is "dismissed"',
returnValue: ['dismissed'], returnValue: ['dismissed'],
hideDismissedValue: true, hideDismissedValue: true,
}, },
...@@ -101,7 +101,7 @@ describe('filters actions', () => { ...@@ -101,7 +101,7 @@ describe('filters actions', () => {
{ {
type: types.SET_TOGGLE_VALUE, type: types.SET_TOGGLE_VALUE,
payload: { payload: {
key: 'hide_dismissed', key: 'hideDismissed',
value: testCase.hideDismissedValue, value: testCase.hideDismissedValue,
}, },
}, },
......
...@@ -764,7 +764,7 @@ describe('vulnerability dismissal', () => { ...@@ -764,7 +764,7 @@ describe('vulnerability dismissal', () => {
state = { state = {
...initialState(), ...initialState(),
filters: { filters: {
hide_dismissed: true, hideDismissed: true,
}, },
}; };
mock mock
......
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