consent disable feature (no-mistakes)

This commit is contained in:
Igor Loskutov
2025-12-18 11:14:02 -05:00
parent c62e3c0753
commit 129a19bcb5
10 changed files with 210 additions and 11 deletions

View File

@@ -91,6 +91,7 @@ const roomInitialState = {
icsEnabled: false,
icsFetchInterval: 5,
platform: "whereby",
skipConsent: false,
};
export default function RoomsList() {
@@ -175,6 +176,7 @@ export default function RoomsList() {
icsEnabled: detailedEditedRoom.ics_enabled || false,
icsFetchInterval: detailedEditedRoom.ics_fetch_interval || 5,
platform: detailedEditedRoom.platform,
skipConsent: detailedEditedRoom.skip_consent || false,
}
: null,
[detailedEditedRoom],
@@ -326,6 +328,7 @@ export default function RoomsList() {
ics_enabled: room.icsEnabled,
ics_fetch_interval: room.icsFetchInterval,
platform,
skip_consent: room.skipConsent,
};
if (isEditing) {
@@ -388,6 +391,7 @@ export default function RoomsList() {
icsEnabled: roomData.ics_enabled || false,
icsFetchInterval: roomData.ics_fetch_interval || 5,
platform: roomData.platform,
skipConsent: roomData.skip_consent || false,
});
setEditRoomId(roomId);
setIsEditing(true);
@@ -796,6 +800,34 @@ export default function RoomsList() {
<Checkbox.Label>Shared room</Checkbox.Label>
</Checkbox.Root>
</Field.Root>
{room.recordingType === "cloud" && (
<Field.Root mt={4}>
<Checkbox.Root
name="skipConsent"
checked={room.skipConsent}
onCheckedChange={(e) => {
const syntheticEvent = {
target: {
name: "skipConsent",
type: "checkbox",
checked: e.checked,
},
};
handleRoomChange(syntheticEvent);
}}
>
<Checkbox.HiddenInput />
<Checkbox.Control>
<Checkbox.Indicator />
</Checkbox.Control>
<Checkbox.Label>Skip consent dialog</Checkbox.Label>
</Checkbox.Root>
<Field.HelperText>
When enabled, participants won't be asked for
recording consent. Audio will be stored automatically.
</Field.HelperText>
</Field.Root>
)}
</Tabs.Content>
<Tabs.Content value="share" pt={6}>

View File

@@ -8,6 +8,7 @@ import type { components } from "../../reflector-api";
import { useAuth } from "../../lib/AuthProvider";
import {
ConsentDialogButton,
RecordingIndicator,
recordingTypeRequiresConsent,
} from "../../lib/consent";
import { useRoomJoinMeeting } from "../../lib/apiHooks";
@@ -162,7 +163,12 @@ export default function DailyRoom({ meeting }: DailyRoomProps) {
<div ref={containerRef} style={{ width: "100%", height: "100%" }} />
{meeting.recording_type &&
recordingTypeRequiresConsent(meeting.recording_type) &&
meeting.id && <ConsentDialogButton meetingId={meeting.id} />}
meeting.id &&
(meeting.skip_consent ? (
<RecordingIndicator />
) : (
<ConsentDialogButton meetingId={meeting.id} />
))}
</Box>
);
}

View File

@@ -8,6 +8,7 @@ import { getWherebyUrl, useWhereby } from "../../lib/wherebyClient";
import { assertExistsAndNonEmptyString, NonEmptyString } from "../../lib/utils";
import {
ConsentDialogButton as BaseConsentDialogButton,
RecordingIndicator,
useConsentDialog,
recordingTypeRequiresConsent,
} from "../../lib/consent";
@@ -90,12 +91,15 @@ export default function WherebyRoom({ meeting }: WherebyRoomProps) {
/>
{recordingType &&
recordingTypeRequiresConsent(recordingType) &&
meetingId && (
meetingId &&
(meeting.skip_consent ? (
<RecordingIndicator />
) : (
<WherebyConsentDialogButton
meetingId={assertExistsAndNonEmptyString(meetingId)}
wherebyRef={wherebyRef}
/>
)}
))}
</>
);
}

View File

@@ -0,0 +1,33 @@
"use client";
import { Box, Text } from "@chakra-ui/react";
import { FaCircle } from "react-icons/fa6";
import {
CONSENT_BUTTON_TOP_OFFSET,
CONSENT_BUTTON_LEFT_OFFSET,
CONSENT_BUTTON_Z_INDEX,
} from "./constants";
export function RecordingIndicator() {
return (
<Box
position="absolute"
top={CONSENT_BUTTON_TOP_OFFSET}
left={CONSENT_BUTTON_LEFT_OFFSET}
zIndex={CONSENT_BUTTON_Z_INDEX}
display="flex"
alignItems="center"
gap={2}
bg="red.500"
color="white"
px={3}
py={1.5}
borderRadius="md"
fontSize="sm"
fontWeight="medium"
>
<FaCircle size={8} />
<Text>Recording</Text>
</Box>
);
}

