diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 21:09:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 21:09:45 +0000 |
commit | dd4bee69b7d55620f7dc9db8c36b478bd4959755 (patch) | |
tree | 78ba4c486ad8aa2d5effaccf23241ffb6c6dde26 /app/assets/javascripts/blob | |
parent | ce8a0b90849ac5d1895e741c023432930f24d724 (diff) | |
download | gitlab-ce-dd4bee69b7d55620f7dc9db8c36b478bd4959755.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue | 17 | ||||
-rw-r--r-- | app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue index d304ae7dbf6..7f0c232eea8 100644 --- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue +++ b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue @@ -4,6 +4,9 @@ import Cookies from 'js-cookie'; import { parseBoolean, scrollToElement } from '~/lib/utils/common_utils'; import { s__ } from '~/locale'; import { glEmojiTag } from '~/emoji'; +import Tracking from '~/tracking'; + +const trackingMixin = Tracking.mixin(); const popoverStates = { suggest_gitlab_ci_yml: { @@ -27,6 +30,7 @@ export default { GlIcon, GlButton, }, + mixins: [trackingMixin], props: { target: { type: String, @@ -40,10 +44,18 @@ export default { type: String, required: true, }, + humanAccess: { + type: String, + required: true, + }, }, data() { return { popoverDismissed: parseBoolean(Cookies.get(this.dismissKey)), + tracking: { + label: this.trackLabel, + property: this.humanAccess, + }, }; }, computed: { @@ -60,12 +72,17 @@ export default { mounted() { if (this.trackLabel === 'suggest_commit_first_project_gitlab_ci_yml' && !this.popoverDismissed) scrollToElement(document.querySelector(this.target)); + + this.trackOnShow(); }, methods: { onDismiss() { this.popoverDismissed = true; Cookies.set(this.dismissKey, this.popoverDismissed, { expires: 365 }); }, + trackOnShow() { + if (!this.popoverDismissed) this.track(); + }, }, }; </script> diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js index 2cc342fb381..3b67b3dd259 100644 --- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js +++ b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js @@ -10,6 +10,7 @@ export default el => target: el.dataset.target, trackLabel: el.dataset.trackLabel, dismissKey: el.dataset.dismissKey, + humanAccess: el.dataset.humanAccess, }, }); }, |