From 6d391a866921722be5fd2785b106f237f1577ceb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 20 Jun 2024 18:23:36 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../components/pipelines_table_wrapper.vue | 15 ++ .../javascripts/lib/utils/text_utility.js | 20 ++ .../components/details_page/tags_list_row.vue | 20 +- .../explorer/constants/details.js | 2 +- .../container_protection_rule_form.vue | 4 +- .../components/container_protection_rules.vue | 1 + .../components/create_work_item.vue | 4 +- .../components/create_work_item_modal.vue | 6 + .../work_items/graphql/cache_utils.js | 4 +- app/assets/javascripts/work_items/utils.js | 34 ++++ app/assets/stylesheets/tailwind.css | 83 --------- .../organizations/groups_controller.rb | 16 +- .../protection/rule/create.rb | 32 ++-- .../protection/rule/update.rb | 24 +-- .../protection/rule_type.rb | 24 ++- .../container_registry/protection/rule.rb | 11 +- config/routes/organizations.rb | 4 +- config/tailwind.config.js | 37 +++- ...5160001_17_0.yml => 202405160001_17_0.yml} | 1 - data/whats_new/20240620001_17_1.yml | 113 +++++++++++ ..._protection_rules_minimum_access_levels.rb | 25 +++ ..._protection_rules_minimum_access_levels.rb | 19 ++ db/schema_migrations/20240528144520 | 1 + db/schema_migrations/20240528144530 | 1 + db/structure.sql | 5 +- doc/api/graphql/reference/index.md | 62 ++++-- doc/solutions/codelanguages/index.md | 17 ++ doc/solutions/codelanguages/rust/index.md | 45 +++++ .../secret_push_protection/index.md | 3 +- doc/user/gitlab_duo_chat/index.md | 32 ++++ doc/user/project/merge_requests/commits.md | 3 + doc/user/project/protected_branches.md | 7 +- .../pagination/keyset/simple_order_builder.rb | 9 +- .../offset/pagination_with_index_only_scan.rb | 176 ++++++++++++++++++ locale/gitlab.pot | 11 +- package.json | 2 +- qa/qa/resource/api_fabricator.rb | 22 ++- qa/qa/resource/design.rb | 18 ++ qa/spec/resource/api_fabricator_spec.rb | 97 ++++++++++ .../blobs/blob_line_permalink_updater_spec.rb | 2 +- .../files/dockerfile_dropdown_spec.rb | 2 +- .../projects/files/download_buttons_spec.rb | 2 +- .../files/edit_file_soft_wrap_spec.rb | 2 +- .../projects/files/editing_a_file_spec.rb | 2 +- ...files_sort_submodules_with_folders_spec.rb | 2 +- .../projects/files/gitignore_dropdown_spec.rb | 2 +- .../files/gitlab_ci_yml_dropdown_spec.rb | 2 +- ...eate_license_file_in_empty_project_spec.rb | 2 +- .../projects/files/undo_template_spec.rb | 2 +- ..._a_folder_containing_only_a_folder_spec.rb | 2 +- .../projects/files/user_uploads_files_spec.rb | 2 +- .../features/projects/forks/fork_list_spec.rb | 2 +- .../projects/hook_logs/user_reads_log_spec.rb | 2 +- .../projects/jobs/permissions_spec.rb | 2 +- .../pipelines_table_wrapper_spec.js | 18 ++ spec/frontend/lib/utils/text_utility_spec.js | 17 ++ .../details_page/tags_list_row_spec.js | 10 +- .../container_protection_rule_form_spec.js | 36 +++- .../container_protection_rules_spec.js | 24 ++- .../components/create_work_item_modal_spec.js | 62 +++++- spec/graphql/resolvers/group_resolver_spec.rb | 28 +-- .../resolvers/project_resolver_spec.rb | 29 +-- .../protection/rule_type_spec.rb | 4 +- .../pagination_with_index_only_scan_spec.rb | 144 ++++++++++++++ .../protection/rule_spec.rb | 29 ++- .../protection/rule/create_spec.rb | 73 +++++--- .../protection/rule/update_spec.rb | 29 ++- .../organizations/groups_controller_spec.rb | 146 +++++++++++++++ .../protection/create_rule_service_spec.rb | 7 + .../group_and_project_shared_examples.rb | 24 +++ yarn.lock | 8 +- 71 files changed, 1426 insertions(+), 302 deletions(-) rename data/whats_new/{202505160001_17_0.yml => 202405160001_17_0.yml} (99%) create mode 100644 data/whats_new/20240620001_17_1.yml create mode 100644 db/migrate/20240528144520_add_multi_not_null_constraint_on_container_protection_rules_minimum_access_levels.rb create mode 100644 db/migrate/20240528144530_remove_not_null_constraint_on_container_protection_rules_minimum_access_levels.rb create mode 100644 db/schema_migrations/20240528144520 create mode 100644 db/schema_migrations/20240528144530 create mode 100644 doc/solutions/codelanguages/index.md create mode 100644 doc/solutions/codelanguages/rust/index.md create mode 100644 lib/gitlab/pagination/offset/pagination_with_index_only_scan.rb create mode 100644 spec/lib/gitlab/pagination/offset/pagination_with_index_only_scan_spec.rb create mode 100644 spec/support/shared_examples/graphql/resolvers/group_and_project_shared_examples.rb diff --git a/app/assets/javascripts/ci/merge_requests/components/pipelines_table_wrapper.vue b/app/assets/javascripts/ci/merge_requests/components/pipelines_table_wrapper.vue index b96c13e5481..e22eb494fa0 100644 --- a/app/assets/javascripts/ci/merge_requests/components/pipelines_table_wrapper.vue +++ b/app/assets/javascripts/ci/merge_requests/components/pipelines_table_wrapper.vue @@ -80,8 +80,13 @@ export default { return formatPipelinesGraphQLDataToREST(data?.project) || []; }, result({ data }) { + const pipelineCount = data?.project?.mergeRequest?.pipelines?.count; this.isInitialLoading = false; this.pageInfo = data?.project?.mergeRequest?.pipelines?.pageInfo || {}; + + if (pipelineCount) { + this.updateBadgeCount(pipelineCount); + } }, error() { this.hasError = true; @@ -214,6 +219,16 @@ export default { this.$refs.modal.show(); } }, + updateBadgeCount(pipelineCount) { + const updatePipelinesEvent = new CustomEvent('update-pipelines-count', { + detail: { pipelineCount }, + }); + + // Event to update the count in tabs in app/assets/javascripts/commit/pipelines/utils.js + if (this.$el?.parentElement) { + this.$el.parentElement.dispatchEvent(updatePipelinesEvent); + } + }, }, modal: { id: 'create-pipeline-for-uork-merge-request-modal', diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js index b30eba25aa8..a538dc8307f 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js +++ b/app/assets/javascripts/lib/utils/text_utility.js @@ -541,3 +541,23 @@ export const humanizeBranchValidationErrors = (invalidChars = []) => { * @returns {String} String without any enclosure */ export const stripQuotes = (value) => value.replace(/^('|")(.*)('|")$/, '$2'); + +/** + * Converts a sentence to title case inspite of it being in any case + * e.g. Hello world => Hello World + * e.g HELLO WORLD => Hello World + * e.g. hello World => Hello World + * e.g. Hello world => Hello World + * e.g. Hello World => Hello World + * + * @param {String} string + * @returns {String} + */ + +export const convertEachWordToTitleCase = (str) => { + return str + .toLowerCase() + .split(' ') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +}; diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue index 83ef7a525d0..28ceda06dbc 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue @@ -8,7 +8,7 @@ import { GlBadge, GlLink, } from '@gitlab/ui'; -import { formatDate } from '~/lib/utils/datetime_utility'; +import { localeDateFormat } from '~/lib/utils/datetime_utility'; import { numberToHumanSize } from '~/lib/utils/number_utils'; import { n__ } from '~/locale'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; @@ -116,14 +116,11 @@ export default { // remove sha256: from the string, and show only the first 7 char return this.tag.digest?.substring(7, 14) ?? NOT_AVAILABLE_TEXT; }, - publishDate() { + publishDateTime() { return this.tag.publishedAt || this.tag.createdAt; }, - publishedDate() { - return formatDate(this.publishDate, 'isoDate'); - }, - publishedTime() { - return formatDate(this.publishDate, 'HH:MM:ss Z'); + publishedDateTime() { + return localeDateFormat.asDateTimeFull.format(this.publishDateTime); }, formattedRevision() { // to be removed when API response is adjusted @@ -210,7 +207,7 @@ export default { @@ -243,11 +240,8 @@ export default { - -