Skip to content

Commit

Permalink
[Synthetics UI] Prefer custom_heartbeat_id to monitor.id for Upti…
Browse files Browse the repository at this point in the history
…me detail link when present (elastic#143128)

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

* Prefer `ConfigKey`.

(cherry picked from commit c25eedc)
  • Loading branch information
justinkambic committed Oct 19, 2022
1 parent 8a9da50 commit fd5c83c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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',
Expand Down

0 comments on commit fd5c83c

Please sign in to comment.