Skip to content

Commit

Permalink
missing url
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Apr 26, 2023
1 parent 7534cc7 commit c666ea6
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export const MonitorDetailsPanel = ({
return <EuiLoadingContent lines={8} />;
}

const url = latestPing?.url?.full ?? (monitor as unknown as MonitorFields)[ConfigKey.URLS];

return (
<PanelWithTitle
paddingSize="m"
Expand Down Expand Up @@ -95,13 +97,15 @@ export const MonitorDetailsPanel = ({
)}
<TitleLabel>{URL_LABEL}</TitleLabel>
<DescriptionLabel style={{ wordBreak: 'break-all' }}>
<EuiLink
data-test-subj="syntheticsMonitorDetailsPanelLink"
href={latestPing?.url?.full ?? (monitor as unknown as MonitorFields)[ConfigKey.URLS]}
external
>
{latestPing?.url?.full ?? (monitor as unknown as MonitorFields)[ConfigKey.URLS]}
</EuiLink>
{url ? (
<EuiLink data-test-subj="syntheticsMonitorDetailsPanelLink" href={url} external>
{url}
</EuiLink>
) : (
<EuiText color="subdued" size="s">
{UN_AVAILABLE_LABEL}
</EuiText>
)}
</DescriptionLabel>
<TitleLabel>{LAST_RUN_LABEL}</TitleLabel>
<DescriptionLabel>
Expand Down Expand Up @@ -260,3 +264,7 @@ const PROJECT_ID_LABEL = i18n.translate('xpack.synthetics.monitorList.projectIdH
const MONITOR_ID_ITEM_TEXT = i18n.translate('xpack.synthetics.monitorList.monitorIdItemText', {
defaultMessage: 'Monitor ID',
});

const UN_AVAILABLE_LABEL = i18n.translate('xpack.synthetics.monitorList.unAvailable', {
defaultMessage: '(unavailable)',
});

0 comments on commit c666ea6

Please sign in to comment.