From 08c811d7ce13c6c7d17d45b4e92272ec49570827 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 6 May 2025 12:07:17 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- ...Geo Replicate a new Git repository type.md | 13 + .../Geo Replicate a new blob type.md | 13 + .rubocop_todo/gitlab/bounded_contexts.yml | 3 - .../gitlab/feature_flag_without_actor.yml | 1 - .../layout/line_break_after_final_mixin.yml | 23 - ...e_end_string_concatenation_indentation.yml | 2 - .../style/inline_disable_annotation.yml | 1 - GITALY_SERVER_VERSION | 2 +- .../notes/components/comment_field_layout.vue | 9 - .../notes/components/comment_form.vue | 1 - .../notes/mixins/issuable_state.js | 5 +- .../components/wiki_comment_form.vue | 3 - .../tracking/dispatch_snowplow_event.js | 6 +- app/assets/javascripts/tracking/index.js | 49 +- .../javascripts/tracking/internal_events.js | 5 + .../components/notes/noteable_warning.vue | 86 +- .../components/create_work_item.vue | 17 +- .../notes/work_item_comment_form.vue | 28 +- .../work_item_change_type_modal.vue | 13 +- .../work_items/components/work_item_dates.vue | 8 +- ...item_create_branch_merge_request_modal.vue | 8 +- .../work_item_development.vue | 20 +- .../work_item_actions_split_button.vue | 8 +- .../components/work_item_milestone.vue | 8 +- .../components/work_item_parent.vue | 15 +- app/graphql/mutations/issues/bulk_update.rb | 125 - .../mutations/work_items/bulk_update.rb | 3 +- app/graphql/types/mutation_type.rb | 1 - app/models/application_setting.rb | 10 +- app/models/audit_event.rb | 2 +- app/models/ci/bridge.rb | 2 +- app/models/ci/build.rb | 2 +- .../concerns/audit_events/common_model.rb | 2 +- app/models/concerns/diff_positionable_note.rb | 6 +- app/models/concerns/issue_parent.rb | 11 - app/models/hooks/web_hook_log.rb | 6 +- app/models/issue.rb | 10 +- app/models/merge_request.rb | 2 +- app/models/personal_access_token.rb | 2 +- app/models/project.rb | 1 - app/models/project_import_data.rb | 2 +- app/models/projects/deletion_schedule.rb | 12 + app/models/user.rb | 7 +- app/services/projects/destroy_service.rb | 12 +- config/application.rb | 1 + ...prompt_migration_explain_vulnerability.yml | 9 - .../prompt_migration_merge_request_reader.yml | 9 - .../prompt_migration_summarize_comments.yml | 9 - .../prompt_migration_troubleshoot_job.yml | 9 - .../bulk_update_issues_mutation.yml | 8 - .../optimize_issues_banned_users_query.yml | 10 - .../wip/rapid_diffs_on_commit_show.yml | 2 +- .../wip/rapid_diffs_on_compare_show.yml | 2 +- .../wip/rapid_diffs_on_mr_creation.yml | 2 +- .../wip/rapid_diffs_on_mr_show.yml | 2 +- config/initializers/00_deprecations.rb | 2 - db/docs/issue_email_participants.yml | 12 +- ...ame_to_compliance_requirements_controls.rb | 20 + ...mail_participants_namespace_id_not_null.rb | 14 + ...id_index_from_vulnerability_occurrences.rb | 19 + ...rnal_control_name_scoped_to_requirement.rb | 21 + db/schema_migrations/20250424180146 | 1 + db/schema_migrations/20250428090743 | 1 + db/schema_migrations/20250429031256 | 1 + db/schema_migrations/20250429034345 | 1 + db/structure.sql | 11 +- .../operations/moving_repositories.md | 2 +- doc/api/graphql/reference/_index.md | 53 +- doc/user/discussions/_index.md | 11 + lib/api/discussions.rb | 1 + lib/api/events.rb | 1 + lib/api/group_labels.rb | 1 + lib/api/issues.rb | 1 + lib/api/labels.rb | 1 + lib/api/notes.rb | 1 + lib/api/project_events.rb | 1 + lib/api/remote_mirrors.rb | 1 + lib/api/resource_label_events.rb | 1 + lib/api/resource_milestone_events.rb | 1 + lib/api/resource_state_events.rb | 1 + lib/api/rubygem_packages.rb | 1 + .../modules/v1/namespace_packages.rb | 1 + .../terraform/modules/v1/project_packages.rb | 1 + lib/gitlab/pdf.rb | 10 + lib/gitlab/pdf/header.rb | 79 + locale/gitlab.pot | 126 +- spec/factories/projects/deletion_schedules.rb | 9 + .../components/comment_field_layout_spec.js | 8 - .../tracking/dispatch_snowplow_event_spec.js | 27 + .../frontend/tracking/internal_events_spec.js | 18 + .../tracking/tracking_initialization_spec.js | 20 + .../noteable_warning_spec.js.snap | 33 +- .../components/notes/noteable_warning_spec.js | 81 +- .../notes/work_item_comment_form_spec.js | 3 - spec/lib/gitlab/pdf/header_spec.rb | 62 + .../models/projects/deletion_schedule_spec.rb | 20 + spec/models/user_spec.rb | 1 + .../mutations/issues/bulk_update_spec.rb | 179 -- .../services/projects/destroy_service_spec.rb | 55 + .../work_items/work_items_shared_examples.rb | 6 +- .../lib/tooling/glci/failure_analyzer_spec.rb | 20 +- .../job_trace_to_failure_category_spec.rb | 2484 ++++++++--------- tooling/lib/tooling/glci/failure_analyzer.rb | 22 +- .../job_trace_to_failure_category.rb | 29 +- .../patterns/multiline_patterns.yml | 2 +- .../glci/local_batch_failure_analyzer.rb | 170 ++ 106 files changed, 2116 insertions(+), 2159 deletions(-) delete mode 100644 app/graphql/mutations/issues/bulk_update.rb delete mode 100644 app/models/concerns/issue_parent.rb create mode 100644 app/models/projects/deletion_schedule.rb delete mode 100644 config/feature_flags/beta/prompt_migration_explain_vulnerability.yml delete mode 100644 config/feature_flags/beta/prompt_migration_merge_request_reader.yml delete mode 100644 config/feature_flags/beta/prompt_migration_summarize_comments.yml delete mode 100644 config/feature_flags/beta/prompt_migration_troubleshoot_job.yml delete mode 100644 config/feature_flags/development/bulk_update_issues_mutation.yml delete mode 100644 config/feature_flags/gitlab_com_derisk/optimize_issues_banned_users_query.yml create mode 100644 db/migrate/20250429031256_add_external_control_name_to_compliance_requirements_controls.rb create mode 100644 db/post_migrate/20250424180146_add_issue_email_participants_namespace_id_not_null.rb create mode 100644 db/post_migrate/20250428090743_remove_redundant_uuid_index_from_vulnerability_occurrences.rb create mode 100644 db/post_migrate/20250429034345_add_index_on_external_control_name_scoped_to_requirement.rb create mode 100644 db/schema_migrations/20250424180146 create mode 100644 db/schema_migrations/20250428090743 create mode 100644 db/schema_migrations/20250429031256 create mode 100644 db/schema_migrations/20250429034345 create mode 100644 lib/gitlab/pdf.rb create mode 100644 lib/gitlab/pdf/header.rb create mode 100644 spec/factories/projects/deletion_schedules.rb create mode 100644 spec/lib/gitlab/pdf/header_spec.rb create mode 100644 spec/models/projects/deletion_schedule_spec.rb delete mode 100644 spec/requests/api/graphql/mutations/issues/bulk_update_spec.rb create mode 100755 tooling/lib/tooling/glci/local_batch_failure_analyzer.rb diff --git a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md index 37a2cf694fb..bbd0a24b97d 100644 --- a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md +++ b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md @@ -330,6 +330,9 @@ That's all of the required database changes. ``` - [ ] Create `ee/app/replicators/geo/cool_widget_replicator.rb`. Implement the `#repository` method which should return a `` instance, and implement the class method `.model` to return the `CoolWidget` class: + - Implement the `replicable_title` and `replicable_title_plural` methods to + return the human-readable singular and pluralized title of the replicable, + which will be displayed in the UI and Rails console ```ruby # frozen_string_literal: true @@ -343,6 +346,16 @@ That's all of the required database changes. ::CoolWidget end + # @return [String] human-readable title. + def self.replicable_title + s_('Geo|Cool Widget') + end + + # @return [String] pluralized human-readable title. + def self.replicable_title_plural + s_('Geo|Cool Widgets') + end + override :verification_feature_flag_enabled? def self.verification_feature_flag_enabled? # We are adding verification at the same time as replication, so we diff --git a/.gitlab/issue_templates/Geo Replicate a new blob type.md b/.gitlab/issue_templates/Geo Replicate a new blob type.md index 4ff8c5bc9f3..4545b8d0a20 100644 --- a/.gitlab/issue_templates/Geo Replicate a new blob type.md +++ b/.gitlab/issue_templates/Geo Replicate a new blob type.md @@ -327,6 +327,9 @@ That's all of the required database changes. ``` - [ ] Create `ee/app/replicators/geo/cool_widget_replicator.rb`. Implement the `#carrierwave_uploader` method which should return a `CarrierWave::Uploader`, and implement the class method `.model` to return the `CoolWidget` class: + - Implement the `replicable_title` and `replicable_title_plural` methods to + return the human-readable singular and pluralized title of the replicable, + which will be displayed in the UI and Rails console ```ruby # frozen_string_literal: true @@ -340,6 +343,16 @@ That's all of the required database changes. ::CoolWidget end + # @return [String] human-readable title. + def self.replicable_title + s_('Geo|Cool Widget') + end + + # @return [String] pluralized human-readable title. + def self.replicable_title_plural + s_('Geo|Cool Widgets') + end + def carrierwave_uploader model_record.file end diff --git a/.rubocop_todo/gitlab/bounded_contexts.yml b/.rubocop_todo/gitlab/bounded_contexts.yml index de781647e00..b994c55d353 100644 --- a/.rubocop_todo/gitlab/bounded_contexts.yml +++ b/.rubocop_todo/gitlab/bounded_contexts.yml @@ -182,7 +182,6 @@ Gitlab/BoundedContexts: - 'app/graphql/mutations/incident_management/timeline_event_tag/base.rb' - 'app/graphql/mutations/incident_management/timeline_event_tag/create.rb' - 'app/graphql/mutations/issues/base.rb' - - 'app/graphql/mutations/issues/bulk_update.rb' - 'app/graphql/mutations/issues/common_mutation_arguments.rb' - 'app/graphql/mutations/issues/create.rb' - 'app/graphql/mutations/issues/link_alerts.rb' @@ -845,7 +844,6 @@ Gitlab/BoundedContexts: - 'app/models/concerns/issuable.rb' - 'app/models/concerns/issuable_link.rb' - 'app/models/concerns/issue_available_features.rb' - - 'app/models/concerns/issue_parent.rb' - 'app/models/concerns/issue_resource_event.rb' - 'app/models/concerns/label_eventable.rb' - 'app/models/concerns/legacy_bulk_insert.rb' @@ -2155,7 +2153,6 @@ Gitlab/BoundedContexts: - 'ee/app/graphql/ee/mutations/alert_management/http_integration/http_integration_base.rb' - 'ee/app/graphql/ee/mutations/alert_management/http_integration/update.rb' - 'ee/app/graphql/ee/mutations/groups/update.rb' - - 'ee/app/graphql/ee/mutations/issues/bulk_update.rb' - 'ee/app/graphql/ee/mutations/issues/create.rb' - 'ee/app/graphql/ee/mutations/issues/update.rb' - 'ee/app/graphql/ee/mutations/resolves_issuable.rb' diff --git a/.rubocop_todo/gitlab/feature_flag_without_actor.yml b/.rubocop_todo/gitlab/feature_flag_without_actor.yml index f7bf6875d19..1f9b36f7d13 100644 --- a/.rubocop_todo/gitlab/feature_flag_without_actor.yml +++ b/.rubocop_todo/gitlab/feature_flag_without_actor.yml @@ -12,7 +12,6 @@ Gitlab/FeatureFlagWithoutActor: - 'app/finders/merge_requests_finder.rb' - 'app/finders/notes_finder.rb' - 'app/finders/snippets_finder.rb' - - 'app/graphql/mutations/issues/bulk_update.rb' - 'app/graphql/types/namespace_type.rb' - 'app/graphql/types/project_type.rb' - 'app/helpers/auto_devops_helper.rb' diff --git a/.rubocop_todo/layout/line_break_after_final_mixin.yml b/.rubocop_todo/layout/line_break_after_final_mixin.yml index b445a9bc419..abcc87d7889 100644 --- a/.rubocop_todo/layout/line_break_after_final_mixin.yml +++ b/.rubocop_todo/layout/line_break_after_final_mixin.yml @@ -58,29 +58,6 @@ Layout/LineBreakAfterFinalMixin: - 'ee/app/workers/sync_seat_link_worker.rb' - 'ee/app/workers/vulnerabilities/historical_statistics/deletion_worker.rb' - 'ee/app/workers/vulnerabilities/statistics/schedule_worker.rb' - - 'ee/lib/api/dependency_proxy/packages/maven.rb' - - 'ee/lib/api/resource_iteration_events.rb' - - 'ee/lib/api/resource_weight_events.rb' - - 'ee/lib/ee/api/entities/project_push_rule.rb' - - 'ee/lib/gitlab/auth/group_saml/identity_linker.rb' - - 'ee/lib/gitlab/llm/chain/tools/explain_code/prompts/anthropic.rb' - - 'ee/lib/gitlab/search/zoekt/client.rb' - - 'ee/lib/gitlab/status_page/storage/s3_multipart_upload.rb' - - 'ee/lib/search/zoekt/query.rb' - - 'lib/api/discussions.rb' - - 'lib/api/events.rb' - - 'lib/api/group_labels.rb' - - 'lib/api/issues.rb' - - 'lib/api/labels.rb' - - 'lib/api/notes.rb' - - 'lib/api/project_events.rb' - - 'lib/api/remote_mirrors.rb' - - 'lib/api/resource_label_events.rb' - - 'lib/api/resource_milestone_events.rb' - - 'lib/api/resource_state_events.rb' - - 'lib/api/rubygem_packages.rb' - - 'lib/api/terraform/modules/v1/namespace_packages.rb' - - 'lib/api/terraform/modules/v1/project_packages.rb' - 'lib/banzai/filter/references/design_reference_filter.rb' - 'lib/feature.rb' - 'lib/gitlab/auth/current_user_mode.rb' diff --git a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml index 3cb9680a461..ef135df18ca 100644 --- a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml +++ b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml @@ -249,7 +249,6 @@ Layout/LineEndStringConcatenationIndentation: - 'ee/spec/requests/api/graphql/mutations/dast_site_profiles/update_spec.rb' - 'ee/spec/requests/api/graphql/mutations/epics/create_spec.rb' - 'ee/spec/requests/api/graphql/mutations/epics/update_spec.rb' - - 'ee/spec/requests/api/graphql/mutations/issues/bulk_update_spec.rb' - 'ee/spec/requests/api/graphql/mutations/issues/promote_to_epic_spec.rb' - 'ee/spec/requests/api/graphql/mutations/issues/set_epic_spec.rb' - 'ee/spec/requests/api/graphql/mutations/issues/set_weight_spec.rb' @@ -531,7 +530,6 @@ Layout/LineEndStringConcatenationIndentation: - 'spec/requests/api/graphql/mutations/achievements/update_user_achievement_priorities_spec.rb' - 'spec/requests/api/graphql/mutations/ci/runner/create_spec.rb' - 'spec/requests/api/graphql/mutations/clusters/agent_tokens/agent_tokens/create_spec.rb' - - 'spec/requests/api/graphql/mutations/issues/bulk_update_spec.rb' - 'spec/requests/api/graphql/mutations/merge_requests/set_milestone_spec.rb' - 'spec/requests/api/graphql/mutations/ml/models/delete_spec.rb' - 'spec/requests/api/graphql/mutations/uploads/delete_spec.rb' diff --git a/.rubocop_todo/style/inline_disable_annotation.yml b/.rubocop_todo/style/inline_disable_annotation.yml index 4beb4f34def..250b5a95be0 100644 --- a/.rubocop_todo/style/inline_disable_annotation.yml +++ b/.rubocop_todo/style/inline_disable_annotation.yml @@ -2255,7 +2255,6 @@ Style/InlineDisableAnnotation: - 'spec/requests/api/ci/runner/jobs_artifacts_spec.rb' - 'spec/requests/api/graphql/groups_query_spec.rb' - 'spec/requests/api/graphql/issues_spec.rb' - - 'spec/requests/api/graphql/mutations/issues/bulk_update_spec.rb' - 'spec/requests/api/group_import_spec.rb' - 'spec/requests/api/internal/base_spec.rb' - 'spec/requests/api/ml_model_packages_spec.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index c1c02782d82..6f22fcc3a5d 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -dad1421c02c5d89c3d667ed0abd41da2336d6418 +124a10130bac885023b44616e773ffd4229ee592 diff --git a/app/assets/javascripts/notes/components/comment_field_layout.vue b/app/assets/javascripts/notes/components/comment_field_layout.vue index 82644924efb..50db2c2f0f6 100644 --- a/app/assets/javascripts/notes/components/comment_field_layout.vue +++ b/app/assets/javascripts/notes/components/comment_field_layout.vue @@ -4,7 +4,6 @@ import NoteableWarning from '~/vue_shared/components/notes/noteable_warning.vue' import EmailParticipantsWarning from './email_participants_warning.vue'; const ATTACHMENT_REGEXP = /!?\[.*?\]\(\/uploads\/[0-9a-f]{32}\/.*?\)/; -const DEFAULT_NOTEABLE_TYPE = 'Issue'; export default { i18n: { @@ -34,11 +33,6 @@ export default { type: Object, required: true, }, - noteableType: { - type: String, - required: false, - default: DEFAULT_NOTEABLE_TYPE, - }, withAlertContainer: { type: Boolean, required: false, @@ -92,9 +86,6 @@ export default { class="-gl-mb-3 gl-rounded-lg gl-rounded-b-none gl-pb-5 gl-pt-4" :is-locked="isLocked" :is-confidential="isConfidential" - :noteable-type="noteableType" - :locked-noteable-docs-path="noteableData.locked_discussion_docs_path" - :confidential-noteable-docs-path="noteableData.confidential_issues_docs_path" />
import { GlLink, GlIcon, GlSprintf } from '@gitlab/ui'; -import { __, sprintf } from '~/locale'; - -const noteableTypeText = { - Issue: __('issue'), - Epic: __('epic'), - MergeRequest: __('merge request'), - Task: __('task'), - KeyResult: __('key result'), - Objective: __('objective'), -}; +import { helpPagePath } from '~/helpers/help_page_helper'; export default { + docsLinks: { + locked: helpPagePath('user/discussions/_index', { + anchor: 'prevent-comments-by-locking-the-discussion', + }), + confidential: helpPagePath('user/discussions/_index', { + anchor: 'comments-on-confidential-items', + }), + }, components: { GlIcon, GlLink, @@ -28,22 +27,6 @@ export default { default: false, required: false, }, - noteableType: { - type: String, - required: false, - // eslint-disable-next-line @gitlab/require-i18n-strings - default: 'Issue', - }, - lockedNoteableDocsPath: { - type: String, - required: false, - default: '', - }, - confidentialNoteableDocsPath: { - type: String, - required: false, - default: '', - }, }, computed: { warningIcon() { @@ -55,19 +38,6 @@ export default { isLockedAndConfidential() { return this.isConfidential && this.isLocked; }, - noteableTypeText() { - return noteableTypeText[this.noteableType]; - }, - confidentialContextText() { - return sprintf(__('This is a confidential %{noteableTypeText}.'), { - noteableTypeText: this.noteableTypeText, - }); - }, - lockedContextText() { - return sprintf(__('The discussion in this %{noteableTypeText} is locked.'), { - noteableTypeText: this.noteableTypeText, - }); - }, }, }; @@ -85,36 +55,44 @@ export default { - - {{ - __("People without permission will never get a notification and won't be able to comment.") - }} - {{ confidentialContextText }} - {{ __('People without permission will never get a notification.') }} - {{ - __('Learn more.') - }} + + + - {{ lockedContextText }} - {{ __('Only project members can comment.') }} - {{ __('Learn more.') }} + + +
diff --git a/app/assets/javascripts/work_items/components/create_work_item.vue b/app/assets/javascripts/work_items/components/create_work_item.vue index 2943b6270f3..6de09724dc7 100644 --- a/app/assets/javascripts/work_items/components/create_work_item.vue +++ b/app/assets/javascripts/work_items/components/create_work_item.vue @@ -33,7 +33,6 @@ import { import { TYPENAME_MERGE_REQUEST, TYPENAME_VULNERABILITY } from '~/graphql_shared/constants'; import { I18N_WORK_ITEM_ERROR_CREATING, - sprintfWorkItem, i18n, NAME_TO_TEXT_LOWERCASE_MAP, NAME_TO_TEXT_MAP, @@ -396,21 +395,27 @@ export default { return options; }, createErrorText() { - return sprintfWorkItem(I18N_WORK_ITEM_ERROR_CREATING, this.selectedWorkItemTypeName); + return sprintf(I18N_WORK_ITEM_ERROR_CREATING, { + workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.selectedWorkItemTypeName], + }); }, createWorkItemText() { - return sprintfWorkItem(s__('WorkItem|Create %{workItemType}'), this.selectedWorkItemTypeName); + return sprintf(s__('WorkItem|Create %{workItemType}'), { + workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.selectedWorkItemTypeName], + }); }, makeConfidentialText() { - return sprintfWorkItem( + return sprintf( s__( 'WorkItem|This %{workItemType} is confidential and should only be visible to users having at least the Planner role', ), - this.selectedWorkItemTypeName, + { workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.selectedWorkItemTypeName] }, ); }, titleText() { - return sprintfWorkItem(s__('WorkItem|New %{workItemType}'), this.selectedWorkItemTypeName); + return sprintf(s__('WorkItem|New %{workItemType}'), { + workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.selectedWorkItemTypeName], + }); }, canUpdate() { return this.workItem?.userPermissions?.updateWorkItem; diff --git a/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue b/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue index 2ff8b058f31..cd00d565d21 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue @@ -4,7 +4,7 @@ import { helpPagePath } from '~/helpers/help_page_helper'; import { s__, __ } from '~/locale'; import { detectAndConfirmSensitiveTokens } from '~/lib/utils/secret_detection'; import { capitalizeFirstCharacter } from '~/lib/utils/text_utility'; -import { STATE_OPEN, WORK_ITEM_TYPE_NAME_TASK, i18n } from '~/work_items/constants'; +import { STATE_OPEN, i18n } from '~/work_items/constants'; import { getDraft, clearDraft, updateDraft } from '~/lib/utils/autosave'; import gfmEventHub from '~/vue_shared/components/markdown/eventhub'; import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal'; @@ -17,19 +17,6 @@ import workItemByIidQuery from '../../graphql/work_item_by_iid.query.graphql'; import workItemEmailParticipantsByIidQuery from '../../graphql/notes/work_item_email_participants_by_iid.query.graphql'; import { findEmailParticipantsWidget } from '../../utils'; -const DOCS_WORK_ITEM_LOCKED_TASKS_PATH = helpPagePath('user/tasks.html', { - anchor: 'lock-discussion', -}); -const DOCS_WORK_ITEM_CONFIDENTIAL_TASKS_PATH = helpPagePath('user/tasks.html', { - anchor: 'confidential-tasks', -}); -const DOCS_WORK_ITEM_LOCKED_OKRS_PATH = helpPagePath('user/okrs.html', { - anchor: 'lock-discussion', -}); -const DOCS_WORK_ITEM_CONFIDENTIAL_OKRS_PATH = helpPagePath('user/okrs.html', { - anchor: 'confidential-okrs', -}); - export default { i18n: { internal: s__('Notes|Make this an internal note'), @@ -201,23 +188,11 @@ export default { commentButtonTextComputed() { return this.isNoteInternal ? this.$options.i18n.addInternalNote : this.commentButtonText; }, - docsLinks() { - return this.workItemType === WORK_ITEM_TYPE_NAME_TASK - ? { - confidential_issues_docs_path: DOCS_WORK_ITEM_CONFIDENTIAL_TASKS_PATH, - locked_discussion_docs_path: DOCS_WORK_ITEM_LOCKED_TASKS_PATH, - } - : { - confidential_issues_docs_path: DOCS_WORK_ITEM_CONFIDENTIAL_OKRS_PATH, - locked_discussion_docs_path: DOCS_WORK_ITEM_LOCKED_OKRS_PATH, - }; - }, getWorkItemData() { return { confidential: this.isWorkItemConfidential, discussion_locked: this.isDiscussionLocked, issue_email_participants: this.emailParticipants, - ...this.docsLinks, }; }, workItemTypeKey() { @@ -369,7 +344,6 @@ export default { :is-internal-note="isDiscussionInternal || isNoteInternal" :note="commentText" :noteable-data="getWorkItemData" - :noteable-type="workItemTypeKey" > { - const message = sprintfWorkItem(I18N_WORK_ITEM_ERROR_UPDATING, this.workItemType); + const message = sprintf(I18N_WORK_ITEM_ERROR_UPDATING, { + workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.workItemType], + }); this.$emit('error', message); Sentry.captureException(error); }) diff --git a/app/assets/javascripts/work_items/components/work_item_development/work_item_create_branch_merge_request_modal.vue b/app/assets/javascripts/work_items/components/work_item_development/work_item_create_branch_merge_request_modal.vue index 093331a1f88..4064de5ad3f 100644 --- a/app/assets/javascripts/work_items/components/work_item_development/work_item_create_branch_merge_request_modal.vue +++ b/app/assets/javascripts/work_items/components/work_item_development/work_item_create_branch_merge_request_modal.vue @@ -4,7 +4,7 @@ import { debounce } from 'lodash'; import axios from '~/lib/utils/axios_utils'; import { createAlert } from '~/alert'; import { - sprintfWorkItem, + NAME_TO_TEXT_LOWERCASE_MAP, WORK_ITEM_CREATE_ENTITY_MODAL_TARGET_SOURCE, WORK_ITEM_CREATE_ENTITY_MODAL_TARGET_BRANCH, } from '~/work_items/constants'; @@ -19,7 +19,7 @@ import { import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue'; import getProjectRootRef from '~/work_items/graphql/get_project_root_ref.query.graphql'; -import { s__, __ } from '~/locale'; +import { s__, __, sprintf } from '~/locale'; import confidentialMergeRequestState from '~/confidential_merge_request/state'; import ProjectFormGroup from '~/confidential_merge_request/components/project_form_group.vue'; @@ -250,9 +250,9 @@ export default { this.$emit('hideModal'); } catch { createAlert({ - message: sprintfWorkItem( + message: sprintf( s__('WorkItem|Failed to create a branch for this %{workItemType}. Please try again.'), - this.workItemType?.toLowerCase(), + { workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.workItemType] }, ), }); } finally { diff --git a/app/assets/javascripts/work_items/components/work_item_development/work_item_development.vue b/app/assets/javascripts/work_items/components/work_item_development/work_item_development.vue index 9dbbeebc015..9c413a5fe1d 100644 --- a/app/assets/javascripts/work_items/components/work_item_development/work_item_development.vue +++ b/app/assets/javascripts/work_items/components/work_item_development/work_item_development.vue @@ -2,11 +2,15 @@ import { GlIcon, GlAlert, GlTooltipDirective } from '@gitlab/ui'; import * as Sentry from '~/sentry/sentry_browser_wrapper'; import { ERROR_POLICY_ALL } from '~/lib/graphql'; -import { s__, __ } from '~/locale'; +import { s__, __, sprintf } from '~/locale'; import workItemByIidQuery from '~/work_items/graphql/work_item_by_iid.query.graphql'; import workItemDevelopmentQuery from '~/work_items/graphql/work_item_development.query.graphql'; import workItemDevelopmentUpdatedSubscription from '~/work_items/graphql/work_item_development.subscription.graphql'; -import { sprintfWorkItem, STATE_OPEN, DEVELOPMENT_ITEMS_ANCHOR } from '~/work_items/constants'; +import { + DEVELOPMENT_ITEMS_ANCHOR, + NAME_TO_TEXT_LOWERCASE_MAP, + STATE_OPEN, +} from '~/work_items/constants'; import { findDevelopmentWidget } from '~/work_items/utils'; import CrudComponent from '~/vue_shared/components/crud_component.vue'; import WorkItemActionsSplitButton from '~/work_items/components/work_item_links/work_item_actions_split_button.vue'; @@ -109,21 +113,21 @@ export default { }, openStateText() { return this.closingMergeRequests.length > 1 - ? sprintfWorkItem( + ? sprintf( s__( 'WorkItem|This %{workItemType} will be closed when any of the following is merged.', ), - this.workItemType, + { workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.workItemType] }, ) - : sprintfWorkItem( + : sprintf( s__('WorkItem|This %{workItemType} will be closed when the following is merged.'), - this.workItemType, + { workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.workItemType] }, ); }, closedStateText() { - return sprintfWorkItem( + return sprintf( s__('WorkItem|The %{workItemType} was closed automatically when a branch was merged.'), - this.workItemType, + { workItemType: NAME_TO_TEXT_LOWERCASE_MAP[this.workItemType] }, ); }, tooltipText() { diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_actions_split_button.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_actions_split_button.vue index 61945383c6f..4f39d7704af 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_actions_split_button.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_actions_split_button.vue @@ -1,12 +1,12 @@