Commit 10ee96a3 authored by Kev's avatar Kev Committed by Nicolò Maria Mezzopera

Resolve "Retrieve security dashboard URL used on Project Severity status...

Resolve "Retrieve security dashboard URL used on Project Severity status report from backend - FE implementation"
parent cccc9bad
---
title: Retrieve security dashboard URL used on Project Severity status report from
backend
merge_request: 40801
author: Kev @KevSlashNull
type: changed
...@@ -194,7 +194,7 @@ export default { ...@@ -194,7 +194,7 @@ export default {
<li v-for="project in severityGroup.projects" :key="project.id" class="gl-py-3"> <li v-for="project in severityGroup.projects" :key="project.id" class="gl-py-3">
<gl-link <gl-link
target="_blank" target="_blank"
:href="`/${project.fullPath}/-/security/dashboard`" :href="project.securityDashboardPath"
data-qa-selector="project_name_text" data-qa-selector="project_name_text"
>{{ project.nameWithNamespace }}</gl-link >{{ project.nameWithNamespace }}</gl-link
> >
......
...@@ -2,6 +2,7 @@ fragment Project on Project { ...@@ -2,6 +2,7 @@ fragment Project on Project {
id id
name name
nameWithNamespace nameWithNamespace
securityDashboardPath
fullPath fullPath
avatarUrl avatarUrl
path path
......
...@@ -136,7 +136,7 @@ describe('Vulnerability Severity component', () => { ...@@ -136,7 +136,7 @@ describe('Vulnerability Severity component', () => {
relatedProjects.forEach((project, i) => { relatedProjects.forEach((project, i) => {
const projectLink = findProjectName(accordion).at(i); const projectLink = findProjectName(accordion).at(i);
expect(projectLink.text()).toBe(project.nameWithNamespace); expect(projectLink.text()).toBe(project.nameWithNamespace);
expect(projectLink.attributes('href')).toBe(`/${project.fullPath}/-/security/dashboard`); expect(projectLink.attributes('href')).toBe(project.securityDashboardPath);
}); });
}); });
......
...@@ -100,6 +100,7 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -100,6 +100,7 @@ export const generateProjectsWithSeverityCounts = () => [
name: 'Gitlab Test 1', name: 'Gitlab Test 1',
nameWithNamespace: 'Gitlab Org / Gitlab Test 1', nameWithNamespace: 'Gitlab Org / Gitlab Test 1',
fullPath: 'gitlab-org/gitlab-test-1', fullPath: 'gitlab-org/gitlab-test-1',
securityDashboardPath: '/gitlab-org/gitlab-test-1/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 2, critical: 2,
high: 0, high: 0,
...@@ -114,6 +115,7 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -114,6 +115,7 @@ export const generateProjectsWithSeverityCounts = () => [
name: 'Gitlab Test 2', name: 'Gitlab Test 2',
nameWithNamespace: 'Gitlab Org / Gitlab Test 2', nameWithNamespace: 'Gitlab Org / Gitlab Test 2',
fullPath: 'gitlab-org/gitlab-test-2', fullPath: 'gitlab-org/gitlab-test-2',
securityDashboardPath: '/gitlab-org/gitlab-test-2/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 0, critical: 0,
high: 1, high: 1,
...@@ -128,6 +130,7 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -128,6 +130,7 @@ export const generateProjectsWithSeverityCounts = () => [
name: 'Gitlab Test 3', name: 'Gitlab Test 3',
nameWithNamespace: 'Gitlab Org / Gitlab Test 3', nameWithNamespace: 'Gitlab Org / Gitlab Test 3',
fullPath: 'gitlab-org/gitlab-test-3', fullPath: 'gitlab-org/gitlab-test-3',
securityDashboardPath: '/gitlab-org/gitlab-test-3/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 0, critical: 0,
high: 0, high: 0,
...@@ -142,6 +145,7 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -142,6 +145,7 @@ export const generateProjectsWithSeverityCounts = () => [
name: 'Gitlab Test 4', name: 'Gitlab Test 4',
nameWithNamespace: 'Gitlab Org / Gitlab Test 4', nameWithNamespace: 'Gitlab Org / Gitlab Test 4',
fullPath: 'gitlab-org/gitlab-test-4', fullPath: 'gitlab-org/gitlab-test-4',
securityDashboardPath: '/gitlab-org/gitlab-test-4/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 0, critical: 0,
high: 0, high: 0,
...@@ -156,6 +160,7 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -156,6 +160,7 @@ export const generateProjectsWithSeverityCounts = () => [
name: 'Gitlab Test 5', name: 'Gitlab Test 5',
nameWithNamespace: 'Gitlab Org / Gitlab Test 5', nameWithNamespace: 'Gitlab Org / Gitlab Test 5',
fullPath: 'gitlab-org/gitlab-test-5', fullPath: 'gitlab-org/gitlab-test-5',
securityDashboardPath: '/gitlab-org/gitlab-test-5/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 0, critical: 0,
high: 0, high: 0,
...@@ -170,6 +175,7 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -170,6 +175,7 @@ export const generateProjectsWithSeverityCounts = () => [
name: 'Gitlab Test 6', name: 'Gitlab Test 6',
nameWithNamespace: 'Gitlab Org / Gitlab Test 6', nameWithNamespace: 'Gitlab Org / Gitlab Test 6',
fullPath: 'gitlab-org/gitlab-test-6', fullPath: 'gitlab-org/gitlab-test-6',
securityDashboardPath: '/gitlab-org/gitlab-test-6/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 0, critical: 0,
high: 0, high: 0,
...@@ -182,8 +188,9 @@ export const generateProjectsWithSeverityCounts = () => [ ...@@ -182,8 +188,9 @@ export const generateProjectsWithSeverityCounts = () => [
{ {
id: 'gid://gitlab/Project/7', id: 'gid://gitlab/Project/7',
name: 'Gitlab Test 7', name: 'Gitlab Test 7',
nameWithNamespace: 'Gitlab Org / Gitlab Test 7', nameWithNamespace: 'Gitlab Org / Subgroup / Gitlab Test 7',
fullPath: 'gitlab-org/gitlab-test-7', fullPath: 'gitlab-org/subgroup/gitlab-test-7',
securityDashboardPath: '/gitlab-org/subgroup/gitlab-test-7/-/security/dashboard',
vulnerabilitySeveritiesCount: { vulnerabilitySeveritiesCount: {
critical: 0, critical: 0,
high: 0, high: 0,
......
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