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
3ace873b
Commit
3ace873b
authored
Mar 24, 2022
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to load vulnerability link from backend
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/356279
parent
058c4528
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
9 deletions
+19
-9
app/assets/javascripts/security_configuration/components/app.vue
...ets/javascripts/security_configuration/components/app.vue
+2
-6
app/assets/javascripts/security_configuration/index.js
app/assets/javascripts/security_configuration/index.js
+2
-0
app/helpers/projects/security/configuration_helper.rb
app/helpers/projects/security/configuration_helper.rb
+4
-0
app/views/projects/security/configuration/show.html.haml
app/views/projects/security/configuration/show.html.haml
+1
-0
ee/app/views/projects/security/configuration/show.html.haml
ee/app/views/projects/security/configuration/show.html.haml
+1
-0
spec/frontend/security_configuration/components/app_spec.js
spec/frontend/security_configuration/components/app_spec.js
+3
-3
spec/helpers/projects/security/configuration_helper_spec.rb
spec/helpers/projects/security/configuration_helper_spec.rb
+6
-0
No files found.
app/assets/javascripts/security_configuration/components/app.vue
View file @
3ace873b
...
...
@@ -4,7 +4,6 @@ import { __, s__ } from '~/locale';
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
LocalStorageSync
from
'
~/vue_shared/components/local_storage_sync.vue
'
;
import
UserCalloutDismisser
from
'
~/vue_shared/components/user_callout_dismisser.vue
'
;
import
{
helpPagePath
}
from
'
~/helpers/help_page_helper
'
;
import
AutoDevOpsAlert
from
'
./auto_dev_ops_alert.vue
'
;
import
AutoDevOpsEnabledAlert
from
'
./auto_dev_ops_enabled_alert.vue
'
;
import
{
AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY
}
from
'
./constants
'
;
...
...
@@ -52,7 +51,7 @@ export default {
TrainingProviderList
,
},
mixins
:
[
glFeatureFlagsMixin
()],
inject
:
[
'
projectFullPath
'
],
inject
:
[
'
projectFullPath
'
,
'
vulnerabilityTrainingDocsPath
'
],
props
:
{
augmentedSecurityFeatures
:
{
type
:
Array
,
...
...
@@ -127,9 +126,6 @@ export default {
},
},
autoDevopsEnabledAlertStorageKey
:
AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY
,
securityTraininDocLink
:
helpPagePath
(
'
user/application_security/vulnerabilities/index
'
,
{
anchor
:
'
enable-security-training-for-vulnerabilities
'
,
}),
};
</
script
>
...
...
@@ -268,7 +264,7 @@ export default {
{{
$options
.
i18n
.
securityTrainingDescription
}}
</p>
<p>
<gl-link
:href=
"
$options.securityTraininDocLink
"
>
{{
<gl-link
:href=
"
vulnerabilityTrainingDocsPath
"
>
{{
$options
.
i18n
.
securityTrainingDoc
}}
</gl-link>
</p>
...
...
app/assets/javascripts/security_configuration/index.js
View file @
3ace873b
...
...
@@ -25,6 +25,7 @@ export const initSecurityConfiguration = (el) => {
gitlabCiHistoryPath
,
autoDevopsHelpPagePath
,
autoDevopsPath
,
vulnerabilityTrainingDocsPath
,
}
=
el
.
dataset
;
const
{
augmentedSecurityFeatures
,
augmentedComplianceFeatures
}
=
augmentFeatures
(
...
...
@@ -41,6 +42,7 @@ export const initSecurityConfiguration = (el) => {
upgradePath
,
autoDevopsHelpPagePath
,
autoDevopsPath
,
vulnerabilityTrainingDocsPath
,
},
render
(
createElement
)
{
return
createElement
(
SecurityConfigurationApp
,
{
...
...
app/helpers/projects/security/configuration_helper.rb
View file @
3ace873b
...
...
@@ -6,6 +6,10 @@ module Projects
def
security_upgrade_path
"https://
#{
ApplicationHelper
.
promo_host
}
/pricing/"
end
def
vulnerability_training_docs_path
help_page_path
(
'user/application_security/vulnerabilities/index'
,
anchor:
'enable-security-training-for-vulnerabilities'
)
end
end
end
end
...
...
app/views/projects/security/configuration/show.html.haml
View file @
3ace873b
...
...
@@ -3,5 +3,6 @@
-
@content_class
=
"limit-container-width"
unless
fluid_layout
#js-security-configuration
{
data:
{
**
@configuration
.
to_html_data_attribute
,
vulnerability_training_docs_path:
vulnerability_training_docs_path
,
upgrade_path:
security_upgrade_path
,
project_full_path:
@project
.
full_path
}
}
ee/app/views/projects/security/configuration/show.html.haml
View file @
3ace873b
...
...
@@ -3,5 +3,6 @@
-
@content_class
=
"limit-container-width"
unless
fluid_layout
#js-security-configuration
{
data:
{
**
@configuration
.
to_html_data_attribute
,
vulnerability_training_docs_path:
vulnerability_training_docs_path
,
upgrade_path:
security_upgrade_path
,
project_full_path:
@project
.
full_path
}
}
spec/frontend/security_configuration/components/app_spec.js
View file @
3ace873b
...
...
@@ -33,6 +33,7 @@ const autoDevopsHelpPagePath = '/autoDevopsHelpPagePath';
const
autoDevopsPath
=
'
/autoDevopsPath
'
;
const
gitlabCiHistoryPath
=
'
test/historyPath
'
;
const
projectFullPath
=
'
namespace/project
'
;
const
vulnerabilityTrainingDocsPath
=
'
user/application_security/vulnerabilities/index
'
;
useLocalStorageSpy
();
...
...
@@ -55,6 +56,7 @@ describe('App component', () => {
autoDevopsHelpPagePath
,
autoDevopsPath
,
projectFullPath
,
vulnerabilityTrainingDocsPath
,
glFeatures
:
{
secureVulnerabilityTraining
,
},
...
...
@@ -462,9 +464,7 @@ describe('App component', () => {
const
trainingLink
=
findVulnerabilityManagementTab
().
findComponent
(
GlLink
);
expect
(
trainingLink
.
text
()).
toBe
(
'
Learn more about vulnerability training
'
);
expect
(
trainingLink
.
attributes
(
'
href
'
)).
toBe
(
'
/help/user/application_security/vulnerabilities/index#enable-security-training-for-vulnerabilities
'
,
);
expect
(
trainingLink
.
attributes
(
'
href
'
)).
toBe
(
vulnerabilityTrainingDocsPath
);
});
});
...
...
spec/helpers/projects/security/configuration_helper_spec.rb
View file @
3ace873b
...
...
@@ -10,4 +10,10 @@ RSpec.describe Projects::Security::ConfigurationHelper do
it
{
is_expected
.
to
eq
(
"https://
#{
ApplicationHelper
.
promo_host
}
/pricing/"
)
}
end
describe
'vulnerability_training_docs_path'
do
subject
{
helper
.
vulnerability_training_docs_path
}
it
{
is_expected
.
to
eq
(
help_page_path
(
'user/application_security/vulnerabilities/index'
,
anchor:
'enable-security-training-for-vulnerabilities'
))
}
end
end
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