Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/packages_and_registries/harbor_registry/components/list')
-rw-r--r--app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_header.vue12
-rw-r--r--app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_row.vue32
2 files changed, 17 insertions, 27 deletions
diff --git a/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_header.vue b/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_header.vue
index 086b9c73d75..db66ebef937 100644
--- a/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_header.vue
+++ b/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_header.vue
@@ -5,6 +5,7 @@ import {
HARBOR_REGISTRY_TITLE,
LIST_INTRO_TEXT,
imagesCountInfoText,
+ HARBOR_REGISTRY_HELP_PAGE_PATH,
} from '~/packages_and_registries/harbor_registry/constants';
import MetadataItem from '~/vue_shared/components/registry/metadata_item.vue';
@@ -20,11 +21,6 @@ export default {
default: 0,
required: false,
},
- helpPagePath: {
- type: String,
- default: '',
- required: false,
- },
metadataLoading: {
type: Boolean,
required: false,
@@ -32,7 +28,7 @@ export default {
},
},
i18n: {
- HARBOR_REGISTRY_TITLE,
+ harborRegistryTitle: HARBOR_REGISTRY_TITLE,
},
computed: {
imagesCountText() {
@@ -40,7 +36,7 @@ export default {
return sprintf(pluralisedString, { count: this.imagesCount });
},
infoMessages() {
- return [{ text: LIST_INTRO_TEXT, link: this.helpPagePath }];
+ return [{ text: LIST_INTRO_TEXT, link: HARBOR_REGISTRY_HELP_PAGE_PATH }];
},
},
};
@@ -48,7 +44,7 @@ export default {
<template>
<title-area
- :title="$options.i18n.HARBOR_REGISTRY_TITLE"
+ :title="$options.i18n.harborRegistryTitle"
:info-messages="infoMessages"
:metadata-loading="metadataLoading"
>
diff --git a/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_row.vue b/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_row.vue
index 258472fe16e..bfe0c250dd9 100644
--- a/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_row.vue
+++ b/app/assets/javascripts/packages_and_registries/harbor_registry/components/list/harbor_list_row.vue
@@ -1,15 +1,14 @@
<script>
-import { GlIcon, GlSprintf, GlSkeletonLoader } from '@gitlab/ui';
+import { GlIcon, GlSkeletonLoader } from '@gitlab/ui';
import { n__ } from '~/locale';
-
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import ListItem from '~/vue_shared/components/registry/list_item.vue';
+import { getNameFromParams } from '~/packages_and_registries/harbor_registry/utils';
export default {
name: 'HarborListRow',
components: {
ClipboardButton,
- GlSprintf,
GlIcon,
ListItem,
GlSkeletonLoader,
@@ -26,19 +25,18 @@ export default {
},
},
computed: {
- id() {
- return this.item.id;
+ linkTo() {
+ const { projectName, imageName } = getNameFromParams(this.item.name);
+
+ return { name: 'details', params: { project: projectName, image: imageName } };
},
artifactCountText() {
return n__(
- 'HarborRegistry|%{count} Tag',
- 'HarborRegistry|%{count} Tags',
+ 'HarborRegistry|%d artifact',
+ 'HarborRegistry|%d artifacts',
this.item.artifactCount,
);
},
- imageName() {
- return this.item.name;
- },
},
};
</script>
@@ -50,9 +48,9 @@ export default {
class="gl-text-body gl-font-weight-bold"
data-testid="details-link"
data-qa-selector="registry_image_content"
- :to="{ name: 'details', params: { id } }"
+ :to="linkTo"
>
- {{ imageName }}
+ {{ item.name }}
</router-link>
<clipboard-button
v-if="item.location"
@@ -63,13 +61,9 @@ export default {
</template>
<template #left-secondary>
<template v-if="!metadataLoading">
- <span class="gl-display-flex gl-align-items-center" data-testid="tags-count">
- <gl-icon name="tag" class="gl-mr-2" />
- <gl-sprintf :message="artifactCountText">
- <template #count>
- {{ item.artifactCount }}
- </template>
- </gl-sprintf>
+ <span class="gl-display-flex gl-align-items-center" data-testid="artifacts-count">
+ <gl-icon name="package" class="gl-mr-2" />
+ {{ artifactCountText }}
</span>
</template>