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

mr_widget_status_icon.vue « components « vue_merge_request_widget « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 370e07b397c1c97dd1c76f6f6e52411f1f3803da (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
<script>
import { GlIcon } from '@gitlab/ui';
import { STATUS_CLOSED, STATUS_MERGED } from '~/issues/constants';
import StatusIcon from './extensions/status_icon.vue';

export default {
  components: {
    StatusIcon,
    GlIcon,
  },
  props: {
    status: {
      type: String,
      required: true,
    },
  },
  computed: {
    isClosed() {
      return this.status === STATUS_CLOSED;
    },
    isLoading() {
      return this.status === 'loading';
    },
    isMerged() {
      return this.status === STATUS_MERGED;
    },
  },
};
</script>
<template>
  <div class="gl-w-6 gl-h-6 gl-display-flex gl-align-self-start gl-mr-3">
    <div class="gl-display-flex gl-m-auto">
      <gl-icon v-if="isMerged" name="merge" :size="16" class="gl-text-blue-500" />
      <gl-icon v-else-if="isClosed" name="merge-request-close" :size="16" class="gl-text-red-500" />
      <gl-icon v-else-if="status === 'approval'" name="approval" :size="16" />
      <status-icon v-else :is-loading="isLoading" :icon-name="status" :level="1" class="gl-m-0!" />
    </div>
  </div>
</template>