Skip to content

Commit 3ad4854

Browse files
committed
feat: 발표자 정보 수정 추가
1 parent 81a5f2e commit 3ad4854

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

apps/pyconkr-participant-portal/src/components/elements/multilang_field.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,14 @@ type TranslatedText = {
6161
en: string;
6262
};
6363

64+
type TranslatedNode = {
65+
ko: React.ReactNode;
66+
en: React.ReactNode;
67+
};
68+
6469
type MultiLanguageCommonProps = {
6570
label: TranslatedText;
66-
description?: TranslatedText;
71+
description?: TranslatedNode;
6772
};
6873

6974
type MultiLanguageFieldProps = Omit<TextFieldProps, "label" | "defaultValue" | "value" | "onChange"> &

apps/pyconkr-participant-portal/src/components/pages/session_editor.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Box, Button, Divider, SelectChangeEvent, Stack, Typography } from "@mui
44
import { ErrorBoundary, Suspense } from "@suspensive/react";
55
import { enqueueSnackbar, OptionsObject } from "notistack";
66
import * as React from "react";
7-
import { Navigate, useParams } from "react-router-dom";
7+
import { Link, Navigate, useParams } from "react-router-dom";
88
import * as R from "remeda";
99

1010
import { useAppContext } from "../../contexts/app_context";
@@ -57,12 +57,14 @@ const InnerSessionEditor: React.FC = () => {
5757
const participantPortalClient = Common.Hooks.BackendParticipantPortalAPI.useParticipantPortalClient();
5858
const updateSessionMutation = Common.Hooks.BackendParticipantPortalAPI.useUpdatePresentationMutation(participantPortalClient);
5959
const { data: session } = Common.Hooks.BackendParticipantPortalAPI.useRetrievePresentationQuery(participantPortalClient, sessionId || "");
60+
const { data: profile } = Common.Hooks.BackendParticipantPortalAPI.useSignedInUserQuery(participantPortalClient);
6061
const [editorState, setEditorState] = React.useState<SessionEditorState>({
6162
openSubmitConfirmDialog: false,
6263
...(session || DummySessionInfo),
6364
});
6465

65-
if (!sessionId || !session || !(R.isArray(editorState.speakers) && !R.isEmpty(editorState.speakers))) return <Navigate to="/" replace />;
66+
if (!sessionId || !session || !profile || !(R.isArray(editorState.speakers) && !R.isEmpty(editorState.speakers)))
67+
return <Navigate to="/" replace />;
6668

6769
// 유저는 하나의 세션에 발표자가 한번만 가능하고, 백엔드에서 본 유저의 세션 발표자 정보만 제공하므로, 첫 번째 발표자 정보를 사용해도 안전합니다.
6870
const speaker = editorState.speakers[0];
@@ -137,6 +139,7 @@ const InnerSessionEditor: React.FC = () => {
137139
description_ko: editorState.description_ko,
138140
description_en: editorState.description_en,
139141
image: editorState.image || null,
142+
speakers: editorState.speakers,
140143
},
141144
{
142145
onSuccess: () => {
@@ -198,6 +201,26 @@ const InnerSessionEditor: React.FC = () => {
198201

199202
<SecondaryTitle variant="h5" children={titleStrForSpeaker} />
200203
<Box sx={{ width: "100%", mb: 2, textAlign: "start" }} children={speakerEditDescription} />
204+
<MultiLanguageField
205+
label={{ ko: "발표자 별칭", en: "Speaker Nickname" }}
206+
description={{
207+
ko: (
208+
<Stack spacing={1}>
209+
<Typography variant="body2" color="textSecondary" children="발표자 별칭은 프로필 편집에서 변경할 수 있어요." />
210+
<Link to="/user" children={<Button size="small" variant="contained" children="프로필 수정 페이지로 이동" />} />
211+
</Stack>
212+
),
213+
en: (
214+
<Stack spacing={1}>
215+
<Typography variant="body2" color="textSecondary" children="You can change speaker nickname in the profile editor." />
216+
<Link to="/user" children={<Button size="small" variant="contained" children="Go to Profile Editor" />} />
217+
</Stack>
218+
),
219+
}}
220+
value={{ ko: profile.nickname_ko || "", en: profile.nickname_en || "" }}
221+
disabled
222+
fullWidth
223+
/>
201224
<MultiLanguageMarkdownField
202225
label={{ ko: "발표자 소개", en: "Speaker Biography" }}
203226
value={{ ko: speaker.biography_ko || "", en: speaker.biography_en || "" }}

packages/common/src/schemas/backendParticipantPortalAPI.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ namespace BackendParticipantPortalAPISchemas {
8181
description_ko: string;
8282
description_en: string;
8383
image: string | null;
84+
speakers: {
85+
id: string; // UUID of the speaker
86+
biography_ko: string; // Biography in Korean
87+
biography_en: string; // Biography in English
88+
image: string | null; // PK of the speaker's image
89+
}[];
8490
};
8591

8692
export type ModificationAuditSchema = {

0 commit comments

Comments
 (0)