Skip to content

Commit 3ba4918

Browse files
committed
chore: 120자 제한에서 임시로 150자 제한으로 수정
1 parent 280b8f1 commit 3ba4918

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+284
-667
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"semi": true,
33
"singleQuote": false,
44
"tabWidth": 2,
5-
"printWidth": 120,
5+
"printWidth": 150,
66
"trailingComma": "es5",
77
"arrowParens": "always",
88
"endOfLine": "auto"

apps/pyconkr-admin/src/components/layouts/admin_editor.tsx

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,9 @@ const InnerAdminEditor: React.FC<AppResourceIdType & AdminEditorPropsType> = Err
144144
const selectedLanguage = editorState.tab === 0 ? "ko" : "en";
145145
const notSelectedLanguage = editorState.tab === 0 ? "en" : "ko";
146146

147-
const createMutation = Common.Hooks.BackendAdminAPI.useCreateMutation<Record<string, string>>(
148-
backendAdminClient,
149-
app,
150-
resource
151-
);
152-
const modifyMutation = Common.Hooks.BackendAdminAPI.useUpdateMutation<Record<string, string>>(
153-
backendAdminClient,
154-
app,
155-
resource,
156-
id || ""
157-
);
158-
const deleteMutation = Common.Hooks.BackendAdminAPI.useRemoveMutation(
159-
backendAdminClient,
160-
app,
161-
resource,
162-
id || "undefined"
163-
);
147+
const createMutation = Common.Hooks.BackendAdminAPI.useCreateMutation<Record<string, string>>(backendAdminClient, app, resource);
148+
const modifyMutation = Common.Hooks.BackendAdminAPI.useUpdateMutation<Record<string, string>>(backendAdminClient, app, resource, id || "");
149+
const deleteMutation = Common.Hooks.BackendAdminAPI.useRemoveMutation(backendAdminClient, app, resource, id || "undefined");
164150
const submitMutation = id ? modifyMutation : createMutation;
165151

166152
React.useEffect(() => {
@@ -170,16 +156,12 @@ const InnerAdminEditor: React.FC<AppResourceIdType & AdminEditorPropsType> = Err
170156
return;
171157
}
172158

173-
setFormDataState(
174-
(await Common.BackendAdminAPIs.retrieve<Record<string, string>>(backendAdminClient, app, resource, id)()) ||
175-
{}
176-
);
159+
setFormDataState((await Common.BackendAdminAPIs.retrieve<Record<string, string>>(backendAdminClient, app, resource, id)()) || {});
177160
})();
178161
// eslint-disable-next-line react-hooks/exhaustive-deps
179162
}, [app, resource, id]);
180163

181-
const onSubmitButtonClick: React.MouseEventHandler<HTMLButtonElement> = () =>
182-
formRef.current && formRef.current.submit();
164+
const onSubmitButtonClick: React.MouseEventHandler<HTMLButtonElement> = () => formRef.current && formRef.current.submit();
183165

184166
const onSubmitFunc = (data: EditorFormDataEventType, event: React.FormEvent) => {
185167
// react-jsonschema-form에서 주는 formData에는 translation_fields로 필터링된 필드가 빠져있어,
@@ -275,11 +257,7 @@ const InnerAdminEditor: React.FC<AppResourceIdType & AdminEditorPropsType> = Err
275257
<TableRow key={key}>
276258
<TableCell>{key}</TableCell>
277259
<TableCell>
278-
<ReadOnlyValueField
279-
name={key}
280-
value={languageFilteredFormData?.[key]}
281-
uiSchema={uiSchema}
282-
/>
260+
<ReadOnlyValueField name={key} value={languageFilteredFormData?.[key]} uiSchema={uiSchema} />
283261
</TableCell>
284262
</TableRow>
285263
))}
@@ -319,37 +297,18 @@ const InnerAdminEditor: React.FC<AppResourceIdType & AdminEditorPropsType> = Err
319297
새 객체 추가
320298
</Button>
321299
{!notDeletable && (
322-
<Button
323-
variant="outlined"
324-
color="error"
325-
onClick={onDeleteFunc}
326-
disabled={disabled}
327-
startIcon={<Delete />}
328-
>
300+
<Button variant="outlined" color="error" onClick={onDeleteFunc} disabled={disabled} startIcon={<Delete />}>
329301
삭제
330302
</Button>
331303
)}
332304
{!notModifiable && (
333-
<Button
334-
variant="contained"
335-
color="primary"
336-
onClick={onSubmitButtonClick}
337-
disabled={disabled}
338-
startIcon={<Edit />}
339-
>
305+
<Button variant="contained" color="primary" onClick={onSubmitButtonClick} disabled={disabled} startIcon={<Edit />}>
340306
수정
341307
</Button>
342308
)}
343309
</>
344310
) : (
345-
<Button
346-
type="submit"
347-
variant="contained"
348-
color="primary"
349-
onClick={onSubmitButtonClick}
350-
disabled={disabled}
351-
startIcon={<Add />}
352-
>
311+
<Button type="submit" variant="contained" color="primary" onClick={onSubmitButtonClick} disabled={disabled} startIcon={<Add />}>
353312
새 객체 추가
354313
</Button>
355314
)}
@@ -366,9 +325,7 @@ export const AdminEditor: React.FC<AppResourceIdType & AdminEditorPropsType> = (
366325
</BackendAdminSignInGuard>
367326
);
368327

