feat: support multiple synthetic ids

Signed-off-by: Isaiah Thiessen <isaiah.thiessen@telus.com>
This commit is contained in:
Isaiah Thiessen
2022-07-21 15:22:15 -07:00
parent 14f7461381
commit 71b7a4c822
2 changed files with 15 additions and 11 deletions
@@ -56,16 +56,19 @@ export const DynatraceTab = () => {
dynatraceBaseUrl={dynatraceBaseUrl}
/>
</Grid>
{syntheticsIds ? (
<Grid item xs={12} lg={12}>
<SyntheticsCard
syntheticsId={syntheticsIds}
dynatraceBaseUrl={dynatraceBaseUrl}
/>
</Grid>
) : (
<></>
)}
{syntheticsIds
.replace(' ', '')
.split(',')
.map(id => {
return (
<Grid item xs={12} lg={12}>
<SyntheticsCard
syntheticsId={id}
dynatraceBaseUrl={dynatraceBaseUrl}
/>
</Grid>
);
})}
</Grid>
</Content>
</Page>
@@ -56,6 +56,7 @@ export const SyntheticsCard = (props: SyntheticsCardProps) => {
const deepLinkPrefix = dynatraceMonitorPrefixes(
`${syntheticsId.match(/(.+)-/)![1]}`,
);
const lastFailed = value?.locationsExecutionResults.map(l => {
return {
timestamp: l.requestResults[0].startTimestamp,
@@ -68,7 +69,7 @@ export const SyntheticsCard = (props: SyntheticsCardProps) => {
title="Synthetics"
subheader={`Recent Activity for Monitor ${syntheticsId}`}
deepLink={{
title: 'View Synthetics in Dynatrace',
title: 'View this Synthetic in Dynatrace',
link: `${dynatraceBaseUrl}/${deepLinkPrefix}/${syntheticsId}`,
}}
>