[8.14] [Alert table] Fix Triggered column timezone and format (#182653) (#182776)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Alert table] Fix Triggered column timezone and format
(#182653)](https://github.com/elastic/kibana/pull/182653)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2024-05-07T08:11:28Z","message":"[Alert
table] Fix Triggered column timezone and format (#182653)\n\nPartially
implements #182650\r\n\r\n## Summary\r\n\r\nThis PR fixes START_TIME
timezone and format [similar to what we have in\r\nthe
stack\r\nmanagement](23d2ac9d-db2b-423c-82e2-be3753b0954c)|\r\n\r\nThere
are more questions to be answered in #182650, but for now, I've\r\nadded
this fix to have something consistent with the stack
management\r\nalerts
table.","sha":"dcf6e83aeaed3c45cbca24ae75a4acf37ad8468c","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.15.0"],"title":"[Alert
table] Fix Triggered column timezone and
format","number":182653,"url":"https://github.com/elastic/kibana/pull/182653","mergeCommit":{"message":"[Alert
table] Fix Triggered column timezone and format (#182653)\n\nPartially
implements #182650\r\n\r\n## Summary\r\n\r\nThis PR fixes START_TIME
timezone and format [similar to what we have in\r\nthe
stack\r\nmanagement](23d2ac9d-db2b-423c-82e2-be3753b0954c)|\r\n\r\nThere
are more questions to be answered in #182650, but for now, I've\r\nadded
this fix to have something consistent with the stack
management\r\nalerts
table.","sha":"dcf6e83aeaed3c45cbca24ae75a4acf37ad8468c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/182653","number":182653,"mergeCommit":{"message":"[Alert
table] Fix Triggered column timezone and format (#182653)\n\nPartially
implements #182650\r\n\r\n## Summary\r\n\r\nThis PR fixes START_TIME
timezone and format [similar to what we have in\r\nthe
stack\r\nmanagement](23d2ac9d-db2b-423c-82e2-be3753b0954c)|\r\n\r\nThere
are more questions to be answered in #182650, but for now, I've\r\nadded
this fix to have something consistent with the stack
management\r\nalerts
table.","sha":"dcf6e83aeaed3c45cbca24ae75a4acf37ad8468c"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
This commit is contained in:
Kibana Machine 2024-05-07 05:31:04 -04:00 committed by GitHub
parent eebedd434b
commit fe4c4954f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,6 +19,7 @@ import {
ALERT_EVALUATION_VALUES,
ALERT_RULE_NAME,
ALERT_RULE_CATEGORY,
ALERT_START,
} from '@kbn/rule-data-utils';
import { isEmpty } from 'lodash';
import type { TimelineNonEcsData } from '@kbn/timelines-plugin/common';
@ -95,6 +96,7 @@ export const getRenderCellValue = ({
}
return <AlertStatusIndicator alertStatus={value} />;
case TIMESTAMP:
case ALERT_START:
return <TimestampTooltip time={new Date(value ?? '').getTime()} timeUnit="milliseconds" />;
case ALERT_DURATION:
return asDuration(Number(value));