From c9a2d3369d0b95bd4837fef183335fdced1e9a67 Mon Sep 17 00:00:00 2001 From: Andres Tito Date: Thu, 7 Mar 2024 11:38:00 +0000 Subject: [PATCH 1/2] Add Neccesary parameter to resolveVulnAliases function common.resolveVulnALiases needs the vulnerability source and the aliases to deduplicate the list on the Aliases column, In case before, the only parameter added to the function was "value" which do not include neither the source of the current vulnerability or their aliases. Thats why I am adding row.source and row.aliases to the function. I discovered that the 'return' statement was located within the condition if(typeof value !== 'undefined'), This created a problem because the function would not return anything for null values. To fix this, I moved the 'return' outside of the condition. Signed-off-by: Andres Tito --- src/views/portfolio/vulnerabilities/VulnerabilityList.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/portfolio/vulnerabilities/VulnerabilityList.vue b/src/views/portfolio/vulnerabilities/VulnerabilityList.vue index b6de2e819..af0f7a0d7 100644 --- a/src/views/portfolio/vulnerabilities/VulnerabilityList.vue +++ b/src/views/portfolio/vulnerabilities/VulnerabilityList.vue @@ -87,9 +87,9 @@ export default { field: 'aliases', visible: false, formatter(value, row, index) { + let label = ''; if (typeof value !== 'undefined') { - let label = ''; - const aliases = common.resolveVulnAliases(value); + const aliases = common.resolveVulnAliases(row.source,row.aliases); for (let i = 0; i < aliases.length; i++) { let alias = aliases[i]; let url = xssFilters.uriInUnQuotedAttr( @@ -102,8 +102,8 @@ export default { )}`; if (i < aliases.length - 1) label += '

'; } - return label; } + return label; }, }, { From f943b4f1a34459f88f199230eada519710dc0da8 Mon Sep 17 00:00:00 2001 From: Andres Tito Date: Tue, 12 Mar 2024 10:01:59 +0000 Subject: [PATCH 2/2] Keep same format seen in ComponentVulnerabilities.vue, just add row.source and value to the resolveVulnAliases function and it will have same results. No difference in taking the "return label" outside or inside the if condition, no changes required. Run prettier. Signed-off-by: Andres Tito --- src/views/portfolio/vulnerabilities/VulnerabilityList.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/portfolio/vulnerabilities/VulnerabilityList.vue b/src/views/portfolio/vulnerabilities/VulnerabilityList.vue index af0f7a0d7..d3fa22ee2 100644 --- a/src/views/portfolio/vulnerabilities/VulnerabilityList.vue +++ b/src/views/portfolio/vulnerabilities/VulnerabilityList.vue @@ -87,9 +87,9 @@ export default { field: 'aliases', visible: false, formatter(value, row, index) { - let label = ''; if (typeof value !== 'undefined') { - const aliases = common.resolveVulnAliases(row.source,row.aliases); + let label = ''; + const aliases = common.resolveVulnAliases(row.source, value); for (let i = 0; i < aliases.length; i++) { let alias = aliases[i]; let url = xssFilters.uriInUnQuotedAttr( @@ -102,8 +102,8 @@ export default { )}`; if (i < aliases.length - 1) label += '

'; } + return label; } - return label; }, }, {