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