From 1f0b0c1c1822d7efaa1a70779214799918614514 Mon Sep 17 00:00:00 2001 From: Martijn van der Meij Date: Thu, 10 Oct 2024 10:44:24 +0200 Subject: [PATCH] fix: make navigation relative to the application root so open in new tab or window works --- src/views/audit/PolicyViolationAudit.vue | 8 ++++---- .../globalAudit/VulnerabilityAuditByOccurrence.vue | 8 ++++---- .../VulnerabilityAuditGroupedByVulnerability.vue | 2 +- src/views/portfolio/components/ComponentSearch.vue | 10 +++------- src/views/portfolio/licenses/LicenseList.vue | 2 +- .../projects/ComponentVulnerabilities.vue | 4 ++-- src/views/portfolio/projects/ProjectComponents.vue | 9 +++------ src/views/portfolio/projects/ProjectEpss.vue | 9 +++------ src/views/portfolio/projects/ProjectFindings.vue | 14 ++++---------- src/views/portfolio/projects/ProjectList.vue | 2 +- .../portfolio/projects/ProjectPolicyViolations.vue | 4 ++-- src/views/portfolio/projects/ProjectServices.vue | 4 +--- .../vulnerabilities/VulnerabilityList.vue | 4 ++-- 13 files changed, 31 insertions(+), 49 deletions(-) diff --git a/src/views/audit/PolicyViolationAudit.vue b/src/views/audit/PolicyViolationAudit.vue index 64918916c..80308b4d4 100644 --- a/src/views/audit/PolicyViolationAudit.vue +++ b/src/views/audit/PolicyViolationAudit.vue @@ -356,7 +356,7 @@ export default { formatter: (value, row, index) => { if (row.component) { let url = xssFilters.uriInUnQuotedAttr( - '../../../components/' + row.component.uuid, + './components/' + row.component.uuid, ); let name = common.concatenateComponentName( null, @@ -364,7 +364,7 @@ export default { row.component.version, ); let dependencyGraphUrl = xssFilters.uriInUnQuotedAttr( - '../../../projects/' + + './projects/' + row.project.uuid + '/dependencyGraph/' + row.component.uuid, @@ -384,7 +384,7 @@ export default { sortable: true, formatter(value, row, index) { let url = xssFilters.uriInUnQuotedAttr( - '../projects/' + row.project.uuid, + './projects/' + row.project.uuid, ); let name = common.concatenateComponentName( null, @@ -429,7 +429,7 @@ export default { ) ) { let licenseurl = - '../../../licenses/' + row.component.resolvedLicense.licenseId; + './licenses/' + row.component.resolvedLicense.licenseId; return ( ' ` + @@ -291,7 +288,7 @@ export default { sortable: false, formatter(value, row, index) { let url = xssFilters.uriInUnQuotedAttr( - '../projects/' + row.project.uuid, + './projects/' + row.project.uuid, ); let name = common.concatenateComponentName( null, @@ -312,8 +309,7 @@ export default { } let url = xssFilters.uriInUnQuotedAttr( - '../licenses/' + - encodeURIComponent(row.resolvedLicense.licenseId), + './licenses/' + encodeURIComponent(row.resolvedLicense.licenseId), ); return `${xssFilters.inHTMLData(row.resolvedLicense.name)}`; }, diff --git a/src/views/portfolio/licenses/LicenseList.vue b/src/views/portfolio/licenses/LicenseList.vue index 6f0341025..35cd88eb9 100644 --- a/src/views/portfolio/licenses/LicenseList.vue +++ b/src/views/portfolio/licenses/LicenseList.vue @@ -70,7 +70,7 @@ export default { sortable: true, formatter: function (value, row, index) { let url = xssFilters.uriInUnQuotedAttr( - '../licenses/' + encodeURIComponent(value), + './licenses/' + encodeURIComponent(value), ); return `${xssFilters.inHTMLData(value)}`; }, diff --git a/src/views/portfolio/projects/ComponentVulnerabilities.vue b/src/views/portfolio/projects/ComponentVulnerabilities.vue index 491438374..e511ea921 100644 --- a/src/views/portfolio/projects/ComponentVulnerabilities.vue +++ b/src/views/portfolio/projects/ComponentVulnerabilities.vue @@ -36,7 +36,7 @@ export default { sortable: true, formatter(value, row, index) { let url = xssFilters.uriInUnQuotedAttr( - '../../vulnerabilities/' + row.source + '/' + value, + './vulnerabilities/' + row.source + '/' + value, ); return ( common.formatSourceLabel(row.source) + @@ -55,7 +55,7 @@ export default { for (let i = 0; i < aliases.length; i++) { let alias = aliases[i]; let url = xssFilters.uriInUnQuotedAttr( - '../../vulnerabilities/' + alias.source + '/' + alias.vulnId, + './vulnerabilities/' + alias.source + '/' + alias.vulnId, ); label += common.formatSourceLabel(alias.source) + diff --git a/src/views/portfolio/projects/ProjectComponents.vue b/src/views/portfolio/projects/ProjectComponents.vue index 1a8468067..5b473aa5c 100644 --- a/src/views/portfolio/projects/ProjectComponents.vue +++ b/src/views/portfolio/projects/ProjectComponents.vue @@ -168,11 +168,9 @@ export default { field: 'name', sortable: true, formatter: (value, row, index) => { - let url = xssFilters.uriInUnQuotedAttr( - '../../../components/' + row.uuid, - ); + let url = xssFilters.uriInUnQuotedAttr('./components/' + row.uuid); let dependencyGraphUrl = xssFilters.uriInUnQuotedAttr( - '../../../projects/' + this.uuid + '/dependencyGraph/' + row.uuid, + './projects/' + this.uuid + '/dependencyGraph/' + row.uuid, ); return ( ` ` + @@ -258,8 +256,7 @@ export default { sortable: false, formatter(value, row, index) { if (Object.prototype.hasOwnProperty.call(row, 'resolvedLicense')) { - let licenseurl = - '../../../licenses/' + row.resolvedLicense.licenseId; + let licenseurl = './licenses/' + row.resolvedLicense.licenseId; return ( '${xssFilters.inHTMLData(value)}`; }, }, diff --git a/src/views/portfolio/projects/ProjectPolicyViolations.vue b/src/views/portfolio/projects/ProjectPolicyViolations.vue index 74888ce7a..858656336 100644 --- a/src/views/portfolio/projects/ProjectPolicyViolations.vue +++ b/src/views/portfolio/projects/ProjectPolicyViolations.vue @@ -104,7 +104,7 @@ export default { formatter: (value, row, index) => { if (row.component) { let url = xssFilters.uriInUnQuotedAttr( - '../../../components/' + row.component.uuid, + './components/' + row.component.uuid, ); let name = common.concatenateComponentName( null, @@ -112,7 +112,7 @@ export default { row.component.version, ); let dependencyGraphUrl = xssFilters.uriInUnQuotedAttr( - '../../../projects/' + + './projects/' + this.uuid + '/dependencyGraph/' + row.component.uuid, diff --git a/src/views/portfolio/projects/ProjectServices.vue b/src/views/portfolio/projects/ProjectServices.vue index 28029f151..63153447f 100644 --- a/src/views/portfolio/projects/ProjectServices.vue +++ b/src/views/portfolio/projects/ProjectServices.vue @@ -38,9 +38,7 @@ export default { field: 'name', sortable: true, formatter(value, row, index) { - let url = xssFilters.uriInUnQuotedAttr( - '../../../services/' + row.uuid, - ); + let url = xssFilters.uriInUnQuotedAttr('./services/' + row.uuid); return `${xssFilters.inHTMLData(value)}`; }, }, diff --git a/src/views/portfolio/vulnerabilities/VulnerabilityList.vue b/src/views/portfolio/vulnerabilities/VulnerabilityList.vue index d3fa22ee2..2f4bcfa3d 100644 --- a/src/views/portfolio/vulnerabilities/VulnerabilityList.vue +++ b/src/views/portfolio/vulnerabilities/VulnerabilityList.vue @@ -74,7 +74,7 @@ export default { sortable: true, formatter(value, row, index) { let url = xssFilters.uriInUnQuotedAttr( - '../vulnerabilities/' + row.source + '/' + value, + './vulnerabilities/' + row.source + '/' + value, ); return ( common.formatSourceLabel(row.source) + @@ -93,7 +93,7 @@ export default { for (let i = 0; i < aliases.length; i++) { let alias = aliases[i]; let url = xssFilters.uriInUnQuotedAttr( - '../vulnerabilities/' + alias.source + '/' + alias.vulnId, + './vulnerabilities/' + alias.source + '/' + alias.vulnId, ); label += common.formatSourceLabel(alias.source) +