diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-10 21:10:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-10 21:10:41 +0300 |
commit | 7f04cb580bc7895145fc1df51907582f80adbbca (patch) | |
tree | 31eb03182fcd84002895e3befb3d453bbcf048b4 /app/assets/javascripts/groups | |
parent | bd5eb9f0201cf39ecfb0e754787a2297d5fdf051 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/groups')
-rw-r--r-- | app/assets/javascripts/groups/components/invite_members_banner.vue | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/app/assets/javascripts/groups/components/invite_members_banner.vue b/app/assets/javascripts/groups/components/invite_members_banner.vue index 747cea6a46e..402d9a07c53 100644 --- a/app/assets/javascripts/groups/components/invite_members_banner.vue +++ b/app/assets/javascripts/groups/components/invite_members_banner.vue @@ -1,5 +1,6 @@ <script> import { GlBanner } from '@gitlab/ui'; +import eventHub from '~/invite_members/event_hub'; import { parseBoolean, setCookie, getCookie } from '~/lib/utils/common_utils'; import { s__ } from '~/locale'; import Tracking from '~/tracking'; @@ -11,7 +12,7 @@ export default { GlBanner, }, mixins: [trackingMixin], - inject: ['svgPath', 'inviteMembersPath', 'isDismissedKey', 'trackLabel'], + inject: ['svgPath', 'isDismissedKey', 'trackLabel'], data() { return { isDismissed: parseBoolean(getCookie(this.isDismissedKey)), @@ -20,11 +21,6 @@ export default { }, }; }, - created() { - this.$nextTick(() => { - this.addTrackingAttributesToButton(); - }); - }, mounted() { this.trackOnShow(); }, @@ -39,15 +35,12 @@ export default { if (!this.isDismissed) this.track(this.$options.displayEvent); }); }, - addTrackingAttributesToButton() { - if (this.$refs.banner === undefined) return; - - const button = this.$refs.banner.$el.querySelector(`[href='${this.inviteMembersPath}']`); - - if (button) { - button.setAttribute('data-track-event', this.$options.buttonClickEvent); - button.setAttribute('data-track-label', this.trackLabel); - } + openModal() { + eventHub.$emit('openModal', { + inviteeType: 'members', + source: this.$options.openModalSource, + }); + this.track(this.$options.buttonClickEvent); }, }, i18n: { @@ -59,6 +52,7 @@ export default { }, displayEvent: 'invite_members_banner_displayed', buttonClickEvent: 'invite_members_banner_button_clicked', + openModalSource: 'invite_members_banner', dismissEvent: 'invite_members_banner_dismissed', }; </script> @@ -70,8 +64,8 @@ export default { :title="$options.i18n.title" :button-text="$options.i18n.button_text" :svg-path="svgPath" - :button-link="inviteMembersPath" @close="handleClose" + @primary="openModal" > <p>{{ $options.i18n.body }}</p> </gl-banner> |