terrier-engine 4.34.0 → 4.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data-dive/dives/dive-delivery.ts +13 -6
- package/data-dive/dives/dive-editor.ts +11 -3
- package/data-dive/dives/dive-runs.ts +14 -15
- package/data-dive/gen/models.ts +4 -2
- package/data-dive/plots/dive-plot-axes.ts +85 -10
- package/data-dive/plots/dive-plot-editor.ts +54 -11
- package/data-dive/plots/dive-plot-layouts.ts +49 -0
- package/data-dive/plots/dive-plot-list.ts +19 -5
- package/data-dive/plots/dive-plot-render-part.ts +68 -1
- package/data-dive/plots/dive-plot-styles.ts +194 -0
- package/data-dive/plots/dive-plot-traces.ts +77 -51
- package/data-dive/plots/dive-plots.ts +11 -14
- package/data-dive/queries/columns.ts +33 -24
- package/data-dive/queries/filters.ts +144 -118
- package/data-dive/queries/tables.ts +1 -1
- package/package.json +2 -2
- package/terrier/forms.ts +1 -22
- package/terrier/ids.ts +13 -1
- package/terrier/schedules.ts +43 -48
package/terrier/schedules.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import TerrierFormPart from "./parts/terrier-form-part"
|
|
2
1
|
import {PartTag} from "tuff-core/parts"
|
|
3
2
|
import * as inflection from "inflection"
|
|
4
3
|
import Messages from "tuff-core/messages"
|
|
5
4
|
import {Logger} from "tuff-core/logging"
|
|
6
5
|
import dayjs from "dayjs"
|
|
6
|
+
import {TerrierFormFields} from "./forms"
|
|
7
7
|
|
|
8
8
|
const log = new Logger("Schedules")
|
|
9
9
|
|
|
@@ -81,65 +81,59 @@ export type CombinedRegularSchedule = {
|
|
|
81
81
|
// Form
|
|
82
82
|
////////////////////////////////////////////////////////////////////////////////
|
|
83
83
|
|
|
84
|
-
export class
|
|
84
|
+
export class RegularScheduleFields extends TerrierFormFields<CombinedRegularSchedule> {
|
|
85
85
|
|
|
86
86
|
scheduleTypeChangeKey = Messages.typedKey<{schedule_type: ScheduleType}>()
|
|
87
87
|
|
|
88
|
-
async init() {
|
|
89
|
-
this.onChange(this.scheduleTypeChangeKey, m => {
|
|
90
|
-
log.info(`Schedule type changed to ${m.data.schedule_type}`)
|
|
91
|
-
this.dirty()
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
|
|
95
88
|
get parentClasses(): Array<string> {
|
|
96
89
|
return ['tt-flex', 'column', 'gap', 'regular-schedule-form', 'tt-form']
|
|
97
90
|
}
|
|
98
91
|
|
|
99
|
-
|
|
100
92
|
render(parent: PartTag): any {
|
|
101
|
-
parent.
|
|
102
|
-
|
|
103
|
-
.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
parent.label('.caption-size', label => {
|
|
108
|
-
this.radio(label, 'schedule_type', 'daily')
|
|
109
|
-
.emitChange(this.scheduleTypeChangeKey, {schedule_type: 'daily'})
|
|
110
|
-
label.span().text("Deliver Daily")
|
|
111
|
-
})
|
|
112
|
-
if (this.state.schedule_type == 'daily') {
|
|
113
|
-
parent.div('.schedule-type-fields.daily.tt-flex.gap', row => {
|
|
114
|
-
this.select(row, 'hour_of_day', HourOfDayOptions)
|
|
93
|
+
parent.div('.tt-flex.column.gap.regular-schedule-form.tt-form', col => {
|
|
94
|
+
col.label('.caption-size', label => {
|
|
95
|
+
this.radio(label, 'schedule_type', 'none')
|
|
96
|
+
.emitChange(this.scheduleTypeChangeKey, {schedule_type: 'none'})
|
|
97
|
+
label.span().text("Do Not Deliver")
|
|
115
98
|
})
|
|
116
|
-
}
|
|
117
99
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
})
|
|
123
|
-
if (this.state.schedule_type == 'weekly') {
|
|
124
|
-
parent.div('.schedule-type-fields.weekly.tt-flex.gap', row => {
|
|
125
|
-
this.select(row, 'day_of_week', DayOfWeekOptions)
|
|
126
|
-
.data({tooltip: "Day of the week"})
|
|
127
|
-
this.select(row, 'hour_of_day', HourOfDayOptions)
|
|
100
|
+
col.label('.caption-size', label => {
|
|
101
|
+
this.radio(label, 'schedule_type', 'daily')
|
|
102
|
+
.emitChange(this.scheduleTypeChangeKey, {schedule_type: 'daily'})
|
|
103
|
+
label.span().text("Deliver Daily")
|
|
128
104
|
})
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
.data({tooltip: "Day of the month"})
|
|
140
|
-
this.select(row, 'hour_of_day', HourOfDayOptions)
|
|
105
|
+
if (this.data.schedule_type == 'daily') {
|
|
106
|
+
col.div('.schedule-type-fields.daily.tt-flex.gap', row => {
|
|
107
|
+
this.select(row, 'hour_of_day', HourOfDayOptions)
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
col.label('.caption-size', label => {
|
|
112
|
+
this.radio(label, 'schedule_type', 'weekly')
|
|
113
|
+
.emitChange(this.scheduleTypeChangeKey, {schedule_type: 'weekly'})
|
|
114
|
+
label.span().text("Deliver Weekly")
|
|
141
115
|
})
|
|
142
|
-
|
|
116
|
+
if (this.data.schedule_type == 'weekly') {
|
|
117
|
+
col.div('.schedule-type-fields.weekly.tt-flex.gap', row => {
|
|
118
|
+
this.select(row, 'day_of_week', DayOfWeekOptions)
|
|
119
|
+
.data({tooltip: "Day of the week"})
|
|
120
|
+
this.select(row, 'hour_of_day', HourOfDayOptions)
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
col.label('.caption-size', label => {
|
|
125
|
+
this.radio(label, 'schedule_type', 'monthly')
|
|
126
|
+
.emitChange(this.scheduleTypeChangeKey, {schedule_type: 'monthly'})
|
|
127
|
+
label.span().text("Deliver Monthly")
|
|
128
|
+
})
|
|
129
|
+
if (this.data.schedule_type == 'monthly') {
|
|
130
|
+
col.div('.schedule-type-fields.monthly.tt-flex.gap', row => {
|
|
131
|
+
this.select(row, 'day_of_month', DayOfMonthOptions)
|
|
132
|
+
.data({tooltip: "Day of the month"})
|
|
133
|
+
this.select(row, 'hour_of_day', HourOfDayOptions)
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
})
|
|
143
137
|
}
|
|
144
138
|
|
|
145
139
|
|
|
@@ -150,6 +144,7 @@ export class RegularScheduleForm extends TerrierFormPart<CombinedRegularSchedule
|
|
|
150
144
|
const raw = await this.serialize()
|
|
151
145
|
const schedule_type = raw.schedule_type
|
|
152
146
|
const hour_of_day = raw.hour_of_day || '0'
|
|
147
|
+
log.info(`Serializing schedule type ${schedule_type}`, raw)
|
|
153
148
|
switch (schedule_type) {
|
|
154
149
|
case 'none':
|
|
155
150
|
return {schedule_type}
|