Commit bcee661f authored by Dave Pisek's avatar Dave Pisek

Show create-jira-issue when gitlab issues disabled

This commit makes sure that the create-jira-issue button
shows on the pipeline view when GitLab issues are disabled.

Changelog: fixed
EE: true
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64889
parent 5696f591
...@@ -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