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