Skip to content

Commit

Permalink
Add Updated column
Browse files Browse the repository at this point in the history
  • Loading branch information
e40pud committed Dec 2, 2024
1 parent d17d49d commit 9acb183
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export * from './name';
export * from './risk_score';
export * from './severity';
export * from './status';
export * from './updated';
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@ export const COLUMN_SEVERITY = i18n.translate(
defaultMessage: 'Severity',
}
);

export const COLUMN_UPDATED = i18n.translate(
'xpack.securitySolution.siemMigrations.rules.tableColumn.updatedLabel',
{
defaultMessage: 'Updated',
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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 React from 'react';
import { FormattedRelativePreferenceDate } from '../../../../common/components/formatted_date';
import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen';
import * as i18n from './translations';
import type { TableColumn } from './constants';

export const createUpdatedColumn = (): TableColumn => {
return {
field: 'updated_at',
name: i18n.COLUMN_UPDATED,
render: (value: RuleMigration['updated_at']) => (
<FormattedRelativePreferenceDate value={value} dateFormat="M/D/YY" />
),
sortable: true,
truncateText: false,
align: 'center',
width: '10%',
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
createRiskScoreColumn,
createSeverityColumn,
createStatusColumn,
createUpdatedColumn,
} from '../components/rules_table_columns';

export const useRulesTableColumns = ({
Expand All @@ -27,6 +28,7 @@ export const useRulesTableColumns = ({
}): TableColumn[] => {
return useMemo(
() => [
createUpdatedColumn(),
createNameColumn({ openMigrationRulePreview }),
createStatusColumn(),
createRiskScoreColumn(),
Expand Down

0 comments on commit 9acb183

Please sign in to comment.