Browse Source

ref(crons): Rename TimeWindow{Options -> Config} (#67796)

Evan Purkhiser 11 months ago
parent
commit
5a9b95e111

+ 2 - 2
static/app/views/monitors/components/overviewTimeline/checkInTimeline.tsx

@@ -9,12 +9,12 @@ import {getAggregateStatus} from 'sentry/views/monitors/utils/getAggregateStatus
 import {mergeBuckets} from 'sentry/views/monitors/utils/mergeBuckets';
 
 import {JobTickTooltip} from './jobTickTooltip';
-import type {MonitorBucketData, TimeWindowOptions} from './types';
+import type {MonitorBucketData, TimeWindowConfig} from './types';
 
 interface TimelineProps {
   end: Date;
   start: Date;
-  timeWindowConfig: TimeWindowOptions;
+  timeWindowConfig: TimeWindowConfig;
   width: number;
 }
 

+ 3 - 3
static/app/views/monitors/components/overviewTimeline/gridLines.tsx

@@ -4,14 +4,14 @@ import moment from 'moment';
 
 import DateTime from 'sentry/components/dateTime';
 import {space} from 'sentry/styles/space';
-import type {TimeWindowOptions} from 'sentry/views/monitors/components/overviewTimeline/types';
+import type {TimeWindowConfig} from 'sentry/views/monitors/components/overviewTimeline/types';
 
 import {useTimelineCursor} from './timelineCursor';
 
 interface Props {
   end: Date;
   start: Date;
-  timeWindowConfig: TimeWindowOptions;
+  timeWindowConfig: TimeWindowConfig;
   width: number;
   className?: string;
   showCursor?: boolean;
@@ -40,7 +40,7 @@ interface TimeMarker {
 function getTimeMarkersFromConfig(
   start: Date,
   end: Date,
-  config: TimeWindowOptions,
+  config: TimeWindowConfig,
   width: number
 ) {
   const {elapsedMinutes, timeMarkerInterval} = config;

+ 2 - 2
static/app/views/monitors/components/overviewTimeline/jobTickTooltip.spec.tsx

@@ -2,7 +2,7 @@ import {render, screen, within} from 'sentry-test/reactTestingLibrary';
 
 import {getFormat} from 'sentry/utils/dates';
 import {JobTickTooltip} from 'sentry/views/monitors/components/overviewTimeline/jobTickTooltip';
-import type {TimeWindowOptions} from 'sentry/views/monitors/components/overviewTimeline/types';
+import type {TimeWindowConfig} from 'sentry/views/monitors/components/overviewTimeline/types';
 
 type StatusCounts = [
   in_progress: number,
@@ -19,7 +19,7 @@ export function generateEnvMapping(name: string, counts: StatusCounts) {
   };
 }
 
-const tickConfig: TimeWindowOptions = {
+const tickConfig: TimeWindowConfig = {
   dateLabelFormat: getFormat({timeOnly: true, seconds: true}),
   elapsedMinutes: 60,
   timeMarkerInterval: 10,

+ 2 - 2
static/app/views/monitors/components/overviewTimeline/jobTickTooltip.tsx

@@ -9,14 +9,14 @@ import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
 import type {
   JobTickData,
-  TimeWindowOptions,
+  TimeWindowConfig,
 } from 'sentry/views/monitors/components/overviewTimeline/types';
 import type {CheckInStatus} from 'sentry/views/monitors/types';
 import {statusToText, tickStyle} from 'sentry/views/monitors/utils';
 
 interface Props extends Omit<TooltipProps, 'title'> {
   jobTick: JobTickData;
-  timeWindowConfig: TimeWindowOptions;
+  timeWindowConfig: TimeWindowConfig;
 }
 
 export function JobTickTooltip({jobTick, timeWindowConfig, children, ...props}: Props) {

+ 1 - 1
static/app/views/monitors/components/overviewTimeline/types.tsx

@@ -2,7 +2,7 @@ import type {CheckInStatus} from 'sentry/views/monitors/types';
 
 export type TimeWindow = '1h' | '24h' | '7d' | '30d';
 
-export interface TimeWindowOptions {
+export interface TimeWindowConfig {
   /**
    * The time format used for the cursor label and job tick tooltip
    */

+ 2 - 2
static/app/views/monitors/components/overviewTimeline/utils.tsx

@@ -2,7 +2,7 @@ import moment from 'moment';
 
 import {getFormat} from 'sentry/utils/dates';
 
-import type {TimeWindow, TimeWindowOptions} from './types';
+import type {TimeWindow, TimeWindowConfig} from './types';
 
 // Stores the elapsed minutes for each selectable resolution
 export const resolutionElapsedMinutes: Record<TimeWindow, number> = {
@@ -25,7 +25,7 @@ export function getConfigFromTimeRange(
   start: Date,
   end: Date,
   timelineWidth: number
-): TimeWindowOptions {
+): TimeWindowConfig {
   // Acceptable intervals between time labels, in minutes
   const minuteRanges = [1, 10, 30, 60, 4 * 60, 8 * 60, 12 * 60];
   const startEndMinutes = (end.getTime() - start.getTime()) / (1000 * 60);