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
513fae68
Commit
513fae68
authored
4 years ago
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide "Create Issue" button when issues are disabled
parent
1a50cb13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
ee/app/assets/javascripts/vulnerabilities/components/related_issues.vue
...javascripts/vulnerabilities/components/related_issues.vue
+1
-1
ee/spec/frontend/vulnerabilities/related_issues_spec.js
ee/spec/frontend/vulnerabilities/related_issues_spec.js
+17
-2
No files found.
ee/app/assets/javascripts/vulnerabilities/components/related_issues.vue
View file @
513fae68
...
@@ -261,7 +261,7 @@ export default {
...
@@ -261,7 +261,7 @@ export default {
<
template
#headerText
>
<
template
#headerText
>
{{
$options
.
i18n
.
relatedIssues
}}
{{
$options
.
i18n
.
relatedIssues
}}
</
template
>
</
template
>
<
template
v-if=
"!isIssueAlreadyCreated && !isFetching"
#headerActions
>
<
template
v-if=
"!isIssueAlreadyCreated && !isFetching
&& createIssueUrl
"
#headerActions
>
<gl-button
<gl-button
ref=
"createIssue"
ref=
"createIssue"
variant=
"success"
variant=
"success"
...
...
This diff is collapsed.
Click to expand it.
ee/spec/frontend/vulnerabilities/related_issues_spec.js
View file @
513fae68
...
@@ -33,7 +33,7 @@ describe('Vulnerability related issues component', () => {
...
@@ -33,7 +33,7 @@ describe('Vulnerability related issues component', () => {
const
issue1
=
{
id
:
3
,
vulnerabilityLinkId
:
987
};
const
issue1
=
{
id
:
3
,
vulnerabilityLinkId
:
987
};
const
issue2
=
{
id
:
25
,
vulnerabilityLinkId
:
876
};
const
issue2
=
{
id
:
25
,
vulnerabilityLinkId
:
876
};
const
createWrapper
=
async
(
data
=
{},
opts
)
=>
{
const
createWrapper
=
async
(
data
=
{},
provide
=
{},
opts
)
=>
{
wrapper
=
shallowMount
(
RelatedIssues
,
{
wrapper
=
shallowMount
(
RelatedIssues
,
{
propsData
,
propsData
,
data
:
()
=>
data
,
data
:
()
=>
data
,
...
@@ -44,6 +44,7 @@ describe('Vulnerability related issues component', () => {
...
@@ -44,6 +44,7 @@ describe('Vulnerability related issues component', () => {
reportType
,
reportType
,
issueTrackingHelpPath
,
issueTrackingHelpPath
,
permissionsHelpPath
,
permissionsHelpPath
,
...
provide
,
},
},
...
opts
,
...
opts
,
});
});
...
@@ -270,6 +271,7 @@ describe('Vulnerability related issues component', () => {
...
@@ -270,6 +271,7 @@ describe('Vulnerability related issues component', () => {
isFetching
:
false
,
isFetching
:
false
,
state
:
{
relatedIssues
:
[
issue1
,
{
...
issue2
,
vulnerabilityLinkType
:
'
created
'
}]
},
state
:
{
relatedIssues
:
[
issue1
,
{
...
issue2
,
vulnerabilityLinkType
:
'
created
'
}]
},
},
},
{},
{
stubs
:
{
RelatedIssuesBlock
}
},
{
stubs
:
{
RelatedIssuesBlock
}
},
);
);
});
});
...
@@ -289,7 +291,7 @@ describe('Vulnerability related issues component', () => {
...
@@ -289,7 +291,7 @@ describe('Vulnerability related issues component', () => {
beforeEach
(
async
()
=>
{
beforeEach
(
async
()
=>
{
mockAxios
.
onGet
(
propsData
.
endpoint
).
replyOnce
(
httpStatusCodes
.
OK
,
[
issue1
,
issue2
]);
mockAxios
.
onGet
(
propsData
.
endpoint
).
replyOnce
(
httpStatusCodes
.
OK
,
[
issue1
,
issue2
]);
createWrapper
({},
{
stubs
:
{
RelatedIssuesBlock
}
});
createWrapper
({},
{
},
{
stubs
:
{
RelatedIssuesBlock
}
});
await
axios
.
waitForAll
();
await
axios
.
waitForAll
();
});
});
...
@@ -327,4 +329,17 @@ describe('Vulnerability related issues component', () => {
...
@@ -327,4 +329,17 @@ describe('Vulnerability related issues component', () => {
expect
(
findAlert
().
exists
()).
toBe
(
false
);
expect
(
findAlert
().
exists
()).
toBe
(
false
);
});
});
});
});
describe
(
'
when project issue tracking is disabled
'
,
()
=>
{
it
(
'
hides the "Create Issue" button
'
,
()
=>
{
createWrapper
(
{},
{
createIssueUrl
:
undefined
,
},
);
expect
(
findCreateIssueButton
().
exists
()).
toBe
(
false
);
});
});
});
});
This diff is collapsed.
Click to expand it.
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