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
873dc49a
Commit
873dc49a
authored
Mar 24, 2021
by
Dheeraj Joshi
Committed by
Kushal Pandya
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update localStorage key for On-demand scans form
parent
856ce98e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans_form.vue
...ripts/on_demand_scans/components/on_demand_scans_form.vue
+14
-5
ee/changelogs/unreleased/djadmin-dast-ls-key-update.yml
ee/changelogs/unreleased/djadmin-dast-ls-key-update.yml
+5
-0
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
...d/on_demand_scans/components/on_demand_scans_form_spec.js
+2
-1
No files found.
ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans_form.vue
View file @
873dc49a
...
@@ -221,16 +221,20 @@ export default {
...
@@ -221,16 +221,20 @@ export default {
return
isFormInvalid
||
(
loading
&&
loading
!==
saveScanBtnId
);
return
isFormInvalid
||
(
loading
&&
loading
!==
saveScanBtnId
);
},
},
formFieldValues
()
{
formFieldValues
()
{
const
{
selectedScannerProfileId
,
selectedSiteProfileId
}
=
this
;
const
{
selectedScannerProfileId
,
selectedSiteProfileId
,
selectedBranch
}
=
this
;
return
{
return
{
...
serializeFormObject
(
this
.
form
.
fields
),
...
serializeFormObject
(
this
.
form
.
fields
),
selectedScannerProfileId
,
selectedScannerProfileId
,
selectedSiteProfileId
,
selectedSiteProfileId
,
selectedBranch
,
};
};
},
},
hasExcludedUrls
()
{
hasExcludedUrls
()
{
return
this
.
selectedSiteProfile
.
excludedUrls
?.
length
>
0
;
return
this
.
selectedSiteProfile
.
excludedUrls
?.
length
>
0
;
},
},
storageKey
()
{
return
`
${
this
.
projectPath
}
/
${
ON_DEMAND_SCANS_STORAGE_KEY
}
`
;
},
},
},
created
()
{
created
()
{
const
params
=
queryToObject
(
window
.
location
.
search
);
const
params
=
queryToObject
(
window
.
location
.
search
);
...
@@ -307,17 +311,22 @@ export default {
...
@@ -307,17 +311,22 @@ export default {
this
.
showAlert
=
false
;
this
.
showAlert
=
false
;
},
},
updateFromStorage
(
val
)
{
updateFromStorage
(
val
)
{
const
{
selectedSiteProfileId
,
selectedScannerProfileId
,
name
,
description
}
=
val
;
const
{
selectedSiteProfileId
,
selectedScannerProfileId
,
name
,
description
,
selectedBranch
,
}
=
val
;
this
.
form
.
fields
.
name
.
value
=
name
??
this
.
form
.
fields
.
name
.
value
;
this
.
form
.
fields
.
name
.
value
=
name
??
this
.
form
.
fields
.
name
.
value
;
this
.
form
.
fields
.
description
.
value
=
description
??
this
.
form
.
fields
.
description
.
value
;
this
.
form
.
fields
.
description
.
value
=
description
??
this
.
form
.
fields
.
description
.
value
;
this
.
selectedBranch
=
selectedBranch
;
// precedence is given to profile IDs passed from the query params
// precedence is given to profile IDs passed from the query params
this
.
selectedSiteProfileId
=
this
.
selectedSiteProfileId
??
selectedSiteProfileId
;
this
.
selectedSiteProfileId
=
this
.
selectedSiteProfileId
??
selectedSiteProfileId
;
this
.
selectedScannerProfileId
=
this
.
selectedScannerProfileId
??
selectedScannerProfileId
;
this
.
selectedScannerProfileId
=
this
.
selectedScannerProfileId
??
selectedScannerProfileId
;
},
},
},
},
ON_DEMAND_SCANS_STORAGE_KEY
,
EXCLUDED_URLS_SEPARATOR
,
EXCLUDED_URLS_SEPARATOR
,
};
};
</
script
>
</
script
>
...
@@ -327,7 +336,7 @@ export default {
...
@@ -327,7 +336,7 @@ export default {
<local-storage-sync
<local-storage-sync
v-if=
"!isEdit"
v-if=
"!isEdit"
as-json
as-json
:storage-key=
"
$options.ON_DEMAND_SCANS_STORAGE_KEY
"
:storage-key=
"
storageKey
"
:clear=
"clearStorage"
:clear=
"clearStorage"
:value=
"formFieldValues"
:value=
"formFieldValues"
@
input=
"updateFromStorage"
@
input=
"updateFromStorage"
...
...
ee/changelogs/unreleased/djadmin-dast-ls-key-update.yml
0 → 100644
View file @
873dc49a
---
title
:
Update localStorage key for On-demand scans form
merge_request
:
57224
author
:
type
:
other
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
View file @
873dc49a
...
@@ -56,7 +56,7 @@ jest.mock('~/lib/utils/url_utility', () => ({
...
@@ -56,7 +56,7 @@ jest.mock('~/lib/utils/url_utility', () => ({
redirectTo
:
jest
.
fn
(),
redirectTo
:
jest
.
fn
(),
}));
}));
const
LOCAL_STORAGE_KEY
=
'
on-demand-scans-new-form
'
;
const
LOCAL_STORAGE_KEY
=
'
group/project/
on-demand-scans-new-form
'
;
describe
(
'
OnDemandScansForm
'
,
()
=>
{
describe
(
'
OnDemandScansForm
'
,
()
=>
{
let
localVue
;
let
localVue
;
...
@@ -268,6 +268,7 @@ describe('OnDemandScansForm', () => {
...
@@ -268,6 +268,7 @@ describe('OnDemandScansForm', () => {
name
:
'
My daily scan
'
,
name
:
'
My daily scan
'
,
selectedScannerProfileId
:
'
gid://gitlab/DastScannerProfile/1
'
,
selectedScannerProfileId
:
'
gid://gitlab/DastScannerProfile/1
'
,
selectedSiteProfileId
:
'
gid://gitlab/DastSiteProfile/1
'
,
selectedSiteProfileId
:
'
gid://gitlab/DastSiteProfile/1
'
,
selectedBranch
:
'
some-other-branch
'
,
}),
}),
],
],
]);
]);
...
...
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