mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Make interval in rrule config required (#220003)
Fixes the optional interval settings in the rrule schema
This commit is contained in:
parent
59aa8f2f93
commit
c51c0ce212
1 changed files with 17 additions and 21 deletions
|
@ -37,27 +37,23 @@ const validateRecurrenceByWeekday = (array: string[]) => {
|
|||
};
|
||||
|
||||
const rruleCommon = schema.object({
|
||||
freq: schema.maybe(
|
||||
schema.oneOf([
|
||||
schema.literal(0),
|
||||
schema.literal(1),
|
||||
schema.literal(2),
|
||||
schema.literal(3),
|
||||
schema.literal(4),
|
||||
schema.literal(5),
|
||||
schema.literal(6),
|
||||
])
|
||||
),
|
||||
interval: schema.maybe(
|
||||
schema.number({
|
||||
validate: (interval: number) => {
|
||||
if (!Number.isInteger(interval)) {
|
||||
return 'rRule interval must be an integer greater than 0';
|
||||
}
|
||||
},
|
||||
min: 1,
|
||||
})
|
||||
),
|
||||
freq: schema.oneOf([
|
||||
schema.literal(0),
|
||||
schema.literal(1),
|
||||
schema.literal(2),
|
||||
schema.literal(3),
|
||||
schema.literal(4),
|
||||
schema.literal(5),
|
||||
schema.literal(6),
|
||||
]),
|
||||
interval: schema.number({
|
||||
validate: (interval: number) => {
|
||||
if (!Number.isInteger(interval)) {
|
||||
return 'rRule interval must be an integer greater than 0';
|
||||
}
|
||||
},
|
||||
min: 1,
|
||||
}),
|
||||
tzid: schema.string({ validate: validateTimezone, defaultValue: 'UTC' }),
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue