Commit 5c23334d authored by Lukas Eipert's avatar Lukas Eipert

Remove unused permission variable from Vuex store

Apparently we do not use these two variables canCreateIssuePermission
and canCreateFeedbackPermission, so we can just get rid of them.
parent ebaaefc3
......@@ -146,8 +146,6 @@ export default {
'dependencyScanning',
'summaryCounts',
'modal',
'canCreateIssuePermission',
'canCreateFeedbackPermission',
]),
...mapGetters([
'groupedSummaryText',
......@@ -198,9 +196,6 @@ export default {
this.setCreateVulnerabilityFeedbackDismissalPath(this.createVulnerabilityFeedbackDismissalPath);
this.setPipelineId(this.pipelineId);
this.setCanCreateIssuePermission(this.canCreateIssue);
this.setCanCreateFeedbackPermission(this.canCreateFeedback);
const sastDiffEndpoint = gl?.mrWidgetData?.sast_comparison_path;
if (sastDiffEndpoint && this.hasSastReports) {
......@@ -241,8 +236,6 @@ export default {
'setCreateVulnerabilityFeedbackMergeRequestPath',
'setCreateVulnerabilityFeedbackDismissalPath',
'setPipelineId',
'setCanCreateIssuePermission',
'setCanCreateFeedbackPermission',
'dismissVulnerability',
'revertDismissVulnerability',
'createNewIssue',
......
......@@ -41,12 +41,6 @@ export const setCreateVulnerabilityFeedbackDismissalPath = ({ commit }, path) =>
export const setPipelineId = ({ commit }, id) => commit(types.SET_PIPELINE_ID, id);
export const setCanCreateIssuePermission = ({ commit }, permission) =>
commit(types.SET_CAN_CREATE_ISSUE_PERMISSION, permission);
export const setCanCreateFeedbackPermission = ({ commit }, permission) =>
commit(types.SET_CAN_CREATE_FEEDBACK_PERMISSION, permission);
/**
* CONTAINER SCANNING
*/
......
......@@ -10,8 +10,6 @@ export const SET_CREATE_VULNERABILITY_FEEDBACK_MERGE_REQUEST_PATH =
export const SET_CREATE_VULNERABILITY_FEEDBACK_DISMISSAL_PATH =
'SET_CREATE_VULNERABILITY_FEEDBACK_DISMISSAL_PATH';
export const SET_PIPELINE_ID = 'SET_PIPELINE_ID';
export const SET_CAN_CREATE_ISSUE_PERMISSION = 'SET_CAN_CREATE_ISSUE_PERMISSION';
export const SET_CAN_CREATE_FEEDBACK_PERMISSION = 'SET_CAN_CREATE_FEEDBACK_PERMISSION';
// CONTAINER SCANNING
export const SET_CONTAINER_SCANNING_DIFF_ENDPOINT = 'SET_CONTAINER_SCANNING_DIFF_ENDPOINT';
......
......@@ -40,14 +40,6 @@ export default {
state.pipelineId = id;
},
[types.SET_CAN_CREATE_ISSUE_PERMISSION](state, permission) {
state.canCreateIssuePermission = permission;
},
[types.SET_CAN_CREATE_FEEDBACK_PERMISSION](state, permission) {
state.canCreateFeedbackPermission = permission;
},
// CONTAINER SCANNING
[types.SET_CONTAINER_SCANNING_DIFF_ENDPOINT](state, path) {
Vue.set(state.containerScanning.paths, 'diffEndpoint', path);
......
......@@ -11,8 +11,6 @@ export default () => ({
createVulnerabilityFeedbackMergeRequestPath: null,
createVulnerabilityFeedbackDismissalPath: null,
pipelineId: null,
canCreateIssuePermission: false,
canCreateFeedbackPermission: false,
containerScanning: {
paths: {
......
......@@ -5,8 +5,6 @@ import {
setVulnerabilityFeedbackPath,
setVulnerabilityFeedbackHelpPath,
setPipelineId,
setCanCreateIssuePermission,
setCanCreateFeedbackPermission,
requestContainerScanningDiff,
requestDastDiff,
requestDependencyScanningDiff,
......@@ -194,42 +192,6 @@ describe('security reports actions', () => {
});
});
describe('setCanCreateIssuePermission', () => {
it('should commit set can create issue permission', done => {
testAction(
setCanCreateIssuePermission,
true,
mockedState,
[
{
type: types.SET_CAN_CREATE_ISSUE_PERMISSION,
payload: true,
},
],
[],
done,
);
});
});
describe('setCanCreateFeedbackPermission', () => {
it('should commit set can create feedback permission', done => {
testAction(
setCanCreateFeedbackPermission,
true,
mockedState,
[
{
type: types.SET_CAN_CREATE_FEEDBACK_PERMISSION,
payload: true,
},
],
[],
done,
);
});
});
describe('requestContainerScanningDiff', () => {
it('should commit request mutation', done => {
testAction(
......
......@@ -55,22 +55,6 @@ describe('security reports mutations', () => {
});
});
describe('SET_CAN_CREATE_ISSUE_PERMISSION', () => {
it('should set permission for create issue', () => {
mutations[types.SET_CAN_CREATE_ISSUE_PERMISSION](stateCopy, true);
expect(stateCopy.canCreateIssuePermission).toEqual(true);
});
});
describe('SET_CAN_CREATE_FEEDBACK_PERMISSION', () => {
it('should set permission for create feedback', () => {
mutations[types.SET_CAN_CREATE_FEEDBACK_PERMISSION](stateCopy, true);
expect(stateCopy.canCreateFeedbackPermission).toEqual(true);
});
});
describe('REQUEST_CONTAINER_SCANNING_DIFF', () => {
it('should set container scanning loading flag to true', () => {
mutations[types.REQUEST_CONTAINER_SCANNING_DIFF](stateCopy);
......
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