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
|
<script>
import { GlLink, GlSprintf, GlTruncate } from '@gitlab/ui';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import PackageTags from '~/packages_and_registries/shared/components/package_tags.vue';
import PublishMethod from '~/packages_and_registries/shared/components/publish_method.vue';
import ListItem from '~/vue_shared/components/registry/list_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { PACKAGE_DEFAULT_STATUS } from '../../constants';
export default {
name: 'PackageListRow',
components: {
GlLink,
GlSprintf,
GlTruncate,
PackageTags,
PublishMethod,
ListItem,
TimeAgoTooltip,
},
props: {
packageEntity: {
type: Object,
required: true,
},
},
computed: {
packageLink() {
return `${getIdFromGraphQLId(this.packageEntity.id)}`;
},
disabledRow() {
return this.packageEntity.status && this.packageEntity.status !== PACKAGE_DEFAULT_STATUS;
},
},
};
</script>
<template>
<list-item :disabled="disabledRow">
<template #left-primary>
<div class="gl-display-flex gl-align-items-center gl-mr-3 gl-min-w-0">
<gl-link :href="packageLink" class="gl-text-body gl-min-w-0" :disabled="disabledRow">
<gl-truncate :text="packageEntity.name" />
</gl-link>
<package-tags
v-if="packageEntity.tags.nodes && packageEntity.tags.nodes.length"
class="gl-ml-3"
:tags="packageEntity.tags.nodes"
hide-label
:tag-display-limit="1"
/>
</div>
</template>
<template #left-secondary>
{{ packageEntity.version }}
</template>
<template #right-primary>
<publish-method :package-entity="packageEntity" />
</template>
<template #right-secondary>
<span>
<gl-sprintf :message="__('Created %{timestamp}')">
<template #timestamp>
<time-ago-tooltip :time="packageEntity.createdAt" />
</template>
</gl-sprintf>
</span>
</template>
</list-item>
</template>
|