Skip to content

Commit 60974d8

Browse files
author
Wagner O. Wutzke
authored
Merge pull request #33 from nordeck/nic/feat/ZO-178
feat: room name entering and saving added
2 parents 4cca929 + 747da91 commit 60974d8

File tree

10 files changed

+345
-30
lines changed

10 files changed

+345
-30
lines changed

package-lock.json

Lines changed: 155 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"react": "^19.0.0",
3131
"react-dom": "^19.0.0",
3232
"react-i18next": "^15.4.0",
33+
"string-strip-html": "^13.4.8",
3334
"uuid": "^11.0.5"
3435
},
3536
"devDependencies": {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2025 Nordeck IT + Consulting GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { fetchWithAuth } from '@/utils/api/fetchWithAuth';
18+
import { NextRequest } from 'next/server';
19+
20+
export async function PUT(
21+
request: NextRequest,
22+
props: { params: Promise<{ meetingId: string }> },
23+
) {
24+
const params = await props.params;
25+
return fetchWithAuth({
26+
relativeUrl: `api/v1.0/meetings/${params.meetingId}`,
27+
requestInit: {
28+
body: JSON.stringify(await request.json()),
29+
method: 'PUT',
30+
},
31+
});
32+
}

src/components/conference/ConferenceActions.tsx

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,28 @@
1616

1717
'use client'
1818

19-
import { useEffect } from 'react'
20-
import StartConferenceButton from "@/components/conference/StartConferenceButton";
21-
import CopyConferenceInfoButton from "@/components/conference/CopyConferenceInfoButton";
19+
import {createContext, useEffect, useState} from 'react'
2220
import {useGetOrCreateInstantMeeting} from "@/components/conference/useGetOrCreateInstantMeeting";
23-
import VideoTestButton from "@/components/conference/VideoTestButton";
2421
import {useSnackbar} from "@/contexts/Snackbar/SnackbarContext";
2522
import {useAuth} from "@/contexts/Auth/AuthProvider";
2623
import {isVarTrue} from "@/lib/isVarTrue";
27-
import {Stack} from "@mui/material";
24+
import {Card, Stack} from "@mui/material";
25+
import ConferenceNameField from "@/components/conference/ConferenceNameField";
26+
import StartConferenceButton from "@/components/conference/StartConferenceButton";
27+
import CopyConferenceInfoButton from "@/components/conference/CopyConferenceInfoButton";
28+
import VideoTestButton from "@/components/conference/VideoTestButton";
29+
import {Meeting} from "@/types/types";
2830
import "../../../i18n"
2931

32+
export type MeetingContext = {
33+
meeting: Meeting | undefined,
34+
nameHasChanged: boolean,
35+
setNameHasChanged: (val: boolean) => void,
36+
}
37+
38+
39+
export const ConferenceContext = createContext<MeetingContext | null>(null);
40+
3041
function ConferenceActions() {
3142

3243
const {
@@ -35,10 +46,13 @@ function ConferenceActions() {
3546
},
3647
} = useAuth();
3748

49+
3850
const isVideoTestEnabled = isVarTrue(NEXT_PUBLIC_VIDEO_TEST_ENABLED);
3951

4052
const { meeting, isLoading, error, getOrCreateMeeting } = useGetOrCreateInstantMeeting();
4153

54+
const [ nameHasChanged, setNameHasChanged ] = useState(false);
55+
4256
const { showSnackbar } = useSnackbar();
4357

4458
useEffect(() => {
@@ -56,20 +70,26 @@ function ConferenceActions() {
5670

5771
return (
5872
<>
59-
<Stack className="space-y-6 w-full items-center justify-center">
60-
<Stack className="w-1/4">
61-
<StartConferenceButton meeting={meeting} />
62-
</Stack>
63-
<Stack className={""}></Stack>
64-
<Stack className="w-1/6">
65-
<CopyConferenceInfoButton meeting={meeting} />
66-
</Stack>
67-
{ isVideoTestEnabled &&
68-
<Stack className="w-1/6">
69-
<VideoTestButton />
73+
<ConferenceContext.Provider value={{ meeting, nameHasChanged, setNameHasChanged }}>
74+
<Card variant="outlined" className={'w-2/3 p-4'}>
75+
<Stack className="space-y-6 w-full items-center justify-center">
76+
<Stack className="w-1/3">
77+
<ConferenceNameField />
78+
</Stack>
79+
<Stack className="w-1/3">
80+
<StartConferenceButton />
81+
</Stack>
82+
<Stack className="w-1/4">
83+
<CopyConferenceInfoButton meeting={meeting} />
84+
</Stack>
85+
{ isVideoTestEnabled &&
86+
<Stack className="w-1/4">
87+
<VideoTestButton />
88+
</Stack>
89+
}
7090
</Stack>
71-
}
72-
</Stack>
91+
</Card>
92+
</ConferenceContext.Provider>
7393
</>
7494
)
7595
}

0 commit comments

Comments
 (0)