[Synthetics UI] Prefer custom_heartbeat_id to monitor.id for Uptime detail link when present (#143128) (#143707)

* Prefer `custom_heartbeat_id` to `monitor.id` when present.

* Prefer `ConfigKey`.

(cherry picked from commit c25eedc402)

Co-authored-by: Justin Kambic <jk@elastic.co>
This commit is contained in:
Kibana Machine 2022-10-19 16:45:50 -06:00 committed by GitHub
parent 8a9da5065d
commit 8a9a635d73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,6 +118,7 @@ export const LastTenTestRuns = () => {
},
];
const historyIdParam = monitor?.[ConfigKey.CUSTOM_HEARTBEAT_ID] ?? monitor?.[ConfigKey.ID];
return (
<EuiPanel css={{ minHeight: 200 }}>
<EuiFlexGroup alignItems="center" gutterSize="s">
@ -133,7 +134,8 @@ export const LastTenTestRuns = () => {
iconType="list"
iconSide="left"
data-test-subj="monitorSummaryViewLastTestRun"
href={`${basePath}/app/uptime/monitor/${btoa(monitor?.id ?? '')}`}
disabled={!historyIdParam}
href={`${basePath}/app/uptime/monitor/${btoa(historyIdParam ?? '')}`}
>
{i18n.translate('xpack.synthetics.monitorDetails.summary.viewHistory', {
defaultMessage: 'View History',