369-
export const AdminEditorCreateRoutePage: React.FC<AppResourceType & AdminEditorPropsType> = (props) => (
370-
<AdminEditor {...props} />
371-
);
328+
export const AdminEditorCreateRoutePage: React.FC<AppResourceType & AdminEditorPropsType> = (props) => <AdminEditor {...props} />;
372329

373330
export const AdminEditorModifyRoutePage: React.FC<AppResourceType & AdminEditorPropsType> = Suspense.with(
374331
{ fallback: <CircularProgress /> },

apps/pyconkr-admin/src/components/layouts/admin_list.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
import * as Common from "@frontend/common";
22
import { Add } from "@mui/icons-material";
3-
import {
4-
Box,
5-
Button,
6-
CircularProgress,
7-
Stack,
8-
Table,
9-
TableBody,
10-
TableCell,
11-
TableHead,
12-
TableRow,
13-
Typography,
14-
} from "@mui/material";
3+
import { Box, Button, CircularProgress, Stack, Table, TableBody, TableCell, TableHead, TableRow, Typography } from "@mui/material";
154
import { ErrorBoundary, Suspense } from "@suspensive/react";
165
import * as React from "react";
176
import { Link, useNavigate } from "react-router-dom";

apps/pyconkr-admin/src/components/layouts/global.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ export const Layout: React.FC<{ routes: RouteDef[] }> = ({ routes }) => {
9292
)}
9393
</ListItem>
9494
) : (
95-
<ListItem
96-
key={`${routeInfo.app}-${routeInfo.resource}`}
97-
sx={routeInfo.placeOnBottom ? { marginTop: "auto" } : {}}
98-
disablePadding
99-
>
95+
<ListItem key={`${routeInfo.app}-${routeInfo.resource}`} sx={routeInfo.placeOnBottom ? { marginTop: "auto" } : {}} disablePadding>
10096
<ListItemButton
10197
sx={{
10298
minHeight: 48,

apps/pyconkr-admin/src/components/pages/account/manage.tsx

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -93,30 +93,9 @@ export const AccountManagementPage: React.FC = () => {
9393
<br />
9494
<form ref={changePasswordFormRef} onSubmit={handleChangePassword}>
9595
<Stack spacing={2}>
96-
<TextField
97-
disabled={disabled}
98-
name="old_password"
99-
type="password"
100-
label="현재 비밀번호"
101-
required
102-
fullWidth
103-
/>
104-
<TextField
105-
disabled={disabled}
106-
name="new_password"
107-
type="password"
108-
label="새 비밀번호"
109-
required
110-
fullWidth
111-
/>
112-
<TextField
113-
disabled={disabled}
114-
name="new_password_confirm"
115-
type="password"
116-
label="새 비밀번호 확인"
117-
required
118-
fullWidth
119-
/>
96+
<TextField disabled={disabled} name="old_password" type="password" label="현재 비밀번호" required fullWidth />
97+
<TextField disabled={disabled} name="new_password" type="password" label="새 비밀번호" required fullWidth />
98+
<TextField disabled={disabled} name="new_password_confirm" type="password" label="새 비밀번호 확인" required fullWidth />
12099
<Button type="submit" variant="contained" disabled={disabled} fullWidth>
121100
비밀번호 변경
122101
</Button>
@@ -128,12 +107,7 @@ export const AccountManagementPage: React.FC = () => {
128107
<>
129108
<Typography variant="h5">정말 로그아웃하시겠습니까?</Typography>
130109
<br />
131-
<Button
132-
variant="contained"
133-
onClick={handleSignOut}
134-
disabled={signOutMutation.isPending}
135-
startIcon={<Logout />}
136-
>
110+
<Button variant="contained" onClick={handleSignOut} disabled={signOutMutation.isPending} startIcon={<Logout />}>
137111
로그아웃
138112
</Button>
139113
</>

apps/pyconkr-admin/src/components/pages/file/upload.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ const InnerPublicFileUploadPage: React.FC = () => {
6464
const x = e.clientX,
6565
y = e.clientY,
6666
currentHoveredElement = document.elementFromPoint(x, y);
67-
if (!fileDragBoxRef.current.contains(currentHoveredElement) || (x === 0 && y === 0))
68-
setState((prev) => ({ ...prev, isMouseOnDragBox: false }));
67+
if (!fileDragBoxRef.current.contains(currentHoveredElement) || (x === 0 && y === 0)) setState((prev) => ({ ...prev, isMouseOnDragBox: false }));
6968
};
7069

7170
const handleFile = React.useCallback(
@@ -202,12 +201,7 @@ const InnerPublicFileUploadPage: React.FC = () => {
202201
</ul>
203202
현재 선택된 파일 : {(selectedFile && selectedFile.name) || "없음"}
204203
</Box>
205-
<Button
206-
variant="contained"
207-
onClick={onSubmit}
208-
disabled={!selectedFile || uploadPublicFileMutation.isPending}
209-
startIcon={<CloudUpload />}
210-
>
204+
<Button variant="contained" onClick={onSubmit} disabled={!selectedFile || uploadPublicFileMutation.isPending} startIcon={<CloudUpload />}>
211205
업로드
212206
</Button>
213207
</Stack>

apps/pyconkr-admin/src/components/pages/page/editor.tsx

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,7 @@ type SectionEditorPropType = CommonSectionEditorPropType & {
3333
onChange: (value: SectionType) => void;
3434
};
3535

36-
const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({
37-
disabled,
38-
defaultValue,
39-
onInsertNewSection,
40-
onChange,
41-
onDelete,
42-
}) => {
36+
const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({ disabled, defaultValue, onInsertNewSection, onChange, onDelete }) => {
4337
const deleteActionButton = commands.group([], {
4438
name: "delete",
4539
groupName: "delete",
@@ -51,12 +45,7 @@ const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({
5145
return (
5246
<Stack direction="row" spacing={2} sx={{ width: "100%", height: "100%", maxWidth: "100%" }}>
5347
<Stack sx={{ flexGrow: 1, width: "50%" }}>
54-
<Common.Components.MDXEditor
55-
disabled={disabled}
56-
defaultValue={defaultValue}
57-
onChange={onChange}
58-
extraCommands={[deleteActionButton]}
59-
/>
48+
<Common.Components.MDXEditor disabled={disabled} defaultValue={defaultValue} onChange={onChange} extraCommands={[deleteActionButton]} />
6049
<Button size="small" onClick={onInsertNewSection} startIcon={<Add />}>
6150
여기에 섹션 추가
6251
</Button>
@@ -70,14 +59,7 @@ const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({
7059
);
7160
};
7261

73-
const SectionEditorField: React.FC<SectionEditorPropType> = ({
74-
language,
75-
disabled,
76-
defaultValue,
77-
onInsertNewSection,
78-
onChange,
79-
onDelete,
80-
}) => {
62+
const SectionEditorField: React.FC<SectionEditorPropType> = ({ language, disabled, defaultValue, onInsertNewSection, onChange, onDelete }) => {
8163
const onFieldChange = (key: "body_ko" | "body_en", value?: string) => onChange({ ...defaultValue, [key]: value });
8264

8365
return (
@@ -104,21 +86,14 @@ export const AdminCMSPageEditor: React.FC = ErrorBoundary.with(
10486
const { id } = useParams<{ id?: string }>();
10587
const { frontendDomain } = Common.Hooks.Common.useCommonContext();
10688
const backendAdminClient = Common.Hooks.BackendAdminAPI.useBackendAdminClient();
107-
const { data: initialSections } = Common.Hooks.BackendAdminAPI.useListPageSectionsQuery(
108-
backendAdminClient,
109-
id || ""
110-
);
89+
const { data: initialSections } = Common.Hooks.BackendAdminAPI.useListPageSectionsQuery(backendAdminClient, id || "");
11190
const [editorState, setEditorState] = React.useState<AdminCMSPageEditorStateType>({
11291
sections: initialSections,
11392
tab: 0,
11493
});
115-
const bulkUpdateSectionsMutation = Common.Hooks.BackendAdminAPI.useBulkUpdatePageSectionsMutation(
116-
backendAdminClient,
117-
id || ""
118-
);
94+
const bulkUpdateSectionsMutation = Common.Hooks.BackendAdminAPI.useBulkUpdatePageSectionsMutation(backendAdminClient, id || "");
11995

120-
const setTab = (_: React.SyntheticEvent, selectedTab: number) =>
121-
setEditorState((ps) => ({ ...ps, tab: selectedTab }));
96+
const setTab = (_: React.SyntheticEvent, selectedTab: number) => setEditorState((ps) => ({ ...ps, tab: selectedTab }));
12297

12398
const openOnSiteButton: ButtonProps = {
12499
variant: "outlined",
@@ -141,9 +116,7 @@ export const AdminCMSPageEditor: React.FC = ErrorBoundary.with(
141116

142117
const deleteSection = (index: number) => () => {
143118
setEditorState((ps) => {
144-
const sections = [...(ps.sections || []).slice(0, index), ...(ps.sections || []).slice(index + 1)].map(
145-
(s, order) => ({ ...s, order })
146-
); // Reorder sections
119+
const sections = [...(ps.sections || []).slice(0, index), ...(ps.sections || []).slice(index + 1)].map((s, order) => ({ ...s, order })); // Reorder sections
147120
return { ...ps, sections };
148121
});
149122
};

apps/pyconkr-admin/src/components/pages/user/editor.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import * as Common from "@frontend/common";
22
import { KeyOff } from "@mui/icons-material";
3-
import {
4-
Button,
5-
ButtonProps,
6-
CircularProgress,
7-
Dialog,
8-
DialogActions,
9-
DialogContent,
10-
DialogContentText,
11-
DialogTitle,
12-
} from "@mui/material";
3+
import { Button, ButtonProps, CircularProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from "@mui/material";
134
import { ErrorBoundary, Suspense } from "@suspensive/react";
145
import * as React from "react";
156
import { useParams } from "react-router-dom";
@@ -30,10 +21,7 @@ export const AdminUserExtEditor: React.FC = ErrorBoundary.with(
3021
const closeDialog = () => setPageState((ps) => ({ ...ps, isDialogOpen: false }));
3122

3223
const backendAdminClient = Common.Hooks.BackendAdminAPI.useBackendAdminClient();
33-
const useResetPasswordMutation = Common.Hooks.BackendAdminAPI.useResetUserPasswordMutation(
34-
backendAdminClient,
35-
id || ""
36-
);
24+
const useResetPasswordMutation = Common.Hooks.BackendAdminAPI.useResetUserPasswordMutation(backendAdminClient, id || "");
3725

3826
const resetUserPassword = () => {
3927
closeDialog();

apps/pyconkr-admin/src/main.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ const ShopOptions: Shop.Contexts.ContextOptions = {
5151

5252
ReactDom.createRoot(document.getElementById("root")!).render(
5353
<React.StrictMode>
54-
<ErrorBoundary
55-
fallback={
56-
<Common.Components.CenteredPage>문제가 발생했습니다, 새로고침을 해주세요.</Common.Components.CenteredPage>
57-
}
58-
>
54+
<ErrorBoundary fallback={<Common.Components.CenteredPage>문제가 발생했습니다, 새로고침을 해주세요.</Common.Components.CenteredPage>}>
5955
<Suspense
6056
fallback={
6157
<Common.Components.CenteredPage>

apps/pyconkr-admin/src/utils/snackbar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ export const getDefaultSnackOption: (v: VariantType) => OptionsObject = (v) => (
55
variant: v,
66
anchorOrigin: { vertical: "bottom", horizontal: "center" },
77
});
8-
export const addSnackbar = (c: string | React.ReactNode, v: VariantType) =>
9-
enqueueSnackbar(c, getDefaultSnackOption(v));
8+
export const addSnackbar = (c: string | React.ReactNode, v: VariantType) => enqueueSnackbar(c, getDefaultSnackOption(v));
109
export const addErrorSnackbar = (error: Error) => {
1110
console.error(error);
1211
addSnackbar(

0 commit comments

Comments
 (0)