Skip to content

Commit

Permalink
ref(crons): Consistently import using relative imports (#82868)
Browse files Browse the repository at this point in the history
Small clean up to make it easier to tease this apart to move things
around.

Part of GH-82428
  • Loading branch information
evanpurkhiser authored Jan 3, 2025
1 parent 268b95a commit a2dc4b7
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 31 deletions.
2 changes: 1 addition & 1 deletion static/app/views/monitors/components/detailsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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});

Expand Down
4 changes: 1 addition & 3 deletions static/app/views/monitors/components/monitorCheckIns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -218,8 +218,6 @@ function MonitorCheckIns({monitor, monitorEnvs, orgSlug}: Props) {
);
}

export default MonitorCheckIns;

const Status = styled('div')`
line-height: 1.1;
`;
Expand Down
4 changes: 1 addition & 3 deletions static/app/views/monitors/components/monitorHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -45,5 +45,3 @@ function MonitorHeader({monitor, orgSlug, onUpdate}: Props) {
</Layout.Header>
);
}

export default MonitorHeader;
4 changes: 1 addition & 3 deletions static/app/views/monitors/components/monitorIssues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -117,5 +117,3 @@ const ControlsWrapper = styled('div')`
margin-bottom: ${space(1)};
flex-wrap: wrap;
`;

export default MonitorIssues;
2 changes: 1 addition & 1 deletion static/app/views/monitors/components/monitorStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions static/app/views/monitors/components/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Props {
monitor: Monitor;
}

function MonitorOnboarding({monitor}: Props) {
export function MonitorOnboarding({monitor}: Props) {
return (
<OnboardingPanel noCenter>
<h3>{t('Instrument your monitor')}</h3>
Expand All @@ -28,5 +28,3 @@ function MonitorOnboarding({monitor}: Props) {
</OnboardingPanel>
);
}

export default MonitorOnboarding;
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type {
import {ProcessingErrorItem} from './processingErrorItem';
import {ProcessingErrorTitle} from './processingErrorTitle';

export default function MonitorProcessingErrors({
export function MonitorProcessingErrors({
checkinErrors,
children,
onDismiss,
Expand Down
22 changes: 11 additions & 11 deletions static/app/views/monitors/details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion static/app/views/monitors/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>();
Expand Down
4 changes: 2 additions & 2 deletions static/app/views/monitors/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';

Expand Down
3 changes: 2 additions & 1 deletion static/app/views/monitors/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a2dc4b7

Please sign in to comment.