diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/assets/javascripts/groups/components/invite_members_banner.vue | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/groups/components/invite_members_banner.vue')
-rw-r--r-- | app/assets/javascripts/groups/components/invite_members_banner.vue | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/assets/javascripts/groups/components/invite_members_banner.vue b/app/assets/javascripts/groups/components/invite_members_banner.vue index 402d9a07c53..dfc1549fb4a 100644 --- a/app/assets/javascripts/groups/components/invite_members_banner.vue +++ b/app/assets/javascripts/groups/components/invite_members_banner.vue @@ -1,7 +1,7 @@ <script> import { GlBanner } from '@gitlab/ui'; import eventHub from '~/invite_members/event_hub'; -import { parseBoolean, setCookie, getCookie } from '~/lib/utils/common_utils'; +import axios from '~/lib/utils/axios_utils'; import { s__ } from '~/locale'; import Tracking from '~/tracking'; @@ -12,10 +12,10 @@ export default { GlBanner, }, mixins: [trackingMixin], - inject: ['svgPath', 'isDismissedKey', 'trackLabel'], + inject: ['svgPath', 'trackLabel', 'calloutsPath', 'calloutsFeatureId', 'groupId'], data() { return { - isDismissed: parseBoolean(getCookie(this.isDismissedKey)), + isDismissed: false, tracking: { label: this.trackLabel, }, @@ -26,7 +26,16 @@ export default { }, methods: { handleClose() { - setCookie(this.isDismissedKey, true); + axios + .post(this.calloutsPath, { + feature_name: this.calloutsFeatureId, + group_id: this.groupId, + }) + .catch((e) => { + // eslint-disable-next-line @gitlab/require-i18n-strings, no-console + console.error('Failed to dismiss banner.', e); + }); + this.isDismissed = true; this.track(this.$options.dismissEvent); }, @@ -61,6 +70,7 @@ export default { <gl-banner v-if="!isDismissed" ref="banner" + data-testid="invite-members-banner" :title="$options.i18n.title" :button-text="$options.i18n.button_text" :svg-path="svgPath" |