Skip to content

Commit 0dc73c6

Browse files
feat: ZO-190 - conferences history with copy info and delete actions
feat: ZO-190 - conferences history with copy info and delete actions
2 parents e68beff + 5a73b4d commit 0dc73c6

18 files changed

+541
-137
lines changed

package-lock.json

+106-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"dependencies": {
1212
"@emotion/react": "^11.14.0",
1313
"@emotion/styled": "^11.14.0",
14-
"@mui/icons-material": "^6.4.0",
15-
"@mui/material": "^6.4.0",
14+
"@mui/icons-material": "^6.4.7",
15+
"@mui/material": "^6.4.7",
1616
"@mui/material-nextjs": "^6.4.3",
17+
"@mui/x-data-grid": "^7.27.2",
1718
"@mui/x-date-pickers": "^7.23.6",
1819
"axios": "^1.7.9",
1920
"i18next": "^24.2.1",
@@ -30,7 +31,6 @@
3031
"react": "^19.0.0",
3132
"react-dom": "^19.0.0",
3233
"react-i18next": "^15.4.0",
33-
"string-strip-html": "^13.4.8",
3434
"uuid": "^11.0.5"
3535
},
3636
"devDependencies": {

src/app/api/meetings/[meetingId]/route.ts

+13
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,17 @@ export async function PUT(
2929
method: 'PUT',
3030
},
3131
});
32+
}
33+
34+
export async function DELETE(
35+
request: NextRequest,
36+
props: { params: Promise<{ meetingId: string }> },
37+
) {
38+
const params = await props.params;
39+
return fetchWithAuth({
40+
relativeUrl: `api/v1.0/meetings/${params.meetingId}`,
41+
requestInit: {
42+
method: 'DELETE',
43+
},
44+
});
3245
}

src/app/conference/page.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import { Metadata } from "next";
1818
import NavigationTopBar from "@/components/opendesk/NavigationTopBar/NavigationTopBar";
1919
import ConferenceActions from "@/components/conference/ConferenceActions";
20+
import ConferenceHistory from "@/components/conference/ConferenceHistory";
21+
import {ConferenceAppContext} from "@/contexts/Conference/ConferenceAppContext";
2022

2123
export const metadata: Metadata = {
2224
title: 'openDesk Video Conference',
@@ -27,9 +29,10 @@ export default function Conference() {
2729
return (
2830
<>
2931
<NavigationTopBar />
30-
<section className="flex flex-col h-screen max-h-[50vh] items-center justify-center main-section">
32+
<ConferenceAppContext>
3133
<ConferenceActions />
32-
</section>
34+
<ConferenceHistory />
35+
</ConferenceAppContext>
3336
</>
3437
);
3538
}

src/components/conference/ConferenceActions.tsx

+17-45
Original file line numberDiff line numberDiff line change
@@ -16,59 +16,31 @@
1616

1717
'use client'
1818

19-
import {createContext, useState} from 'react'
20-
import {useAuth, useAuthLoggedUser} from "@/contexts/Auth/AuthProvider";
21-
import {isVarTrue} from "@/lib/isVarTrue";
2219
import {Stack, Typography} from "@mui/material";
2320
import ConferenceNameField from "@/components/conference/ConferenceNameField";
2421
import StartConferenceButton from "@/components/conference/StartConferenceButton";
2522
import CopyConferenceInfoButton from "@/components/conference/CopyConferenceInfoButton";
2623
import VideoTestButton from "@/components/conference/VideoTestButton";
27-
import {Meeting} from "@/types/types";
2824
import {t} from "i18next";
2925
import "../../../i18n"
26+
import {useContext} from "react";
27+
import {ConferenceAppProps, ConferenceContext} from "@/contexts/Conference/ConferenceAppContext";
3028

31-
export type MeetingContext = {
32-
loggedUser: string,
33-
meeting: Meeting | undefined,
34-
setMeeting: (meeting: Meeting | undefined) => void,
35-
meetingName: string,
36-
setMeetingName: (meetingName: string) => void,
37-
}
38-
39-
export const ConferenceContext= createContext<MeetingContext | null>(null);
4029

4130
function ConferenceActions() {
4231

43-
const {
44-
clientEnv: {
45-
NEXT_PUBLIC_VIDEO_TEST_ENABLED,
46-
},
47-
} = useAuth();
48-
49-
const isVideoTestEnabled = isVarTrue(NEXT_PUBLIC_VIDEO_TEST_ENABLED);
50-
const { email: loggedUser} = useAuthLoggedUser();
51-
52-
const [ meetingName, setMeetingName ] = useState('');
53-
const [ meeting, setMeeting ] = useState<Meeting | undefined>();
32+
const { isVideoTestEnabled } = useContext(ConferenceContext) as ConferenceAppProps;
5433

5534
return (
5635
<>
57-
<ConferenceContext.Provider value={{
58-
loggedUser,
59-
meeting,
60-
setMeeting,
61-
meetingName,
62-
setMeetingName
63-
}}>
64-
36+
<section className="flex flex-col h-screen max-h-[48vh] items-center justify-center main-section">
6537
<Typography className={'text-white'}
66-
sx={{
67-
fontSize: 30,
68-
fontWeight: 'bold',
69-
marginTop: 2,
70-
marginBottom: 6,
71-
}}
38+
sx={{
39+
fontSize: 40,
40+
fontWeight: '700',
41+
marginTop: 2,
42+
marginBottom: 4,
43+
}}
7244
>
7345
{t('main.title', 'main.title')}
7446
</Typography>
@@ -84,19 +56,19 @@ function ConferenceActions() {
8456

8557
<Stack className="space-y-6 w-full items-center justify-center m-4">
8658
<Stack className="w-2/5 items-center justify-center" direction={'row'} spacing={0}>
87-
<ConferenceNameField />
88-
<StartConferenceButton />
59+
<ConferenceNameField/>
60+
<StartConferenceButton/>
8961
</Stack>
9062
<Stack className="w-2/5 items-center justify-center" direction={'row'} spacing={2}>
91-
<CopyConferenceInfoButton />
92-
{ isVideoTestEnabled &&
93-
<VideoTestButton />
63+
<CopyConferenceInfoButton/>
64+
{isVideoTestEnabled &&
65+
<VideoTestButton/>
9466
}
9567
</Stack>
9668
</Stack>
97-
</ConferenceContext.Provider>
69+
</section>
9870
</>
99-
)
71+
);
10072
}
10173

10274
export default ConferenceActions

0 commit comments

Comments
 (0)