mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
only recordings that are *recorded* require consent
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from typing import Annotated, Optional
|
from typing import Annotated, Optional, Literal
|
||||||
|
|
||||||
import reflector.auth as auth
|
import reflector.auth as auth
|
||||||
from fastapi import APIRouter, Depends, HTTPException
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
@@ -37,6 +37,7 @@ class Meeting(BaseModel):
|
|||||||
host_room_url: str
|
host_room_url: str
|
||||||
start_date: datetime
|
start_date: datetime
|
||||||
end_date: datetime
|
end_date: datetime
|
||||||
|
recording_type: Literal["none", "local", "cloud"] = "cloud"
|
||||||
|
|
||||||
|
|
||||||
class CreateRoom(BaseModel):
|
class CreateRoom(BaseModel):
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { notFound } from "next/navigation";
|
|||||||
import useSessionStatus from "../lib/useSessionStatus";
|
import useSessionStatus from "../lib/useSessionStatus";
|
||||||
import { useRecordingConsent } from "../recordingConsentContext";
|
import { useRecordingConsent } from "../recordingConsentContext";
|
||||||
import useApi from "../lib/useApi";
|
import useApi from "../lib/useApi";
|
||||||
|
import { Meeting } from '../api';
|
||||||
|
|
||||||
export type RoomDetails = {
|
export type RoomDetails = {
|
||||||
params: {
|
params: {
|
||||||
@@ -96,6 +97,10 @@ function ConsentDialog({ meetingId }: { meetingId: string }) {
|
|||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const recordingTypeRequiresConsent = (recordingType: NonNullable<Meeting['recording_type']>) => {
|
||||||
|
return recordingType === 'cloud';
|
||||||
|
}
|
||||||
|
|
||||||
export default function Room(details: RoomDetails) {
|
export default function Room(details: RoomDetails) {
|
||||||
const wherebyRef = useRef<HTMLElement>(null);
|
const wherebyRef = useRef<HTMLElement>(null);
|
||||||
const roomName = details.params.roomName;
|
const roomName = details.params.roomName;
|
||||||
@@ -109,6 +114,8 @@ export default function Room(details: RoomDetails) {
|
|||||||
|
|
||||||
const meetingId = meeting?.response?.id;
|
const meetingId = meeting?.response?.id;
|
||||||
|
|
||||||
|
const recordingType = meeting?.response?.recording_type;
|
||||||
|
|
||||||
const handleLeave = useCallback(() => {
|
const handleLeave = useCallback(() => {
|
||||||
router.push("/browse");
|
router.push("/browse");
|
||||||
}, [router]);
|
}, [router]);
|
||||||
@@ -165,7 +172,7 @@ export default function Room(details: RoomDetails) {
|
|||||||
room={roomUrl}
|
room={roomUrl}
|
||||||
style={{ width: "100vw", height: "100vh" }}
|
style={{ width: "100vw", height: "100vh" }}
|
||||||
/>
|
/>
|
||||||
<ConsentDialog meetingId={meetingId} />
|
{recordingType && recordingTypeRequiresConsent(recordingType) && <ConsentDialog meetingId={meetingId} />}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -546,6 +546,12 @@ export const $Meeting = {
|
|||||||
format: "date-time",
|
format: "date-time",
|
||||||
title: "End Date",
|
title: "End Date",
|
||||||
},
|
},
|
||||||
|
recording_type: {
|
||||||
|
type: "string",
|
||||||
|
enum: ["none", "local", "cloud"],
|
||||||
|
title: "Recording Type",
|
||||||
|
default: "cloud",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
type: "object",
|
type: "object",
|
||||||
required: [
|
required: [
|
||||||
|
|||||||
@@ -108,8 +108,11 @@ export type Meeting = {
|
|||||||
host_room_url: string;
|
host_room_url: string;
|
||||||
start_date: string;
|
start_date: string;
|
||||||
end_date: string;
|
end_date: string;
|
||||||
|
recording_type?: "none" | "local" | "cloud";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type recording_type = "none" | "local" | "cloud";
|
||||||
|
|
||||||
export type MeetingConsentRequest = {
|
export type MeetingConsentRequest = {
|
||||||
consent_given: boolean;
|
consent_given: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user