summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/deploy_keys/components/confirm_modal.vue
blob: 25551d7b5cbcd421ea1c2c6e65167235730369ed (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
<script>
import { GlModal } from '@gitlab/ui';
import { __ } from '~/locale';

export default {
  components: {
    GlModal,
  },
  props: {
    visible: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  i18n: {
    body: __(
      'Are you sure you want to remove this deploy key? If anything is still using this key, it will stop working.',
    ),
  },
  modalOptions: {
    title: __('Do you want to remove this deploy key?'),
    actionPrimary: {
      text: __('Remove deploy key'),
      attributes: { variant: 'danger' },
    },
    actionSecondary: {
      text: __('Cancel'),
      attributes: { category: 'tertiary' },
    },
    static: true,
    modalId: 'confirm-remove-deploy-key',
  },
};
</script>
<template>
  <gl-modal
    v-bind="$options.modalOptions"
    :visible="visible"
    @primary="$emit('remove')"
    @secondary="$emit('cancel')"
    @hidden="$emit('cancel')"
  >
    {{ $options.i18n.body }}
  </gl-modal>
</template>