Welcome to mirror list, hosted at ThFree Co, Russian Federation.

job_sidebar_retry_button.vue « sidebar « job « components « jobs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7183a8b5d037df55de7063b833022675f1f4b536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<script>
import { GlButton, GlDropdown, GlDropdownItem, GlModalDirective } from '@gitlab/ui';
import { mapGetters } from 'vuex';
import { JOB_SIDEBAR_COPY } from '~/jobs/constants';

export default {
  name: 'JobSidebarRetryButton',
  i18n: {
    ...JOB_SIDEBAR_COPY,
  },
  components: {
    GlButton,
    GlDropdown,
    GlDropdownItem,
  },
  directives: {
    GlModal: GlModalDirective,
  },
  props: {
    modalId: {
      type: String,
      required: true,
    },
    href: {
      type: String,
      required: true,
    },
    isManualJob: {
      type: Boolean,
      required: true,
    },
  },
  computed: {
    ...mapGetters(['hasForwardDeploymentFailure']),
  },
};
</script>
<template>
  <gl-button
    v-if="hasForwardDeploymentFailure"
    v-gl-modal="modalId"
    :aria-label="$options.i18n.retryJobLabel"
    category="primary"
    variant="confirm"
    icon="retry"
    data-testid="retry-job-button"
  />
  <gl-dropdown
    v-else-if="isManualJob"
    icon="retry"
    category="primary"
    :right="true"
    variant="confirm"
  >
    <gl-dropdown-item :href="href" data-method="post">
      {{ $options.i18n.runAgainJobButtonLabel }}
    </gl-dropdown-item>
    <gl-dropdown-item @click="$emit('updateVariablesClicked')">
      {{ $options.i18n.updateVariables }}
    </gl-dropdown-item>
  </gl-dropdown>
  <gl-button
    v-else
    :href="href"
    :aria-label="$options.i18n.retryJobLabel"
    category="primary"
    variant="confirm"
    icon="retry"
    data-method="post"
    data-testid="retry-job-link"
  />
</template>