Commit 53cf3a9a authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch...

Merge branch '334146-create-jira-issue-button-does-not-show-in-mrs-if-gitlab-issues-are-disabled-for-project' into 'master'

Show create-jira-issue when gitlab issues disabled

See merge request gitlab-org/gitlab!64889
parents e637487b bcee661f
...@@ -65,8 +65,10 @@ export default { ...@@ -65,8 +65,10 @@ export default {
return this.projectFullPath && this.pipelineIid && this.securityReportSummary.coverageFuzzing; return this.projectFullPath && this.pipelineIid && this.securityReportSummary.coverageFuzzing;
}, },
canCreateIssue() { canCreateIssue() {
const path = this.vulnerability.create_vulnerability_feedback_issue_path; const gitLabIssuePath = this.vulnerability.create_vulnerability_feedback_issue_path;
return Boolean(path); const jiraIssueUrl = this.vulnerability.create_jira_issue_url;
return Boolean(gitLabIssuePath || jiraIssueUrl);
}, },
canCreateMergeRequest() { canCreateMergeRequest() {
const path = this.vulnerability.create_vulnerability_feedback_merge_request_path; const path = this.vulnerability.create_vulnerability_feedback_merge_request_path;
......
...@@ -154,6 +154,7 @@ describe('Security Dashboard component', () => { ...@@ -154,6 +154,7 @@ describe('Security Dashboard component', () => {
givenState | expectedProps givenState | expectedProps
${{ modal: { vulnerability: 'foo' } }} | ${{ modal: { vulnerability: 'foo' }, canCreateIssue: false, canCreateMergeRequest: false, canDismissVulnerability: false, isCreatingIssue: false, isDismissingVulnerability: false, isCreatingMergeRequest: false }} ${{ modal: { vulnerability: 'foo' } }} | ${{ modal: { vulnerability: 'foo' }, canCreateIssue: false, canCreateMergeRequest: false, canDismissVulnerability: false, isCreatingIssue: false, isDismissingVulnerability: false, isCreatingMergeRequest: false }}
${{ modal: { vulnerability: { create_vulnerability_feedback_issue_path: 'foo' } } }} | ${expect.objectContaining({ canCreateIssue: true })} ${{ modal: { vulnerability: { create_vulnerability_feedback_issue_path: 'foo' } } }} | ${expect.objectContaining({ canCreateIssue: true })}
${{ modal: { vulnerability: { create_jira_issue_url: 'foo' } } }} | ${expect.objectContaining({ canCreateIssue: true })}
${{ modal: { vulnerability: { create_vulnerability_feedback_merge_request_path: 'foo' } } }} | ${expect.objectContaining({ canCreateMergeRequest: true })} ${{ modal: { vulnerability: { create_vulnerability_feedback_merge_request_path: 'foo' } } }} | ${expect.objectContaining({ canCreateMergeRequest: true })}
${{ modal: { vulnerability: { create_vulnerability_feedback_dismissal_path: 'foo' } } }} | ${expect.objectContaining({ canDismissVulnerability: true })} ${{ modal: { vulnerability: { create_vulnerability_feedback_dismissal_path: 'foo' } } }} | ${expect.objectContaining({ canDismissVulnerability: true })}
${{ isCreatingIssue: true }} | ${expect.objectContaining({ isCreatingIssue: true })} ${{ isCreatingIssue: true }} | ${expect.objectContaining({ isCreatingIssue: true })}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment