Skip to content
Snippets Groups Projects
Commit 5648e5c9 authored by Miguel Rincon's avatar Miguel Rincon
Browse files

Merge branch '346793-improve-error-message-when-runner-deletion-fails' into 'master'

Add title to runner delete error alert

See merge request !102535



Merged-by: Miguel Rincon's avatarMiguel Rincon <mrincon@gitlab.com>
Approved-by: default avatarFiona Neill <fneill@gitlab.com>
Approved-by: default avatarRahul Chanila <rchanila@gitlab.com>
Approved-by: default avatarDan Mizzi-Harris <dmizzi-harris@gitlab.com>
parents 1c505128 037f69a5
No related branches found
No related tags found
No related merge requests found
Pipeline #693894100 passed with warnings
Pipeline: GitLab

#693908557

    Pipeline: GitLab

    #693902376

      ......@@ -2,7 +2,7 @@
      import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui';
      import runnerDeleteMutation from '~/ci/runner/graphql/shared/runner_delete.mutation.graphql';
      import { createAlert } from '~/flash';
      import { sprintf } from '~/locale';
      import { sprintf, s__ } from '~/locale';
      import { captureException } from '~/ci/runner/sentry_utils';
      import { getIdFromGraphQLId } from '~/graphql_shared/utils';
      import { I18N_DELETE_RUNNER, I18N_DELETED_TOAST } from '../constants';
      ......@@ -122,8 +122,11 @@ export default {
      onError(error) {
      this.deleting = false;
      const { message } = error;
      const title = sprintf(s__('Runner|Runner %{runnerName} failed to delete'), {
      runnerName: this.runnerName,
      });
      createAlert({ message });
      createAlert({ title, message });
      captureException({ error, component: this.$options.name });
      },
      },
      ......
      ......@@ -35479,6 +35479,9 @@ msgstr ""
      msgid "Runner|Owner"
      msgstr ""
       
      msgid "Runner|Runner %{runnerName} failed to delete"
      msgstr ""
      msgid "Running"
      msgstr ""
       
      ......@@ -17,6 +17,7 @@ import { allRunnersData } from '../mock_data';
      const mockRunner = allRunnersData.data.runners.nodes[0];
      const mockRunnerId = getIdFromGraphQLId(mockRunner.id);
      const mockRunnerName = `#${mockRunnerId} (${mockRunner.shortSha})`;
      Vue.use(VueApollo);
      ......@@ -96,7 +97,7 @@ describe('RunnerDeleteButton', () => {
      });
      it('Displays a modal with the runner name', () => {
      expect(findModal().props('runnerName')).toBe(`#${mockRunnerId} (${mockRunner.shortSha})`);
      expect(findModal().props('runnerName')).toBe(mockRunnerName);
      });
      it('Does not have tabindex when button is enabled', () => {
      ......@@ -189,6 +190,10 @@ describe('RunnerDeleteButton', () => {
      it('error is shown to the user', () => {
      expect(createAlert).toHaveBeenCalledTimes(1);
      expect(createAlert).toHaveBeenCalledWith({
      title: expect.stringContaining(mockRunnerName),
      message: mockErrorMsg,
      });
      });
      });
      ......@@ -217,6 +222,10 @@ describe('RunnerDeleteButton', () => {
      it('error is shown to the user', () => {
      expect(createAlert).toHaveBeenCalledTimes(1);
      expect(createAlert).toHaveBeenCalledWith({
      title: expect.stringContaining(mockRunnerName),
      message: `${mockErrorMsg} ${mockErrorMsg2}`,
      });
      });
      it('does not evict runner from apollo cache', () => {
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Finish editing this message first!
      Please register or to comment