diff options
Diffstat (limited to 'app/assets/javascripts/registry/explorer/components')
3 files changed, 46 insertions, 10 deletions
diff --git a/app/assets/javascripts/registry/explorer/components/details_page/delete_modal.vue b/app/assets/javascripts/registry/explorer/components/details_page/delete_modal.vue index 0432cf1123c..f857c96c9d1 100644 --- a/app/assets/javascripts/registry/explorer/components/details_page/delete_modal.vue +++ b/app/assets/javascripts/registry/explorer/components/details_page/delete_modal.vue @@ -1,5 +1,5 @@ <script> -import { GlModal, GlSprintf } from '@gitlab/ui'; +import { GlModal, GlSprintf, GlFormInput } from '@gitlab/ui'; import { n__ } from '~/locale'; import { REMOVE_TAG_CONFIRMATION_TEXT, @@ -12,6 +12,7 @@ export default { components: { GlModal, GlSprintf, + GlFormInput, }, props: { itemsToBeDeleted: { @@ -25,7 +26,15 @@ export default { required: false, }, }, + data() { + return { + projectPath: '', + }; + }, computed: { + imageProjectPath() { + return this.itemsToBeDeleted[0]?.project?.path; + }, modalTitle() { if (this.deleteImage) { return DELETE_IMAGE_CONFIRMATION_TITLE; @@ -40,6 +49,7 @@ export default { if (this.deleteImage) { return { message: DELETE_IMAGE_CONFIRMATION_TEXT, + item: this.imageProjectPath, }; } if (this.itemsToBeDeleted.length > 1) { @@ -55,6 +65,9 @@ export default { item: first?.path, }; }, + disablePrimaryButton() { + return this.deleteImage && this.projectPath !== this.imageProjectPath; + }, }, methods: { show() { @@ -69,10 +82,14 @@ export default { ref="deleteModal" modal-id="delete-tag-modal" ok-variant="danger" - :action-primary="{ text: __('Confirm'), attributes: { variant: 'danger' } }" + :action-primary="{ + text: __('Delete'), + attributes: [{ variant: 'danger' }, { disabled: disablePrimaryButton }], + }" :action-cancel="{ text: __('Cancel') }" @primary="$emit('confirmDelete')" @cancel="$emit('cancelDelete')" + @change="projectPath = ''" > <template #modal-title>{{ modalTitle }}</template> <p v-if="modalDescription" data-testid="description"> @@ -80,7 +97,13 @@ export default { <template #item> <b>{{ modalDescription.item }}</b> </template> + <template #code> + <code>{{ modalDescription.item }}</code> + </template> </gl-sprintf> </p> + <div v-if="deleteImage"> + <gl-form-input v-model="projectPath" /> + </div> </gl-modal> </template> diff --git a/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue b/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue index 80ed9a32039..e9e36151fe6 100644 --- a/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue +++ b/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui'; +import { GlIcon, GlTooltipDirective, GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { sprintf, n__, s__ } from '~/locale'; import MetadataItem from '~/vue_shared/components/registry/metadata_item.vue'; import TitleArea from '~/vue_shared/components/registry/title_area.vue'; @@ -27,7 +27,7 @@ import getContainerRepositoryTagsCountQuery from '../../graphql/queries/get_cont export default { name: 'DetailsHeader', - components: { GlButton, GlIcon, TitleArea, MetadataItem }, + components: { GlIcon, TitleArea, MetadataItem, GlDropdown, GlDropdownItem }, directives: { GlTooltip: GlTooltipDirective, }, @@ -143,9 +143,22 @@ export default { /> </template> <template #right-actions> - <gl-button variant="danger" :disabled="deleteButtonDisabled" @click="$emit('delete')"> - {{ __('Delete image repository') }} - </gl-button> + <gl-dropdown + icon="ellipsis_v" + text="More actions" + :text-sr-only="true" + category="tertiary" + no-caret + right + > + <gl-dropdown-item + variant="danger" + :disabled="deleteButtonDisabled" + @click="$emit('delete')" + > + {{ __('Delete image repository') }} + </gl-dropdown-item> + </gl-dropdown> </template> </title-area> </template> diff --git a/app/assets/javascripts/registry/explorer/components/list_page/cleanup_status.vue b/app/assets/javascripts/registry/explorer/components/list_page/cleanup_status.vue index 8d9e221af4c..1f52e319ad0 100644 --- a/app/assets/javascripts/registry/explorer/components/list_page/cleanup_status.vue +++ b/app/assets/javascripts/registry/explorer/components/list_page/cleanup_status.vue @@ -1,7 +1,7 @@ <script> import { GlTooltipDirective, GlIcon } from '@gitlab/ui'; import { - ASYNC_DELETE_IMAGE_ERROR_MESSAGE, + CLEANUP_TIMED_OUT_ERROR_MESSAGE, CLEANUP_STATUS_SCHEDULED, CLEANUP_STATUS_ONGOING, CLEANUP_STATUS_UNFINISHED, @@ -34,7 +34,7 @@ export default { CLEANUP_STATUS_SCHEDULED, CLEANUP_STATUS_ONGOING, CLEANUP_STATUS_UNFINISHED, - ASYNC_DELETE_IMAGE_ERROR_MESSAGE, + CLEANUP_TIMED_OUT_ERROR_MESSAGE, }, computed: { showStatus() { @@ -61,7 +61,7 @@ export default { </span> <gl-icon v-if="failedDelete" - v-gl-tooltip="{ title: $options.i18n.ASYNC_DELETE_IMAGE_ERROR_MESSAGE }" + v-gl-tooltip="{ title: $options.i18n.CLEANUP_TIMED_OUT_ERROR_MESSAGE }" :size="14" class="gl-text-black-normal" data-testid="extra-info" |