diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 00:10:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 00:10:20 +0300 |
commit | be522a9abd386ad605786eeb805e12025af0c742 (patch) | |
tree | 3f1057f84c7594b42a889281f96fd51fb778e894 /app/assets/javascripts/invite_members | |
parent | 0e5ce539275e32cfd7592362e03673807fca9cc7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/invite_members')
-rw-r--r-- | app/assets/javascripts/invite_members/components/import_project_members_modal.vue | 27 | ||||
-rw-r--r-- | app/assets/javascripts/invite_members/constants.js | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/app/assets/javascripts/invite_members/components/import_project_members_modal.vue b/app/assets/javascripts/invite_members/components/import_project_members_modal.vue index e58e274253a..cc95027f0db 100644 --- a/app/assets/javascripts/invite_members/components/import_project_members_modal.vue +++ b/app/assets/javascripts/invite_members/components/import_project_members_modal.vue @@ -4,12 +4,20 @@ import { uniqueId, isEmpty } from 'lodash'; import { importProjectMembers } from '~/api/projects_api'; import { BV_SHOW_MODAL, BV_HIDE_MODAL } from '~/lib/utils/constants'; import { s__, __, sprintf } from '~/locale'; +import Tracking from '~/tracking'; import eventHub from '../event_hub'; + import { displaySuccessfulInvitationAlert, reloadOnInvitationSuccess, } from '../utils/trigger_successful_invite_alert'; -import { PROJECT_SELECT_LABEL_ID } from '../constants'; + +import { + PROJECT_SELECT_LABEL_ID, + IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_CATEGORY, + IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_LABEL, +} from '../constants'; + import UserLimitNotification from './user_limit_notification.vue'; import ProjectSelect from './project_select.vue'; @@ -22,6 +30,12 @@ export default { UserLimitNotification, ProjectSelect, }, + mixins: [ + Tracking.mixin({ + category: IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_CATEGORY, + label: IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_LABEL, + }), + ], props: { projectId: { type: String, @@ -92,6 +106,7 @@ export default { }, methods: { openModal() { + this.track('render'); this.$root.$emit(BV_SHOW_MODAL, this.$options.modalId); }, closeModal() { @@ -115,6 +130,8 @@ export default { }); }, onInviteSuccess() { + this.track('invite_successful'); + if (this.reloadPageOnSubmit) { reloadOnInvitationSuccess(); } else { @@ -128,6 +145,12 @@ export default { showErrorAlert() { this.invalidFeedbackMessage = this.$options.i18n.defaultError; }, + onCancel() { + this.track('click_cancel'); + }, + onClose() { + this.track('click_x'); + }, }, toastOptions() { return { @@ -166,6 +189,8 @@ export default { no-focus-on-show @primary="submitImport" @hidden="resetFields" + @cancel="onCancel" + @close="onClose" > <user-limit-notification v-if="showUserLimitNotification" diff --git a/app/assets/javascripts/invite_members/constants.js b/app/assets/javascripts/invite_members/constants.js index 9afcaff6e16..a4fe1a413aa 100644 --- a/app/assets/javascripts/invite_members/constants.js +++ b/app/assets/javascripts/invite_members/constants.js @@ -25,6 +25,8 @@ export const TRIGGER_ELEMENT_DROPDOWN_WITH_EMOJI = 'dropdown-text-emoji'; export const TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN = 'dropdown-text'; export const INVITE_MEMBER_MODAL_TRACKING_CATEGORY = 'invite_members_modal'; export const TRIGGER_DEFAULT_QA_SELECTOR = 'invite_members_button'; +export const IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_CATEGORY = 'invite_project_members_modal'; +export const IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_LABEL = 'project-members-page'; export const MEMBERS_MODAL_DEFAULT_TITLE = s__('InviteMembersModal|Invite members'); export const MEMBERS_MODAL_CELEBRATE_TITLE = s__( 'InviteMembersModal|GitLab is better with colleagues!', |