consent disable refactor

This commit is contained in:
Igor Loskutov
2025-12-18 23:16:24 -05:00
parent fbf319573e
commit 9edc38b861
7 changed files with 10 additions and 68 deletions

View File

@@ -1,48 +0,0 @@
"""add skip_consent to room and meeting
Revision ID: 20251217000000
Revises: 05f8688d6895
Create Date: 2025-12-17 00:00:00.000000
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "20251217000000"
down_revision: Union[str, None] = "05f8688d6895"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
with op.batch_alter_table("room", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
"skip_consent",
sa.Boolean(),
nullable=False,
server_default=sa.text("false"),
)
)
with op.batch_alter_table("meeting", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
"skip_consent",
sa.Boolean(),
nullable=False,
server_default=sa.text("false"),
)
)
def downgrade() -> None:
with op.batch_alter_table("meeting", schema=None) as batch_op:
batch_op.drop_column("skip_consent")
with op.batch_alter_table("room", schema=None) as batch_op:
batch_op.drop_column("skip_consent")

View File

@@ -63,12 +63,6 @@ meetings = sa.Table(
nullable=False, nullable=False,
server_default=assert_equal(WHEREBY_PLATFORM, "whereby"), server_default=assert_equal(WHEREBY_PLATFORM, "whereby"),
), ),
sa.Column(
"skip_consent",
sa.Boolean,
nullable=False,
server_default=sa.false(),
),
sa.Index("idx_meeting_room_id", "room_id"), sa.Index("idx_meeting_room_id", "room_id"),
sa.Index("idx_meeting_calendar_event", "calendar_event_id"), sa.Index("idx_meeting_calendar_event", "calendar_event_id"),
) )
@@ -116,7 +110,6 @@ class Meeting(BaseModel):
calendar_event_id: str | None = None calendar_event_id: str | None = None
calendar_metadata: dict[str, Any] | None = None calendar_metadata: dict[str, Any] | None = None
platform: Platform = WHEREBY_PLATFORM platform: Platform = WHEREBY_PLATFORM
skip_consent: bool = False
class MeetingController: class MeetingController:
@@ -147,7 +140,6 @@ class MeetingController:
calendar_event_id=calendar_event_id, calendar_event_id=calendar_event_id,
calendar_metadata=calendar_metadata, calendar_metadata=calendar_metadata,
platform=room.platform, platform=room.platform,
skip_consent=room.skip_consent,
) )
query = meetings.insert().values(**meeting.model_dump()) query = meetings.insert().values(**meeting.model_dump())
await get_database().execute(query) await get_database().execute(query)

View File

@@ -73,7 +73,6 @@ class Meeting(BaseModel):
calendar_event_id: str | None = None calendar_event_id: str | None = None
calendar_metadata: dict[str, Any] | None = None calendar_metadata: dict[str, Any] | None = None
platform: Platform platform: Platform
skip_consent: bool = False
class CreateRoom(BaseModel): class CreateRoom(BaseModel):

View File

@@ -15,12 +15,14 @@ import { useRoomJoinMeeting } from "../../lib/apiHooks";
import { assertExists } from "../../lib/utils"; import { assertExists } from "../../lib/utils";
type Meeting = components["schemas"]["Meeting"]; type Meeting = components["schemas"]["Meeting"];
type Room = components["schemas"]["RoomDetails"];
interface DailyRoomProps { interface DailyRoomProps {
meeting: Meeting; meeting: Meeting;
room: Room;
} }
export default function DailyRoom({ meeting }: DailyRoomProps) { export default function DailyRoom({ meeting, room }: DailyRoomProps) {
const router = useRouter(); const router = useRouter();
const params = useParams(); const params = useParams();
const auth = useAuth(); const auth = useAuth();
@@ -164,7 +166,7 @@ export default function DailyRoom({ meeting }: DailyRoomProps) {
{meeting.recording_type && {meeting.recording_type &&
recordingTypeRequiresConsent(meeting.recording_type) && recordingTypeRequiresConsent(meeting.recording_type) &&
meeting.id && meeting.id &&
(meeting.skip_consent ? ( (room.skip_consent ? (
<RecordingIndicator /> <RecordingIndicator />
) : ( ) : (
<ConsentDialogButton meetingId={meeting.id} /> <ConsentDialogButton meetingId={meeting.id} />

View File

@@ -192,9 +192,9 @@ export default function RoomContainer(details: RoomDetails) {
switch (platform) { switch (platform) {
case "daily": case "daily":
return <DailyRoom meeting={meeting} />; return <DailyRoom meeting={meeting} room={room} />;
case "whereby": case "whereby":
return <WherebyRoom meeting={meeting} />; return <WherebyRoom meeting={meeting} room={room} />;
default: { default: {
const _exhaustive: never = platform; const _exhaustive: never = platform;
return ( return (

View File

@@ -14,9 +14,11 @@ import {
} from "../../lib/consent"; } from "../../lib/consent";
type Meeting = components["schemas"]["Meeting"]; type Meeting = components["schemas"]["Meeting"];
type Room = components["schemas"]["RoomDetails"];
interface WherebyRoomProps { interface WherebyRoomProps {
meeting: Meeting; meeting: Meeting;
room: Room;
} }
function WherebyConsentDialogButton({ function WherebyConsentDialogButton({
@@ -49,7 +51,7 @@ function WherebyConsentDialogButton({
return <BaseConsentDialogButton meetingId={meetingId} />; return <BaseConsentDialogButton meetingId={meetingId} />;
} }
export default function WherebyRoom({ meeting }: WherebyRoomProps) { export default function WherebyRoom({ meeting, room }: WherebyRoomProps) {
const wherebyLoaded = useWhereby(); const wherebyLoaded = useWhereby();
const wherebyRef = useRef<HTMLElement>(null); const wherebyRef = useRef<HTMLElement>(null);
const router = useRouter(); const router = useRouter();
@@ -92,7 +94,7 @@ export default function WherebyRoom({ meeting }: WherebyRoomProps) {
{recordingType && {recordingType &&
recordingTypeRequiresConsent(recordingType) && recordingTypeRequiresConsent(recordingType) &&
meetingId && meetingId &&
(meeting.skip_consent ? ( (room.skip_consent ? (
<RecordingIndicator /> <RecordingIndicator />
) : ( ) : (
<WherebyConsentDialogButton <WherebyConsentDialogButton

View File

@@ -1544,11 +1544,6 @@ export interface components {
* @enum {string} * @enum {string}
*/ */
platform: "whereby" | "daily"; platform: "whereby" | "daily";
/**
* Skip Consent
* @default false
*/
skip_consent: boolean;
}; };
/** MeetingConsentRequest */ /** MeetingConsentRequest */
MeetingConsentRequest: { MeetingConsentRequest: {