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

status_alert.vue « details_page « components « explorer « registry « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc1504f6c31e30c019d80711da6416ce3cdf65eb (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
<script>
import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui';
import {
  IMAGE_STATUS_MESSAGES,
  IMAGE_STATUS_TITLES,
  IMAGE_STATUS_ALERT_TYPE,
  PACKAGE_DELETE_HELP_PAGE_PATH,
} from '../../constants';

export default {
  components: {
    GlAlert,
    GlSprintf,
    GlLink,
  },
  props: {
    status: {
      type: String,
      required: true,
    },
  },
  computed: {
    message() {
      return IMAGE_STATUS_MESSAGES[this.status];
    },
    title() {
      return IMAGE_STATUS_TITLES[this.status];
    },
    variant() {
      return IMAGE_STATUS_ALERT_TYPE[this.status];
    },
  },
  links: {
    PACKAGE_DELETE_HELP_PAGE_PATH,
  },
};
</script>
<template>
  <gl-alert :title="title" :variant="variant">
    <span data-testid="message">
      <gl-sprintf :message="message">
        <template #link="{ content }">
          <gl-link :href="$options.links.PACKAGE_DELETE_HELP_PAGE_PATH" target="_blank">{{
            content
          }}</gl-link>
        </template>
      </gl-sprintf>
    </span>
  </gl-alert>
</template>