diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-26 00:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-26 00:09:46 +0300 |
commit | 44fb0702f3d2161d286df9b409f4309ed41207df (patch) | |
tree | 413f71c07a4ef9d13f17fee357832693e6cb3c48 /app/assets/javascripts/packages_and_registries | |
parent | c7531da771f30a54e2220f8f62efeba4b0b1a674 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/packages_and_registries')
4 files changed, 25 insertions, 7 deletions
diff --git a/app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue b/app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue index 67c2ca02d20..5689e0c04f3 100644 --- a/app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue +++ b/app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue @@ -102,10 +102,10 @@ export default { return { fullPath: this.groupPath, first: GRAPHQL_PAGE_SIZE }; }, pageInfo() { - return this.group.dependencyProxyManifests.pageInfo; + return this.group.dependencyProxyManifests?.pageInfo; }, manifests() { - return this.group.dependencyProxyManifests.nodes; + return this.group.dependencyProxyManifests?.nodes; }, modalTitleWithCount() { return sprintf( @@ -132,7 +132,7 @@ export default { ); }, showDeleteDropdown() { - return this.group.dependencyProxyBlobCount > 0; + return this.group.dependencyProxyManifests?.nodes.length > 0; }, }, methods: { diff --git a/app/assets/javascripts/packages_and_registries/dependency_proxy/components/manifest_row.vue b/app/assets/javascripts/packages_and_registries/dependency_proxy/components/manifest_row.vue index 78880b6e3f4..1bbd0c32dc4 100644 --- a/app/assets/javascripts/packages_and_registries/dependency_proxy/components/manifest_row.vue +++ b/app/assets/javascripts/packages_and_registries/dependency_proxy/components/manifest_row.vue @@ -1,5 +1,6 @@ <script> -import { GlSprintf } from '@gitlab/ui'; +import { GlIcon, GlSprintf } from '@gitlab/ui'; +import { MANIFEST_PENDING_DESTRUCTION_STATUS } from '~/packages_and_registries/dependency_proxy/constants'; import ListItem from '~/vue_shared/components/registry/list_item.vue'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import { s__ } from '~/locale'; @@ -7,6 +8,7 @@ import { s__ } from '~/locale'; export default { name: 'ManifestRow', components: { + GlIcon, GlSprintf, ListItem, TimeagoTooltip, @@ -24,17 +26,31 @@ export default { version() { return this.manifest?.imageName.split(':')[1]; }, + isErrorStatus() { + return this.manifest?.status === MANIFEST_PENDING_DESTRUCTION_STATUS; + }, + disabledRowStyle() { + return this.isErrorStatus ? 'gl-font-weight-normal gl-text-gray-500' : ''; + }, }, i18n: { cachedAgoMessage: s__('DependencyProxy|Cached %{time}'), + scheduledForDeletion: s__('DependencyProxy|Scheduled for deletion'), }, }; </script> <template> - <list-item> - <template #left-primary> {{ name }} </template> - <template #left-secondary> {{ version }} </template> + <list-item :disabled="isErrorStatus"> + <template #left-primary> + <span :class="disabledRowStyle">{{ name }}</span> + </template> + <template #left-secondary> + {{ version }} + <span v-if="isErrorStatus" class="gl-ml-4" data-testid="status" + ><gl-icon name="clock" /> {{ $options.i18n.scheduledForDeletion }}</span + > + </template> <template #right-primary> </template> <template #right-secondary> <timeago-tooltip :time="manifest.createdAt" data-testid="cached-message"> diff --git a/app/assets/javascripts/packages_and_registries/dependency_proxy/constants.js b/app/assets/javascripts/packages_and_registries/dependency_proxy/constants.js index 3c6ede6fdce..fdad69204ba 100644 --- a/app/assets/javascripts/packages_and_registries/dependency_proxy/constants.js +++ b/app/assets/javascripts/packages_and_registries/dependency_proxy/constants.js @@ -1 +1,2 @@ export const GRAPHQL_PAGE_SIZE = 20; +export const MANIFEST_PENDING_DESTRUCTION_STATUS = 'PENDING_DESTRUCTION'; diff --git a/app/assets/javascripts/packages_and_registries/dependency_proxy/graphql/queries/get_dependency_proxy_details.query.graphql b/app/assets/javascripts/packages_and_registries/dependency_proxy/graphql/queries/get_dependency_proxy_details.query.graphql index 5c43b10a5e3..c1597625964 100644 --- a/app/assets/javascripts/packages_and_registries/dependency_proxy/graphql/queries/get_dependency_proxy_details.query.graphql +++ b/app/assets/javascripts/packages_and_registries/dependency_proxy/graphql/queries/get_dependency_proxy_details.query.graphql @@ -20,6 +20,7 @@ query getDependencyProxyDetails( id createdAt imageName + status } pageInfo { ...PageInfo |