diff options
Diffstat (limited to 'app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue')
-rw-r--r-- | app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue | 90 |
1 files changed, 34 insertions, 56 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..1faff1ff4de 100644 --- a/app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue +++ b/app/assets/javascripts/packages_and_registries/dependency_proxy/app.vue @@ -16,10 +16,7 @@ import Api from '~/api'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import TitleArea from '~/vue_shared/components/registry/title_area.vue'; import ManifestsList from '~/packages_and_registries/dependency_proxy/components/manifests_list.vue'; -import { - DEPENDENCY_PROXY_SETTINGS_DESCRIPTION, - DEPENDENCY_PROXY_DOCS_PATH, -} from '~/packages_and_registries/settings/group/constants'; +import { DEPENDENCY_PROXY_DOCS_PATH } from '~/packages_and_registries/settings/group/constants'; import { GRAPHQL_PAGE_SIZE } from '~/packages_and_registries/dependency_proxy/constants'; import getDependencyProxyDetailsQuery from '~/packages_and_registries/dependency_proxy/graphql/queries/get_dependency_proxy_details.query.graphql'; @@ -42,11 +39,8 @@ export default { directives: { GlModalDirective, }, - inject: ['groupPath', 'groupId', 'dependencyProxyAvailable', 'noManifestsIllustration'], + inject: ['groupPath', 'groupId', 'noManifestsIllustration'], i18n: { - proxyNotAvailableText: s__( - 'DependencyProxy|Dependency Proxy feature is limited to public groups for now.', - ), proxyImagePrefix: s__('DependencyProxy|Dependency Proxy image prefix'), copyImagePrefixText: s__('DependencyProxy|Copy prefix'), blobCountAndSize: s__('DependencyProxy|Contains %{count} blobs of images (%{size})'), @@ -80,32 +74,20 @@ export default { apollo: { group: { query: getDependencyProxyDetailsQuery, - skip() { - return !this.dependencyProxyAvailable; - }, variables() { return this.queryVariables; }, }, }, computed: { - infoMessages() { - return [ - { - text: DEPENDENCY_PROXY_SETTINGS_DESCRIPTION, - link: DEPENDENCY_PROXY_DOCS_PATH, - }, - ]; - }, - queryVariables() { 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 +114,10 @@ export default { ); }, showDeleteDropdown() { - return this.group.dependencyProxyBlobCount > 0; + return this.group.dependencyProxyManifests?.nodes.length > 0; + }, + showDependencyProxyImagePrefix() { + return this.group.dependencyProxyImagePrefix?.length > 0; }, }, methods: { @@ -181,7 +166,7 @@ export default { > {{ deleteCacheAlertMessage }} </gl-alert> - <title-area :title="$options.i18n.pageTitle" :info-messages="infoMessages"> + <title-area :title="$options.i18n.pageTitle"> <template v-if="showDeleteDropdown" #right-actions> <gl-dropdown icon="ellipsis_v" @@ -198,41 +183,34 @@ export default { </gl-dropdown> </template> </title-area> - <gl-alert - v-if="!dependencyProxyAvailable" - :dismissible="false" - data-testid="proxy-not-available" - > - {{ $options.i18n.proxyNotAvailableText }} - </gl-alert> - <gl-skeleton-loader v-else-if="$apollo.queries.group.loading" /> - - <div v-else data-testid="main-area"> - <gl-form-group :label="$options.i18n.proxyImagePrefix"> - <gl-form-input-group - readonly - :value="group.dependencyProxyImagePrefix" - class="gl-layout-w-limited" - data-testid="proxy-url" - > - <template #append> - <clipboard-button - :text="group.dependencyProxyImagePrefix" - :title="$options.i18n.copyImagePrefixText" - /> - </template> - </gl-form-input-group> - <template #description> - <span data-qa-selector="dependency_proxy_count" data-testid="proxy-count"> - <gl-sprintf :message="$options.i18n.blobCountAndSize"> - <template #count>{{ group.dependencyProxyBlobCount }}</template> - <template #size>{{ group.dependencyProxyTotalSize }}</template> - </gl-sprintf> - </span> + <gl-form-group v-if="showDependencyProxyImagePrefix" :label="$options.i18n.proxyImagePrefix"> + <gl-form-input-group + readonly + :value="group.dependencyProxyImagePrefix" + class="gl-layout-w-limited" + data-testid="proxy-url" + > + <template #append> + <clipboard-button + :text="group.dependencyProxyImagePrefix" + :title="$options.i18n.copyImagePrefixText" + /> </template> - </gl-form-group> + </gl-form-input-group> + <template #description> + <span data-qa-selector="dependency_proxy_count" data-testid="proxy-count"> + <gl-sprintf :message="$options.i18n.blobCountAndSize"> + <template #count>{{ group.dependencyProxyBlobCount }}</template> + <template #size>{{ group.dependencyProxyTotalSize }}</template> + </gl-sprintf> + </span> + </template> + </gl-form-group> + <gl-skeleton-loader v-if="$apollo.queries.group.loading" /> + + <div v-else data-testid="main-area"> <manifests-list v-if="manifests && manifests.length" :manifests="manifests" |