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
b875ac69
Commit
b875ac69
authored
Aug 23, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace static props with provide/inject
parent
5c09e414
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
26 deletions
+10
-26
ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans_form.vue
...ripts/on_demand_scans/components/on_demand_scans_form.vue
+1
-16
ee/app/assets/javascripts/on_demand_scans/index.js
ee/app/assets/javascripts/on_demand_scans/index.js
+2
-2
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
...d/on_demand_scans/components/on_demand_scans_form_spec.js
+7
-8
No files found.
ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans_form.vue
View file @
b875ac69
...
...
@@ -98,23 +98,8 @@ export default {
SITE_PROFILES_QUERY
,
),
},
inject
:
{
dastSiteValidationDocsPath
:
{
default
:
''
,
},
profilesLibraryPath
:
{
default
:
''
,
},
},
inject
:
[
'
projectPath
'
,
'
helpPagePath
'
,
'
dastSiteValidationDocsPath
'
,
'
profilesLibraryPath
'
],
props
:
{
helpPagePath
:
{
type
:
String
,
required
:
true
,
},
projectPath
:
{
type
:
String
,
required
:
true
,
},
defaultBranch
:
{
type
:
String
,
required
:
false
,
...
...
ee/app/assets/javascripts/on_demand_scans/index.js
View file @
b875ac69
...
...
@@ -26,6 +26,8 @@ export default () => {
el
,
apolloProvider
,
provide
:
{
projectPath
,
helpPagePath
,
profilesLibraryPath
,
scannerProfilesLibraryPath
,
siteProfilesLibraryPath
,
...
...
@@ -36,8 +38,6 @@ export default () => {
render
(
h
)
{
return
h
(
OnDemandScansForm
,
{
props
:
{
helpPagePath
,
projectPath
,
defaultBranch
,
dastScan
:
dastScan
?
convertObjectPropsToCamelCase
(
JSON
.
parse
(
dastScan
))
:
null
,
},
...
...
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
View file @
b875ac69
...
...
@@ -21,6 +21,7 @@ import * as responses from '../mocks/apollo_mocks';
import
{
scannerProfiles
,
siteProfiles
}
from
'
../mocks/mock_data
'
;
const
helpPagePath
=
'
/application_security/dast/index#on-demand-scans
'
;
const
dastSiteValidationDocsPath
=
'
/application_security/dast/index#dast-site-validation
'
;
const
projectPath
=
'
group/project
'
;
const
defaultBranch
=
'
main
'
;
const
selectedBranch
=
'
some-other-branch
'
;
...
...
@@ -29,13 +30,6 @@ const scannerProfilesLibraryPath = '/security/configuration/dast_scans#scanner-p
const
siteProfilesLibraryPath
=
'
/security/configuration/dast_scans#site-profiles
'
;
const
newScannerProfilePath
=
'
/security/configuration/dast_scans/dast_scanner_profile/new
'
;
const
newSiteProfilePath
=
`/
${
projectPath
}
/-/security/configuration/dast_scans`
;
const
defaultProps
=
{
helpPagePath
,
projectPath
,
defaultBranch
,
};
const
pipelineUrl
=
`/
${
projectPath
}
/pipelines/123`
;
const
editPath
=
`/
${
projectPath
}
/on_demand_scans/1/edit`
;
const
[
passiveScannerProfile
,
activeScannerProfile
]
=
scannerProfiles
;
...
...
@@ -154,14 +148,19 @@ describe('OnDemandScansForm', () => {
merge
(
{},
{
propsData
:
defaultProps
,
propsData
:
{
defaultBranch
,
},
mocks
:
defaultMocks
,
provide
:
{
projectPath
,
helpPagePath
,
profilesLibraryPath
,
scannerProfilesLibraryPath
,
siteProfilesLibraryPath
,
newScannerProfilePath
,
newSiteProfilePath
,
dastSiteValidationDocsPath
,
},
stubs
:
{
GlFormInput
:
GlFormInputStub
,
...
...
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