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
a3e365cf
Commit
a3e365cf
authored
Apr 06, 2022
by
anna_vovchenko
Committed by
Anna Vovchenko
Apr 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a snowplow event for the docs link
We need the event to track user clicks on the docs link.
parent
f1bd30ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
3 deletions
+48
-3
app/assets/javascripts/projects/new/components/deployment_target_select.vue
...ipts/projects/new/components/deployment_target_select.vue
+10
-2
app/assets/javascripts/projects/new/constants.js
app/assets/javascripts/projects/new/constants.js
+1
-0
config/events/1649272430_projectsnew_visit_docs.yml
config/events/1649272430_projectsnew_visit_docs.yml
+18
-0
spec/frontend/projects/new/components/deployment_target_select_spec.js
.../projects/new/components/deployment_target_select_spec.js
+19
-1
No files found.
app/assets/javascripts/projects/new/components/deployment_target_select.vue
View file @
a3e365cf
...
@@ -7,6 +7,7 @@ import {
...
@@ -7,6 +7,7 @@ import {
DEPLOYMENT_TARGET_SELECTIONS
,
DEPLOYMENT_TARGET_SELECTIONS
,
DEPLOYMENT_TARGET_LABEL
,
DEPLOYMENT_TARGET_LABEL
,
DEPLOYMENT_TARGET_EVENT
,
DEPLOYMENT_TARGET_EVENT
,
VISIT_DOCS_EVENT
,
NEW_PROJECT_FORM
,
NEW_PROJECT_FORM
,
K8S_OPTION
,
K8S_OPTION
,
}
from
'
../constants
'
;
}
from
'
../constants
'
;
...
@@ -22,8 +23,10 @@ export default {
...
@@ -22,8 +23,10 @@ export default {
),
),
},
},
deploymentTargets
:
DEPLOYMENT_TARGET_SELECTIONS
,
deploymentTargets
:
DEPLOYMENT_TARGET_SELECTIONS
,
VISIT_DOCS_EVENT
,
DEPLOYMENT_TARGET_LABEL
,
selectId
:
'
deployment-target-select
'
,
selectId
:
'
deployment-target-select
'
,
helpPageUrl
:
helpPagePath
(
'
user/clusters/agent
'
),
helpPageUrl
:
helpPagePath
(
'
user/clusters/agent
/index
'
),
components
:
{
components
:
{
GlFormGroup
,
GlFormGroup
,
GlFormSelect
,
GlFormSelect
,
...
@@ -76,7 +79,12 @@ export default {
...
@@ -76,7 +79,12 @@ export default {
<gl-form-text
v-if=
"isK8sOptionSelected"
>
<gl-form-text
v-if=
"isK8sOptionSelected"
>
<gl-sprintf
:message=
"$options.i18n.k8sEducationText"
>
<gl-sprintf
:message=
"$options.i18n.k8sEducationText"
>
<
template
#link=
"{ content }"
>
<
template
#link=
"{ content }"
>
<gl-link
:href=
"$options.helpPageUrl"
>
{{
content
}}
</gl-link>
<gl-link
:href=
"$options.helpPageUrl"
:data-track-action=
"$options.VISIT_DOCS_EVENT"
:data-track-label=
"$options.DEPLOYMENT_TARGET_LABEL"
>
{{
content
}}
</gl-link
>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</gl-form-text>
</gl-form-text>
...
...
app/assets/javascripts/projects/new/constants.js
View file @
a3e365cf
...
@@ -20,3 +20,4 @@ export const DEPLOYMENT_TARGET_SELECTIONS = [
...
@@ -20,3 +20,4 @@ export const DEPLOYMENT_TARGET_SELECTIONS = [
export
const
NEW_PROJECT_FORM
=
'
new_project
'
;
export
const
NEW_PROJECT_FORM
=
'
new_project
'
;
export
const
DEPLOYMENT_TARGET_LABEL
=
'
new_project_deployment_target
'
;
export
const
DEPLOYMENT_TARGET_LABEL
=
'
new_project_deployment_target
'
;
export
const
DEPLOYMENT_TARGET_EVENT
=
'
select_deployment_target
'
;
export
const
DEPLOYMENT_TARGET_EVENT
=
'
select_deployment_target
'
;
export
const
VISIT_DOCS_EVENT
=
'
visit_docs
'
;
config/events/1649272430_projectsnew_visit_docs.yml
0 → 100644
View file @
a3e365cf
---
description
:
Docs link under the deployment target select visited from new project creation form
category
:
projects:new
action
:
visit_docs
label_description
:
new_project_deployment_target
product_section
:
ops
product_stage
:
configure
product_group
:
group::configure
milestone
:
"
14.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84224
distributions
:
-
ce
-
ee
tiers
:
-
free
-
premium
-
ultimate
spec/frontend/projects/new/components/deployment_target_select_spec.js
View file @
a3e365cf
import
{
GlFormGroup
,
GlFormSelect
,
GlFormText
}
from
'
@gitlab/ui
'
;
import
{
GlFormGroup
,
GlFormSelect
,
GlFormText
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
import
DeploymentTargetSelect
from
'
~/projects/new/components/deployment_target_select.vue
'
;
import
DeploymentTargetSelect
from
'
~/projects/new/components/deployment_target_select.vue
'
;
...
@@ -6,7 +6,9 @@ import {
...
@@ -6,7 +6,9 @@ import {
DEPLOYMENT_TARGET_SELECTIONS
,
DEPLOYMENT_TARGET_SELECTIONS
,
DEPLOYMENT_TARGET_LABEL
,
DEPLOYMENT_TARGET_LABEL
,
DEPLOYMENT_TARGET_EVENT
,
DEPLOYMENT_TARGET_EVENT
,
VISIT_DOCS_EVENT
,
NEW_PROJECT_FORM
,
NEW_PROJECT_FORM
,
K8S_OPTION
,
}
from
'
~/projects/new/constants
'
;
}
from
'
~/projects/new/constants
'
;
describe
(
'
Deployment target select
'
,
()
=>
{
describe
(
'
Deployment target select
'
,
()
=>
{
...
@@ -16,11 +18,14 @@ describe('Deployment target select', () => {
...
@@ -16,11 +18,14 @@ describe('Deployment target select', () => {
const
findFormGroup
=
()
=>
wrapper
.
findComponent
(
GlFormGroup
);
const
findFormGroup
=
()
=>
wrapper
.
findComponent
(
GlFormGroup
);
const
findSelect
=
()
=>
wrapper
.
findComponent
(
GlFormSelect
);
const
findSelect
=
()
=>
wrapper
.
findComponent
(
GlFormSelect
);
const
findText
=
()
=>
wrapper
.
findComponent
(
GlFormText
);
const
findText
=
()
=>
wrapper
.
findComponent
(
GlFormText
);
const
findLink
=
()
=>
wrapper
.
findComponent
(
GlLink
);
const
createdWrapper
=
()
=>
{
const
createdWrapper
=
()
=>
{
wrapper
=
shallowMount
(
DeploymentTargetSelect
,
{
wrapper
=
shallowMount
(
DeploymentTargetSelect
,
{
stubs
:
{
stubs
:
{
GlFormSelect
,
GlFormSelect
,
GlFormText
,
GlSprintf
,
},
},
});
});
};
};
...
@@ -95,4 +100,17 @@ describe('Deployment target select', () => {
...
@@ -95,4 +100,17 @@ describe('Deployment target select', () => {
expect
(
findText
().
exists
()).
toBe
(
isTextShown
);
expect
(
findText
().
exists
()).
toBe
(
isTextShown
);
});
});
});
});
describe
(
'
when user clicks on the docs link
'
,
()
=>
{
beforeEach
(
async
()
=>
{
await
findSelect
().
vm
.
$emit
(
'
input
'
,
K8S_OPTION
);
findLink
().
trigger
(
'
click
'
);
});
it
(
'
sends the snowplow tracking event
'
,
()
=>
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
'
_category_
'
,
VISIT_DOCS_EVENT
,
{
label
:
DEPLOYMENT_TARGET_LABEL
,
});
});
});
});
});
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