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
9e3dcbd8
Commit
9e3dcbd8
authored
Feb 22, 2022
by
Samantha Ming
Committed by
Phil Hughes
Feb 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update vulnerability metric to use constant
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/352915
parent
bed6867b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
app/assets/javascripts/security_configuration/constants.js
app/assets/javascripts/security_configuration/constants.js
+1
-1
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_training.vue
...pts/vulnerabilities/components/vulnerability_training.vue
+2
-3
ee/spec/frontend/vulnerabilities/vulnerability_training_spec.js
...c/frontend/vulnerabilities/vulnerability_training_spec.js
+2
-3
No files found.
app/assets/javascripts/security_configuration/constants.js
View file @
9e3dcbd8
export
const
TRACK_TOGGLE_TRAINING_PROVIDER_ACTION
=
'
toggle_security_training_provider
'
;
export
const
TRACK_TOGGLE_TRAINING_PROVIDER_LABEL
=
'
update_security_training_provider
'
;
export
const
TRACK_CLICK_TRAINING_LINK
=
'
click_security_training_link
'
;
export
const
TRACK_PROVIDER_LEARN_MORE_CLICK_ACTION
=
'
click_link
'
;
export
const
TRACK_PROVIDER_LEARN_MORE_CLICK_LABEL
=
'
security_training_provider
'
;
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_training.vue
View file @
9e3dcbd8
...
...
@@ -6,6 +6,7 @@ import securityTrainingProvidersQuery from '~/security_configuration/graphql/sec
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
TRACK_CLICK_TRAINING_LINK
}
from
'
~/security_configuration/constants
'
;
import
{
SUPPORTED_IDENTIFIER_TYPES
}
from
'
../constants
'
;
export
const
i18n
=
{
...
...
@@ -116,9 +117,7 @@ export default {
const
{
name
}
=
this
.
supportedIdentifier
;
const
{
id
}
=
mockProvider
;
// Follow-up: switch to utilize constants once another MR is merged
// https://gitlab.com/gitlab-org/gitlab/-/issues/352915
this
.
track
(
'
click_security_training_link
'
,
{
this
.
track
(
TRACK_CLICK_TRAINING_LINK
,
{
label
:
`vendor_
${
id
}
`
,
property
:
name
,
});
...
...
ee/spec/frontend/vulnerabilities/vulnerability_training_spec.js
View file @
9e3dcbd8
...
...
@@ -14,6 +14,7 @@ import VulnerabilityTraining, {
import
securityTrainingProvidersQuery
from
'
~/security_configuration/graphql/security_training_providers.query.graphql
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
SUPPORTED_IDENTIFIER_TYPES
}
from
'
ee/vulnerabilities/constants
'
;
import
{
TRACK_CLICK_TRAINING_LINK
}
from
'
~/security_configuration/constants
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
securityTrainingProvidersResponse
}
from
'
jest/security_configuration/mock_data
'
;
...
...
@@ -197,9 +198,7 @@ describe('VulnerabilityTraining component', () => {
await
waitForQueryToBeLoaded
();
await
findTrainingItemLink
().
vm
.
$emit
(
'
click
'
);
// Follow-up: switch to utilize constants once another MR is merged
// https://gitlab.com/gitlab-org/gitlab/-/issues/352915
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
click_security_training_link
'
,
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
TRACK_CLICK_TRAINING_LINK
,
{
property
:
defaultProps
.
identifiers
[
0
].
name
,
label
:
`vendor_
${
mockProvider
.
id
}
`
,
});
...
...
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