From 69a09fb6f70607e7fff03f2107afddd7cfa96146 Mon Sep 17 00:00:00 2001 From: "M. E. Abdelsalam" Date: Wed, 25 Dec 2024 17:40:20 +0200 Subject: [PATCH] removed: deprecated or no more necessary code has been removed. --- .../PendingInterview/index.tsx | 7 +- .../TutorOnboardingSteps/Interview/index.tsx | 3 +- .../components/TutorOnboardingSteps/index.tsx | 3 +- apps/nova/src/pages/Call.tsx | 19 +- apps/nova/src/types/index.ts | 1 + apps/nova/src/types/props.ts | 24 ++ packages/atlas/src/atlas.ts | 6 - packages/atlas/src/peer.ts | 24 -- packages/atlas/src/session.ts | 12 - packages/headless/src/sessions.ts | 149 +------ packages/luna/src/locales/ar-eg.json | 3 +- packages/models/fixtures/db.ts | 1 + .../models/migrations/1716146586880_setup.js | 30 +- packages/models/src/interviews.ts | 1 - packages/models/tests/cache/session.test.ts | 2 +- packages/types/src/index.ts | 1 - packages/types/src/interview.ts | 33 +- packages/types/src/peer.ts | 27 -- pnpm-lock.yaml | 47 ++- services/server/src/handlers/peer.ts | 87 ---- services/server/src/handlers/session.ts | 67 --- services/server/src/index.ts | 2 - .../server/src/middleware/accessControl.ts | 389 ------------------ services/server/src/routes/index.ts | 4 - services/server/src/routes/peer.ts | 10 - services/server/src/routes/session.ts | 9 - .../server/src/wss/handlers/connection.ts | 1 + services/server/src/wss/handlers/index.ts | 3 - .../server/src/wss/handlers/inputDevices.ts | 19 +- services/server/src/wss/handlers/peer.ts | 55 --- .../wss/{call.test.ts => session.test.ts} | 16 +- 31 files changed, 109 insertions(+), 946 deletions(-) create mode 100644 apps/nova/src/types/props.ts delete mode 100644 packages/atlas/src/peer.ts delete mode 100644 packages/atlas/src/session.ts delete mode 100644 packages/types/src/peer.ts delete mode 100644 services/server/src/handlers/peer.ts delete mode 100644 services/server/src/handlers/session.ts delete mode 100644 services/server/src/middleware/accessControl.ts delete mode 100644 services/server/src/routes/peer.ts delete mode 100644 services/server/src/routes/session.ts delete mode 100644 services/server/src/wss/handlers/peer.ts rename services/server/tests/wss/{call.test.ts => session.test.ts} (90%) diff --git a/apps/nova/src/components/TutorOnboardingSteps/Interview/ScheduledInterview/PendingInterview/index.tsx b/apps/nova/src/components/TutorOnboardingSteps/Interview/ScheduledInterview/PendingInterview/index.tsx index 483ff0ec6..be2c5bbb4 100644 --- a/apps/nova/src/components/TutorOnboardingSteps/Interview/ScheduledInterview/PendingInterview/index.tsx +++ b/apps/nova/src/components/TutorOnboardingSteps/Interview/ScheduledInterview/PendingInterview/index.tsx @@ -2,19 +2,16 @@ import { Button, ButtonType, ButtonSize, - ButtonVariant, } from "@litespace/luna/Button"; import { asFullAssetUrl } from "@litespace/luna/backend"; import { useFormatMessage } from "@litespace/luna/hooks/intl"; import { ISession } from "@litespace/types"; import React from "react"; -import { Link } from "react-router-dom"; -import { Route } from "@/types/routes"; const PendingInterview: React.FC<{ interviewer: ISession.PopuldatedMember; session: ISession.Self; -}> = ({ interviewer, session }) => { +}> = ({ interviewer }) => { const intl = useFormatMessage(); return (
@@ -57,6 +54,7 @@ const PendingInterview: React.FC<{

+ {/* diff --git a/apps/nova/src/components/TutorOnboardingSteps/Interview/index.tsx b/apps/nova/src/components/TutorOnboardingSteps/Interview/index.tsx index 2ce4becd8..4bc70fedd 100644 --- a/apps/nova/src/components/TutorOnboardingSteps/Interview/index.tsx +++ b/apps/nova/src/components/TutorOnboardingSteps/Interview/index.tsx @@ -3,10 +3,11 @@ import React, { useMemo } from "react"; import { marked } from "marked"; import markdown from "@/markdown/tutorOnboarding/interview.md?raw"; import RawHtml from "@/components/TutorOnboardingSteps/RawHtml"; +import { FindPagedInterviewsProps } from "@/types/props"; // import ScheduledInterview from "@/components/TutorOnboardingSteps/Interview/ScheduledInterview"; const Interview: React.FC<{ - interviews: IInterview.FindPagedInterviewsProps; + interviews: FindPagedInterviewsProps; current: Element | null; }> = ({ current }) => { // const onScheduleSuccess = useCallback(() => { diff --git a/apps/nova/src/components/TutorOnboardingSteps/index.tsx b/apps/nova/src/components/TutorOnboardingSteps/index.tsx index 86af132e1..d29ed2daf 100644 --- a/apps/nova/src/components/TutorOnboardingSteps/index.tsx +++ b/apps/nova/src/components/TutorOnboardingSteps/index.tsx @@ -3,10 +3,11 @@ import React from "react"; import Interview from "@/components/TutorOnboardingSteps/Interview"; import MediaShot from "@/components/TutorOnboardingSteps/MediaShot"; import { Element, IInterview } from "@litespace/types"; +import { FindPagedInterviewsProps } from "@/types/props"; const TutorOnboardingSteps: React.FC<{ step: number; - interviews: IInterview.FindPagedInterviewsProps; + interviews: FindPagedInterviewsProps; current: Element | null; }> = ({ step, interviews, current }) => { if (step === TutorOnboardingStep.Interview) diff --git a/apps/nova/src/pages/Call.tsx b/apps/nova/src/pages/Call.tsx index 999514349..9d5c365dd 100644 --- a/apps/nova/src/pages/Call.tsx +++ b/apps/nova/src/pages/Call.tsx @@ -16,12 +16,11 @@ import cn from "classnames"; // import Messages from "@/components/Chat/Messages"; import { orNull, orUndefined } from "@litespace/sol/utils"; import { - useSessionMembers, - // useCall, + //useSessionMembers, + //usePeerIds, useSessionV2, useFindSessionRoomById, useFullScreen, - usePeerIds, } from "@litespace/headless/sessions"; import { useDisplayRecorder } from "@litespace/headless/recorder"; import { isGhost } from "@/lib/ghost"; @@ -56,8 +55,8 @@ const Call: React.FC = () => { return callRoom.data.members.find((member) => member.id !== user?.id); }, [callRoom.data, user?.id]); - const members = useSessionMembers(sessionId); - useEffect(() => console.log("In App members: ", members), [members]); + //const members = useSessionMembers(sessionId); + //useEffect(() => console.log("In App members: ", members), [members]); // const messages = useMemo( // () => @@ -118,6 +117,7 @@ const Call: React.FC = () => { const fullScreen = useFullScreen(); + /* const peers = usePeerIds( useMemo( () => ({ @@ -130,6 +130,7 @@ const Call: React.FC = () => { [sessionId, mateInfo?.id, user?.role] ) ); + */ const onCloseSession = useCallback(() => { // peers.ghost.refetch(); @@ -150,12 +151,12 @@ const Call: React.FC = () => { useMemo( () => ({ isGhost, - ghostPeerId: orNull(peers.ghost.data), - tutorPeerId: orNull(peers.tutor.data), + ghostPeerId: orNull("ghost"), // TODO: pass peers.ghost.data + tutorPeerId: orNull("ghost"), // TODO: pass peers.tutor.data userId: orNull(user?.id), onCloseSession, }), - [onCloseSession, peers.ghost.data, peers.tutor.data, user?.id] + [onCloseSession, user?.id] ) ); @@ -302,12 +303,14 @@ const Call: React.FC = () => { /* * TODO: replace this by members views */ + /*

Joined members

{members.map((m) => ( ))}
+ */ } {/*