Skip to content

Commit bc4a9b4

Browse files
fix(crons): Support timezone in MockTimelineVisualization (#68477)
The visualization will now provide the timezone to the sample schedule data endpoint. Refs GH-68473
1 parent 6cb0089 commit bc4a9b4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

static/app/views/monitors/components/mockTimelineVisualization.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface ScheduleConfig {
2121
intervalFrequency?: FieldValue;
2222
intervalUnit?: FieldValue;
2323
scheduleType?: FieldValue;
24+
timezone?: FieldValue;
2425
}
2526

2627
const NUM_SAMPLE_TICKS = 9;
@@ -38,13 +39,16 @@ interface Props {
3839
}
3940

4041
export function MockTimelineVisualization({schedule}: Props) {
41-
const {scheduleType, cronSchedule, intervalFrequency, intervalUnit} = schedule;
42+
const {scheduleType, cronSchedule, timezone, intervalFrequency, intervalUnit} =
43+
schedule;
44+
4245
const organization = useOrganization();
4346
const {form} = useContext(FormContext);
4447

4548
const query = {
4649
num_ticks: NUM_SAMPLE_TICKS,
4750
schedule_type: scheduleType,
51+
timezone,
4852
schedule:
4953
scheduleType === 'interval' ? [intervalFrequency, intervalUnit] : cronSchedule,
5054
};

static/app/views/monitors/components/monitorCreateForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ export default function MonitorCreateForm() {
204204
{() => {
205205
const scheduleType = form.current.getValue('config.scheduleType');
206206
const cronSchedule = form.current.getValue('config.schedule');
207+
const timezone = form.current.getValue('config.timezone');
207208
const intervalFrequency = form.current.getValue('config.schedule.frequency');
208209
const intervalUnit = form.current.getValue('config.schedule.interval');
209210

210211
const schedule = {
211212
scheduleType,
213+
timezone,
212214
cronSchedule,
213215
intervalFrequency,
214216
intervalUnit,

0 commit comments

Comments
 (0)