Commit 6450bc43 authored by samdbeckham's avatar samdbeckham

Rewords 'revert dismissal' on the GSD

Where GSD is the group security dashboard

Renames:
- the button text
- the tooltip text
- the test names
- the action and mutation names

It also updates the locale file for the newer wording.
parent f0fcec4f
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
'fetchVulnerabilities', 'fetchVulnerabilities',
'fetchVulnerabilitiesCount', 'fetchVulnerabilitiesCount',
'fetchVulnerabilitiesHistory', 'fetchVulnerabilitiesHistory',
'revertDismissal', 'undoDismiss',
'setVulnerabilitiesCountEndpoint', 'setVulnerabilitiesCountEndpoint',
'setVulnerabilitiesEndpoint', 'setVulnerabilitiesEndpoint',
'setVulnerabilitiesHistoryEndpoint', 'setVulnerabilitiesHistoryEndpoint',
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
:can-create-feedback-permission="canCreateFeedbackPermission" :can-create-feedback-permission="canCreateFeedbackPermission"
@createNewIssue="createIssue({ vulnerability: modal.vulnerability })" @createNewIssue="createIssue({ vulnerability: modal.vulnerability })"
@dismissIssue="dismissVulnerability({ vulnerability: modal.vulnerability })" @dismissIssue="dismissVulnerability({ vulnerability: modal.vulnerability })"
@revertDismissIssue="revertDismissal({ vulnerability: modal.vulnerability })" @revertDismissIssue="undoDismiss({ vulnerability: modal.vulnerability })"
/> />
</div> </div>
</template> </template>
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
'openModal', 'openModal',
'createIssue', 'createIssue',
'dismissVulnerability', 'dismissVulnerability',
'revertDismissal', 'undoDismiss',
]), ]),
handleCreateIssue() { handleCreateIssue() {
const { vulnerability } = this; const { vulnerability } = this;
...@@ -52,9 +52,9 @@ export default { ...@@ -52,9 +52,9 @@ export default {
const { vulnerability } = this; const { vulnerability } = this;
this.dismissVulnerability({ vulnerability, flashError: true }); this.dismissVulnerability({ vulnerability, flashError: true });
}, },
handleRevertDismissal() { handleUndoDismiss() {
const { vulnerability } = this; const { vulnerability } = this;
this.revertDismissal({ vulnerability, flashError: true }); this.undoDismiss({ vulnerability, flashError: true });
}, },
}, },
}; };
...@@ -89,14 +89,14 @@ export default { ...@@ -89,14 +89,14 @@ export default {
<template v-if="canDismissVulnerability"> <template v-if="canDismissVulnerability">
<loading-button <loading-button
v-if="isDismissed" v-if="isDismissed"
key="revert-dismissal" key="undo-dismiss"
v-gl-tooltip v-gl-tooltip
:aria-label="s__('Security Reports|Undo dismiss')" :aria-label="s__('Security Reports|Undo dismiss')"
:loading="isDismissingVulnerability" :loading="isDismissingVulnerability"
:title="s__('Security Reports|Undo dismiss')" :title="s__('Security Reports|Undo dismiss')"
container-class="btn btn-inverted btn-warning btn-border-color js-revert-dismissal" container-class="btn btn-inverted btn-warning btn-border-color js-undo-dismiss"
type="button" type="button"
@click="handleRevertDismissal" @click="handleUndoDismiss"
> >
<icon name="repeat" /> <icon name="repeat" />
</loading-button> </loading-button>
......
...@@ -172,33 +172,33 @@ export const receiveDismissVulnerabilityError = ({ commit }, { flashError }) => ...@@ -172,33 +172,33 @@ export const receiveDismissVulnerabilityError = ({ commit }, { flashError }) =>
} }
}; };
export const revertDismissal = ({ dispatch }, { vulnerability, flashError }) => { export const undoDismiss = ({ dispatch }, { vulnerability, flashError }) => {
const { vulnerability_feedback_dismissal_path, dismissal_feedback } = vulnerability; const { vulnerability_feedback_dismissal_path, dismissal_feedback } = vulnerability;
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const url = `${vulnerability_feedback_dismissal_path}/${dismissal_feedback.id}`; const url = `${vulnerability_feedback_dismissal_path}/${dismissal_feedback.id}`;
dispatch('requestRevertDismissal'); dispatch('requestUndoDismiss');
axios axios
.delete(url) .delete(url)
.then(() => { .then(() => {
const { id } = vulnerability; const { id } = vulnerability;
dispatch('receiveRevertDismissalSuccess', { id }); dispatch('receiveUndoDismissSuccess', { id });
}) })
.catch(() => { .catch(() => {
dispatch('receiveRevertDismissalError', { flashError }); dispatch('receiveUndoDismissError', { flashError });
}); });
}; };
export const requestRevertDismissal = ({ commit }) => { export const requestUndoDismiss = ({ commit }) => {
commit(types.REQUEST_REVERT_DISMISSAL); commit(types.REQUEST_REVERT_DISMISSAL);
}; };
export const receiveRevertDismissalSuccess = ({ commit }, payload) => { export const receiveUndoDismissSuccess = ({ commit }, payload) => {
commit(types.RECEIVE_REVERT_DISMISSAL_SUCCESS, payload); commit(types.RECEIVE_REVERT_DISMISSAL_SUCCESS, payload);
}; };
export const receiveRevertDismissalError = ({ commit }, { flashError }) => { export const receiveUndoDismissError = ({ commit }, { flashError }) => {
commit(types.RECEIVE_REVERT_DISMISSAL_ERROR); commit(types.RECEIVE_REVERT_DISMISSAL_ERROR);
if (flashError) { if (flashError) {
createFlash( createFlash(
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
computed: { computed: {
revertTitle() { revertTitle() {
return this.modal.vulnerability.isDismissed return this.modal.vulnerability.isDismissed
? s__('ciReport|Revert dismissal') ? s__('ciReport|Undo dismiss')
: s__('ciReport|Dismiss vulnerability'); : s__('ciReport|Dismiss vulnerability');
}, },
hasDismissedBy() { hasDismissedBy() {
......
---
title: Renames 'revert dismissal' to 'undo dismiss' on the Group security dashboard
merge_request: 9500
author:
type: other
...@@ -146,8 +146,8 @@ describe('Security Dashboard Action Buttons', () => { ...@@ -146,8 +146,8 @@ describe('Security Dashboard Action Buttons', () => {
expect(vm.$el.querySelector('.js-dismiss-vulnerability')).toBeNull(); expect(vm.$el.querySelector('.js-dismiss-vulnerability')).toBeNull();
}); });
it('should render the revert dismissal button', () => { it('should render the undo dismiss button', () => {
expect(vm.$el.querySelector('.js-revert-dismissal')).not.toBeNull(); expect(vm.$el.querySelector('.js-undo-dismiss')).not.toBeNull();
}); });
}); });
}); });
...@@ -572,7 +572,7 @@ describe('vulnerability dismissal', () => { ...@@ -572,7 +572,7 @@ describe('vulnerability dismissal', () => {
}); });
describe('revert vulnerability dismissal', () => { describe('revert vulnerability dismissal', () => {
describe('revertDismissal', () => { describe('undoDismiss', () => {
const vulnerability = mockDataVulnerabilities[2]; const vulnerability = mockDataVulnerabilities[2];
const url = `${vulnerability.vulnerability_feedback_dismissal_path}/${ const url = `${vulnerability.vulnerability_feedback_dismissal_path}/${
vulnerability.dismissal_feedback.id vulnerability.dismissal_feedback.id
...@@ -594,13 +594,13 @@ describe('revert vulnerability dismissal', () => { ...@@ -594,13 +594,13 @@ describe('revert vulnerability dismissal', () => {
it('should dispatch the request and success actions', done => { it('should dispatch the request and success actions', done => {
testAction( testAction(
actions.revertDismissal, actions.undoDismiss,
{ vulnerability }, { vulnerability },
{}, {},
[], [],
[ [
{ type: 'requestRevertDismissal' }, { type: 'requestUndoDismiss' },
{ type: 'receiveRevertDismissalSuccess', payload: { id: vulnerability.id } }, { type: 'receiveUndoDismissSuccess', payload: { id: vulnerability.id } },
], ],
done, done,
); );
...@@ -616,13 +616,13 @@ describe('revert vulnerability dismissal', () => { ...@@ -616,13 +616,13 @@ describe('revert vulnerability dismissal', () => {
const flashError = false; const flashError = false;
testAction( testAction(
actions.revertDismissal, actions.undoDismiss,
{ vulnerability, flashError }, { vulnerability, flashError },
{}, {},
[], [],
[ [
{ type: 'requestRevertDismissal' }, { type: 'requestUndoDismiss' },
{ type: 'receiveRevertDismissalError', payload: { flashError: false } }, { type: 'receiveUndoDismissError', payload: { flashError: false } },
], ],
done, done,
); );
...@@ -630,13 +630,13 @@ describe('revert vulnerability dismissal', () => { ...@@ -630,13 +630,13 @@ describe('revert vulnerability dismissal', () => {
}); });
}); });
describe('receiveRevertDismissalSuccess', () => { describe('receiveUndoDismissSuccess', () => {
it('should commit the success mutation', done => { it('should commit the success mutation', done => {
const state = initialState; const state = initialState;
const data = mockDataVulnerabilities[0]; const data = mockDataVulnerabilities[0];
testAction( testAction(
actions.receiveRevertDismissalSuccess, actions.receiveUndoDismissSuccess,
{ data }, { data },
state, state,
[ [
...@@ -651,12 +651,12 @@ describe('revert vulnerability dismissal', () => { ...@@ -651,12 +651,12 @@ describe('revert vulnerability dismissal', () => {
}); });
}); });
describe('receiveRevertDismissalError', () => { describe('receiveUndoDismissError', () => {
it('should commit the error mutation', done => { it('should commit the error mutation', done => {
const state = initialState; const state = initialState;
testAction( testAction(
actions.receiveRevertDismissalError, actions.receiveUndoDismissError,
{}, {},
state, state,
[{ type: types.RECEIVE_REVERT_DISMISSAL_ERROR }], [{ type: types.RECEIVE_REVERT_DISMISSAL_ERROR }],
...@@ -666,12 +666,12 @@ describe('revert vulnerability dismissal', () => { ...@@ -666,12 +666,12 @@ describe('revert vulnerability dismissal', () => {
}); });
}); });
describe('requestRevertDismissal', () => { describe('requestUndoDismiss', () => {
it('should commit the request mutation', done => { it('should commit the request mutation', done => {
const state = initialState; const state = initialState;
testAction( testAction(
actions.requestRevertDismissal, actions.requestUndoDismiss,
{}, {},
state, state,
[{ type: types.REQUEST_REVERT_DISMISSAL }], [{ type: types.REQUEST_REVERT_DISMISSAL }],
......
...@@ -33,13 +33,11 @@ describe('Security Reports modal', () => { ...@@ -33,13 +33,11 @@ describe('Security Reports modal', () => {
expect(vm.$el.textContent.trim()).toContain('#123'); expect(vm.$el.textContent.trim()).toContain('#123');
}); });
it('renders button to revert dismissal', () => { it('renders button to undo dismiss', () => {
expect(vm.$el.querySelector('.js-dismiss-btn').textContent.trim()).toEqual( expect(vm.$el.querySelector('.js-dismiss-btn').textContent.trim()).toEqual('Undo dismiss');
'Revert dismissal',
);
}); });
it('emits revertDismissIssue when revert dismissal button is clicked', () => { it('emits revertDismissIssue when undo dismiss button is clicked', () => {
spyOn(vm, '$emit'); spyOn(vm, '$emit');
const button = vm.$el.querySelector('.js-dismiss-btn'); const button = vm.$el.querySelector('.js-dismiss-btn');
......
...@@ -11189,9 +11189,6 @@ msgstr "" ...@@ -11189,9 +11189,6 @@ msgstr ""
msgid "ciReport|Performance metrics" msgid "ciReport|Performance metrics"
msgstr "" msgstr ""
msgid "ciReport|Revert dismissal"
msgstr ""
msgid "ciReport|SAST" msgid "ciReport|SAST"
msgstr "" msgstr ""
...@@ -11231,6 +11228,9 @@ msgstr "" ...@@ -11231,6 +11228,9 @@ msgstr ""
msgid "ciReport|There was an error reverting the dismissal. Please try again." msgid "ciReport|There was an error reverting the dismissal. Please try again."
msgstr "" msgstr ""
msgid "ciReport|Undo dismiss"
msgstr ""
msgid "ciReport|Upgrade %{name} from %{version} to %{fixed}." msgid "ciReport|Upgrade %{name} from %{version} to %{fixed}."
msgstr "" msgstr ""
......
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