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 (#143128)

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

* Prefer `ConfigKey`.
  • Loading branch information
justinkambic authored Oct 19, 2022
1 parent 1994a16 commit c25eedc
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 hasShadow={false} hasBorder 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 c25eedc

Please sign in to comment.