From 198460d5879a516844f81f667c6bc4fe84ed1719 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 3 Feb 2023 00:10:55 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../javascripts/frequent_items/components/app.vue | 14 ++- .../components/frequent_items_list_item.vue | 11 ++- .../components/frequent_items_search_input.vue | 15 ++++ app/assets/javascripts/header.js | 7 ++ .../javascripts/header_search/components/app.vue | 4 +- .../javascripts/nav/components/new_nav_toggle.vue | 2 +- .../javascripts/nav/components/top_nav_app.vue | 2 +- .../components/approvals/approvals.vue | 10 ++- .../components/approvals/approvals_summary.vue | 100 ++++++++++++++++----- .../approvals/queries/approved_by.query.graphql | 16 ++++ .../vue_merge_request_widget/mappers.js | 3 + .../stores/mr_widget_store.js | 1 + .../components/user_avatar/user_avatar_list.vue | 2 +- .../javascripts/whats_new/components/app.vue | 6 +- app/helpers/nav/new_dropdown_helper.rb | 19 ++-- app/helpers/nav/top_nav_helper.rb | 6 +- .../concerns/vulnerability_finding_helpers.rb | 2 +- app/models/packages/package.rb | 1 + .../header/_current_user_dropdown.html.haml | 16 ++-- app/views/layouts/header/_default.html.haml | 34 ++++--- app/views/layouts/header/_gitlab_version.html.haml | 2 +- app/views/layouts/header/_help_dropdown.html.haml | 10 +-- app/views/layouts/header/_new_dropdown.html.haml | 2 +- .../shared/_help_dropdown_forum_link.html.haml | 2 +- .../_user_dropdown_contributing_link.html.haml | 2 +- .../_user_dropdown_instance_review.html.haml | 2 +- 26 files changed, 212 insertions(+), 79 deletions(-) create mode 100644 app/assets/javascripts/vue_merge_request_widget/components/approvals/queries/approved_by.query.graphql create mode 100644 app/assets/javascripts/vue_merge_request_widget/mappers.js (limited to 'app') diff --git a/app/assets/javascripts/frequent_items/components/app.vue b/app/assets/javascripts/frequent_items/components/app.vue index a4e883c96b5..947d3053094 100644 --- a/app/assets/javascripts/frequent_items/components/app.vue +++ b/app/assets/javascripts/frequent_items/components/app.vue @@ -6,6 +6,7 @@ import { mapVuexModuleActions, mapVuexModuleGetters, } from '~/lib/utils/vuex_module_mappers'; +import Tracking from '~/tracking'; import { FREQUENT_ITEMS, STORAGE_KEY } from '../constants'; import eventHub from '../event_hub'; import { isMobile, updateExistingFrequentItem, sanitizeItem } from '../utils'; @@ -13,6 +14,8 @@ import FrequentItemsList from './frequent_items_list.vue'; import frequentItemsMixin from './frequent_items_mixin'; import FrequentItemsSearchInput from './frequent_items_search_input.vue'; +const trackingMixin = Tracking.mixin(); + export default { components: { FrequentItemsSearchInput, @@ -24,7 +27,7 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, - mixins: [frequentItemsMixin], + mixins: [frequentItemsMixin, trackingMixin], inject: ['vuexModule'], props: { currentUserName: { @@ -84,6 +87,13 @@ export default { 'toggleItemsListEditablity', 'fetchFrequentItems', ]), + toggleItemsListEditablityTracked() { + this.track('click_button', { + label: 'toggle_edit_frequent_items', + property: 'navigation_top', + }); + this.toggleItemsListEditablity(); + }, dropdownOpenHandler() { if (this.searchQuery === '' || isMobile()) { this.fetchFrequentItems(); @@ -155,7 +165,7 @@ export default { :title="translations.headerEditToggle" :class="{ 'gl-bg-gray-100!': isItemsListEditable }" class="gl-p-2!" - @click="toggleItemsListEditablity" + @click="toggleItemsListEditablityTracked" > diff --git a/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue b/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue index 430498e7194..056dedf8757 100644 --- a/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue +++ b/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue @@ -64,6 +64,13 @@ export default { }, }, methods: { + removeFrequentItemTracked(item) { + this.track('click_button', { + label: `${this.dropdownType}_dropdown_remove_frequent_item`, + property: 'navigation_top', + }); + this.removeFrequentItem(item); + }, ...mapVuexModuleActions((vm) => vm.vuexModule, ['removeFrequentItem']), }, }; @@ -77,7 +84,7 @@ export default { class="gl-text-left gl-w-full" button-text-classes="gl-display-flex gl-w-full" data-testid="frequent-item-link" - @click="track('click_link', { label: itemTrackingLabel })" + @click="track('click_link', { label: itemTrackingLabel, property: 'navigation_top' })" >
diff --git a/app/assets/javascripts/frequent_items/components/frequent_items_search_input.vue b/app/assets/javascripts/frequent_items/components/frequent_items_search_input.vue index 4a1b7e57749..023245f050b 100644 --- a/app/assets/javascripts/frequent_items/components/frequent_items_search_input.vue +++ b/app/assets/javascripts/frequent_items/components/frequent_items_search_input.vue @@ -28,12 +28,25 @@ export default { searchQuery: debounce(function debounceSearchQuery() { this.track('type_search_query', { label: `${this.dropdownType}_dropdown_frequent_items_search_input`, + property: 'navigation_top', }); this.setSearchQuery(this.searchQuery); }, 500), }, methods: { ...mapVuexModuleActions((vm) => vm.vuexModule, ['setSearchQuery']), + trackFocus() { + this.track('focus_input', { + label: `${this.dropdownType}_dropdown_frequent_items_search_input`, + property: 'navigation_top', + }); + }, + trackBlur() { + this.track('blur_input', { + label: `${this.dropdownType}_dropdown_frequent_items_search_input`, + property: 'navigation_top', + }); + }, }, }; @@ -43,6 +56,8 @@ export default {
diff --git a/app/assets/javascripts/header.js b/app/assets/javascripts/header.js index f58781fa9ec..6c9354b663f 100644 --- a/app/assets/javascripts/header.js +++ b/app/assets/javascripts/header.js @@ -33,6 +33,13 @@ function initStatusTriggers() { if (setStatusModalTriggerEl) { setStatusModalTriggerEl.addEventListener('click', () => { + const topNavbar = document.querySelector('.navbar-gitlab'); + const buttonWithinTopNav = topNavbar && topNavbar.contains(setStatusModalTriggerEl); + Tracking.event(undefined, 'click_button', { + label: 'user_edit_status', + property: buttonWithinTopNav ? 'navigation_top' : undefined, + }); + import( /* webpackChunkName: 'statusModalBundle' */ './set_status_modal/set_status_modal_wrapper.vue' ) diff --git a/app/assets/javascripts/header_search/components/app.vue b/app/assets/javascripts/header_search/components/app.vue index bf5daf29b21..ace0d77c431 100644 --- a/app/assets/javascripts/header_search/components/app.vue +++ b/app/assets/javascripts/header_search/components/app.vue @@ -171,7 +171,7 @@ export default { Tracking.event(undefined, 'focus_input', { label: 'global_search', - property: 'top_navigation', + property: 'navigation_top', }); } }, @@ -190,7 +190,7 @@ export default { Tracking.event(undefined, 'blur_input', { label: 'global_search', - property: 'top_navigation', + property: 'navigation_top', }); }, 200); }, diff --git a/app/assets/javascripts/nav/components/new_nav_toggle.vue b/app/assets/javascripts/nav/components/new_nav_toggle.vue index 7b0076cc5d4..da22a8d2fb7 100644 --- a/app/assets/javascripts/nav/components/new_nav_toggle.vue +++ b/app/assets/javascripts/nav/components/new_nav_toggle.vue @@ -45,7 +45,7 @@ export default { Tracking.event(undefined, 'click_toggle', { label: this.enabled ? 'disable_new_nav_beta' : 'enable_new_nav_beta', - property: 'navigation', + property: this.enabled ? 'navigation' : 'navigation_top', }); window.location.reload(); diff --git a/app/assets/javascripts/nav/components/top_nav_app.vue b/app/assets/javascripts/nav/components/top_nav_app.vue index e55bf25a60c..ab9313f7041 100644 --- a/app/assets/javascripts/nav/components/top_nav_app.vue +++ b/app/assets/javascripts/nav/components/top_nav_app.vue @@ -24,7 +24,7 @@ export default { trackToggleEvent() { Tracking.event(undefined, 'click_nav', { label: 'hamburger_menu', - property: 'top_navigation', + property: 'navigation_top', }); }, }, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue index a04b082fa87..4b65d6fd9ac 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue @@ -62,6 +62,7 @@ export default { fetchingApprovals: true, hasApprovalAuthError: false, isApproving: false, + updatedCount: 0, }; }, computed: { @@ -197,6 +198,7 @@ export default { return serviceFn() .then((data) => { this.mr.setApprovals(data); + this.updatedCount += 1; if (!window.gon?.features?.realtimeMrStatusChange) { eventHub.$emit('MRWidgetUpdateRequested'); @@ -250,10 +252,10 @@ export default { />
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_summary.vue b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_summary.vue index d7255eb6ad2..7c283c42a03 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_summary.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_summary.vue @@ -1,4 +1,5 @@