Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a4a02d02
Commit
a4a02d02
authored
Mar 30, 2020
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tracking to goto link
- for tracking
parent
7c701bb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
app/assets/javascripts/blob/pipeline_tour_success_modal.vue
app/assets/javascripts/blob/pipeline_tour_success_modal.vue
+23
-6
spec/frontend/blob/pipeline_tour_success_modal_spec.js
spec/frontend/blob/pipeline_tour_success_modal_spec.js
+15
-2
No files found.
app/assets/javascripts/blob/pipeline_tour_success_modal.vue
View file @
a4a02d02
...
...
@@ -21,6 +21,8 @@ export default {
},
false
,
),
goToTrackValue
:
10
,
trackEvent
:
'
click_button
'
,
components
:
{
GlModal
,
GlSprintf
,
...
...
@@ -43,12 +45,17 @@ export default {
},
data
()
{
return
{
tracking
:
{
label
:
'
congratulate_first_pipeline
'
,
property
:
this
.
humanAccess
,
},
trackLabel
:
'
congratulate_first_pipeline
'
,
};
},
computed
:
{
tracking
()
{
return
{
label
:
this
.
trackLabel
,
property
:
this
.
humanAccess
,
};
},
},
mounted
()
{
this
.
track
();
this
.
disableModalFromRenderingAgain
();
...
...
@@ -88,8 +95,18 @@ export default {
</gl-link>
</
template
>
</gl-sprintf>
<
template
#modal-footer
>
<a
:href=
"goToPipelinesPath"
class=
"btn btn-success"
>
{{
__
(
'
Go to Pipelines
'
)
}}
</a>
<
template
slot=
"modal-footer"
>
<a
ref=
"goto"
:href=
"goToPipelinesPath"
class=
"btn btn-success"
:data-track-property=
"humanAccess"
:data-track-value=
"$options.goToTrackValue"
:data-track-event=
"$options.trackEvent"
:data-track-label=
"trackLabel"
>
{{
__
(
'
Go to Pipelines
'
)
}}
</a>
</
template
>
</gl-modal>
</template>
spec/frontend/blob/pipeline_tour_success_modal_spec.js
View file @
a4a02d02
...
...
@@ -2,7 +2,7 @@ import pipelineTourSuccess from '~/blob/pipeline_tour_success_modal.vue';
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Cookies
from
'
js-cookie
'
;
import
{
GlSprintf
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
mockTracking
,
unmockTracking
}
from
'
helpers/tracking_helper
'
;
import
{
mockTracking
,
triggerEvent
,
unmockTracking
}
from
'
helpers/tracking_helper
'
;
import
modalProps
from
'
./pipeline_tour_success_mock_data
'
;
describe
(
'
PipelineTourSuccessModal
'
,
()
=>
{
...
...
@@ -41,11 +41,24 @@ describe('PipelineTourSuccessModal', () => {
});
describe
(
'
tracking
'
,
()
=>
{
it
(
'
send event for basic view of
popover
'
,
()
=>
{
it
(
'
send event for basic view of
modal
'
,
()
=>
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
undefined
,
{
label
:
'
congratulate_first_pipeline
'
,
property
:
modalProps
.
humanAccess
,
});
});
it
(
'
send an event when go to pipelines is clicked
'
,
()
=>
{
trackingSpy
=
mockTracking
(
'
_category_
'
,
wrapper
.
element
,
jest
.
spyOn
);
const
goToBtn
=
wrapper
.
find
({
ref
:
'
goto
'
});
triggerEvent
(
goToBtn
.
element
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
'
_category_
'
,
'
click_button
'
,
{
label
:
'
congratulate_first_pipeline
'
,
property
:
modalProps
.
humanAccess
,
value
:
'
10
'
,
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment