Commit 2d573a30 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '334144-flash-remove-all-params-that-match-the-defaults' into 'master'

Remove all params that match the defaults for createFlash

See merge request gitlab-org/gitlab!64610
parents 80a2d99c d6233ca2
...@@ -48,7 +48,6 @@ export const receiveSettingsError = ({ commit }, { response = {} }) => { ...@@ -48,7 +48,6 @@ export const receiveSettingsError = ({ commit }, { response = {} }) => {
createFlash({ createFlash({
message: `${__('There was an error saving your changes.')} ${message}`, message: `${__('There was an error saving your changes.')} ${message}`,
type: 'alert',
}); });
commit(types.UPDATE_SETTINGS_LOADING, false); commit(types.UPDATE_SETTINGS_LOADING, false);
}; };
......
...@@ -40,6 +40,5 @@ export const receiveGrafanaIntegrationUpdateError = (_, error) => { ...@@ -40,6 +40,5 @@ export const receiveGrafanaIntegrationUpdateError = (_, error) => {
createFlash({ createFlash({
message: `${__('There was an error saving your changes.')} ${message}`, message: `${__('There was an error saving your changes.')} ${message}`,
type: 'alert',
}); });
}; };
...@@ -61,9 +61,6 @@ export default { ...@@ -61,9 +61,6 @@ export default {
message: sprintf(s__('The name "%{name}" is already taken in this directory.'), { message: sprintf(s__('The name "%{name}" is already taken in this directory.'), {
name: this.entryName, name: this.entryName,
}), }),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -252,9 +252,6 @@ export default { ...@@ -252,9 +252,6 @@ export default {
.catch((err) => { .catch((err) => {
createFlash({ createFlash({
message: __('Error setting up editor. Please try again.'), message: __('Error setting up editor. Please try again.'),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -113,9 +113,6 @@ export const createRouter = (store, defaultBranch) => { ...@@ -113,9 +113,6 @@ export const createRouter = (store, defaultBranch) => {
.catch((e) => { .catch((e) => {
createFlash({ createFlash({
message: __('Error while loading the project data. Please try again.'), message: __('Error while loading the project data. Please try again.'),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -40,10 +40,6 @@ export const createTempEntry = ( ...@@ -40,10 +40,6 @@ export const createTempEntry = (
message: sprintf(__('The name "%{name}" is already taken in this directory.'), { message: sprintf(__('The name "%{name}" is already taken in this directory.'), {
name: name.split('/').pop(), name: name.split('/').pop(),
}), }),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
...@@ -287,9 +283,6 @@ export const getBranchData = ({ commit, state }, { projectId, branchId, force = ...@@ -287,9 +283,6 @@ export const getBranchData = ({ commit, state }, { projectId, branchId, force =
} else { } else {
createFlash({ createFlash({
message: __('Error loading branch data. Please try again.'), message: __('Error loading branch data. Please try again.'),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -36,9 +36,6 @@ export const getMergeRequestsForBranch = ( ...@@ -36,9 +36,6 @@ export const getMergeRequestsForBranch = (
.catch((e) => { .catch((e) => {
createFlash({ createFlash({
message: __(`Error fetching merge requests for ${branchId}`), message: __(`Error fetching merge requests for ${branchId}`),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -21,9 +21,6 @@ export const getProjectData = ({ commit, state }, { namespace, projectId, force ...@@ -21,9 +21,6 @@ export const getProjectData = ({ commit, state }, { namespace, projectId, force
.catch(() => { .catch(() => {
createFlash({ createFlash({
message: __('Error loading project data. Please try again.'), message: __('Error loading project data. Please try again.'),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
...@@ -47,9 +44,6 @@ export const refreshLastCommitData = ({ commit }, { projectId, branchId } = {}) ...@@ -47,9 +44,6 @@ export const refreshLastCommitData = ({ commit }, { projectId, branchId } = {})
.catch((e) => { .catch((e) => {
createFlash({ createFlash({
message: __('Error loading last commit.'), message: __('Error loading last commit.'),
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -145,9 +145,6 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState, roo ...@@ -145,9 +145,6 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState, roo
if (!data.short_id) { if (!data.short_id) {
createFlash({ createFlash({
message: data.message, message: data.message,
type: 'alert',
parent: document,
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -24,7 +24,6 @@ export default class IncidentsSettingsService { ...@@ -24,7 +24,6 @@ export default class IncidentsSettingsService {
createFlash({ createFlash({
message: `${ERROR_MSG} ${message}`, message: `${ERROR_MSG} ${message}`,
type: 'alert',
}); });
}); });
} }
......
...@@ -628,7 +628,6 @@ export default class Notes { ...@@ -628,7 +628,6 @@ export default class Notes {
message: __( message: __(
'Your comment could not be submitted! Please check your network connection and try again.', 'Your comment could not be submitted! Please check your network connection and try again.',
), ),
type: 'alert',
parent: formParentTimeline.get(0), parent: formParentTimeline.get(0),
}); });
} }
......
...@@ -222,7 +222,6 @@ export default { ...@@ -222,7 +222,6 @@ export default {
); );
createFlash({ createFlash({
message: msg, message: msg,
type: 'alert',
parent: this.$el, parent: this.$el,
}); });
this.$refs.noteForm.note = noteText; this.$refs.noteForm.note = noteText;
......
...@@ -320,7 +320,6 @@ export default { ...@@ -320,7 +320,6 @@ export default {
const msg = __('Something went wrong while editing your comment. Please try again.'); const msg = __('Something went wrong while editing your comment. Please try again.');
createFlash({ createFlash({
message: msg, message: msg,
type: 'alert',
parent: this.$el, parent: this.$el,
}); });
this.recoverNoteContent(noteText); this.recoverNoteContent(noteText);
......
...@@ -48,7 +48,6 @@ export default { ...@@ -48,7 +48,6 @@ export default {
const msg = __('Something went wrong while resolving this discussion. Please try again.'); const msg = __('Something went wrong while resolving this discussion. Please try again.');
createFlash({ createFlash({
message: msg, message: msg,
type: 'alert',
parent: this.$el, parent: this.$el,
}); });
}); });
......
...@@ -381,7 +381,6 @@ export const saveNote = ({ commit, dispatch }, noteData) => { ...@@ -381,7 +381,6 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
.catch(() => { .catch(() => {
createFlash({ createFlash({
message: __('Something went wrong while adding your award. Please try again.'), message: __('Something went wrong while adding your award. Please try again.'),
type: 'alert',
parent: noteData.flashContainer, parent: noteData.flashContainer,
}); });
}) })
...@@ -423,7 +422,6 @@ export const saveNote = ({ commit, dispatch }, noteData) => { ...@@ -423,7 +422,6 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
}); });
createFlash({ createFlash({
message: errorMsg, message: errorMsg,
type: 'alert',
parent: noteData.flashContainer, parent: noteData.flashContainer,
}); });
return { ...data, hasFlash: true }; return { ...data, hasFlash: true };
...@@ -627,7 +625,6 @@ export const submitSuggestion = ( ...@@ -627,7 +625,6 @@ export const submitSuggestion = (
createFlash({ createFlash({
message: __(flashMessage), message: __(flashMessage),
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}) })
...@@ -664,7 +661,6 @@ export const submitSuggestionBatch = ({ commit, dispatch, state }, { flashContai ...@@ -664,7 +661,6 @@ export const submitSuggestionBatch = ({ commit, dispatch, state }, { flashContai
createFlash({ createFlash({
message: __(flashMessage), message: __(flashMessage),
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}) })
......
...@@ -37,6 +37,5 @@ export const receiveSaveChangesError = (_, error) => { ...@@ -37,6 +37,5 @@ export const receiveSaveChangesError = (_, error) => {
createFlash({ createFlash({
message: `${__('There was an error saving your changes.')} ${message}`, message: `${__('There was an error saving your changes.')} ${message}`,
type: 'alert',
}); });
}; };
...@@ -24,7 +24,6 @@ export default class TaskList { ...@@ -24,7 +24,6 @@ export default class TaskList {
return createFlash({ return createFlash({
message: errorMessages || __('Update failed'), message: errorMessages || __('Update failed'),
type: 'alert',
}); });
}; };
......
...@@ -81,7 +81,6 @@ export default { ...@@ -81,7 +81,6 @@ export default {
if (this.lineType === 'old') { if (this.lineType === 'old') {
createFlash({ createFlash({
message: __('Unable to apply suggestions to a deleted line.'), message: __('Unable to apply suggestions to a deleted line.'),
type: 'alert',
parent: this.$el, parent: this.$el,
}); });
} }
......
...@@ -14,7 +14,7 @@ import { debounce } from 'lodash'; ...@@ -14,7 +14,7 @@ import { debounce } from 'lodash';
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import Api from '~/api'; import Api from '~/api';
import createFlash, { FLASH_TYPES } from '~/flash'; import createFlash from '~/flash';
import { STORAGE_KEY } from '~/frequent_items/constants'; import { STORAGE_KEY } from '~/frequent_items/constants';
import { getTopFrequentItems } from '~/frequent_items/utils'; import { getTopFrequentItems } from '~/frequent_items/utils';
import AccessorUtilities from '~/lib/utils/accessor'; import AccessorUtilities from '~/lib/utils/accessor';
...@@ -112,7 +112,6 @@ export default { ...@@ -112,7 +112,6 @@ export default {
.catch(() => { .catch(() => {
createFlash({ createFlash({
message: __('Something went wrong while fetching details'), message: __('Something went wrong while fetching details'),
type: FLASH_TYPES.ALERT,
}); });
this.selectedProject = null; this.selectedProject = null;
}) })
......
...@@ -136,7 +136,6 @@ export const receiveCreateIssueError = ({ commit }, { flashError }) => { ...@@ -136,7 +136,6 @@ export const receiveCreateIssueError = ({ commit }, { flashError }) => {
if (flashError) { if (flashError) {
createFlash({ createFlash({
message: s__('SecurityReports|There was an error creating the issue.'), message: s__('SecurityReports|There was an error creating the issue.'),
type: 'alert',
parent: document.querySelector('.ci-table'), parent: document.querySelector('.ci-table'),
}); });
} }
...@@ -208,7 +207,6 @@ export const receiveDismissSelectedVulnerabilitiesError = ({ commit }, { flashEr ...@@ -208,7 +207,6 @@ export const receiveDismissSelectedVulnerabilitiesError = ({ commit }, { flashEr
if (flashError) { if (flashError) {
createFlash({ createFlash({
message: s__('SecurityReports|There was an error dismissing the vulnerabilities.'), message: s__('SecurityReports|There was an error dismissing the vulnerabilities.'),
type: 'alert',
parent: document.querySelector('.ci-table'), parent: document.querySelector('.ci-table'),
}); });
} }
...@@ -295,7 +293,6 @@ export const receiveDismissVulnerabilityError = ({ commit }, { flashError }) => ...@@ -295,7 +293,6 @@ export const receiveDismissVulnerabilityError = ({ commit }, { flashError }) =>
if (flashError) { if (flashError) {
createFlash({ createFlash({
message: s__('SecurityReports|There was an error dismissing the vulnerability.'), message: s__('SecurityReports|There was an error dismissing the vulnerability.'),
type: 'alert',
parent: document.querySelector('.ci-table'), parent: document.querySelector('.ci-table'),
}); });
} }
...@@ -418,7 +415,6 @@ export const receiveUndoDismissError = ({ commit }, { flashError }) => { ...@@ -418,7 +415,6 @@ export const receiveUndoDismissError = ({ commit }, { flashError }) => {
if (flashError) { if (flashError) {
createFlash({ createFlash({
message: s__('SecurityReports|There was an error reverting this dismissal.'), message: s__('SecurityReports|There was an error reverting this dismissal.'),
type: 'alert',
parent: document.querySelector('.ci-table'), parent: document.querySelector('.ci-table'),
}); });
} }
...@@ -486,7 +482,6 @@ export const receiveCreateMergeRequestError = ({ commit }, { flashError }) => { ...@@ -486,7 +482,6 @@ export const receiveCreateMergeRequestError = ({ commit }, { flashError }) => {
if (flashError) { if (flashError) {
createFlash({ createFlash({
message: s__('SecurityReports|There was an error creating the merge request.'), message: s__('SecurityReports|There was an error creating the merge request.'),
type: 'alert',
parent: document.querySelector('.ci-table'), parent: document.querySelector('.ci-table'),
}); });
} }
......
...@@ -52,6 +52,5 @@ export const receiveStatusPageSettingsUpdateError = (_, error) => { ...@@ -52,6 +52,5 @@ export const receiveStatusPageSettingsUpdateError = (_, error) => {
createFlash({ createFlash({
message: `${__('There was an error saving your changes.')} ${message}`, message: `${__('There was an error saving your changes.')} ${message}`,
type: 'alert',
}); });
}; };
...@@ -112,7 +112,6 @@ describe('Status Page actions', () => { ...@@ -112,7 +112,6 @@ describe('Status Page actions', () => {
testAction(actions.receiveStatusPageSettingsUpdateError, error, null, [], [], () => { testAction(actions.receiveStatusPageSettingsUpdateError, error, null, [], [], () => {
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: `There was an error saving your changes. ${error.response.data.message}`, message: `There was an error saving your changes. ${error.response.data.message}`,
type: 'alert',
}); });
done(); done();
}); });
......
...@@ -114,7 +114,6 @@ describe('grafana integration component', () => { ...@@ -114,7 +114,6 @@ describe('grafana integration component', () => {
.then(() => .then(() =>
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: `There was an error saving your changes. ${message}`, message: `There was an error saving your changes. ${message}`,
type: 'alert',
}), }),
); );
}); });
......
...@@ -184,9 +184,6 @@ describe('new file modal component', () => { ...@@ -184,9 +184,6 @@ describe('new file modal component', () => {
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: 'The name "test-path/test" is already taken in this directory.', message: 'The name "test-path/test" is already taken in this directory.',
type: 'alert',
parent: expect.anything(),
actionConfig: null,
fadeTransition: false, fadeTransition: false,
addBodyClass: true, addBodyClass: true,
}); });
......
...@@ -39,7 +39,6 @@ describe('IncidentsSettingsService', () => { ...@@ -39,7 +39,6 @@ describe('IncidentsSettingsService', () => {
return service.updateSettings({}).then(() => { return service.updateSettings({}).then(() => {
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: expect.stringContaining(ERROR_MSG), message: expect.stringContaining(ERROR_MSG),
type: 'alert',
}); });
}); });
}); });
......
...@@ -927,7 +927,6 @@ describe('Actions Notes Store', () => { ...@@ -927,7 +927,6 @@ describe('Actions Notes Store', () => {
expect(resp.hasFlash).toBe(true); expect(resp.hasFlash).toBe(true);
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: 'Your comment could not be submitted because something went wrong', message: 'Your comment could not be submitted because something went wrong',
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}) })
...@@ -1011,7 +1010,6 @@ describe('Actions Notes Store', () => { ...@@ -1011,7 +1010,6 @@ describe('Actions Notes Store', () => {
expect(dispatch.mock.calls).toEqual([['stopPolling'], ['restartPolling']]); expect(dispatch.mock.calls).toEqual([['stopPolling'], ['restartPolling']]);
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: TEST_ERROR_MESSAGE, message: TEST_ERROR_MESSAGE,
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}); });
...@@ -1030,7 +1028,6 @@ describe('Actions Notes Store', () => { ...@@ -1030,7 +1028,6 @@ describe('Actions Notes Store', () => {
expect(dispatch.mock.calls).toEqual([['stopPolling'], ['restartPolling']]); expect(dispatch.mock.calls).toEqual([['stopPolling'], ['restartPolling']]);
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: 'Something went wrong while applying the suggestion. Please try again.', message: 'Something went wrong while applying the suggestion. Please try again.',
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}); });
...@@ -1104,7 +1101,6 @@ describe('Actions Notes Store', () => { ...@@ -1104,7 +1101,6 @@ describe('Actions Notes Store', () => {
expect(dispatch.mock.calls).toEqual([['stopPolling'], ['restartPolling']]); expect(dispatch.mock.calls).toEqual([['stopPolling'], ['restartPolling']]);
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: TEST_ERROR_MESSAGE, message: TEST_ERROR_MESSAGE,
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}); });
...@@ -1127,7 +1123,6 @@ describe('Actions Notes Store', () => { ...@@ -1127,7 +1123,6 @@ describe('Actions Notes Store', () => {
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: message:
'Something went wrong while applying the batch of suggestions. Please try again.', 'Something went wrong while applying the batch of suggestions. Please try again.',
type: 'alert',
parent: flashContainer, parent: flashContainer,
}); });
}); });
......
...@@ -205,7 +205,6 @@ describe('operation settings external dashboard component', () => { ...@@ -205,7 +205,6 @@ describe('operation settings external dashboard component', () => {
.then(() => .then(() =>
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({
message: `There was an error saving your changes. ${message}`, message: `There was an error saving your changes. ${message}`,
type: 'alert',
}), }),
); );
}); });
......
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