feat: add toggle to opt out of booking title translation in instant meetings (#25547)
* feat: add toggle to opt out of booking title translation in instant meetings Co-Authored-By: [email protected] <[email protected]> * fix: add autoTranslateTitleEnabled to test builder Co-Authored-By: [email protected] <[email protected]> * fix: respect autoTranslateTitleEnabled toggle in InstantBookingCreateService Co-Authored-By: [email protected] <[email protected]> * fix: fetch autoTranslateTitleEnabled directly in InstantBookingCreateService Co-Authored-By: [email protected] <[email protected]> * refactor: rename autoTranslateTitleEnabled to autoTranslateInstantMeetingTitleEnabled - Renamed field to clarify it only applies to instant meeting title translation - Moved Prisma query to EventTypeRepository.findInstantMeetingConfigById() - Removed title translation logic from update.handler.ts (flag only controls instant meeting title) - Updated all references across the codebase - Added new i18n translation keys for the renamed field Co-Authored-By: [email protected] <[email protected]> * fix: add autoTranslateInstantMeetingTitleEnabled to test destructuring patterns Co-Authored-By: [email protected] <[email protected]> * fix: use Prisma.TeamCreateInput type for metadata in test helper Co-Authored-By: [email protected] <[email protected]> * fix: add autoTranslateInstantMeetingTitleEnabled to mockUpdatedEventType in test Co-Authored-By: [email protected] <[email protected]> * refactor: use generic findByIdMinimal instead of business-specific method - Add autoTranslateInstantMeetingTitleEnabled to eventTypeSelect constant - Remove findInstantMeetingConfigById from EventTypeRepository - Update InstantBookingCreateService to use findByIdMinimal Co-Authored-By: [email protected] <[email protected]> * refactor: remove autoTranslateInstantMeetingTitleEnabled from eventTypeSelect (not needed for findByIdMinimal) Co-Authored-By: [email protected] <[email protected]> * feat: add autoTranslateInstantMeetingTitleEnabled to event type form defaults - Rename shouldTranslateTitle to shouldAutoTranslateInstantMeetingTitle for clarity - Add autoTranslateInstantMeetingTitleEnabled to findById and findByIdForOrgAdmin selects - Add autoTranslateInstantMeetingTitleEnabled to useEventTypeForm defaultValues Co-Authored-By: [email protected] <[email protected]> * fix: only update autoTranslateInstantMeetingTitleEnabled when explicitly provided Fixes issue where omitting the field in update requests would overwrite the saved opt-out setting with the default value (true). Now the field is only included in the update payload when explicitly provided. Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
14 files changed
+57
-17
No files matched your search
@@ -245,6 +245,21 @@ export default function InstantEventController({
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
<Controller
|
||||
name="autoTranslateInstantMeetingTitleEnabled"
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<SettingsToggle
|
||||
labelClassName="text-sm"
|
||||
title={t("auto_translate_instant_meeting_title")}
|
||||
checked={value}
|
||||
onCheckedChange={(e) => onChange(e)}
|
||||
data-testid="auto-translate-instant-meeting-title-toggle"
|
||||
toggleSwitchAtTheEnd={true}
|
||||
switchContainerClassName="border-subtle rounded-lg border py-6 px-4 sm:px-6 mt-4"
|
||||
description={t("auto_translate_instant_meeting_title_description")}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<InstantMeetingWebhooks eventType={eventType} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -145,6 +145,7 @@ const commons = {
|
||||
requiresConfirmationWillBlockSlot: false,
|
||||
canSendCalVideoTranscriptionEmails: false,
|
||||
instantMeetingExpiryTimeOffsetInSeconds: 0,
|
||||
autoTranslateInstantMeetingTitleEnabled: true,
|
||||
instantMeetingScheduleId: null,
|
||||
instantMeetingParameters: [],
|
||||
eventTypeColor: null,
|
||||
|
||||
@@ -135,6 +135,7 @@ export type FormValues = {
|
||||
seatsShowAvailabilityCount: boolean | null;
|
||||
seatsPerTimeSlotEnabled: boolean;
|
||||
autoTranslateDescriptionEnabled: boolean;
|
||||
autoTranslateInstantMeetingTitleEnabled: boolean;
|
||||
fieldTranslations: EventTypeTranslation[];
|
||||
scheduleName: string;
|
||||
minimumBookingNotice: number;
|
||||
|
||||
@@ -570,6 +570,7 @@ export class EventTypeRepository {
|
||||
requiresConfirmationWillBlockSlot: true,
|
||||
requiresBookerEmailVerification: true,
|
||||
autoTranslateDescriptionEnabled: true,
|
||||
autoTranslateInstantMeetingTitleEnabled: true,
|
||||
fieldTranslations: {
|
||||
select: {
|
||||
translatedText: true,
|
||||
@@ -868,6 +869,7 @@ export class EventTypeRepository {
|
||||
requiresConfirmationWillBlockSlot: true,
|
||||
requiresBookerEmailVerification: true,
|
||||
autoTranslateDescriptionEnabled: true,
|
||||
autoTranslateInstantMeetingTitleEnabled: true,
|
||||
fieldTranslations: {
|
||||
select: {
|
||||
translatedText: true,
|
||||
|
||||
Reference in new issue
Block a user