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
|
<script>
import { isEmpty } from 'lodash';
import MetadataItem from '~/vue_shared/components/registry/metadata_item.vue';
import TitleArea from '~/vue_shared/components/registry/title_area.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago';
import {
EMPTY_TAG_LABEL,
tagsCountText,
} from '~/packages_and_registries/harbor_registry/constants';
export default {
name: 'TagsHeader',
components: {
TitleArea,
MetadataItem,
},
mixins: [timeagoMixin],
props: {
artifactDetail: {
type: Object,
required: true,
},
pageInfo: {
type: Object,
required: true,
},
tagsLoading: {
type: Boolean,
required: true,
},
},
computed: {
tagCountText() {
if (isEmpty(this.pageInfo)) {
return EMPTY_TAG_LABEL;
}
return tagsCountText(this.pageInfo.total);
},
},
};
</script>
<template>
<title-area :metadata-loading="tagsLoading">
<template #title>
<span class="gl-word-break-all" data-testid="title">
{{ artifactDetail.digest }}
</span>
</template>
<template #metadata-tags-count>
<metadata-item icon="tag" :text="tagCountText" data-testid="tags-count" />
</template>
</title-area>
</template>
|