Skip to content

Commit

Permalink
[Security Solution][Detections] Format execution gap in a human reada…
Browse files Browse the repository at this point in the history
…ble way (#141363) (#141761)

**Fixes:** [#138872](#138872)

## Summary

The patch formats the rule execution gap column on the rule monitoring tab in a human readable way.

Before:

![image](https://user-images.githubusercontent.com/3775283/191710889-9b3fde9d-32c8-4beb-8a9f-28a0143cf41c.png)

After:

![image](https://user-images.githubusercontent.com/3775283/191710563-fe74e6fc-1a88-4b5a-aac5-10b6e61945b5.png)

### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

(cherry picked from commit 6282096)

Co-authored-by: Maxim Palenov <[email protected]>
  • Loading branch information
kibanamachine and maximpn authored Sep 26, 2022
1 parent 593bc33 commit a5427db
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { EuiBasicTableColumn, EuiTableActionsColumnType } from '@elastic/eu
import { EuiBadge, EuiLink, EuiText, EuiToolTip } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import React, { useMemo } from 'react';
import moment from 'moment';
import { IntegrationsPopover } from '../../../../components/rules/related_integrations/integrations_popover';
import {
DEFAULT_RELATIVE_DATE_THRESHOLD,
Expand Down Expand Up @@ -387,7 +388,7 @@ export const useMonitoringColumns = ({ hasPermissions }: ColumnsProps): TableCol
),
render: (value: DurationMetric | undefined) => (
<EuiText data-test-subj="gap" size="s">
{value != null ? value.toFixed() : getEmptyTagValue()}
{value != null ? moment.duration(value, 'seconds').humanize() : getEmptyTagValue()}
</EuiText>
),
sortable: !!isInMemorySorting,
Expand Down

0 comments on commit a5427db

Please sign in to comment.