Commit 9b93822f authored by Clement Ho's avatar Clement Ho

Merge branch 'add-missing-flash-import' into 'master'

Add missing flash import

See merge request gitlab-org/gitlab!16731
parents ff7c8d34 c27afc3e
<script>
import $ from 'jquery';
import { __ } from '~/locale';
import createFlash from '~/flash';
import statusIcon from '../mr_widget_status_icon.vue';
import tooltip from '../../../vue_shared/directives/tooltip';
import eventHub from '../../event_hub';
......@@ -29,12 +31,12 @@ export default {
.then(res => res.data)
.then(data => {
eventHub.$emit('UpdateWidgetData', data);
new window.Flash('The merge request can now be merged.', 'notice'); // eslint-disable-line
createFlash(__('The merge request can now be merged.'), 'notice');
$('.merge-request .detail-page-description .title').text(this.mr.title);
})
.catch(() => {
this.isMakingRequest = false;
new window.Flash('Something went wrong. Please try again.'); // eslint-disable-line
createFlash(__('Something went wrong. Please try again.'));
});
},
},
......
......@@ -15527,6 +15527,9 @@ msgstr ""
msgid "The merge conflicts for this merge request have already been resolved. Please return to the merge request."
msgstr ""
msgid "The merge request can now be merged."
msgstr ""
msgid "The name %{entryName} is already taken in this directory."
msgstr ""
......
......@@ -47,7 +47,7 @@ describe('Wip', () => {
it('should make a request to service and handle response', done => {
const vm = createComponent();
spyOn(window, 'Flash').and.returnValue(true);
const flashSpy = spyOnDependency(WorkInProgress, 'createFlash').and.returnValue(true);
spyOn(eventHub, '$emit');
spyOn(vm.service, 'removeWIP').and.returnValue(
new Promise(resolve => {
......@@ -61,10 +61,7 @@ describe('Wip', () => {
setTimeout(() => {
expect(vm.isMakingRequest).toBeTruthy();
expect(eventHub.$emit).toHaveBeenCalledWith('UpdateWidgetData', mrObj);
expect(window.Flash).toHaveBeenCalledWith(
'The merge request can now be merged.',
'notice',
);
expect(flashSpy).toHaveBeenCalledWith('The merge request can now be merged.', 'notice');
done();
}, 333);
});
......
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