forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cloud Security]Added Support to handle Labels on Unified Data Table (e…
…lastic#184295) ## Summary Added Support to handle Labels on Unified Data Table. Previously Findings and Vulnerabilities table columns shows Labels by using the customLabel field in Dataview and we did this by Updating the Dataview when we first retrieve the Dataview. However, we have removed the Update logic, as such we would need a different way to do this which is this PR We used the **settings** prop on UnifiedDataTable to pass on the Column Labels that will be shown in Findings/Vulnerabilities table
- Loading branch information
Showing
14 changed files
with
176 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...curity_posture/public/pages/configurations/latest_findings/findings_table_field_labels.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const findingsTableFieldLabels: Record<string, string> = { | ||
'result.evaluation': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.resultColumnLabel', | ||
{ defaultMessage: 'Result' } | ||
), | ||
'resource.id': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.resourceIdColumnLabel', | ||
{ defaultMessage: 'Resource ID' } | ||
), | ||
'resource.name': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.resourceNameColumnLabel', | ||
{ defaultMessage: 'Resource Name' } | ||
), | ||
'resource.sub_type': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.resourceTypeColumnLabel', | ||
{ defaultMessage: 'Resource Type' } | ||
), | ||
'rule.benchmark.rule_number': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.ruleNumberColumnLabel', | ||
{ defaultMessage: 'Rule Number' } | ||
), | ||
'rule.name': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.ruleNameColumnLabel', | ||
{ defaultMessage: 'Rule Name' } | ||
), | ||
'rule.section': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.ruleSectionColumnLabel', | ||
{ defaultMessage: 'CIS Section' } | ||
), | ||
'@timestamp': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.lastCheckedColumnLabel', | ||
{ defaultMessage: 'Last Checked' } | ||
), | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_table_field_labels.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const vulnerabilitiesTableFieldLabels: Record<string, string> = { | ||
'resource.id': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.resourceIdColumnLabel', | ||
{ defaultMessage: 'Resource ID' } | ||
), | ||
'resource.name': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.resourceNameColumnLabel', | ||
{ defaultMessage: 'Resource Name' } | ||
), | ||
'vulnerability.id': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.vulnerabilityIdColumnLabel', | ||
{ defaultMessage: 'Vulnerability' } | ||
), | ||
'vulnerability.score.base': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.vulnerabilityScoreColumnLabel', | ||
{ defaultMessage: 'CVSS' } | ||
), | ||
'vulnerability.severity': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.vulnerabilitySeverityColumnLabel', | ||
{ defaultMessage: 'Severity' } | ||
), | ||
'package.name': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.packageNameColumnLabel', | ||
{ defaultMessage: 'Package' } | ||
), | ||
'package.version': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.packageVersionColumnLabel', | ||
{ defaultMessage: 'Version' } | ||
), | ||
'package.fixed_version': i18n.translate( | ||
'xpack.csp.findings.findingsTable.findingsTableColumn.packageFixedVersionColumnLabel', | ||
{ defaultMessage: 'Fix Version' } | ||
), | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.