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
604e7ca3
Commit
604e7ca3
authored
Oct 13, 2020
by
Dheeraj Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use form serialize util
parent
1ed54ff5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
ee/app/assets/javascripts/security_configuration/dast_site_profiles_form/components/dast_site_profile_form.vue
..._site_profiles_form/components/dast_site_profile_form.vue
+5
-7
No files found.
ee/app/assets/javascripts/security_configuration/dast_site_profiles_form/components/dast_site_profile_form.vue
View file @
604e7ca3
...
...
@@ -13,6 +13,7 @@ import {
import
*
as
Sentry
from
'
~/sentry/wrapper
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
import
{
isAbsolute
,
redirectTo
}
from
'
~/lib/utils/url_utility
'
;
import
{
serializeFormObject
,
isEmptyValue
}
from
'
~/lib/utils/forms
'
;
import
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
DastSiteValidation
from
'
./dast_site_validation.vue
'
;
...
...
@@ -30,9 +31,6 @@ const initField = value => ({
feedback
:
null
,
});
const
extractFormValues
=
form
=>
Object
.
fromEntries
(
Object
.
entries
(
form
).
map
(([
key
,
{
value
}])
=>
[
key
,
value
]));
export
default
{
name
:
'
DastSiteProfileForm
'
,
components
:
{
...
...
@@ -73,7 +71,7 @@ export default {
return
{
fetchValidationTimeout
:
null
,
form
,
initialFormValues
:
extractFormValues
(
form
),
initialFormValues
:
serializeFormObject
(
form
),
isFetchingValidationStatus
:
false
,
isValidatingSite
:
false
,
isLoading
:
false
,
...
...
@@ -121,13 +119,13 @@ export default {
};
},
formTouched
()
{
return
!
isEqual
(
extractFormValues
(
this
.
form
),
this
.
initialFormValues
);
return
!
isEqual
(
serializeFormObject
(
this
.
form
),
this
.
initialFormValues
);
},
formHasErrors
()
{
return
Object
.
values
(
this
.
form
).
some
(({
state
})
=>
state
===
false
);
},
someFieldEmpty
()
{
return
Object
.
values
(
this
.
form
).
some
(({
value
})
=>
!
value
);
return
Object
.
values
(
this
.
form
).
some
(({
value
})
=>
isEmptyValue
(
value
)
);
},
isSubmitDisabled
()
{
return
(
...
...
@@ -295,7 +293,7 @@ export default {
const
variables
=
{
fullPath
:
this
.
fullPath
,
...(
this
.
isEdit
?
{
id
:
this
.
siteProfile
.
id
}
:
{}),
...
extractFormValues
(
this
.
form
),
...
serializeFormObject
(
this
.
form
),
};
this
.
$apollo
...
...
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