|
@@ -5,6 +5,7 @@ import styled from '@emotion/styled';
|
|
|
import DatePageFilter from 'sentry/components/datePageFilter';
|
|
|
import * as Layout from 'sentry/components/layouts/thirds';
|
|
|
import LoadingIndicator from 'sentry/components/loadingIndicator';
|
|
|
+import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
|
|
|
import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
|
|
|
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
|
|
|
import {space} from 'sentry/styles/space';
|
|
@@ -58,7 +59,10 @@ function MonitorDetails({params, location}: Props) {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- const monitorEnv = monitor.environments.find(env => env.name === environment);
|
|
|
+ const hasLastCheckIn = monitor.environments.some(e => e.lastCheckIn);
|
|
|
+ const envsSortedByLastCheck = monitor.environments.sort((a, b) =>
|
|
|
+ a.lastCheckIn.localeCompare(b.lastCheckIn)
|
|
|
+ );
|
|
|
|
|
|
return (
|
|
|
<SentryDocumentTitle title={`Crons - ${monitor.name}`}>
|
|
@@ -66,36 +70,39 @@ function MonitorDetails({params, location}: Props) {
|
|
|
<MonitorHeader monitor={monitor} orgId={organization.slug} onUpdate={onUpdate} />
|
|
|
<Layout.Body>
|
|
|
<Layout.Main>
|
|
|
- {!monitorEnv?.lastCheckIn ? (
|
|
|
+ <StyledPageFilterBar condensed>
|
|
|
+ <DatePageFilter alignDropdown="left" />
|
|
|
+ <EnvironmentPageFilter />
|
|
|
+ </StyledPageFilterBar>
|
|
|
+ {!hasLastCheckIn ? (
|
|
|
<MonitorOnboarding orgId={organization.slug} monitor={monitor} />
|
|
|
) : (
|
|
|
<Fragment>
|
|
|
- <StyledPageFilterBar condensed>
|
|
|
- <DatePageFilter alignDropdown="left" />
|
|
|
- </StyledPageFilterBar>
|
|
|
-
|
|
|
<MonitorStats
|
|
|
orgId={organization.slug}
|
|
|
monitor={monitor}
|
|
|
- monitorEnv={monitorEnv}
|
|
|
+ monitorEnvs={monitor.environments}
|
|
|
/>
|
|
|
|
|
|
<MonitorIssues
|
|
|
orgId={organization.slug}
|
|
|
monitor={monitor}
|
|
|
- monitorEnv={monitorEnv}
|
|
|
+ monitorEnvs={monitor.environments}
|
|
|
/>
|
|
|
|
|
|
<MonitorCheckIns
|
|
|
orgId={organization.slug}
|
|
|
monitor={monitor}
|
|
|
- monitorEnv={monitorEnv}
|
|
|
+ monitorEnvs={monitor.environments}
|
|
|
/>
|
|
|
</Fragment>
|
|
|
)}
|
|
|
</Layout.Main>
|
|
|
<Layout.Side>
|
|
|
- <DetailsSidebar monitorEnv={monitorEnv} monitor={monitor} />
|
|
|
+ <DetailsSidebar
|
|
|
+ monitorEnv={envsSortedByLastCheck[envsSortedByLastCheck.length - 1]}
|
|
|
+ monitor={monitor}
|
|
|
+ />
|
|
|
</Layout.Side>
|
|
|
</Layout.Body>
|
|
|
</Layout.Page>
|