From 02e0f97f64460ee56e79ba4bf585c8af4fe7542c Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Tue, 10 Jan 2023 21:58:40 +0530 Subject: [PATCH 1/2] updated column widths Signed-off-by: Amardeepsingh Siglani --- .../components/DetectionRules/DetectionRulesTable.tsx | 2 +- .../components/DetectionRules/utils/constants.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx index c6be37e46..b97e78a1c 100644 --- a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx @@ -76,7 +76,7 @@ export const DetectionRulesTable: React.FC = ({ return (rulePriorityBySeverity[a.severity] || 6) - (rulePriorityBySeverity[b.severity] || 6); }); - const onTableChangeHandler = (pagination: CriteriaWithPagination) => { + const onTableChangeHandler = (pagination: CriteriaWithPagination) => { setPagination({ pageIndex: pagination.page.index }); onTableChange && onTableChange(pagination); }; diff --git a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx index 6c62db00a..4480d9929 100644 --- a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx @@ -35,18 +35,25 @@ export const getRulesColumns = ( ); }, + width: '30%', + sortable: true, }, { field: 'severity', name: 'Rule severity', + width: '10%', + sortable: true, }, { field: 'logType', name: 'Log type', + width: '10%', + sortable: true, }, { field: 'library', name: 'Source', + width: '10%', }, { field: 'description', From c4c2f02f643af7bc8cef4828033a91c5559aee0c Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Tue, 10 Jan 2023 22:25:19 +0530 Subject: [PATCH 2/2] improved typography; removed log type filter Signed-off-by: Amardeepsingh Siglani --- .../components/DetectionRules/DetectionRulesTable.tsx | 11 +---------- .../components/DetectionRules/utils/constants.tsx | 4 ++++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx index b97e78a1c..2ecf65507 100644 --- a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/DetectionRulesTable.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { RuleItem } from './types/interfaces'; import { getRulesColumns } from './utils/constants'; import { Search } from '@opensearch-project/oui/src/eui_components/basic_table'; -import { ruleTypes, ruleSeverity, ruleSource } from '../../../../../Rules/utils/constants'; +import { ruleSeverity, ruleSource } from '../../../../../Rules/utils/constants'; export interface DetectionRulesTableProps { ruleItems: RuleItem[]; @@ -43,15 +43,6 @@ export const DetectionRulesTable: React.FC = ({ schema: true, }, filters: [ - { - type: 'field_value_selection', - field: 'logType', - name: 'Log Type', - multiSelect: true, - options: ruleTypes.map((type: string) => ({ - value: type, - })), - }, { type: 'field_value_selection', field: 'severity', diff --git a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx index 4480d9929..1b7132f44 100644 --- a/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/components/DetectionRules/utils/constants.tsx @@ -4,6 +4,7 @@ */ import { EuiBasicTableColumn, EuiLink, EuiSwitch } from '@elastic/eui'; +import { capitalizeFirstLetter } from '../../../../../../../utils/helpers'; import React, { ReactNode } from 'react'; import { RuleItem } from '../types/interfaces'; @@ -43,17 +44,20 @@ export const getRulesColumns = ( name: 'Rule severity', width: '10%', sortable: true, + render: (severity: string) => capitalizeFirstLetter(severity), }, { field: 'logType', name: 'Log type', width: '10%', sortable: true, + render: (logType: string) => capitalizeFirstLetter(logType), }, { field: 'library', name: 'Source', width: '10%', + render: (library: string) => capitalizeFirstLetter(library), }, { field: 'description',