diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 18:10:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 18:10:57 +0300 |
commit | e5c7d631a84940c66e46f1824ba7ce0c7f1d0ea4 (patch) | |
tree | ac1cce129d8c8cdcee6a668e27d8034d2da172e4 /app/assets/javascripts/projects | |
parent | 0687020509cafe1e24eb0bfa0e0f5c9f6c4799d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/projects')
3 files changed, 14 insertions, 2 deletions
diff --git a/app/assets/javascripts/projects/commit/components/form_modal.vue b/app/assets/javascripts/projects/commit/components/form_modal.vue index ec7d37644a8..f9dd72119d1 100644 --- a/app/assets/javascripts/projects/commit/components/form_modal.vue +++ b/app/assets/javascripts/projects/commit/components/form_modal.vue @@ -1,6 +1,7 @@ <script> import { GlModal, GlForm, GlFormCheckbox, GlSprintf, GlFormGroup } from '@gitlab/ui'; import { mapActions, mapState } from 'vuex'; +import api from '~/api'; import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import csrf from '~/lib/utils/csrf'; import eventHub from '../event_hub'; @@ -40,6 +41,11 @@ export default { required: false, default: false, }, + primaryActionEventName: { + type: String, + required: false, + default: null, + }, }, data() { return { @@ -83,6 +89,10 @@ export default { this.$root.$emit(BV_SHOW_MODAL, this.modalId); }, handlePrimary() { + if (this.primaryActionEventName) { + api.trackRedisHllUserEvent(this.primaryActionEventName); + } + this.$refs.form.$el.submit(); }, resetModalHandler() { diff --git a/app/assets/javascripts/projects/commit/init_cherry_pick_commit_modal.js b/app/assets/javascripts/projects/commit/init_cherry_pick_commit_modal.js index 47ee8237fea..b21fd1a74de 100644 --- a/app/assets/javascripts/projects/commit/init_cherry_pick_commit_modal.js +++ b/app/assets/javascripts/projects/commit/init_cherry_pick_commit_modal.js @@ -9,7 +9,7 @@ import { } from './constants'; import createStore from './store'; -export default function initInviteMembersModal() { +export default function initInviteMembersModal(primaryActionEventName) { const el = document.querySelector('.js-cherry-pick-commit-modal'); if (!el) { return false; @@ -52,6 +52,7 @@ export default function initInviteMembersModal() { openModal: OPEN_CHERRY_PICK_MODAL, modalId: CHERRY_PICK_MODAL_ID, isCherryPick: true, + primaryActionEventName, }, }), }); diff --git a/app/assets/javascripts/projects/commit/init_revert_commit_modal.js b/app/assets/javascripts/projects/commit/init_revert_commit_modal.js index df26aa3c830..849b2f4858c 100644 --- a/app/assets/javascripts/projects/commit/init_revert_commit_modal.js +++ b/app/assets/javascripts/projects/commit/init_revert_commit_modal.js @@ -10,7 +10,7 @@ import { } from './constants'; import createStore from './store'; -export default function initInviteMembersModal() { +export default function initInviteMembersModal(primaryActionEventName) { const el = document.querySelector('.js-revert-commit-modal'); if (!el) { return false; @@ -49,6 +49,7 @@ export default function initInviteMembersModal() { i18n: { ...I18N_REVERT_MODAL, ...I18N_MODAL }, openModal: OPEN_REVERT_MODAL, modalId: REVERT_MODAL_ID, + primaryActionEventName, }, }), }); |