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

confirm_delete_modal.vue « components « releases « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa948fbbaf63a3387b16816b37e6b9dee588e724 (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
73
74
75
76
77
<script>
import { GlModal, GlSprintf, GlLink, GlButton } from '@gitlab/ui';
import { mapState } from 'vuex';
import { __, s__, sprintf } from '~/locale';

export default {
  components: {
    GlModal,
    GlSprintf,
    GlLink,
    GlButton,
  },
  data() {
    return {
      visible: false,
    };
  },
  computed: {
    ...mapState('editNew', ['release', 'deleteReleaseDocsPath']),
    title() {
      return sprintf(__('Delete release %{release}?'), { release: this.release.name });
    },
  },
  modalOptions: {
    modalId: 'confirm-delete-release',
    static: true,
    actionPrimary: {
      attributes: { variant: 'danger' },
      text: __('Delete release'),
    },
    actionSecondary: {
      text: __('Cancel'),
      attributes: { variant: 'default' },
    },
  },
  i18n: {
    buttonLabel: __('Delete'),
    line1: s__(
      'DeleteRelease|You are about to delete release %{release} and its assets. The Git tag %{tag} will not be deleted.',
    ),
    line2: s__(
      'DeleteRelease|For more details, see %{docsPathStart}Deleting a release%{docsPathEnd}.',
    ),
    line3: s__('DeleteRelease|Are you sure you want to delete this release?'),
  },
};
</script>
<template>
  <div>
    <gl-button class="gl-mr-3" variant="danger" @click="visible = true">
      {{ $options.i18n.buttonLabel }}
    </gl-button>
    <gl-modal
      v-bind="$options.modalOptions"
      v-model="visible"
      :title="title"
      @primary="$emit('delete')"
    >
      <p>
        <gl-sprintf :message="$options.i18n.line1">
          <template #release>{{ release.name }}</template>
          <template #tag>
            <gl-link :href="release.tagPath">{{ release.tagName }}</gl-link>
          </template>
        </gl-sprintf>
      </p>
      <p>
        <gl-sprintf :message="$options.i18n.line2">
          <template #docsPath="{ content }">
            <gl-link :href="deleteReleaseDocsPath" target="_blank">{{ content }}</gl-link>
          </template>
        </gl-sprintf>
      </p>
      <p>{{ $options.i18n.line3 }}</p>
    </gl-modal>
  </div>
</template>