Convert hide_dismissed to camelCase

parent da173583
......@@ -37,7 +37,7 @@ export default {
<gl-toggle-vuex
class="d-block mt-1 js-toggle"
store-module="filters"
state-property="hide_dismissed"
state-property="hideDismissed"
set-action="setToggleValue"
/>
</div>
......
......@@ -27,7 +27,7 @@ export const lockFilter = ({ commit }, payload) => {
export const setHideDismissedToggleInitialState = ({ commit }) => {
const [urlParam] = getParameterValues('scope');
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 }) => {
......
......@@ -32,10 +32,10 @@ export const activeFilters = state => {
acc[filter.id] = [...Array.from(filter.selection)].filter(id => !isBaseFilterOption(id));
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
if (gon.features && gon.features.hideDismissedVulnerabilities) {
filters.scope = state.hide_dismissed ? 'dismissed' : 'all';
filters.scope = state.hideDismissed ? 'dismissed' : 'all';
}
return filters;
};
......
......@@ -19,7 +19,7 @@ export default {
return { ...filter, selection };
});
state.hide_dismissed = payload.scope !== 'all';
state.hideDismissed = payload.scope !== 'all';
},
[types.SET_FILTER](state, payload) {
const { filterId, optionId } = payload;
......
......@@ -34,5 +34,5 @@ export default () => ({
selection: new Set([BASE_FILTERS.project_id.id]),
},
],
hide_dismissed: true,
hideDismissed: true,
});
......@@ -154,7 +154,7 @@ export const dismissVulnerability = (
) => {
const page = state.pageInfo && state.pageInfo.page ? state.pageInfo.page : 1;
const dismissedVulnerabilitiesHidden = Boolean(
rootState.filters && rootState.filters.hide_dismissed,
rootState.filters && rootState.filters.hideDismissed,
);
dispatch('requestDismissVulnerability');
......
......@@ -175,7 +175,7 @@ describe('Security Dashboard app', () => {
`('$description', ({ getParameterValuesReturnValue, expected }) => {
getParameterValues.mockImplementation(() => getParameterValuesReturnValue);
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', () => {
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: [],
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'],
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'],
hideDismissedValue: true,
},
......@@ -101,7 +101,7 @@ describe('filters actions', () => {
{
type: types.SET_TOGGLE_VALUE,
payload: {
key: 'hide_dismissed',
key: 'hideDismissed',
value: testCase.hideDismissedValue,
},
},
......
......@@ -764,7 +764,7 @@ describe('vulnerability dismissal', () => {
state = {
...initialState(),
filters: {
hide_dismissed: true,
hideDismissed: true,
},
};
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