From 47716f6e5ddee952609d2fa0ffabdfa865286796 Mon Sep 17 00:00:00 2001 From: Igor Monadical Date: Fri, 19 Sep 2025 15:14:40 -0400 Subject: [PATCH] feat: room form edit with enter (#662) * room form edit with enter * mobile form enter do nothing * restore overwritten older change --------- Co-authored-by: Igor Loskutov --- www/app/(app)/rooms/page.tsx | 799 ++++++++++++++++++----------------- 1 file changed, 406 insertions(+), 393 deletions(-) diff --git a/www/app/(app)/rooms/page.tsx b/www/app/(app)/rooms/page.tsx index 9de5950a..723d698a 100644 --- a/www/app/(app)/rooms/page.tsx +++ b/www/app/(app)/rooms/page.tsx @@ -309,7 +309,7 @@ export default function RoomsList() { setRoomInput(null); setIsEditing(false); - setEditRoomId(""); + setEditRoomId(null); setNameError(""); refetch(); onClose(); @@ -449,415 +449,428 @@ export default function RoomsList() { - - - General - Calendar - Share - WebHook - +
{ + e.preventDefault(); + handleSaveRoom(); + }} + > + + + General + Calendar + Share + WebHook + - - - Room name - - - No spaces or special characters allowed - - {nameError && ( - {nameError} - )} - + + + Room name + + + No spaces or special characters allowed + + {nameError && ( + {nameError} + )} + - - { - const syntheticEvent = { - target: { - name: "isLocked", - type: "checkbox", - checked: e.checked, - }, - }; - handleRoomChange(syntheticEvent); - }} - > - - - - - Locked room - - + + { + const syntheticEvent = { + target: { + name: "isLocked", + type: "checkbox", + checked: e.checked, + }, + }; + handleRoomChange(syntheticEvent); + }} + > + + + + + Locked room + + + + Room size + + setRoomInput({ ...room, roomMode: e.value[0] }) + } + collection={roomModeCollection} + > + + + + + + + + + + + + {roomModeOptions.map((option) => ( + + {option.label} + + + ))} + + + + + + Recording type + + setRoomInput({ + ...room, + recordingType: e.value[0], + recordingTrigger: + e.value[0] !== "cloud" + ? "none" + : room.recordingTrigger, + }) + } + collection={recordingTypeCollection} + > + + + + + + + + + + + + {recordingTypeOptions.map((option) => ( + + {option.label} + + + ))} + + + + + + Cloud recording start trigger + + setRoomInput({ + ...room, + recordingTrigger: e.value[0], + }) + } + collection={recordingTriggerCollection} + disabled={room.recordingType !== "cloud"} + > + + + + + + + + + + + + {recordingTriggerOptions.map((option) => ( + + {option.label} + + + ))} + + + + - - Room size - - setRoomInput({ ...room, roomMode: e.value[0] }) - } - collection={roomModeCollection} - > - - - - - - - - - - - - {roomModeOptions.map((option) => ( - - {option.label} - - - ))} - - - - + + { + const syntheticEvent = { + target: { + name: "isShared", + type: "checkbox", + checked: e.checked, + }, + }; + handleRoomChange(syntheticEvent); + }} + > + + + + + Shared room + + + - - Recording type - - setRoomInput({ - ...room, - recordingType: e.value[0], - recordingTrigger: - e.value[0] !== "cloud" - ? "none" - : room.recordingTrigger, - }) - } - collection={recordingTypeCollection} - > - - - - - - - - - - - - {recordingTypeOptions.map((option) => ( - - {option.label} - - - ))} - - - - + + + { + const syntheticEvent = { + target: { + name: "zulipAutoPost", + type: "checkbox", + checked: e.checked, + }, + }; + handleRoomChange(syntheticEvent); + }} + > + + + + + + Automatically post transcription to Zulip + + + + + Zulip stream + + setRoomInput({ + ...room, + zulipStream: e.value[0], + zulipTopic: "", + }) + } + collection={streamCollection} + disabled={!room.zulipAutoPost} + > + + + + + + + + + + + + {streamOptions.map((option) => ( + + {option.label} + + + ))} + + + + + + Zulip topic + + setRoomInput({ ...room, zulipTopic: e.value[0] }) + } + collection={topicCollection} + disabled={!room.zulipAutoPost} + > + + + + + + + + + + + + {topicOptions.map((option) => ( + + {option.label} + + + ))} + + + + + - - Cloud recording start trigger - - setRoomInput({ ...room, recordingTrigger: e.value[0] }) - } - collection={recordingTriggerCollection} - disabled={room.recordingType !== "cloud"} - > - - - - - - - - - - - - {recordingTriggerOptions.map((option) => ( - - {option.label} - - - ))} - - - - + + + Webhook URL + + + Optional: URL to receive notifications when transcripts + are ready + + - - { - const syntheticEvent = { - target: { - name: "isShared", - type: "checkbox", - checked: e.checked, - }, - }; - handleRoomChange(syntheticEvent); - }} - > - - - - - Shared room - - - - - - { - setRoomInput({ - ...room, - icsUrl: - settings.ics_url !== undefined - ? settings.ics_url - : room.icsUrl, - icsEnabled: - settings.ics_enabled !== undefined - ? settings.ics_enabled - : room.icsEnabled, - icsFetchInterval: - settings.ics_fetch_interval !== undefined - ? settings.ics_fetch_interval - : room.icsFetchInterval, - }); - }} - isOwner={true} - isEditing={isEditing} - /> - - - - - { - const syntheticEvent = { - target: { - name: "zulipAutoPost", - type: "checkbox", - checked: e.checked, - }, - }; - handleRoomChange(syntheticEvent); - }} - > - - - - - - Automatically post transcription to Zulip - - - - - - Zulip stream - - setRoomInput({ - ...room, - zulipStream: e.value[0], - zulipTopic: "", - }) - } - collection={streamCollection} - disabled={!room.zulipAutoPost} - > - - - - - - - - - - - - {streamOptions.map((option) => ( - - {option.label} - - - ))} - - - - - - - Zulip topic - - setRoomInput({ ...room, zulipTopic: e.value[0] }) - } - collection={topicCollection} - disabled={!room.zulipAutoPost} - > - - - - - - - - - - - - {topicOptions.map((option) => ( - - {option.label} - - - ))} - - - - - - - - - Webhook URL - - - Optional: URL to receive notifications when transcripts - are ready - - - - {room.webhookUrl && ( - <> - - Webhook Secret - - - {isEditing && room.webhookSecret && ( - + + Webhook Secret + + - setShowWebhookSecret(!showWebhookSecret) - } - > - {showWebhookSecret ? : } - - )} - - - Used for HMAC signature verification (auto-generated - if left empty) - - - - {isEditing && ( - <> - - - {webhookTestResult && ( -
+ {isEditing && room.webhookSecret && ( + + setShowWebhookSecret(!showWebhookSecret) + } > - {webhookTestResult} -
+ {showWebhookSecret ? : } + )}
- - )} - - )} -
-
+ + Used for HMAC signature verification (auto-generated + if left empty) + + + + {isEditing && ( + <> + + + {webhookTestResult && ( +
+ {webhookTestResult} +
+ )} +
+ + )} + + )} + + + + + { + setRoomInput({ + ...room, + icsUrl: + settings.ics_url !== undefined + ? settings.ics_url + : room.icsUrl, + icsEnabled: + settings.ics_enabled !== undefined + ? settings.ics_enabled + : room.icsEnabled, + icsFetchInterval: + settings.ics_fetch_interval !== undefined + ? settings.ics_fetch_interval + : room.icsFetchInterval, + }); + }} + isOwner={true} + isEditing={isEditing} + /> + + + +