Commit fd2771d7 authored by Sam Beckham's avatar Sam Beckham Committed by Phil Hughes

Resolve "Use iid instead of id when displaying link to issue on Group Security Dashboard"

parent 580da305
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
}, },
computed: { computed: {
linkText() { linkText() {
return `${this.projectName}#${this.issue.issue_id}`; return `${this.projectName}#${this.issue.issue_iid}`;
}, },
}, },
}; };
......
...@@ -5,7 +5,6 @@ class VulnerabilityFeedbackEntity < Grape::Entity ...@@ -5,7 +5,6 @@ class VulnerabilityFeedbackEntity < Grape::Entity
expose :id expose :id
expose :project_id expose :project_id
expose :author, using: UserEntity expose :author, using: UserEntity
expose :issue_id
expose :pipeline, if: -> (feedback, _) { feedback.pipeline.present? } do expose :pipeline, if: -> (feedback, _) { feedback.pipeline.present? } do
expose :id do |feedback| expose :id do |feedback|
feedback.pipeline.id feedback.pipeline.id
...@@ -16,6 +15,10 @@ class VulnerabilityFeedbackEntity < Grape::Entity ...@@ -16,6 +15,10 @@ class VulnerabilityFeedbackEntity < Grape::Entity
end end
end end
expose :issue_iid, if: -> (feedback, _) { feedback.issue? } do |feedback|
feedback.issue&.iid
end
expose :issue_url, if: -> (feedback, _) { feedback.issue? } do |feedback| expose :issue_url, if: -> (feedback, _) { feedback.issue? } do |feedback|
project_issue_url(feedback.project, feedback.issue) project_issue_url(feedback.project, feedback.issue)
end end
......
---
title: Used the iid instead of the id for linked issues on the Group Security Dashboard
merge_request: 8357
author:
type: fixed
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"id": { "type": ["integer", "null"] }, "id": { "type": ["integer", "null"] },
"path": { "type": ["string", "null"] } "path": { "type": ["string", "null"] }
}, },
"issue_id": { "type": ["integer", "null"] }, "issue_iid": { "type": ["integer", "null"] },
"issue_url": { "type": ["string", "null"] }, "issue_url": { "type": ["string", "null"] },
"feedback_type": { "feedback_type": {
"type": "string", "type": "string",
......
...@@ -9,7 +9,7 @@ describe('Vulnerability Issue Link component', () => { ...@@ -9,7 +9,7 @@ describe('Vulnerability Issue Link component', () => {
beforeEach(() => { beforeEach(() => {
const issue = { const issue = {
issue_id: 1, issue_iid: 1,
issue_url: 'https://gitlab.com', issue_url: 'https://gitlab.com',
}; };
const projectName = 'Project Name'; const projectName = 'Project Name';
...@@ -22,7 +22,7 @@ describe('Vulnerability Issue Link component', () => { ...@@ -22,7 +22,7 @@ describe('Vulnerability Issue Link component', () => {
}); });
it('should render the severity label', () => { it('should render the severity label', () => {
expect(vm.$el.textContent).toContain(`${props.projectName}#${props.issue.issue_id}`); expect(vm.$el.textContent).toContain(`${props.projectName}#${props.issue.issue_iid}`);
}); });
it('should link to the issue', () => { it('should link to the issue', () => {
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
"status_tooltip_html": null, "status_tooltip_html": null,
"path": "/user6" "path": "/user6"
}, },
"issue_id": null, "issue_iid": null,
"pipeline": { "pipeline": {
"id": 2, "id": 2,
"path": "/namespace5/project5/pipelines/2" "path": "/namespace5/project5/pipelines/2"
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
"status_tooltip_html": null, "status_tooltip_html": null,
"path": "/user8" "path": "/user8"
}, },
"issue_id": 1, "issue_iid": 1,
"pipeline": { "pipeline": {
"id": 3, "id": 3,
"path": "/namespace6/project6/pipelines/3" "path": "/namespace6/project6/pipelines/3"
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
"status_tooltip_html": null, "status_tooltip_html": null,
"path": "/user6" "path": "/user6"
}, },
"issue_id": null, "issue_iid": null,
"pipeline": { "pipeline": {
"id": 2, "id": 2,
"path": "/namespace5/project5/pipelines/2" "path": "/namespace5/project5/pipelines/2"
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
"status_tooltip_html": null, "status_tooltip_html": null,
"path": "/user8" "path": "/user8"
}, },
"issue_id": 1, "issue_iid": 1,
"pipeline": { "pipeline": {
"id": 3, "id": 3,
"path": "/namespace6/project6/pipelines/3" "path": "/namespace6/project6/pipelines/3"
......
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