Read about our upcoming Code of Conduct on this issue

release_block_header.vue 1.08 KB
Newer Older
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
<script>
import { GlTooltipDirective, GlLink, GlBadge } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';

export default {
  name: 'ReleaseBlockHeader',
  components: {
    GlLink,
    GlBadge,
    Icon,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    release: {
      type: Object,
      required: true,
    },
  },
  computed: {
    shouldShowEditButton() {
      return Boolean(this.release._links && this.release._links.edit_url);
    },
  },
};
</script>

<template>
  <div class="card-header d-flex align-items-center bg-white pr-0">
    <h2 class="card-title my-2 mr-auto gl-font-size-20">
      {{ release.name }}
      <gl-badge v-if="release.upcoming_release" variant="warning" class="align-middle">{{
        __('Upcoming Release')
      }}</gl-badge>
    </h2>
    <gl-link
      v-if="shouldShowEditButton"
      v-gl-tooltip
      class="btn btn-default append-right-10 js-edit-button ml-2"
      :title="__('Edit this release')"
      :href="release._links.edit_url"
    >
      <icon name="pencil" />
    </gl-link>
  </div>
</template>