From 59ff6c35ee5df2598b0161d050888ff05592fe2a Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:28:13 +0530 Subject: [PATCH] fix: limits tab in event types (#6545) Signed-off-by: Udit Takkar Signed-off-by: Udit Takkar --- .../components/eventtype/EventLimitsTab.tsx | 204 +++++++++--------- 1 file changed, 103 insertions(+), 101 deletions(-) diff --git a/apps/web/components/eventtype/EventLimitsTab.tsx b/apps/web/components/eventtype/EventLimitsTab.tsx index 07cb287871..033aa3a0c8 100644 --- a/apps/web/components/eventtype/EventLimitsTab.tsx +++ b/apps/web/components/eventtype/EventLimitsTab.tsx @@ -133,108 +133,110 @@ export const EventLimitsTab = ({ eventType }: Pick -
-
- - { - const beforeBufferOptions = [ - { - label: t("event_buffer_default"), - value: 0, - }, - ...[5, 10, 15, 20, 30, 45, 60, 90, 120].map((minutes) => ({ - label: minutes + " " + t("minutes"), - value: minutes, - })), - ]; - return ( - { + if (val) onChange(val.value); + }} + defaultValue={ + beforeBufferOptions.find((option) => option.value === value) || beforeBufferOptions[0] + } + options={beforeBufferOptions} + /> + ); + }} + /> +
+
+ + { + const afterBufferOptions = [ + { + label: t("event_buffer_default"), + value: 0, + }, + ...[5, 10, 15, 20, 30, 45, 60, 90, 120].map((minutes) => ({ + label: minutes + " " + t("minutes"), + value: minutes, + })), + ]; + return ( + { - if (val) onChange(val.value); - }} - defaultValue={ - afterBufferOptions.find((option) => option.value === value) || afterBufferOptions[0] - } - options={afterBufferOptions} - /> - ); - }} - /> -
-
-
-
- - -
-
- - { - const slotIntervalOptions = [ - { - label: t("slot_interval_default"), - value: -1, - }, - ...[5, 10, 15, 20, 30, 45, 60, 75, 90, 105, 120].map((minutes) => ({ - label: minutes + " " + t("minutes"), - value: minutes, - })), - ]; - return ( - { + formMethods.setValue("slotInterval", val && (val.value || 0) > 0 ? val.value : null); + }} + defaultValue={ + slotIntervalOptions.find((option) => option.value === eventType.slotInterval) || + slotIntervalOptions[0] + } + options={slotIntervalOptions} + /> + ); + }} + /> +