From 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Nov 2021 13:16:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-5-stable-ee --- .../explorer/constants/common.js | 4 + .../explorer/constants/details.js | 166 +++++++++++++++++++++ .../explorer/constants/expiration_policies.js | 15 ++ .../container_registry/explorer/constants/index.js | 5 + .../container_registry/explorer/constants/list.js | 53 +++++++ .../explorer/constants/quick_start.js | 9 ++ 6 files changed, 252 insertions(+) create mode 100644 app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/common.js create mode 100644 app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js create mode 100644 app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/expiration_policies.js create mode 100644 app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/index.js create mode 100644 app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/list.js create mode 100644 app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/quick_start.js (limited to 'app/assets/javascripts/packages_and_registries/container_registry/explorer/constants') diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/common.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/common.js new file mode 100644 index 00000000000..f7beec2c935 --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/common.js @@ -0,0 +1,4 @@ +import { s__, __ } from '~/locale'; + +export const ROOT_IMAGE_TEXT = s__('ContainerRegistry|Root image'); +export const MORE_ACTIONS_TEXT = __('More actions'); diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js new file mode 100644 index 00000000000..19e1a75fb2f --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js @@ -0,0 +1,166 @@ +import { helpPagePath } from '~/helpers/help_page_helper'; +import { s__, __ } from '~/locale'; + +// Translations strings +export const DELETE_TAG_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while marking the tag for deletion.', +); +export const DELETE_TAG_SUCCESS_MESSAGE = s__( + 'ContainerRegistry|Tag successfully marked for deletion.', +); +export const DELETE_TAGS_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while marking the tags for deletion.', +); +export const DELETE_TAGS_SUCCESS_MESSAGE = s__( + 'ContainerRegistry|Tags successfully marked for deletion.', +); + +export const FETCH_IMAGE_DETAILS_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while fetching the image details.', +); + +export const TAGS_LIST_TITLE = s__('ContainerRegistry|Image tags'); +export const DIGEST_LABEL = s__('ContainerRegistry|Digest: %{imageId}'); +export const CREATED_AT_LABEL = s__('ContainerRegistry|Published %{timeInfo}'); +export const PUBLISHED_DETAILS_ROW_TEXT = s__( + 'ContainerRegistry|Published to the %{repositoryPath} image repository at %{time} on %{date}', +); +export const MANIFEST_DETAILS_ROW_TEST = s__('ContainerRegistry|Manifest digest: %{digest}'); +export const CONFIGURATION_DETAILS_ROW_TEST = s__( + 'ContainerRegistry|Configuration digest: %{digest}', +); + +export const REMOVE_TAG_BUTTON_TITLE = s__('ContainerRegistry|Delete tag'); +export const REMOVE_TAGS_BUTTON_TITLE = s__('ContainerRegistry|Delete selected tags'); + +export const REMOVE_TAG_CONFIRMATION_TEXT = s__( + `ContainerRegistry|You are about to remove %{item}. Are you sure?`, +); +export const REMOVE_TAGS_CONFIRMATION_TEXT = s__( + `ContainerRegistry|You are about to remove %{item} tags. Are you sure?`, +); +export const NO_TAGS_TITLE = s__('ContainerRegistry|This image has no active tags'); +export const NO_TAGS_MESSAGE = s__( + `ContainerRegistry|The last tag related to this image was recently removed. +This empty image and any associated data will be automatically removed as part of the regular Garbage Collection process. +If you have any questions, contact your administrator.`, +); + +export const MISSING_OR_DELETED_IMAGE_TITLE = s__( + 'ContainerRegistry|The image repository could not be found.', +); +export const MISSING_OR_DELETED_IMAGE_MESSAGE = s__( + 'ContainerRegistry|The requested image repository does not exist or has been deleted. If you think this is an error, try refreshing the page.', +); + +export const MISSING_OR_DELETED_IMAGE_BREADCRUMB = s__( + 'ContainerRegistry|Image repository not found', +); + +export const ADMIN_GARBAGE_COLLECTION_TIP = s__( + 'ContainerRegistry|Remember to run %{docLinkStart}garbage collection%{docLinkEnd} to remove the stale data from storage.', +); + +export const MISSING_MANIFEST_WARNING_TOOLTIP = s__( + 'ContainerRegistry|Invalid tag: missing manifest digest', +); + +export const UPDATED_AT = s__('ContainerRegistry|Last updated %{time}'); + +export const NOT_AVAILABLE_TEXT = __('N/A'); +export const NOT_AVAILABLE_SIZE = __('0 bytes'); + +export const CLEANUP_UNSCHEDULED_TEXT = s__('ContainerRegistry|Cleanup will run %{time}'); +export const CLEANUP_SCHEDULED_TEXT = s__('ContainerRegistry|Cleanup pending'); +export const CLEANUP_ONGOING_TEXT = s__('ContainerRegistry|Cleanup in progress'); +export const CLEANUP_UNFINISHED_TEXT = s__('ContainerRegistry|Cleanup incomplete'); +export const CLEANUP_DISABLED_TEXT = s__('ContainerRegistry|Cleanup disabled'); + +export const CLEANUP_SCHEDULED_TOOLTIP = s__('ContainerRegistry|Cleanup will run soon'); +export const CLEANUP_ONGOING_TOOLTIP = s__('ContainerRegistry|Cleanup is currently removing tags'); +export const CLEANUP_UNFINISHED_TOOLTIP = s__( + 'ContainerRegistry|Cleanup ran but some tags were not removed', +); +export const CLEANUP_DISABLED_TOOLTIP = s__( + 'ContainerRegistry|Cleanup is disabled for this project', +); + +export const CLEANUP_STATUS_SCHEDULED = s__('ContainerRegistry|Cleanup will run soon'); +export const CLEANUP_STATUS_ONGOING = s__('ContainerRegistry|Cleanup is ongoing'); +export const CLEANUP_STATUS_UNFINISHED = s__('ContainerRegistry|Cleanup timed out'); + +export const DETAILS_DELETE_IMAGE_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while scheduling the image for deletion.', +); + +export const DELETE_IMAGE_CONFIRMATION_TITLE = s__('ContainerRegistry|Delete image repository?'); +export const DELETE_IMAGE_CONFIRMATION_TEXT = s__( + 'ContainerRegistry|Deleting the image repository will delete all images and tags inside. This action cannot be undone. Please type the following to confirm: %{code}', +); + +export const SCHEDULED_FOR_DELETION_STATUS_TITLE = s__( + 'ContainerRegistry|Image repository will be deleted', +); +export const SCHEDULED_FOR_DELETION_STATUS_MESSAGE = s__( + 'ContainerRegistry|This image repository will be deleted. %{linkStart}Learn more.%{linkEnd}', +); + +export const FAILED_DELETION_STATUS_TITLE = s__( + 'ContainerRegistry|Image repository deletion failed', +); +export const FAILED_DELETION_STATUS_MESSAGE = s__( + 'ContainerRegistry|This image repository has failed to be deleted', +); + +export const ROOT_IMAGE_TOOLTIP = s__( + 'ContainerRegistry|Image repository with no name located at the project URL.', +); + +// Parameters + +export const DEFAULT_PAGE = 1; +export const DEFAULT_PAGE_SIZE = 10; +export const GROUP_PAGE_TYPE = 'groups'; +export const ALERT_SUCCESS_TAG = 'success_tag'; +export const ALERT_DANGER_TAG = 'danger_tag'; +export const ALERT_SUCCESS_TAGS = 'success_tags'; +export const ALERT_DANGER_TAGS = 'danger_tags'; +export const ALERT_DANGER_IMAGE = 'danger_image'; + +export const DELETE_SCHEDULED = 'DELETE_SCHEDULED'; +export const DELETE_FAILED = 'DELETE_FAILED'; + +export const ALERT_MESSAGES = { + [ALERT_SUCCESS_TAG]: DELETE_TAG_SUCCESS_MESSAGE, + [ALERT_DANGER_TAG]: DELETE_TAG_ERROR_MESSAGE, + [ALERT_SUCCESS_TAGS]: DELETE_TAGS_SUCCESS_MESSAGE, + [ALERT_DANGER_TAGS]: DELETE_TAGS_ERROR_MESSAGE, + [ALERT_DANGER_IMAGE]: DETAILS_DELETE_IMAGE_ERROR_MESSAGE, +}; + +export const UNFINISHED_STATUS = 'UNFINISHED'; +export const UNSCHEDULED_STATUS = 'UNSCHEDULED'; +export const SCHEDULED_STATUS = 'SCHEDULED'; +export const ONGOING_STATUS = 'ONGOING'; + +export const IMAGE_STATUS_TITLES = { + [DELETE_SCHEDULED]: SCHEDULED_FOR_DELETION_STATUS_TITLE, + [DELETE_FAILED]: FAILED_DELETION_STATUS_TITLE, +}; + +export const IMAGE_STATUS_MESSAGES = { + [DELETE_SCHEDULED]: SCHEDULED_FOR_DELETION_STATUS_MESSAGE, + [DELETE_FAILED]: FAILED_DELETION_STATUS_MESSAGE, +}; + +export const IMAGE_STATUS_ALERT_TYPE = { + [DELETE_SCHEDULED]: 'info', + [DELETE_FAILED]: 'warning', +}; + +export const PACKAGE_DELETE_HELP_PAGE_PATH = helpPagePath( + 'user/packages/container_registry/index', + { + anchor: 'delete-images', + }, +); diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/expiration_policies.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/expiration_policies.js new file mode 100644 index 00000000000..40f9b09a982 --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/expiration_policies.js @@ -0,0 +1,15 @@ +import { s__ } from '~/locale'; + +export const EXPIRATION_POLICY_WILL_RUN_IN = s__( + 'ContainerRegistry|Expiration policy will run in %{time}', +); +export const EXPIRATION_POLICY_DISABLED_TEXT = s__( + 'ContainerRegistry|Expiration policy is disabled', +); +export const DELETE_ALERT_TITLE = s__('ContainerRegistry|Some tags were not deleted'); +export const DELETE_ALERT_LINK_TEXT = s__( + 'ContainerRegistry|The cleanup policy timed out before it could delete all tags. An administrator can %{adminLinkStart}manually run cleanup now%{adminLinkEnd} or you can wait for the cleanup policy to automatically run again. %{docLinkStart}More information%{docLinkEnd}', +); +export const CLEANUP_TIMED_OUT_ERROR_MESSAGE = s__( + 'ContainerRegistry|Cleanup timed out before it could delete all tags', +); diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/index.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/index.js new file mode 100644 index 00000000000..6886356d8e2 --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/index.js @@ -0,0 +1,5 @@ +export * from './common'; +export * from './expiration_policies'; +export * from './quick_start'; +export * from './list'; +export * from './details'; diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/list.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/list.js new file mode 100644 index 00000000000..d21a154d1b8 --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/list.js @@ -0,0 +1,53 @@ +import { s__, __ } from '~/locale'; + +// Translations strings + +export const CONTAINER_REGISTRY_TITLE = s__('ContainerRegistry|Container Registry'); +export const CONNECTION_ERROR_TITLE = s__('ContainerRegistry|Docker connection error'); +export const CONNECTION_ERROR_MESSAGE = s__( + `ContainerRegistry|We are having trouble connecting to the Container Registry. Please try refreshing the page. If this error persists, please review %{docLinkStart}the troubleshooting documentation%{docLinkEnd}.`, +); +export const LIST_INTRO_TEXT = s__( + `ContainerRegistry|With the GitLab Container Registry, every project can have its own space to store images. %{docLinkStart}More information%{docLinkEnd}`, +); +export const LIST_DELETE_BUTTON_DISABLED = s__( + 'ContainerRegistry|Missing or insufficient permission, delete button disabled', +); +export const REMOVE_REPOSITORY_LABEL = s__('ContainerRegistry|Remove repository'); +export const REMOVE_REPOSITORY_MODAL_TEXT = s__( + 'ContainerRegistry|You are about to remove repository %{title}. Once you confirm, this repository will be permanently deleted.', +); +export const ROW_SCHEDULED_FOR_DELETION = s__( + `ContainerRegistry|This image repository is scheduled for deletion`, +); +export const FETCH_IMAGES_LIST_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while fetching the repository list.', +); +export const FETCH_TAGS_LIST_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while fetching the tags list.', +); +export const DELETE_IMAGE_ERROR_MESSAGE = s__( + 'ContainerRegistry|Something went wrong while scheduling %{title} for deletion. Please try again.', +); +export const ASYNC_DELETE_IMAGE_ERROR_MESSAGE = s__( + `ContainerRegistry|There was an error during the deletion of this image repository, please try again.`, +); +export const DELETE_IMAGE_SUCCESS_MESSAGE = s__( + 'ContainerRegistry|%{title} was successfully scheduled for deletion', +); +export const EMPTY_RESULT_TITLE = s__('ContainerRegistry|Sorry, your filter produced no results.'); +export const EMPTY_RESULT_MESSAGE = s__( + 'ContainerRegistry|To widen your search, change or remove the filters above.', +); + +// Parameters + +export const IMAGE_DELETE_SCHEDULED_STATUS = 'DELETE_SCHEDULED'; +export const IMAGE_FAILED_DELETED_STATUS = 'DELETE_FAILED'; +export const GRAPHQL_PAGE_SIZE = 10; + +export const SORT_FIELDS = [ + { orderBy: 'UPDATED', label: __('Updated') }, + { orderBy: 'CREATED', label: __('Created') }, + { orderBy: 'NAME', label: __('Name') }, +]; diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/quick_start.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/quick_start.js new file mode 100644 index 00000000000..6a39c07eba2 --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/quick_start.js @@ -0,0 +1,9 @@ +import { s__ } from '~/locale'; + +export const QUICK_START = s__('ContainerRegistry|CLI Commands'); +export const LOGIN_COMMAND_LABEL = s__('ContainerRegistry|Login'); +export const COPY_LOGIN_TITLE = s__('ContainerRegistry|Copy login command'); +export const BUILD_COMMAND_LABEL = s__('ContainerRegistry|Build an image'); +export const COPY_BUILD_TITLE = s__('ContainerRegistry|Copy build command'); +export const PUSH_COMMAND_LABEL = s__('ContainerRegistry|Push an image'); +export const COPY_PUSH_TITLE = s__('ContainerRegistry|Copy push command'); -- cgit v1.2.1