Skip to content

Commit 373d280

Browse files
committed
Merge branch 'main' of https://github.com/pythonkr/frontend into feature/add-session-timetable-component
2 parents 29effcc + 21da907 commit 373d280

File tree

77 files changed

+4064
-109
lines changed

Some content is hidden

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

77 files changed

+4064
-109
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,24 @@ jobs:
3232
BUMP_RULE: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && '--mode development' || '' }}
3333
AWS_S3_PYCONKR_FRONTEND_BUCKET: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_S3_PYCONKR_FRONTEND_BUCKET_DEV || secrets.AWS_S3_PYCONKR_FRONTEND_BUCKET_PROD }}
3434
AWS_S3_PYCONKR_ADMIN_BUCKET: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_S3_PYCONKR_ADMIN_BUCKET_DEV || secrets.AWS_S3_PYCONKR_ADMIN_BUCKET_PROD }}
35+
AWS_S3_PYCONKR_PARTICIPANT_PORTAL_BUCKET: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_S3_PYCONKR_PARTICIPANT_PORTAL_BUCKET_DEV || secrets.AWS_S3_PYCONKR_PARTICIPANT_PORTAL_BUCKET_PROD }}
3536
AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID_DEV || secrets.AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID_PROD }}
3637
AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID_DEV || secrets.AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID_PROD }}
38+
AWS_CLOUDFRONT_PYCONKR_PARTICIPANT_PORTAL_DISTRIBUTION_ID: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_CLOUDFRONT_PYCONKR_PARTICIPANT_PORTAL_DISTRIBUTION_ID_DEV || secrets.AWS_CLOUDFRONT_PYCONKR_PARTICIPANT_PORTAL_DISTRIBUTION_ID_PROD }}
3739

3840
strategy:
3941
matrix:
40-
application: [pyconkr, pyconkr-admin]
42+
application: [pyconkr, pyconkr-admin, pyconkr-participant-portal]
4143
include:
4244
- application: pyconkr
4345
aws_s3_bucket_key: AWS_S3_PYCONKR_FRONTEND_BUCKET
4446
aws_cloudfront_distribution_key: AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID
4547
- application: pyconkr-admin
4648
aws_s3_bucket_key: AWS_S3_PYCONKR_ADMIN_BUCKET
4749
aws_cloudfront_distribution_key: AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID
50+
- application: pyconkr-participant-portal
51+
aws_s3_bucket_key: AWS_S3_PYCONKR_PARTICIPANT_PORTAL_BUCKET
52+
aws_cloudfront_distribution_key: AWS_CLOUDFRONT_PYCONKR_PARTICIPANT_PORTAL_DISTRIBUTION_ID
4853

4954
steps:
5055
- uses: actions/checkout@master

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type AdminListProps = {
1212
resource: string;
1313
hideCreatedAt?: boolean;
1414
hideUpdatedAt?: boolean;
15+
hideCreateNew?: boolean;
1516
};
1617

