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 { ...@@ -146,8 +146,6 @@ export default {
'dependencyScanning', 'dependencyScanning',
'summaryCounts', 'summaryCounts',
'modal', 'modal',
'canCreateIssuePermission',
'canCreateFeedbackPermission',
]), ]),
...mapGetters([ ...mapGetters([
'groupedSummaryText', 'groupedSummaryText',
...@@ -198,9 +196,6 @@ export default { ...@@ -198,9 +196,6 @@ export default {
this.setCreateVulnerabilityFeedbackDismissalPath(this.createVulnerabilityFeedbackDismissalPath); this.setCreateVulnerabilityFeedbackDismissalPath(this.createVulnerabilityFeedbackDismissalPath);
this.setPipelineId(this.pipelineId); this.setPipelineId(this.pipelineId);
this.setCanCreateIssuePermission(this.canCreateIssue);
this.setCanCreateFeedbackPermission(this.canCreateFeedback);
const sastDiffEndpoint = gl?.mrWidgetData?.sast_comparison_path; const sastDiffEndpoint = gl?.mrWidgetData?.sast_comparison_path;
if (sastDiffEndpoint && this.hasSastReports) { if (sastDiffEndpoint && this.hasSastReports) {
...@@ -241,8 +236,6 @@ export default { ...@@ -241,8 +236,6 @@ export default {
'setCreateVulnerabilityFeedbackMergeRequestPath', 'setCreateVulnerabilityFeedbackMergeRequestPath',
'setCreateVulnerabilityFeedbackDismissalPath', 'setCreateVulnerabilityFeedbackDismissalPath',
'setPipelineId', 'setPipelineId',
'setCanCreateIssuePermission',
'setCanCreateFeedbackPermission',
'dismissVulnerability', 'dismissVulnerability',
'revertDismissVulnerability', 'revertDismissVulnerability',
'createNewIssue', 'createNewIssue',
......
...@@ -41,12 +41,6 @@ export const setCreateVulnerabilityFeedbackDismissalPath = ({ commit }, path) => ...@@ -41,12 +41,6 @@ export const setCreateVulnerabilityFeedbackDismissalPath = ({ commit }, path) =>
export const setPipelineId = ({ commit }, id) => commit(types.SET_PIPELINE_ID, id); 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 * CONTAINER SCANNING
*/ */
......
...@@ -10,8 +10,6 @@ export const SET_CREATE_VULNERABILITY_FEEDBACK_MERGE_REQUEST_PATH = ...@@ -10,8 +10,6 @@ export const SET_CREATE_VULNERABILITY_FEEDBACK_MERGE_REQUEST_PATH =
export const SET_CREATE_VULNERABILITY_FEEDBACK_DISMISSAL_PATH = export const SET_CREATE_VULNERABILITY_FEEDBACK_DISMISSAL_PATH =
'SET_CREATE_VULNERABILITY_FEEDBACK_DISMISSAL_PATH'; 'SET_CREATE_VULNERABILITY_FEEDBACK_DISMISSAL_PATH';
export const SET_PIPELINE_ID = 'SET_PIPELINE_ID'; 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 // CONTAINER SCANNING
export const SET_CONTAINER_SCANNING_DIFF_ENDPOINT = 'SET_CONTAINER_SCANNING_DIFF_ENDPOINT'; export const SET_CONTAINER_SCANNING_DIFF_ENDPOINT = 'SET_CONTAINER_SCANNING_DIFF_ENDPOINT';
......
...@@ -40,14 +40,6 @@ export default { ...@@ -40,14 +40,6 @@ export default {
state.pipelineId = id; 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 // CONTAINER SCANNING
[types.SET_CONTAINER_SCANNING_DIFF_ENDPOINT](state, path) { [types.SET_CONTAINER_SCANNING_DIFF_ENDPOINT](state, path) {
Vue.set(state.containerScanning.paths, 'diffEndpoint', path); Vue.set(state.containerScanning.paths, 'diffEndpoint', path);
......
...@@ -11,8 +11,6 @@ export default () => ({ ...@@ -11,8 +11,6 @@ export default () => ({
createVulnerabilityFeedbackMergeRequestPath: null, createVulnerabilityFeedbackMergeRequestPath: null,
createVulnerabilityFeedbackDismissalPath: null, createVulnerabilityFeedbackDismissalPath: null,
pipelineId: null, pipelineId: null,
canCreateIssuePermission: false,
canCreateFeedbackPermission: false,
containerScanning: { containerScanning: {
paths: { paths: {
......
...@@ -5,8 +5,6 @@ import { ...@@ -5,8 +5,6 @@ import {
setVulnerabilityFeedbackPath, setVulnerabilityFeedbackPath,
setVulnerabilityFeedbackHelpPath, setVulnerabilityFeedbackHelpPath,
setPipelineId, setPipelineId,
setCanCreateIssuePermission,
setCanCreateFeedbackPermission,
requestContainerScanningDiff, requestContainerScanningDiff,
requestDastDiff, requestDastDiff,
requestDependencyScanningDiff, requestDependencyScanningDiff,
...@@ -194,42 +192,6 @@ describe('security reports actions', () => { ...@@ -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', () => { describe('requestContainerScanningDiff', () => {
it('should commit request mutation', done => { it('should commit request mutation', done => {
testAction( testAction(
......
...@@ -55,22 +55,6 @@ describe('security reports mutations', () => { ...@@ -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', () => { describe('REQUEST_CONTAINER_SCANNING_DIFF', () => {
it('should set container scanning loading flag to true', () => { it('should set container scanning loading flag to true', () => {
mutations[types.REQUEST_CONTAINER_SCANNING_DIFF](stateCopy); 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