diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/assets/javascripts/packages_and_registries/package_registry/components/details | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/packages_and_registries/package_registry/components/details')
-rw-r--r-- | app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue b/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue index 11fd0db3106..cee976656f9 100644 --- a/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue +++ b/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue @@ -2,7 +2,8 @@ import { GlSprintf, GlBadge, GlResizeObserverDirective } from '@gitlab/ui'; import { GlBreakpointInstance } from '@gitlab/ui/dist/utils'; import { numberToHumanSize } from '~/lib/utils/number_utils'; -import { __ } from '~/locale'; +import { __, s__, sprintf } from '~/locale'; +import { formatDate } from '~/lib/utils/datetime_utility'; import PackageTags from '~/packages_and_registries/shared/components/package_tags.vue'; import { PACKAGE_TYPE_NUGET } from '~/packages_and_registries/package_registry/constants'; import { getPackageTypeLabel } from '~/packages_and_registries/package_registry/utils'; @@ -25,6 +26,7 @@ export default { }, inject: ['isGroupPage'], i18n: { + lastDownloadedAt: s__('PackageRegistry|Last downloaded %{dateTime}'), packageInfo: __('v%{version} published %{timeAgo}'), }, props: { @@ -39,6 +41,11 @@ export default { }; }, computed: { + packageLastDownloadedAtDisplay() { + return sprintf(this.$options.i18n.lastDownloadedAt, { + dateTime: formatDate(this.packageEntity.lastDownloadedAt, 'mmm d, yyyy'), + }); + }, packageTypeDisplay() { return getPackageTypeLabel(this.packageEntity.packageType); }, @@ -136,6 +143,15 @@ export default { <metadata-item data-testid="package-ref" icon="branch" :text="packagePipeline.ref" /> </template> + <template v-if="packageEntity.lastDownloadedAt" #metadata-last-downloaded-at> + <metadata-item + data-testid="package-last-downloaded-at" + icon="download" + :text="packageLastDownloadedAtDisplay" + size="m" + /> + </template> + <template #right-actions> <slot name="delete-button"></slot> </template> |