From 9da482ecb8d25c8b6387f3262cfe983976333eec Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 27 Jul 2022 21:11:07 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../components/related_issuable_item.vue | 51 ++- app/assets/javascripts/issues/index.js | 2 +- .../issues/show/components/description.vue | 1 + .../components/details/package_history.vue | 35 +- .../package_registry/constants.js | 5 + .../pages/projects/issues/show/index.js | 2 +- .../components/related_issues_list.vue | 2 +- .../components/related_issues_root.vue | 9 + .../javascripts/related_issues/index.js | 51 +-- .../components/work_item_detail_modal.vue | 41 +- .../projects/issues/_related_issues.html.haml | 4 +- .../issue_type/_details_content.html.haml | 2 +- config/metrics/aggregates/code_review.yml | 12 + ...uest_widget_accessibility_view_monthly.yml | 25 ++ ...essibility_full_report_clicked_monthly.yml | 25 ++ ...st_widget_accessibility_expand_monthly.yml | 25 ++ ...t_accessibility_expand_success_monthly.yml | 25 ++ ...t_accessibility_expand_warning_monthly.yml | 25 ++ ...et_accessibility_expand_failed_monthly.yml | 25 ++ ...quest_widget_accessibility_view_weekly.yml | 25 ++ ...cessibility_full_report_clicked_weekly.yml | 25 ++ ...est_widget_accessibility_expand_weekly.yml | 25 ++ ...et_accessibility_expand_success_weekly.yml | 25 ++ ...et_accessibility_expand_warning_weekly.yml | 25 ++ ...get_accessibility_expand_failed_weekly.yml | 25 ++ ...equest_widget_accessibility_count_view.yml | 24 ++ ...ccessibility_count_full_report_clicked.yml | 24 ++ ...uest_widget_accessibility_count_expand.yml | 24 ++ ...get_accessibility_count_expand_success.yml | 24 ++ ...get_accessibility_count_expand_warning.yml | 24 ++ ...dget_accessibility_count_expand_failed.yml | 24 ++ ...ate_vulnerabilities_project_id_id_index.rb | 22 + db/schema_migrations/20220603173103 | 1 + db/structure.sql | 2 +- doc/api/features.md | 10 - .../deprecation_guidelines/index.md | 6 + .../known_events/code_review_events.yml | 25 ++ .../merge_request_widget_extension_counter.rb | 2 +- .../components/related_issuable_item_spec.js | 231 +++++++---- .../components/related_issues_root_spec.js | 379 ++++++++---------- .../details/package_history_spec.js | 32 +- .../components/work_item_detail_modal_spec.js | 130 +++++- spec/frontend/work_items/mock_data.js | 26 ++ 43 files changed, 1156 insertions(+), 371 deletions(-) create mode 100644 config/metrics/counts_28d/20220725210913_i_code_review_merge_request_widget_accessibility_view_monthly.yml create mode 100644 config/metrics/counts_28d/20220725210919_i_code_review_merge_request_widget_accessibility_full_report_clicked_monthly.yml create mode 100644 config/metrics/counts_28d/20220725210926_i_code_review_merge_request_widget_accessibility_expand_monthly.yml create mode 100644 config/metrics/counts_28d/20220725210935_i_code_review_merge_request_widget_accessibility_expand_success_monthly.yml create mode 100644 config/metrics/counts_28d/20220725210942_i_code_review_merge_request_widget_accessibility_expand_warning_monthly.yml create mode 100644 config/metrics/counts_28d/20220725210949_i_code_review_merge_request_widget_accessibility_expand_failed_monthly.yml create mode 100644 config/metrics/counts_7d/20220725210831_i_code_review_merge_request_widget_accessibility_view_weekly.yml create mode 100644 config/metrics/counts_7d/20220725210838_i_code_review_merge_request_widget_accessibility_full_report_clicked_weekly.yml create mode 100644 config/metrics/counts_7d/20220725210845_i_code_review_merge_request_widget_accessibility_expand_weekly.yml create mode 100644 config/metrics/counts_7d/20220725210851_i_code_review_merge_request_widget_accessibility_expand_success_weekly.yml create mode 100644 config/metrics/counts_7d/20220725210858_i_code_review_merge_request_widget_accessibility_expand_warning_weekly.yml create mode 100644 config/metrics/counts_7d/20220725210906_i_code_review_merge_request_widget_accessibility_expand_failed_weekly.yml create mode 100644 config/metrics/counts_all/20220725205853_i_code_review_merge_request_widget_accessibility_count_view.yml create mode 100644 config/metrics/counts_all/20220725205901_i_code_review_merge_request_widget_accessibility_count_full_report_clicked.yml create mode 100644 config/metrics/counts_all/20220725205908_i_code_review_merge_request_widget_accessibility_count_expand.yml create mode 100644 config/metrics/counts_all/20220725205915_i_code_review_merge_request_widget_accessibility_count_expand_success.yml create mode 100644 config/metrics/counts_all/20220725205922_i_code_review_merge_request_widget_accessibility_count_expand_warning.yml create mode 100644 config/metrics/counts_all/20220725205928_i_code_review_merge_request_widget_accessibility_count_expand_failed.yml create mode 100644 db/post_migrate/20220603173103_update_vulnerabilities_project_id_id_index.rb create mode 100644 db/schema_migrations/20220603173103 diff --git a/app/assets/javascripts/issuable/components/related_issuable_item.vue b/app/assets/javascripts/issuable/components/related_issuable_item.vue index a505a988360..667c712d3be 100644 --- a/app/assets/javascripts/issuable/components/related_issuable_item.vue +++ b/app/assets/javascripts/issuable/components/related_issuable_item.vue @@ -2,29 +2,35 @@ import '~/commons/bootstrap'; import { GlIcon, + GlLink, GlTooltip, GlTooltipDirective, GlButton, GlSafeHtmlDirective as SafeHtml, } from '@gitlab/ui'; import IssueDueDate from '~/boards/components/issue_due_date.vue'; +import { TYPE_WORK_ITEM } from '~/graphql_shared/constants'; +import { convertToGraphQLId } from '~/graphql_shared/utils'; +import { setUrlParams, updateHistory } from '~/lib/utils/url_utility'; import { sprintf } from '~/locale'; import CiIcon from '~/vue_shared/components/ci_icon.vue'; +import WorkItemDetailModal from '~/work_items/components/work_item_detail_modal.vue'; import relatedIssuableMixin from '../mixins/related_issuable_mixin'; import IssueAssignees from './issue_assignees.vue'; import IssueMilestone from './issue_milestone.vue'; export default { - name: 'IssueItem', components: { IssueMilestone, IssueAssignees, CiIcon, GlIcon, + GlLink, GlTooltip, IssueWeight: () => import('ee_component/boards/components/issue_card_weight.vue'), IssueDueDate, GlButton, + WorkItemDetailModal, }, directives: { GlTooltip: GlTooltipDirective, @@ -47,6 +53,11 @@ export default { required: false, default: '', }, + workItemType: { + type: String, + required: false, + default: '', + }, }, computed: { stateTitle() { @@ -62,6 +73,27 @@ export default { iconClasses() { return `${this.iconClass} ic-${this.iconName}`; }, + workItemId() { + return convertToGraphQLId(TYPE_WORK_ITEM, this.idKey); + }, + }, + methods: { + handleTitleClick(event) { + if (this.workItemType === 'TASK') { + event.preventDefault(); + this.$refs.modal.show(); + this.updateWorkItemIdUrlQuery(this.idKey); + } + }, + handleWorkItemDeleted(workItemId) { + this.$emit('relatedIssueRemoveRequest', workItemId); + }, + updateWorkItemIdUrlQuery(workItemId) { + updateHistory({ + url: setUrlParams({ work_item_id: workItemId }), + replace: true, + }); + }, }, }; @@ -102,7 +134,13 @@ export default { class="confidential-icon gl-mr-2 align-self-baseline align-self-md-auto mt-xl-0" :aria-label="__('Confidential')" /> - {{ title }} + + {{ title }} + @@ -178,16 +216,15 @@ export default { + diff --git a/app/assets/javascripts/issues/index.js b/app/assets/javascripts/issues/index.js index 380bb5f5346..22ac37656ea 100644 --- a/app/assets/javascripts/issues/index.js +++ b/app/assets/javascripts/issues/index.js @@ -9,7 +9,7 @@ import { IssueType } from '~/issues/constants'; import Issue from '~/issues/issue'; import { initTitleSuggestions, initTypePopover } from '~/issues/new'; import { initRelatedMergeRequests } from '~/issues/related_merge_requests'; -import initRelatedIssues from '~/related_issues'; +import { initRelatedIssues } from '~/related_issues'; import { initHeaderActions, initIncidentApp, diff --git a/app/assets/javascripts/issues/show/components/description.vue b/app/assets/javascripts/issues/show/components/description.vue index 3a93bccee88..8a8c50c7138 100644 --- a/app/assets/javascripts/issues/show/components/description.vue +++ b/app/assets/javascripts/issues/show/components/description.vue @@ -326,6 +326,7 @@ export default { } const workItemId = convertToGraphQLId(TYPE_WORK_ITEM, issue); this.addHoverListeners(taskLink, workItemId); + taskLink.classList.add('gl-link'); taskLink.addEventListener('click', (e) => { e.preventDefault(); this.openWorkItemDetailModal(taskLink); diff --git a/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_history.vue b/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_history.vue index 96b82a20364..a1fc7563de1 100644 --- a/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_history.vue +++ b/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_history.vue @@ -5,12 +5,17 @@ import { first } from 'lodash'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { truncateSha } from '~/lib/utils/text_utility'; import { s__, n__ } from '~/locale'; +import Tracking from '~/tracking'; +import { packageTypeToTrackCategory } from '~/packages_and_registries/package_registry/utils'; import { HISTORY_PIPELINES_LIMIT } from '~/packages_and_registries/shared/constants'; import HistoryItem from '~/vue_shared/components/registry/history_item.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import { GRAPHQL_PACKAGE_PIPELINES_PAGE_SIZE, FETCH_PACKAGE_PIPELINES_ERROR_MESSAGE, + TRACKING_ACTION_CLICK_PIPELINE_LINK, + TRACKING_ACTION_CLICK_COMMIT_LINK, + TRACKING_LABEL_PACKAGE_HISTORY, } from '../../constants'; import getPackagePipelinesQuery from '../../graphql/queries/get_package_pipelines.query.graphql'; import PackageHistoryLoader from './package_history_loader.vue'; @@ -37,6 +42,9 @@ export default { PackageHistoryLoader, TimeAgoTooltip, }, + mixins: [Tracking.mixin()], + TRACKING_ACTION_CLICK_PIPELINE_LINK, + TRACKING_ACTION_CLICK_COMMIT_LINK, props: { packageEntity: { type: Object, @@ -97,6 +105,11 @@ export default { first: GRAPHQL_PACKAGE_PIPELINES_PAGE_SIZE, }; }, + tracking() { + return { + category: packageTypeToTrackCategory(this.packageType), + }; + }, }, methods: { truncate(value) { @@ -105,6 +118,12 @@ export default { convertToBaseId(value) { return getIdFromGraphQLId(value); }, + trackPipelineClick() { + this.track(TRACKING_ACTION_CLICK_PIPELINE_LINK, { label: TRACKING_LABEL_PACKAGE_HISTORY }); + }, + trackCommitClick() { + this.track(TRACKING_ACTION_CLICK_COMMIT_LINK, { label: TRACKING_LABEL_PACKAGE_HISTORY }); + }, }, }; @@ -140,7 +159,9 @@ export default {