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
d7f7ed91
Commit
d7f7ed91
authored
Feb 25, 2022
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
4f50dc4e
9808910a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
16 deletions
+39
-16
app/assets/javascripts/security_configuration/constants.js
app/assets/javascripts/security_configuration/constants.js
+1
-0
app/assets/stylesheets/startup/startup-dark.scss
app/assets/stylesheets/startup/startup-dark.scss
+0
-2
app/assets/stylesheets/themes/_dark.scss
app/assets/stylesheets/themes/_dark.scss
+0
-1
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_training.vue
...pts/vulnerabilities/components/vulnerability_training.vue
+9
-2
ee/app/assets/stylesheets/startup/startup-dark.scss
ee/app/assets/stylesheets/startup/startup-dark.scss
+0
-2
ee/spec/frontend/vulnerabilities/vulnerability_training_spec.js
...c/frontend/vulnerabilities/vulnerability_training_spec.js
+29
-9
No files found.
app/assets/javascripts/security_configuration/constants.js
View file @
d7f7ed91
...
...
@@ -3,3 +3,4 @@ export const TRACK_TOGGLE_TRAINING_PROVIDER_LABEL = 'update_security_training_pr
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
'
;
export
const
TRACK_TRAINING_LOADED_ACTION
=
'
security_training_link_loaded
'
;
app/assets/stylesheets/startup/startup-dark.scss
View file @
d7f7ed91
...
...
@@ -1786,7 +1786,6 @@ body.gl-dark {
--border-color
:
#4f4f4f
;
--white
:
#333
;
--black
:
#fff
;
--black-normal
:
#fafafa
;
--svg-status-bg
:
#333
;
}
.nav-sidebar
li
a
{
...
...
@@ -2017,7 +2016,6 @@ body.gl-dark {
--border-color
:
#4f4f4f
;
--white
:
#333
;
--black
:
#fff
;
--black-normal
:
#fafafa
;
--svg-status-bg
:
#333
;
}
.tab-width-8
{
...
...
app/assets/stylesheets/themes/_dark.scss
View file @
d7f7ed91
...
...
@@ -199,7 +199,6 @@ body.gl-dark {
--white
:
#{
$white
}
;
--black
:
#{
$black
}
;
--black-normal
:
#{
$black-normal
}
;
--svg-status-bg
:
#{
$white
}
;
...
...
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_training.vue
View file @
d7f7ed91
...
...
@@ -6,7 +6,10 @@ 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
{
TRACK_CLICK_TRAINING_LINK
,
TRACK_TRAINING_LOADED_ACTION
,
}
from
'
~/security_configuration/constants
'
;
import
{
SUPPORTED_IDENTIFIER_TYPES
}
from
'
../constants
'
;
export
const
i18n
=
{
...
...
@@ -115,6 +118,7 @@ export default {
const
{
data
:
{
url
},
}
=
await
axios
.
get
(
path
,
{
params
});
this
.
triggerMetric
(
TRACK_TRAINING_LOADED_ACTION
);
this
.
training
=
{
name
,
url
};
}
catch
{
this
.
hasError
=
true
;
...
...
@@ -123,10 +127,13 @@ export default {
}
},
clickTrainingLink
()
{
this
.
triggerMetric
(
TRACK_CLICK_TRAINING_LINK
);
},
triggerMetric
(
action
)
{
const
{
name
}
=
this
.
supportedIdentifier
;
const
{
id
}
=
mockProvider
;
this
.
track
(
TRACK_CLICK_TRAINING_LINK
,
{
this
.
track
(
action
,
{
label
:
`vendor_
${
id
}
`
,
property
:
name
,
});
...
...
ee/app/assets/stylesheets/startup/startup-dark.scss
View file @
d7f7ed91
...
...
@@ -1786,7 +1786,6 @@ body.gl-dark {
--border-color
:
#4f4f4f
;
--white
:
#333
;
--black
:
#fff
;
--black-normal
:
#fafafa
;
--svg-status-bg
:
#333
;
}
.nav-sidebar
li
a
{
...
...
@@ -2017,7 +2016,6 @@ body.gl-dark {
--border-color
:
#4f4f4f
;
--white
:
#333
;
--black
:
#fff
;
--black-normal
:
#fafafa
;
--svg-status-bg
:
#333
;
}
.tab-width-8
{
...
...
ee/spec/frontend/vulnerabilities/vulnerability_training_spec.js
View file @
d7f7ed91
...
...
@@ -14,7 +14,10 @@ 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
{
TRACK_CLICK_TRAINING_LINK
,
TRACK_TRAINING_LOADED_ACTION
,
}
from
'
~/security_configuration/constants
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
...
...
@@ -204,21 +207,38 @@ describe('VulnerabilityTraining component', () => {
describe
(
'
metrics
'
,
()
=>
{
let
trackingSpy
;
beforeEach
(
async
()
=>
{
trackingSpy
=
mockTracking
(
undefined
,
wrapper
.
element
,
jest
.
spyOn
);
await
mockTrainingSuccess
();
createComponent
();
await
waitForQueryToBeLoaded
();
});
afterEach
(()
=>
{
unmockTracking
();
});
const
expectedTrackingOptions
=
{
property
:
defaultProps
.
identifiers
[
0
].
name
,
label
:
`vendor_
${
mockProvider
.
id
}
`
,
};
it
(
'
tracks when the training link gets loaded
'
,
()
=>
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
TRACK_TRAINING_LOADED_ACTION
,
expectedTrackingOptions
,
);
});
it
(
'
tracks when a training link gets clicked
'
,
async
()
=>
{
await
mockTrainingSuccess
();
createComponent
();
trackingSpy
=
mockTracking
(
undefined
,
wrapper
.
element
,
jest
.
spyOn
);
await
waitForQueryToBeLoaded
();
await
findTrainingItemLink
().
vm
.
$emit
(
'
click
'
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
TRACK_CLICK_TRAINING_LINK
,
{
property
:
defaultProps
.
identifiers
[
0
].
name
,
label
:
`vendor_
${
mockProvider
.
id
}
`
,
});
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
TRACK_CLICK_TRAINING_LINK
,
expectedTrackingOptions
,
);
});
});
...
...
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