From 90c9981395b282f28919a755979d380aae5dcf73 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 27 May 2020 12:08:19 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../blob/components/blob_content.vue | 1 + .../services/recent_searches_service_error.js | 7 +- app/assets/javascripts/issue.js | 26 +++ ...ickstart_dropdown.vue => cli_commands.vue} | 0 .../components/project_policy_alert.vue | 68 ------ .../explorer/components/registry_header.vue | 138 +++++++++++ .../registry/explorer/constants.js | 21 +- .../registry/explorer/pages/list.vue | 44 ++-- .../rich_content_editor/constants.js | 6 +- .../{toolbar_service.js => editor_service.js} | 6 +- .../rich_content_editor.vue | 21 +- app/graphql/mutations/snippets/create.rb | 2 +- app/views/projects/issues/show.html.haml | 1 + .../registry/repositories/index.html.haml | 1 - babel.config.js | 13 +- ...ry-ui-header-section-with-relevant-met.yml | 5 + ...reate-mutation-non-activerecord-errors.yml | 5 + .../remove-redundant-modsecurity-indexes.yml | 5 + danger/changelog/Dangerfile | 21 +- ..._pipeline_id_from_ci_pipeline_variables.rb | 18 ++ ..._index_on_pipeline_id_from_ci_variables.rb | 18 ++ db/structure.sql | 6 +- .../geo/replication/docker_registry.md | 2 +- doc/administration/instance_limits.md | 2 +- .../secure_partner_integration.md | 4 +- doc/policy/maintenance.md | 3 +- ...iner_registry_group_repositories_v13_0.png | Bin 41813 -> 0 bytes ...iner_registry_group_repositories_v13_1.png | Bin 0 -> 42519 bytes .../container_registry_repositories_v13_0.png | Bin 44925 -> 0 bytes .../container_registry_repositories_v13_1.png | Bin 0 -> 47072 bytes ...try_repositories_with_quickstart_v13_0.png | Bin 48708 -> 0 bytes ...try_repositories_with_quickstart_v13_1.png | Bin 0 -> 50605 bytes doc/user/packages/container_registry/index.md | 6 +- doc/user/project/merge_requests/index.md | 30 +-- .../testing_and_reports_in_merge_requests.md | 36 +++ locale/gitlab.pot | 39 ++-- qa/qa.rb | 1 + qa/qa/page/dashboard/snippet/show.rb | 8 + ...pec.rb => create_personal_snippet_spec.rb} | 4 +- .../snippet/create_project_snippet_spec.rb | 30 +++ spec/features/issues/move_spec.rb | 39 ++++ .../projects/container_registry_spec.rb | 4 +- .../components/blob_header_filepath_spec.js | 5 +- spec/frontend/helpers/dom_shims/index.js | 1 + .../helpers/dom_shims/mutation_observer.js | 7 + .../components/commit_sidebar/form_spec.js | 21 +- .../components/embeds/metric_embed_spec.js | 3 + .../pipelines/graph/graph_component_spec.js | 5 + .../project_empty_state_spec.js.snap | 2 +- ..._dropdown_spec.js => cli_commands_spec.js} | 4 +- .../components/project_policy_alert_spec.js | 132 ----------- .../components/registry_header_spec.js | 221 ++++++++++++++++++ .../registry/explorer/pages/list_spec.js | 49 ++-- spec/frontend/test_setup.js | 15 -- .../editor_service_spec.js | 47 ++++ .../rich_content_editor_spec.js | 21 ++ .../toolbar_service_spec.js | 29 --- .../graphql/mutations/snippets/create_spec.rb | 40 ++-- 58 files changed, 819 insertions(+), 424 deletions(-) rename app/assets/javascripts/registry/explorer/components/{quickstart_dropdown.vue => cli_commands.vue} (100%) delete mode 100644 app/assets/javascripts/registry/explorer/components/project_policy_alert.vue create mode 100644 app/assets/javascripts/registry/explorer/components/registry_header.vue rename app/assets/javascripts/vue_shared/components/rich_content_editor/{toolbar_service.js => editor_service.js} (76%) create mode 100644 changelogs/unreleased/216749-improve-the-container-registry-ui-header-section-with-relevant-met.yml create mode 100644 changelogs/unreleased/fj-fix-snippet-create-mutation-non-activerecord-errors.yml create mode 100644 changelogs/unreleased/remove-redundant-modsecurity-indexes.yml create mode 100644 db/migrate/20200421054930_remove_index_on_pipeline_id_from_ci_pipeline_variables.rb create mode 100644 db/migrate/20200421054948_remove_index_on_pipeline_id_from_ci_variables.rb delete mode 100644 doc/user/packages/container_registry/img/container_registry_group_repositories_v13_0.png create mode 100644 doc/user/packages/container_registry/img/container_registry_group_repositories_v13_1.png delete mode 100644 doc/user/packages/container_registry/img/container_registry_repositories_v13_0.png create mode 100644 doc/user/packages/container_registry/img/container_registry_repositories_v13_1.png delete mode 100644 doc/user/packages/container_registry/img/container_registry_repositories_with_quickstart_v13_0.png create mode 100644 doc/user/packages/container_registry/img/container_registry_repositories_with_quickstart_v13_1.png create mode 100644 doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md rename qa/qa/specs/features/browser_ui/3_create/snippet/{create_snippet_spec.rb => create_personal_snippet_spec.rb} (91%) create mode 100644 qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb create mode 100644 spec/frontend/helpers/dom_shims/mutation_observer.js rename spec/frontend/registry/explorer/components/{quickstart_dropdown_spec.js => cli_commands_spec.js} (96%) delete mode 100644 spec/frontend/registry/explorer/components/project_policy_alert_spec.js create mode 100644 spec/frontend/registry/explorer/components/registry_header_spec.js create mode 100644 spec/frontend/vue_shared/components/rich_content_editor/editor_service_spec.js delete mode 100644 spec/frontend/vue_shared/components/rich_content_editor/toolbar_service_spec.js diff --git a/app/assets/javascripts/blob/components/blob_content.vue b/app/assets/javascripts/blob/components/blob_content.vue index 4f433bd8dfd..eb7f45cba6f 100644 --- a/app/assets/javascripts/blob/components/blob_content.vue +++ b/app/assets/javascripts/blob/components/blob_content.vue @@ -66,6 +66,7 @@ export default { ref="contentViewer" :content="content" :type="activeViewer.fileType" + data-qa-selector="file_content" /> diff --git a/app/assets/javascripts/filtered_search/services/recent_searches_service_error.js b/app/assets/javascripts/filtered_search/services/recent_searches_service_error.js index 011b37e218d..d8c2c6d79c6 100644 --- a/app/assets/javascripts/filtered_search/services/recent_searches_service_error.js +++ b/app/assets/javascripts/filtered_search/services/recent_searches_service_error.js @@ -1,13 +1,10 @@ import { __ } from '~/locale'; -class RecentSearchesServiceError { +class RecentSearchesServiceError extends Error { constructor(message) { + super(message || __('Recent Searches Service is unavailable')); this.name = 'RecentSearchesServiceError'; - this.message = message || __('Recent Searches Service is unavailable'); } } -// Can't use `extends` for builtin prototypes and get true inheritance yet -RecentSearchesServiceError.prototype = Error.prototype; - export default RecentSearchesServiceError; diff --git a/app/assets/javascripts/issue.js b/app/assets/javascripts/issue.js index f0967e77faf..d567f34fa9d 100644 --- a/app/assets/javascripts/issue.js +++ b/app/assets/javascripts/issue.js @@ -6,6 +6,7 @@ import { addDelimiter } from './lib/utils/text_utility'; import flash from './flash'; import CreateMergeRequestDropdown from './create_merge_request_dropdown'; import IssuablesHelper from './helpers/issuables_helper'; +import { joinPaths } from '~/lib/utils/url_utility'; import { __ } from './locale'; export default class Issue { @@ -14,6 +15,16 @@ export default class Issue { if ($('.js-close-blocked-issue-warning').length) this.initIssueWarningBtnEventListener(); + if ($('.js-alert-moved-from-service-desk-warning').length) { + const trimmedPathname = window.location.pathname.slice(1); + this.alertMovedFromServiceDeskDismissedKey = joinPaths( + trimmedPathname, + 'alert-issue-moved-from-service-desk-dismissed', + ); + + this.initIssueMovedFromServiceDeskDismissHandler(); + } + Issue.$btnNewBranch = $('#new-branch'); Issue.createMrDropdownWrap = document.querySelector('.create-mr-dropdown-wrap'); @@ -167,6 +178,21 @@ export default class Issue { }); } + initIssueMovedFromServiceDeskDismissHandler() { + const alertMovedFromServiceDeskWarning = $('.js-alert-moved-from-service-desk-warning'); + + if (!localStorage.getItem(this.alertMovedFromServiceDeskDismissedKey)) { + alertMovedFromServiceDeskWarning.show(); + } + + alertMovedFromServiceDeskWarning.on('click', '.js-close', e => { + e.preventDefault(); + e.stopImmediatePropagation(); + alertMovedFromServiceDeskWarning.remove(); + localStorage.setItem(this.alertMovedFromServiceDeskDismissedKey, true); + }); + } + static submitNoteForm(form) { const noteText = form.find('textarea.js-note-text').val(); if (noteText && noteText.trim().length > 0) { diff --git a/app/assets/javascripts/registry/explorer/components/quickstart_dropdown.vue b/app/assets/javascripts/registry/explorer/components/cli_commands.vue similarity index 100% rename from app/assets/javascripts/registry/explorer/components/quickstart_dropdown.vue rename to app/assets/javascripts/registry/explorer/components/cli_commands.vue diff --git a/app/assets/javascripts/registry/explorer/components/project_policy_alert.vue b/app/assets/javascripts/registry/explorer/components/project_policy_alert.vue deleted file mode 100644 index 88a0710574f..00000000000 --- a/app/assets/javascripts/registry/explorer/components/project_policy_alert.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - diff --git a/app/assets/javascripts/registry/explorer/components/registry_header.vue b/app/assets/javascripts/registry/explorer/components/registry_header.vue new file mode 100644 index 00000000000..6b6154e87dc --- /dev/null +++ b/app/assets/javascripts/registry/explorer/components/registry_header.vue @@ -0,0 +1,138 @@ + + + diff --git a/app/assets/javascripts/registry/explorer/constants.js b/app/assets/javascripts/registry/explorer/constants.js index 7cbe657bfc0..5325086b773 100644 --- a/app/assets/javascripts/registry/explorer/constants.js +++ b/app/assets/javascripts/registry/explorer/constants.js @@ -5,10 +5,10 @@ import { s__ } from '~/locale'; 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 Docker, which could be due to an issue with your project name or path. %{docLinkStart}More Information%{docLinkEnd}`, + `ContainerRegistry|We are having trouble connecting to the Registry, which could be due to an issue with your project name or path. %{docLinkStart}More information%{docLinkEnd}`, ); export const LIST_INTRO_TEXT = s__( - `ContainerRegistry|With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images. %{docLinkStart}More Information%{docLinkEnd}`, + `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__( @@ -103,20 +103,21 @@ export const ADMIN_GARBAGE_COLLECTION_TIP = s__( // Expiration policies -export const EXPIRATION_POLICY_ALERT_TITLE = s__( - 'ContainerRegistry|Retention policy has been Enabled', +export const EXPIRATION_POLICY_WILL_RUN_IN = s__( + 'ContainerRegistry|Expiration policy will run in %{time}', ); -export const EXPIRATION_POLICY_ALERT_PRIMARY_BUTTON = s__('ContainerRegistry|Edit Settings'); -export const EXPIRATION_POLICY_ALERT_FULL_MESSAGE = s__( - 'ContainerRegistry|The retention and expiration policy for this Container Registry has been enabled and will run in %{days}. For more information visit the %{linkStart}documentation%{linkEnd}', + +export const EXPIRATION_POLICY_DISABLED_TEXT = s__( + 'ContainerRegistry|Expiration policy is disabled', ); -export const EXPIRATION_POLICY_ALERT_SHORT_MESSAGE = s__( - 'ContainerRegistry|The retention and expiration policy for this Container Registry has been enabled. For more information visit the %{linkStart}documentation%{linkEnd}', + +export const EXPIRATION_POLICY_DISABLED_MESSAGE = s__( + 'ContainerRegistry|Expiration policies help manage the storage space used by the Container Registry, but the expiration policies for this registry are disabled. Contact your administrator to enable. %{docLinkStart}More information%{docLinkEnd}', ); // Quick Start -export const QUICK_START = s__('ContainerRegistry|Quick Start'); +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'); diff --git a/app/assets/javascripts/registry/explorer/pages/list.vue b/app/assets/javascripts/registry/explorer/pages/list.vue index 4efa6f08d84..fa8b56eb76b 100644 --- a/app/assets/javascripts/registry/explorer/pages/list.vue +++ b/app/assets/javascripts/registry/explorer/pages/list.vue @@ -14,17 +14,15 @@ import Tracking from '~/tracking'; import ProjectEmptyState from '../components/project_empty_state.vue'; import GroupEmptyState from '../components/group_empty_state.vue'; -import ProjectPolicyAlert from '../components/project_policy_alert.vue'; -import QuickstartDropdown from '../components/quickstart_dropdown.vue'; +import RegistryHeader from '../components/registry_header.vue'; import ImageList from '../components/image_list.vue'; +import CliCommands from '../components/cli_commands.vue'; import { DELETE_IMAGE_SUCCESS_MESSAGE, DELETE_IMAGE_ERROR_MESSAGE, - CONTAINER_REGISTRY_TITLE, CONNECTION_ERROR_TITLE, CONNECTION_ERROR_MESSAGE, - LIST_INTRO_TEXT, REMOVE_REPOSITORY_MODAL_TEXT, REMOVE_REPOSITORY_LABEL, SEARCH_PLACEHOLDER_TEXT, @@ -39,8 +37,6 @@ export default { GlEmptyState, ProjectEmptyState, GroupEmptyState, - ProjectPolicyAlert, - QuickstartDropdown, ImageList, GlModal, GlSprintf, @@ -48,6 +44,8 @@ export default { GlAlert, GlSkeletonLoader, GlSearchBoxByClick, + RegistryHeader, + CliCommands, }, directives: { GlTooltip: GlTooltipDirective, @@ -59,10 +57,8 @@ export default { height: 40, }, i18n: { - CONTAINER_REGISTRY_TITLE, CONNECTION_ERROR_TITLE, CONNECTION_ERROR_MESSAGE, - LIST_INTRO_TEXT, REMOVE_REPOSITORY_MODAL_TEXT, REMOVE_REPOSITORY_LABEL, SEARCH_PLACEHOLDER_TEXT, @@ -85,7 +81,7 @@ export default { label: 'registry_repository_delete', }; }, - showQuickStartDropdown() { + showCommands() { return Boolean(!this.isLoading && !this.config?.isGroupPage && this.images?.length); }, showDeleteAlert() { @@ -149,8 +145,6 @@ export default { - -