View File

@@ -2,6 +2,7 @@
export { ConsentDialogButton } from "./ConsentDialogButton";
export { ConsentDialog } from "./ConsentDialog";
export { RecordingIndicator } from "./RecordingIndicator";
export { useConsentDialog } from "./useConsentDialog";
export { recordingTypeRequiresConsent } from "./utils";
export * from "./constants";

View File

@@ -893,8 +893,16 @@ export interface components {
* @default false
*/
ics_enabled: boolean;
/** Platform */
platform?: ("whereby" | "daily") | null;
/**
* Platform
* @enum {string}
*/
platform: "whereby" | "daily";
/**
* Skip Consent
* @default false
*/
skip_consent: boolean;
};
/** CreateRoomMeeting */
CreateRoomMeeting: {
@@ -1123,7 +1131,9 @@ export interface components {
/** Audio Deleted */
audio_deleted?: boolean | null;
/** Participants */
participants: components["schemas"]["TranscriptParticipant"][] | null;
participants:
| components["schemas"]["TranscriptParticipantWithEmail"][]
| null;
/**
* @description discriminator enum property added by openapi-typescript
* @enum {string}
@@ -1184,7 +1194,9 @@ export interface components {
/** Audio Deleted */
audio_deleted?: boolean | null;
/** Participants */
participants: components["schemas"]["TranscriptParticipant"][] | null;
participants:
| components["schemas"]["TranscriptParticipantWithEmail"][]
| null;
};
/**
* GetTranscriptWithText
@@ -1246,7 +1258,9 @@ export interface components {
/** Audio Deleted */
audio_deleted?: boolean | null;
/** Participants */
participants: components["schemas"]["TranscriptParticipant"][] | null;
participants:
| components["schemas"]["TranscriptParticipantWithEmail"][]
| null;
/**
* @description discriminator enum property added by openapi-typescript
* @enum {string}
@@ -1315,7 +1329,9 @@ export interface components {
/** Audio Deleted */
audio_deleted?: boolean | null;
/** Participants */
participants: components["schemas"]["TranscriptParticipant"][] | null;
participants:
| components["schemas"]["TranscriptParticipantWithEmail"][]
| null;
/**
* @description discriminator enum property added by openapi-typescript
* @enum {string}
@@ -1386,7 +1402,9 @@ export interface components {
/** Audio Deleted */
audio_deleted?: boolean | null;
/** Participants */
participants: components["schemas"]["TranscriptParticipant"][] | null;
participants:
| components["schemas"]["TranscriptParticipantWithEmail"][]
| null;
/**
* @description discriminator enum property added by openapi-typescript
* @enum {string}
@@ -1526,6 +1544,11 @@ export interface components {
* @enum {string}
*/
platform: "whereby" | "daily";
/**
* Skip Consent
* @default false
*/
skip_consent: boolean;
};
/** MeetingConsentRequest */
MeetingConsentRequest: {
@@ -1567,6 +1590,11 @@ export interface components {
/** Name */
name: string;
};
/** ProcessStatus */
ProcessStatus: {
/** Status */
status: string;
};
/** Room */
Room: {
/** Id */
@@ -1617,6 +1645,11 @@ export interface components {
* @enum {string}
*/
platform: "whereby" | "daily";
/**
* Skip Consent
* @default false
*/
skip_consent: boolean;
};
/** RoomDetails */
RoomDetails: {
@@ -1668,6 +1701,11 @@ export interface components {
* @enum {string}
*/
platform: "whereby" | "daily";
/**
* Skip Consent
* @default false
*/
skip_consent: boolean;
/** Webhook Url */
webhook_url: string | null;
/** Webhook Secret */
@@ -1813,6 +1851,19 @@ export interface components {
/** User Id */
user_id?: string | null;
};
/** TranscriptParticipantWithEmail */
TranscriptParticipantWithEmail: {
/** Id */
id?: string;
/** Speaker */
speaker: number | null;
/** Name */
name: string;
/** User Id */
user_id?: string | null;
/** Email */
email?: string | null;
};
/**
* TranscriptSegment
* @description A single transcript segment with speaker and timing information.
@@ -1868,6 +1919,8 @@ export interface components {
ics_enabled?: boolean | null;
/** Platform */
platform?: ("whereby" | "daily") | null;
/** Skip Consent */
skip_consent?: boolean | null;
};
/** UpdateTranscript */
UpdateTranscript: {
@@ -3362,7 +3415,7 @@ export interface operations {
[name: string]: unknown;
};
content: {
"application/json": unknown;
"application/json": components["schemas"]["ProcessStatus"];
};
};
/** @description Validation Error */