1718
type ListRowType = {
@@ -23,7 +24,7 @@ type ListRowType = {
2324

2425
const InnerAdminList: React.FC<AdminListProps> = ErrorBoundary.with(
2526
{ fallback: Common.Components.ErrorFallback },
26-
Suspense.with({ fallback: <CircularProgress /> }, ({ app, resource, hideCreatedAt, hideUpdatedAt }) => {
27+
Suspense.with({ fallback: <CircularProgress /> }, ({ app, resource, hideCreatedAt, hideUpdatedAt, hideCreateNew }) => {
2728
const navigate = useNavigate();
2829
const backendAdminClient = Common.Hooks.BackendAdminAPI.useBackendAdminClient();
2930
const listQuery = Common.Hooks.BackendAdminAPI.useListQuery<ListRowType>(backendAdminClient, app, resource);
@@ -35,9 +36,11 @@ const InnerAdminList: React.FC<AdminListProps> = ErrorBoundary.with(
3536
</Typography>
3637
<br />
3738
<Box>
38-
<Button variant="contained" onClick={() => navigate(`/${app}/${resource}/create`)} startIcon={<Add />}>
39-
새 객체 추가
40-
</Button>
39+
{!hideCreateNew && (
40+
<Button variant="contained" onClick={() => navigate(`/${app}/${resource}/create`)} startIcon={<Add />}>
41+
새 객체 추가
42+
</Button>
43+
)}
4144
</Box>
4245
<Table>
4346
<TableHead>
@@ -57,8 +60,8 @@ const InnerAdminList: React.FC<AdminListProps> = ErrorBoundary.with(
5760
<TableCell>
5861
<Link to={`/${app}/${resource}/${item.id}`}>{item.str_repr}</Link>
5962
</TableCell>
60-
{hideCreatedAt === true && <TableCell>{new Date(item.created_at).toLocaleString()}</TableCell>}
61-
{hideUpdatedAt === true && <TableCell>{new Date(item.updated_at).toLocaleString()}</TableCell>}
63+
{!hideCreatedAt && <TableCell>{new Date(item.created_at).toLocaleString()}</TableCell>}
64+
{!hideUpdatedAt && <TableCell>{new Date(item.updated_at).toLocaleString()}</TableCell>}
6265
</TableRow>
6366
))}
6467
</TableBody>

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

Lines changed: 61 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { MiniVariantAppBar, MiniVariantDrawer } from "./sidebar";
2525

2626
export type RouteDef =
2727
| {
28-
type: "routeDefinition";
28+
type: "autoAdminRouteDefinition";
2929
key: string; // Unique key for the route
3030
icon: typeof SvgIcon;
3131
title: string;
@@ -35,6 +35,15 @@ export type RouteDef =
3535
hideOnSidebar?: boolean;
3636
placeOnBottom?: boolean;
3737
}
38+
| {
39+
type: "routeDefinition";
40+
key: string; // Unique key for the route
41+
icon: typeof SvgIcon;
42+
title: string;
43+
route: string;
44+
hideOnSidebar?: boolean;
45+
placeOnBottom?: boolean;
46+
}
3847
| {
3948
type: "separator";
4049
key: string; // Unique key for the route
@@ -72,48 +81,57 @@ export const Layout: React.FC<{ routes: RouteDef[] }> = ({ routes }) => {
7281
const [state, dispatch] = React.useState<LayoutState>({ showDrawer: false });
7382
const toggleDrawer = () => dispatch((ps) => ({ ...ps, showDrawer: !ps.showDrawer }));
7483

75-
const SidebarItem: React.FC<{ routeInfo: RouteDef }> = ({ routeInfo }) =>
76-
routeInfo.type === "separator" ? (
77-
<ListItem key={routeInfo.title} disablePadding sx={{ minHeight: 48 }}>
78-
{state.showDrawer ? (
79-
<ListItemButton disabled>
80-
<ListItemText primary={routeInfo.title} />
81-
</ListItemButton>
82-
) : (
83-
<Stack
84-
alignItems="center"
85-
sx={(t) => ({
86-
width: t.spacing(7),
87-
[t.breakpoints.up("sm")]: { width: t.spacing(8) },
88-
})}
89-
>
90-
<Chip label={routeInfo.title} variant="outlined" size="small" sx={{ flexGrow: 0 }} />
91-
</Stack>
92-
)}
93-
</ListItem>
94-
) : (
95-
<ListItem key={`${routeInfo.app}-${routeInfo.resource}`} sx={routeInfo.placeOnBottom ? { marginTop: "auto" } : {}} disablePadding>
96-
<ListItemButton
97-
sx={{
98-
minHeight: 48,
99-
px: 2.5,
100-
justifyContent: state.showDrawer ? "initial" : "center",
101-
}}
102-
onClick={() => navigate(routeInfo.route || `/${routeInfo.app}/${routeInfo.resource}`)}
103-
>
104-
<ListItemIcon
105-
sx={{
106-
minWidth: 0,
107-
justifyContent: "center",
108-
mr: state.showDrawer ? 3 : "auto",
109-
}}
110-
>
111-
<routeInfo.icon />
112-
</ListItemIcon>
113-
{state.showDrawer && <ListItemText primary={routeInfo.title} />}
114-
</ListItemButton>
115-
</ListItem>
116-
);
84+
const SidebarItem: React.FC<{ routeInfo: RouteDef }> = ({ routeInfo }) => {
85+
switch (routeInfo.type) {
86+
case "separator":
87+
return (
88+
<ListItem key={routeInfo.key} disablePadding sx={{ minHeight: 48 }}>
89+
{state.showDrawer ? (
90+
<ListItemButton disabled>
91+
<ListItemText primary={routeInfo.title} />
92+
</ListItemButton>
93+
) : (
94+
<Stack
95+
alignItems="center"
96+
sx={(t) => ({
97+
width: t.spacing(7),
98+
[t.breakpoints.up("sm")]: { width: t.spacing(8) },
99+
})}
100+
>
101+
<Chip label={routeInfo.title} variant="outlined" size="small" sx={{ flexGrow: 0 }} />
102+
</Stack>
103+
)}
104+
</ListItem>
105+
);
106+
case "routeDefinition":
107+
case "autoAdminRouteDefinition":
108+
return (
109+
<ListItem key={routeInfo.key} sx={routeInfo.placeOnBottom ? { marginTop: "auto" } : {}} disablePadding>
110+
<ListItemButton
111+
sx={{
112+
minHeight: 48,
113+
px: 2.5,
114+
justifyContent: state.showDrawer ? "initial" : "center",
115+
}}
116+
onClick={() => navigate(routeInfo.type === "autoAdminRouteDefinition" ? `/${routeInfo.app}/${routeInfo.resource}` : routeInfo.route)}
117+
>
118+
<ListItemIcon
119+
sx={{
120+
minWidth: 0,
121+
justifyContent: "center",
122+
mr: state.showDrawer ? 3 : "auto",
123+
}}
124+
>
125+
<routeInfo.icon />
126+
</ListItemIcon>
127+
{state.showDrawer && <ListItemText primary={routeInfo.title} />}
128+
</ListItemButton>
129+
</ListItem>
130+
);
131+
default:
132+
return null;
133+
}
134+
};
117135

118136
const menuButtonStyle: (t: Theme) => React.CSSProperties = (t) => ({
119137
width: `calc(${t.spacing(7)} + 1px)`,

0 commit comments

Comments
 (0)