summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipeline_schedules/components/take_ownership_modal.vue
blob: 7ded3945a3202d5bd495d0435fdcf1c8578222a0 (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
<script>
import { GlModal } from '@gitlab/ui';
import { __, s__ } from '~/locale';

export default {
  components: {
    GlModal,
  },
  props: {
    ownershipUrl: {
      type: String,
      required: true,
    },
  },
  modalId: 'pipeline-take-ownership-modal',
  i18n: {
    takeOwnership: s__('PipelineSchedules|Take ownership'),
    ownershipMessage: s__(
      'PipelineSchedules|Only the owner of a pipeline schedule can make changes to it. Do you want to take ownership of this schedule?',
    ),
    cancelLabel: __('Cancel'),
  },
  computed: {
    actionCancel() {
      return { text: this.$options.i18n.cancelLabel };
    },
    actionPrimary() {
      return {
        text: this.$options.i18n.takeOwnership,
        attributes: [
          {
            variant: 'confirm',
            category: 'primary',
            href: this.ownershipUrl,
            'data-method': 'post',
          },
        ],
      };
    },
  },
};
</script>
<template>
  <gl-modal
    :modal-id="$options.modalId"
    :action-primary="actionPrimary"
    :action-cancel="actionCancel"
    :title="$options.i18n.takeOwnership"
  >
    <p>{{ $options.i18n.ownershipMessage }}</p>
  </gl-modal>
</template>