From fbc188d18bbe058102248ae0d43308fa989098c2 Mon Sep 17 00:00:00 2001 From: Sahiba Mittal Date: Mon, 28 Aug 2023 14:06:28 +0100 Subject: [PATCH] add integrity check column in project component view --- src/i18n/locales/en.json | 1 + .../portfolio/projects/ProjectComponents.vue | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 1d2208edb..708c07d9b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -347,6 +347,7 @@ "vulnerability_deleted": "Vulnerability deleted", "created": "Created", "internal": "Internal", + "integrity_check": "Integrity Check", "latest_version": "Latest Version", "metric_refresh_requested": "A refresh has been requested. Metrics will be updated when the refresh task has completed.", "used_by": "Used By", diff --git a/src/views/portfolio/projects/ProjectComponents.vue b/src/views/portfolio/projects/ProjectComponents.vue index dce0f4d12..5c1cf90f3 100644 --- a/src/views/portfolio/projects/ProjectComponents.vue +++ b/src/views/portfolio/projects/ProjectComponents.vue @@ -145,6 +145,26 @@ import SeverityProgressBar from "../../components/SeverityProgressBar"; return value === true ? '' : ""; }, }, + { + title: this.$t('message.integrity_check'), + field: "integrityCheckStatus", + sortable: true, + formatter: (value, row, index) => { + if (Object.prototype.hasOwnProperty.call(row, "integrityAnalysis") && Object.prototype.hasOwnProperty.call(row.integrityAnalysis, "integrityCheckPassed")) { + row.lastCheck = row.integrityAnalysis.lastCheck; + if (typeof row.lastCheck !== 'undefined') { + row.lastCheck = common.formatTimestamp(row.lastCheck); + } + if (row.integrityAnalysis.integrityCheckPassed == false) { + return ' ' + xssFilters.inHTMLData(row.lastCheck); + } else { + return ' ' + xssFilters.inHTMLData(row.lastCheck); + } + } else { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + } + }, { title: this.$t('message.license'), field: "license",