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
ef9ed59d
Commit
ef9ed59d
authored
May 25, 2021
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move checkbox disabled to computed prop
parent
0570f736
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
ee/app/assets/javascripts/integrations/edit/components/jira_issue_creation_vulnerabilities.vue
...s/edit/components/jira_issue_creation_vulnerabilities.vue
+4
-1
ee/spec/frontend/integrations/edit/components/jira_issue_creation_vulnerabilities_spec.js
...it/components/jira_issue_creation_vulnerabilities_spec.js
+14
-1
No files found.
ee/app/assets/javascripts/integrations/edit/components/jira_issue_creation_vulnerabilities.vue
View file @
ef9ed59d
...
...
@@ -87,6 +87,9 @@ export default {
'
isLoadingJiraIssueTypes
'
,
'
loadingJiraIssueTypesErrorMessage
'
,
]),
checkboxDisabled
()
{
return
!
this
.
showFullFeature
||
this
.
isInheriting
;
},
initialJiraIssueType
()
{
return
this
.
jiraIssueTypes
?.
find
(({
id
})
=>
id
===
this
.
initialIssueTypeId
)
||
{};
},
...
...
@@ -135,7 +138,7 @@ export default {
<gl-form-checkbox
v-model=
"isJiraVulnerabilitiesEnabled"
data-testid=
"enable-jira-vulnerabilities"
:disabled=
"
!showFullFeature || isInheriting
"
:disabled=
"
checkboxDisabled
"
>
{{
$options
.
i18n
.
checkbox
.
label
}}
<template
#help
>
...
...
ee/spec/frontend/integrations/edit/components/jira_issue_creation_vulnerabilities_spec.js
View file @
ef9ed59d
...
...
@@ -22,11 +22,14 @@ describe('JiraIssuesFields', () => {
{
id
:
'
3
'
,
name
:
'
epic
'
,
description
:
'
epic
'
},
];
const
createComponent
=
(
mountFn
)
=>
({
props
}
=
{})
=>
{
const
createComponent
=
(
mountFn
)
=>
({
isInheriting
=
false
,
props
}
=
{})
=>
{
return
extendedWrapper
(
mountFn
(
JiraIssueCreationVulnerabilities
,
{
store
,
propsData
:
{
...
defaultProps
,
...
props
},
computed
:
{
isInheriting
:
()
=>
isInheriting
,
},
}),
);
};
...
...
@@ -98,6 +101,16 @@ describe('JiraIssuesFields', () => {
await
setEnableJiraVulnerabilitiesChecked
(
isChecked
);
expect
(
findIssueTypeSection
().
exists
()).
toBe
(
isChecked
);
});
describe
(
'
when isInheriting = true
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createShallowComponent
({
isInheriting
:
true
});
});
it
(
'
disables the checkbox
'
,
()
=>
{
expect
(
findEnableJiraVulnerabilities
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
});
});
describe
(
'
when showFullFeature is off
'
,
()
=>
{
...
...
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