Files
calendar/packages/features/ee/teams/components/RoundRobinResetInterval.tsx
T
6de715b884 feat: Round Robin timestamp basis (#21337)
* add rrTimeStampBasis to prisma schema

* add rr time stamp basis setting

* update migration

* add getLuckyUser logic

* add rrTimestampBasis to tests

* add load balancing warning message

* disable load balancing logic

* disable load balancing in event type settings

* add missing translations

* fix UI

* disable load balancing on all team event types

* don't show routing forms in router position

* use correct interval times

* fix variable naming

* fix event type update handler

* add test to booking.test.ts

* add test for getting interval times

* remove not needed prop

* fix label

* improve warning message

* fix removing maxLeadTreshold

* fix typo

* fix disabling maxLeadThreshold

* add back missing translation

* improve rr reset interval label

* fix rr_load_balancing_disabled text

* improve test

* fix description

* only use rrTimestampBasis in weights round robin

* fix dropdown width

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2025-06-12 11:37:38 +01:00

55 lines
1.3 KiB
TypeScript

"use client";
import { Controller } from "react-hook-form";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RRResetInterval } from "@calcom/prisma/enums";
import { Select } from "@calcom/ui/components/form";
const RoundRobinResetInterval = () => {
const { t } = useLocale();
const intervalOptions: {
value: RRResetInterval;
label: string;
}[] = [
{
value: RRResetInterval.MONTH,
label: t("monthly"),
},
{
value: RRResetInterval.DAY,
label: t("daily"),
},
];
return (
<Controller
name="rrResetInterval"
render={({ field: { value, onChange } }) => {
return (
<>
<div className="">
<h4 className="text-emphasis text-sm font-semibold leading-5">
{t("reset_interval_weighted_rr")}
</h4>
<p className="text-default text-sm">{t("rr_reset_interval_description")}</p>
<div className="mt-4 w-48">
<Select
options={intervalOptions}
value={intervalOptions.find((opt) => opt.value === value)}
onChange={(val) => {
onChange(val?.value);
}}
/>
</div>
</div>
</>
);
}}
/>
);
};
export default RoundRobinResetInterval;