Commit dfb2a4b3 authored by Tan Le's avatar Tan Le

Show success message on MR approval settings save

This commit adds a flash message on top of the page when MR approval
settings have been updated successfully.
parent 774a38ed
...@@ -34,6 +34,10 @@ export const updateSettings = ({ commit, state }, endpoint) => { ...@@ -34,6 +34,10 @@ export const updateSettings = ({ commit, state }, endpoint) => {
.put(endpoint, payload) .put(endpoint, payload)
.then(({ data }) => { .then(({ data }) => {
commit(types.UPDATE_SETTINGS_SUCCESS, data); commit(types.UPDATE_SETTINGS_SUCCESS, data);
createFlash({
message: __('Merge request approval settings have been updated.'),
type: 'notice',
});
}) })
.catch(({ response }) => { .catch(({ response }) => {
const error = response?.data?.message; const error = response?.data?.message;
......
...@@ -92,7 +92,12 @@ describe('EE approvals group settings module actions', () => { ...@@ -92,7 +92,12 @@ describe('EE approvals group settings module actions', () => {
{ type: types.UPDATE_SETTINGS_SUCCESS, payload: data }, { type: types.UPDATE_SETTINGS_SUCCESS, payload: data },
], ],
[], [],
); ).then(() => {
expect(createFlash).toHaveBeenCalledWith({
message: 'Merge request approval settings have been updated.',
type: 'notice',
});
});
}); });
}); });
......
...@@ -18533,6 +18533,9 @@ msgstr "" ...@@ -18533,6 +18533,9 @@ msgstr ""
msgid "Merge request (MR) approvals" msgid "Merge request (MR) approvals"
msgstr "" msgstr ""
msgid "Merge request approval settings have been updated."
msgstr ""
msgid "Merge request approvals" msgid "Merge request approvals"
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