Commit 32c8651d authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'show-toast-on-iteration-delete' into 'master'

Show toast when deleting an iteration

See merge request gitlab-org/gitlab!70783
parents 58698ac4 4fc95be4
......@@ -115,6 +115,7 @@ export default {
}
this.$router.push('/');
this.$toast.show(s__('Iterations|The iteration has been deleted.'));
})
.catch((err) => {
this.error = err;
......
......@@ -15,7 +15,7 @@ import { TYPE_ITERATION } from '~/graphql_shared/constants';
import { convertToGraphQLId } from '~/graphql_shared/utils';
import { formatDate } from '~/lib/utils/datetime_utility';
import { visitUrl } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
import { __, s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { Namespace } from '../constants';
import deleteIteration from '../queries/destroy_iteration.mutation.graphql';
......@@ -202,6 +202,8 @@ export default {
}
this.isEditing = false;
this.$toast.show(s__('Iterations|The iteration has been deleted.'));
visitUrl(this.iterationsListPath);
})
.catch((err) => {
......
import { GlToast } from '@gitlab/ui';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
......@@ -10,6 +11,7 @@ import Iterations from './components/iterations.vue';
import { Namespace } from './constants';
import createRouter from './router';
Vue.use(GlToast);
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
......
......@@ -21,6 +21,9 @@ const $router = {
},
},
};
const $toast = {
show: jest.fn(),
};
describe('Iterations report', () => {
let wrapper;
......@@ -72,6 +75,7 @@ describe('Iterations report', () => {
},
mocks: {
$router,
$toast,
},
stubs: {
GlLoadingIcon,
......@@ -148,6 +152,7 @@ describe('Iterations report', () => {
await waitForPromises();
expect($router.push).toHaveBeenCalledWith('/');
expect($toast.show).toHaveBeenCalledWith('The iteration has been deleted.');
});
it('shows error when delete fails', async () => {
......
......@@ -19195,6 +19195,9 @@ msgstr ""
msgid "Iterations|The duration for each iteration (in weeks)"
msgstr ""
msgid "Iterations|The iteration has been deleted."
msgstr ""
msgid "Iterations|The start date of your first iteration"
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