From a2dc4b719d72b67ddb2ad2c8e600e149c9b30a82 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Fri, 3 Jan 2025 13:46:25 -0500 Subject: [PATCH] ref(crons): Consistently import using relative imports (#82868) Small clean up to make it easier to tease this apart to move things around. Part of GH-82428 --- .../monitors/components/detailsSidebar.tsx | 2 +- .../monitors/components/monitorCheckIns.tsx | 4 +--- .../monitors/components/monitorHeader.tsx | 4 +--- .../monitors/components/monitorIssues.tsx | 4 +--- .../monitors/components/monitorStats.tsx | 2 +- .../views/monitors/components/onboarding.tsx | 4 +--- .../monitorProcessingErrors.spec.tsx | 2 +- .../monitorProcessingErrors.tsx | 2 +- static/app/views/monitors/details.tsx | 22 +++++++++---------- static/app/views/monitors/edit.tsx | 2 +- static/app/views/monitors/overview.tsx | 4 ++-- static/app/views/monitors/utils.tsx | 3 ++- 12 files changed, 24 insertions(+), 31 deletions(-) diff --git a/static/app/views/monitors/components/detailsSidebar.tsx b/static/app/views/monitors/components/detailsSidebar.tsx index 92f1e3b1f6a00e..f104123508b448 100644 --- a/static/app/views/monitors/components/detailsSidebar.tsx +++ b/static/app/views/monitors/components/detailsSidebar.tsx @@ -32,7 +32,7 @@ interface Props { showUnknownLegend?: boolean; } -export default function DetailsSidebar({monitorEnv, monitor, showUnknownLegend}: Props) { +export function DetailsSidebar({monitorEnv, monitor, showUnknownLegend}: Props) { const {checkin_margin, schedule, schedule_type, max_runtime, timezone} = monitor.config; const {onClick, label} = useCopyToClipboard({text: monitor.slug}); diff --git a/static/app/views/monitors/components/monitorCheckIns.tsx b/static/app/views/monitors/components/monitorCheckIns.tsx index 7f3573b83b2f0e..484491a6a3ba72 100644 --- a/static/app/views/monitors/components/monitorCheckIns.tsx +++ b/static/app/views/monitors/components/monitorCheckIns.tsx @@ -49,7 +49,7 @@ export const checkStatusToIndicatorStatus: Record< [CheckInStatus.UNKNOWN]: 'muted', }; -function MonitorCheckIns({monitor, monitorEnvs, orgSlug}: Props) { +export function MonitorCheckIns({monitor, monitorEnvs, orgSlug}: Props) { const user = useUser(); const location = useLocation(); const organization = useOrganization(); @@ -218,8 +218,6 @@ function MonitorCheckIns({monitor, monitorEnvs, orgSlug}: Props) { ); } -export default MonitorCheckIns; - const Status = styled('div')` line-height: 1.1; `; diff --git a/static/app/views/monitors/components/monitorHeader.tsx b/static/app/views/monitors/components/monitorHeader.tsx index 94115071e485f0..33f4af8e5fd36a 100644 --- a/static/app/views/monitors/components/monitorHeader.tsx +++ b/static/app/views/monitors/components/monitorHeader.tsx @@ -13,7 +13,7 @@ interface Props { orgSlug: string; } -function MonitorHeader({monitor, orgSlug, onUpdate}: Props) { +export function MonitorHeader({monitor, orgSlug, onUpdate}: Props) { const crumbs = [ { label: t('Crons'), @@ -45,5 +45,3 @@ function MonitorHeader({monitor, orgSlug, onUpdate}: Props) { ); } - -export default MonitorHeader; diff --git a/static/app/views/monitors/components/monitorIssues.tsx b/static/app/views/monitors/components/monitorIssues.tsx index 86c850f0ce95f0..9b1360a4538700 100644 --- a/static/app/views/monitors/components/monitorIssues.tsx +++ b/static/app/views/monitors/components/monitorIssues.tsx @@ -42,7 +42,7 @@ function MonitorIssuesEmptyMessage() { ); } -function MonitorIssues({orgSlug, monitor, monitorEnvs}: Props) { +export function MonitorIssues({orgSlug, monitor, monitorEnvs}: Props) { const {selection} = usePageFilters(); const {start, end, period} = selection.datetime; const timeProps = @@ -117,5 +117,3 @@ const ControlsWrapper = styled('div')` margin-bottom: ${space(1)}; flex-wrap: wrap; `; - -export default MonitorIssues; diff --git a/static/app/views/monitors/components/monitorStats.tsx b/static/app/views/monitors/components/monitorStats.tsx index e6278c573cadd1..9dbe941246e9c6 100644 --- a/static/app/views/monitors/components/monitorStats.tsx +++ b/static/app/views/monitors/components/monitorStats.tsx @@ -28,7 +28,7 @@ type Props = { orgSlug: string; }; -function MonitorStats({monitor, monitorEnvs, orgSlug}: Props) { +export function MonitorStats({monitor, monitorEnvs, orgSlug}: Props) { const {selection} = usePageFilters(); const {start, end, period} = selection.datetime; diff --git a/static/app/views/monitors/components/onboarding.tsx b/static/app/views/monitors/components/onboarding.tsx index 39c224e72c1465..17da8e3519226d 100644 --- a/static/app/views/monitors/components/onboarding.tsx +++ b/static/app/views/monitors/components/onboarding.tsx @@ -10,7 +10,7 @@ interface Props { monitor: Monitor; } -function MonitorOnboarding({monitor}: Props) { +export function MonitorOnboarding({monitor}: Props) { return (

{t('Instrument your monitor')}

@@ -28,5 +28,3 @@ function MonitorOnboarding({monitor}: Props) {
); } - -export default MonitorOnboarding; diff --git a/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.spec.tsx b/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.spec.tsx index ffe9c89ea6e7fe..2aa83a62b6eb73 100644 --- a/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.spec.tsx +++ b/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.spec.tsx @@ -8,7 +8,7 @@ import { userEvent, } from 'sentry-test/reactTestingLibrary'; -import MonitorProcessingErrors from 'sentry/views/monitors/components/processingErrors/monitorProcessingErrors'; +import {MonitorProcessingErrors} from 'sentry/views/monitors/components/processingErrors/monitorProcessingErrors'; describe('MonitorProcessingErrors', () => { it('should group errors by type', async () => { diff --git a/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.tsx b/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.tsx index 36b9212d2dc68f..406c33ec1fc973 100644 --- a/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.tsx +++ b/static/app/views/monitors/components/processingErrors/monitorProcessingErrors.tsx @@ -26,7 +26,7 @@ import type { import {ProcessingErrorItem} from './processingErrorItem'; import {ProcessingErrorTitle} from './processingErrorTitle'; -export default function MonitorProcessingErrors({ +export function MonitorProcessingErrors({ checkinErrors, children, onDismiss, diff --git a/static/app/views/monitors/details.tsx b/static/app/views/monitors/details.tsx index 350436d9c4cbf0..9234e99ee72b7c 100644 --- a/static/app/views/monitors/details.tsx +++ b/static/app/views/monitors/details.tsx @@ -20,20 +20,20 @@ import type {RouteComponentProps} from 'sentry/types/legacyReactRouter'; import {setApiQueryData, useApiQuery, useQueryClient} from 'sentry/utils/queryClient'; import useApi from 'sentry/utils/useApi'; import useOrganization from 'sentry/utils/useOrganization'; -import DetailsSidebar from 'sentry/views/monitors/components/detailsSidebar'; -import {DetailsTimeline} from 'sentry/views/monitors/components/detailsTimeline'; -import MonitorProcessingErrors from 'sentry/views/monitors/components/processingErrors/monitorProcessingErrors'; -import {makeMonitorErrorsQueryKey} from 'sentry/views/monitors/components/processingErrors/utils'; -import {makeMonitorDetailsQueryKey} from 'sentry/views/monitors/utils'; - -import MonitorCheckIns from './components/monitorCheckIns'; -import MonitorHeader from './components/monitorHeader'; -import MonitorIssues from './components/monitorIssues'; -import MonitorStats from './components/monitorStats'; -import MonitorOnboarding from './components/onboarding'; + +import {DetailsSidebar} from './components/detailsSidebar'; +import {DetailsTimeline} from './components/detailsTimeline'; +import {MonitorCheckIns} from './components/monitorCheckIns'; +import {MonitorHeader} from './components/monitorHeader'; +import {MonitorIssues} from './components/monitorIssues'; +import {MonitorStats} from './components/monitorStats'; +import {MonitorOnboarding} from './components/onboarding'; +import {MonitorProcessingErrors} from './components/processingErrors/monitorProcessingErrors'; +import {makeMonitorErrorsQueryKey} from './components/processingErrors/utils'; import {StatusToggleButton} from './components/statusToggleButton'; import type {MonitorBucket} from './components/timeline/types'; import type {CheckinProcessingError, Monitor, ProcessingErrorType} from './types'; +import {makeMonitorDetailsQueryKey} from './utils'; const DEFAULT_POLL_INTERVAL_MS = 5000; diff --git a/static/app/views/monitors/edit.tsx b/static/app/views/monitors/edit.tsx index b24302c40b96cb..2566163e7a714a 100644 --- a/static/app/views/monitors/edit.tsx +++ b/static/app/views/monitors/edit.tsx @@ -14,10 +14,10 @@ import normalizeUrl from 'sentry/utils/url/normalizeUrl'; import useOrganization from 'sentry/utils/useOrganization'; import usePageFilters from 'sentry/utils/usePageFilters'; import {useParams} from 'sentry/utils/useParams'; -import {makeMonitorDetailsQueryKey} from 'sentry/views/monitors/utils'; import MonitorForm from './components/monitorForm'; import type {Monitor} from './types'; +import {makeMonitorDetailsQueryKey} from './utils'; export default function EditMonitor() { const {monitorSlug, projectId} = useParams<{monitorSlug: string; projectId: string}>(); diff --git a/static/app/views/monitors/overview.tsx b/static/app/views/monitors/overview.tsx index 03f0dfb007a11e..7b52169509b50f 100644 --- a/static/app/views/monitors/overview.tsx +++ b/static/app/views/monitors/overview.tsx @@ -30,8 +30,6 @@ import useApi from 'sentry/utils/useApi'; import {useLocation} from 'sentry/utils/useLocation'; import {useNavigate} from 'sentry/utils/useNavigate'; import useOrganization from 'sentry/utils/useOrganization'; -import MonitorProcessingErrors from 'sentry/views/monitors/components/processingErrors/monitorProcessingErrors'; -import {makeMonitorListErrorsQueryKey} from 'sentry/views/monitors/components/processingErrors/utils'; import { CronsLandingPanel, @@ -41,6 +39,8 @@ import { import {NewMonitorButton} from './components/newMonitorButton'; import {OverviewTimeline} from './components/overviewTimeline'; import {OwnerFilter} from './components/ownerFilter'; +import {MonitorProcessingErrors} from './components/processingErrors/monitorProcessingErrors'; +import {makeMonitorListErrorsQueryKey} from './components/processingErrors/utils'; import type {CheckinProcessingError, Monitor, ProcessingErrorType} from './types'; import {makeMonitorListQueryKey} from './utils'; diff --git a/static/app/views/monitors/utils.tsx b/static/app/views/monitors/utils.tsx index 46f1c059fd621c..36bc20e5033f6b 100644 --- a/static/app/views/monitors/utils.tsx +++ b/static/app/views/monitors/utils.tsx @@ -4,7 +4,8 @@ import {t, tn} from 'sentry/locale'; import type {SelectValue} from 'sentry/types/core'; import type {Organization} from 'sentry/types/organization'; import type {ColorOrAlias} from 'sentry/utils/theme'; -import {CheckInStatus} from 'sentry/views/monitors/types'; + +import {CheckInStatus} from './types'; export function makeMonitorListQueryKey( organization: Organization,