Remove unncessary type options

Toasts have been migrated to the default variant as success and error
variants are not supported by the design system.

Changelog: changed
parent b74175ca
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
} = await axios.put(this.resetPath); } = await axios.put(this.resetPath);
this.email = newAddress; this.email = newAddress;
} catch { } catch {
this.$toast.show(__('There was an error when reseting email token.'), { type: 'error' }); this.$toast.show(__('There was an error when reseting email token.'));
} }
}, },
cancelHandler() { cancelHandler() {
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
this.events = this.buildEvents(events); this.events = this.buildEvents(events);
} catch (error) { } catch (error) {
this.$toast.show(this.$options.i18n.loadNotificationLevelErrorMessage, { type: 'error' }); this.$toast.show(this.$options.i18n.loadNotificationLevelErrorMessage);
} finally { } finally {
this.isLoading = false; this.isLoading = false;
} }
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
this.events = this.buildEvents(events); this.events = this.buildEvents(events);
} catch (error) { } catch (error) {
this.$toast.show(this.$options.i18n.updateNotificationLevelErrorMessage, { type: 'error' }); this.$toast.show(this.$options.i18n.updateNotificationLevelErrorMessage);
} }
}, },
}, },
......
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
this.selectedNotificationLevel = level; this.selectedNotificationLevel = level;
this.openNotificationsModal(); this.openNotificationsModal();
} catch (error) { } catch (error) {
this.$toast.show(this.$options.i18n.updateNotificationLevelErrorMessage, { type: 'error' }); this.$toast.show(this.$options.i18n.updateNotificationLevelErrorMessage);
} finally { } finally {
this.isLoading = false; this.isLoading = false;
} }
......
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
this.alertMessage = ERROR_UPDATING_SETTINGS; this.alertMessage = ERROR_UPDATING_SETTINGS;
} else { } else {
this.dismissAlert(); this.dismissAlert();
this.$toast.show(SUCCESS_UPDATING_SETTINGS, { type: 'success' }); this.$toast.show(SUCCESS_UPDATING_SETTINGS);
} }
}) })
.catch((e) => { .catch((e) => {
......
...@@ -158,14 +158,14 @@ export default { ...@@ -158,14 +158,14 @@ export default {
.then(({ data }) => { .then(({ data }) => {
const errorMessage = data?.updateContainerExpirationPolicy?.errors[0]; const errorMessage = data?.updateContainerExpirationPolicy?.errors[0];
if (errorMessage) { if (errorMessage) {
this.$toast.show(errorMessage, { type: 'error' }); this.$toast.show(errorMessage);
} else { } else {
this.$toast.show(UPDATE_SETTINGS_SUCCESS_MESSAGE, { type: 'success' }); this.$toast.show(UPDATE_SETTINGS_SUCCESS_MESSAGE);
} }
}) })
.catch((error) => { .catch((error) => {
this.setApiErrors(error); this.setApiErrors(error);
this.$toast.show(UPDATE_SETTINGS_ERROR_MESSAGE, { type: 'error' }); this.$toast.show(UPDATE_SETTINGS_ERROR_MESSAGE);
}) })
.finally(() => { .finally(() => {
this.mutationLoading = false; this.mutationLoading = false;
......
...@@ -22,11 +22,7 @@ export default { ...@@ -22,11 +22,7 @@ export default {
this.$toast.show(__('User pipeline minutes were successfully reset.')); this.$toast.show(__('User pipeline minutes were successfully reset.'));
} }
}) })
.catch(() => .catch(() => this.$toast.show(__('There was an error resetting user pipeline minutes.')));
this.$toast.show(__('There was an error resetting user pipeline minutes.'), {
type: 'error',
}),
);
}, },
}, },
}; };
......
...@@ -87,9 +87,6 @@ describe('Reset pipeline minutes button', () => { ...@@ -87,9 +87,6 @@ describe('Reset pipeline minutes button', () => {
expect(axiosSpy).toHaveBeenCalled(); expect(axiosSpy).toHaveBeenCalled();
expect($toast.show).toHaveBeenCalledWith( expect($toast.show).toHaveBeenCalledWith(
'There was an error resetting user pipeline minutes.', 'There was an error resetting user pipeline minutes.',
{
type: 'error',
},
); );
}); });
}); });
......
...@@ -154,10 +154,7 @@ describe('IssuableByEmail', () => { ...@@ -154,10 +154,7 @@ describe('IssuableByEmail', () => {
await clickResetEmail(); await clickResetEmail();
expect(mockToastShow).toHaveBeenCalledWith( expect(mockToastShow).toHaveBeenCalledWith('There was an error when reseting email token.');
'There was an error when reseting email token.',
{ type: 'error' },
);
expect(findFormInputGroup().props('value')).toBe('user@gitlab.com'); expect(findFormInputGroup().props('value')).toBe('user@gitlab.com');
}); });
}); });
......
...@@ -177,11 +177,8 @@ describe('CustomNotificationsModal', () => { ...@@ -177,11 +177,8 @@ describe('CustomNotificationsModal', () => {
await waitForPromises(); await waitForPromises();
expect( expect(mockToastShow).toHaveBeenCalledWith(
mockToastShow,
).toHaveBeenCalledWith(
'An error occurred while loading the notification settings. Please try again.', 'An error occurred while loading the notification settings. Please try again.',
{ type: 'error' },
); );
}); });
}); });
...@@ -255,11 +252,8 @@ describe('CustomNotificationsModal', () => { ...@@ -255,11 +252,8 @@ describe('CustomNotificationsModal', () => {
await waitForPromises(); await waitForPromises();
expect( expect(mockToastShow).toHaveBeenCalledWith(
mockToastShow,
).toHaveBeenCalledWith(
'An error occurred while updating the notification settings. Please try again.', 'An error occurred while updating the notification settings. Please try again.',
{ type: 'error' },
); );
}); });
}); });
......
...@@ -242,11 +242,8 @@ describe('NotificationsDropdown', () => { ...@@ -242,11 +242,8 @@ describe('NotificationsDropdown', () => {
await clickDropdownItemAt(1); await clickDropdownItemAt(1);
expect(wrapper.vm.selectedNotificationLevel).toBe('global'); expect(wrapper.vm.selectedNotificationLevel).toBe('global');
expect( expect(mockToastShow).toHaveBeenCalledWith(
mockToastShow,
).toHaveBeenCalledWith(
'An error occurred while updating the notification settings. Please try again.', 'An error occurred while updating the notification settings. Please try again.',
{ type: 'error' },
); );
}); });
......
...@@ -244,9 +244,7 @@ describe('Group Settings App', () => { ...@@ -244,9 +244,7 @@ describe('Group Settings App', () => {
await waitForPromises(); await waitForPromises();
expect(show).toHaveBeenCalledWith(SUCCESS_UPDATING_SETTINGS, { expect(show).toHaveBeenCalledWith(SUCCESS_UPDATING_SETTINGS);
type: 'success',
});
}); });
it('has an optimistic response', async () => { it('has an optimistic response', async () => {
......
...@@ -321,9 +321,7 @@ describe('Settings Form', () => { ...@@ -321,9 +321,7 @@ describe('Settings Form', () => {
await waitForPromises(); await waitForPromises();
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.$toast.show).toHaveBeenCalledWith(UPDATE_SETTINGS_SUCCESS_MESSAGE, { expect(wrapper.vm.$toast.show).toHaveBeenCalledWith(UPDATE_SETTINGS_SUCCESS_MESSAGE);
type: 'success',
});
}); });
describe('when submit fails', () => { describe('when submit fails', () => {
...@@ -339,9 +337,7 @@ describe('Settings Form', () => { ...@@ -339,9 +337,7 @@ describe('Settings Form', () => {
await waitForPromises(); await waitForPromises();
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.$toast.show).toHaveBeenCalledWith('foo', { expect(wrapper.vm.$toast.show).toHaveBeenCalledWith('foo');
type: 'error',
});
}); });
}); });
...@@ -355,9 +351,7 @@ describe('Settings Form', () => { ...@@ -355,9 +351,7 @@ describe('Settings Form', () => {
await waitForPromises(); await waitForPromises();
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.$toast.show).toHaveBeenCalledWith(UPDATE_SETTINGS_ERROR_MESSAGE, { expect(wrapper.vm.$toast.show).toHaveBeenCalledWith(UPDATE_SETTINGS_ERROR_MESSAGE);
type: 'error',
});
}); });
it('parses the error messages', async () => { it('parses the error messages', async () => {
......
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