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
38e8e2b7
Commit
38e8e2b7
authored
Sep 09, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add disabled prop to dynamic fields
* Update unit tests
parent
6aa21d72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
ee/app/assets/javascripts/security_configuration/sast/components/dynamic_fields.vue
...security_configuration/sast/components/dynamic_fields.vue
+6
-1
ee/spec/frontend/security_configuration/sast/components/analyzer_configuration_spec.js
...figuration/sast/components/analyzer_configuration_spec.js
+1
-1
ee/spec/frontend/security_configuration/sast/components/dynamic_fields_spec.js
...rity_configuration/sast/components/dynamic_fields_spec.js
+11
-0
No files found.
ee/app/assets/javascripts/security_configuration/sast/components/dynamic_fields.vue
View file @
38e8e2b7
...
...
@@ -18,6 +18,11 @@ export default {
required
:
true
,
validator
:
value
=>
value
.
every
(
isValidConfigurationEntity
),
},
disabled
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
methods
:
{
componentForEntity
({
type
})
{
...
...
@@ -49,7 +54,7 @@ export default {
</
script
>
<
template
>
<gl-form-group>
<gl-form-group
:disabled=
"disabled"
>
<component
:is=
"componentForEntity(entity)"
v-for=
"entity in entities"
...
...
ee/spec/frontend/security_configuration/sast/components/analyzer_configuration_spec.js
View file @
38e8e2b7
...
...
@@ -116,7 +116,7 @@ describe('AnalyzerConfiguration component', () => {
});
it
(
'
passes the disabled prop to dynamic fields component
'
,
()
=>
{
expect
(
findDynamicFields
().
vm
.
$attrs
.
disabled
).
toBe
(
!
analyzerEntity
.
enabled
);
expect
(
findDynamicFields
().
props
(
'
disabled
'
)
).
toBe
(
!
analyzerEntity
.
enabled
);
});
it
(
'
passes the entities prop to the dynamic fields component
'
,
()
=>
{
...
...
ee/spec/frontend/security_configuration/sast/components/dynamic_fields_spec.js
View file @
38e8e2b7
...
...
@@ -44,6 +44,17 @@ describe('DynamicFields component', () => {
fields
=
findFields
();
});
describe
.
each
([
true
,
false
])(
'
when the disabled prop is %s
'
,
disabled
=>
{
beforeEach
(()
=>
{
entities
=
makeEntities
(
3
);
createComponent
({
entities
,
disabled
});
});
it
(
`it is passed a disabled prop set to
${
disabled
}
`
,
()
=>
{
expect
(
wrapper
.
props
(
'
disabled
'
)).
toBe
(
disabled
);
});
});
it
(
'
renders each field with the correct component
'
,
()
=>
{
entities
.
forEach
((
entity
,
i
)
=>
{
const
field
=
fields
.
at
(
i
);
...
...
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