From 7c1846ea3629b0d059118f95a334652ae8f342ed Mon Sep 17 00:00:00 2001 From: Manan Vaghasiya Date: Mon, 15 Jul 2024 12:26:54 +0000 Subject: [PATCH] use problem title for grouped results table --- deepfence_frontend/apps/dashboard/api-spec.json | 3 ++- .../generated/models/ModelCloudNodeComplianceControl.ts | 8 ++++++++ .../models/ModelComplianceScanResultControlGroup.ts | 6 +++--- .../postures/components/scan-result/cloud/hooks.tsx | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/deepfence_frontend/apps/dashboard/api-spec.json b/deepfence_frontend/apps/dashboard/api-spec.json index 8cd94b77ca..3d7aa91134 100644 --- a/deepfence_frontend/apps/dashboard/api-spec.json +++ b/deepfence_frontend/apps/dashboard/api-spec.json @@ -13784,6 +13784,7 @@ "description": { "type": "string" }, "enabled": { "type": "boolean" }, "node_id": { "type": "string" }, + "problem_title": { "type": "string" }, "service": { "type": "string" }, "title": { "type": "string" } } @@ -14055,7 +14056,7 @@ "properties": { "benchmark_types": { "type": "array", "items": { "type": "string" } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, - "title": { "type": "string" } + "problem_title": { "type": "string" } } }, "ModelComplianceScanResultsGroupResp": { diff --git a/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelCloudNodeComplianceControl.ts b/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelCloudNodeComplianceControl.ts index fcc916bf7d..1be24ef26a 100644 --- a/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelCloudNodeComplianceControl.ts +++ b/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelCloudNodeComplianceControl.ts @@ -61,6 +61,12 @@ export interface ModelCloudNodeComplianceControl { * @memberof ModelCloudNodeComplianceControl */ node_id?: string; + /** + * + * @type {string} + * @memberof ModelCloudNodeComplianceControl + */ + problem_title?: string; /** * * @type {string} @@ -101,6 +107,7 @@ export function ModelCloudNodeComplianceControlFromJSONTyped(json: any, ignoreDi 'description': !exists(json, 'description') ? undefined : json['description'], 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], 'node_id': !exists(json, 'node_id') ? undefined : json['node_id'], + 'problem_title': !exists(json, 'problem_title') ? undefined : json['problem_title'], 'service': !exists(json, 'service') ? undefined : json['service'], 'title': !exists(json, 'title') ? undefined : json['title'], }; @@ -122,6 +129,7 @@ export function ModelCloudNodeComplianceControlToJSON(value?: ModelCloudNodeComp 'description': value.description, 'enabled': value.enabled, 'node_id': value.node_id, + 'problem_title': value.problem_title, 'service': value.service, 'title': value.title, }; diff --git a/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelComplianceScanResultControlGroup.ts b/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelComplianceScanResultControlGroup.ts index 424f185570..97c75b5dc9 100644 --- a/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelComplianceScanResultControlGroup.ts +++ b/deepfence_frontend/apps/dashboard/src/api/generated/models/ModelComplianceScanResultControlGroup.ts @@ -36,7 +36,7 @@ export interface ModelComplianceScanResultControlGroup { * @type {string} * @memberof ModelComplianceScanResultControlGroup */ - title?: string; + problem_title?: string; } /** @@ -60,7 +60,7 @@ export function ModelComplianceScanResultControlGroupFromJSONTyped(json: any, ig 'benchmark_types': !exists(json, 'benchmark_types') ? undefined : json['benchmark_types'], 'counts': !exists(json, 'counts') ? undefined : json['counts'], - 'title': !exists(json, 'title') ? undefined : json['title'], + 'problem_title': !exists(json, 'problem_title') ? undefined : json['problem_title'], }; } @@ -75,7 +75,7 @@ export function ModelComplianceScanResultControlGroupToJSON(value?: ModelComplia 'benchmark_types': value.benchmark_types, 'counts': value.counts, - 'title': value.title, + 'problem_title': value.problem_title, }; } diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/hooks.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/hooks.tsx index 1f08243063..4accef43fb 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/hooks.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/hooks.tsx @@ -137,7 +137,7 @@ export const useGetControls = ({ nodeType }: { nodeType: string }) => { results.push({ controlId, benchmarkTypes: countsByControlsData[controlId].benchmark_types ?? [], - title: countsByControlsData[controlId].title ?? controlId, + title: countsByControlsData[controlId].problem_title ?? controlId, counts: countsByControlsData[controlId].counts ?? {}, totalCount, });