Skip to content

Commit a3ccb5d

Browse files
committed
2 parents 3f52ef7 + 71c5744 commit a3ccb5d

19 files changed

Lines changed: 198 additions & 131 deletions

File tree

apps/ticket-admin/src/app/events/[eventId]/edit/_clientBoundary/EventEditFormClient/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export function EventEditFormClient({ eventId }: Props) {
9696
});
9797
});
9898
};
99+
99100
const handleRemoveSiteMapImage = (idOrUrl: number | string) => {
100101
setFormData((prev) => {
101102
const current = (prev.siteMapImages as PreviewMedia[] | undefined) ?? [];
@@ -696,7 +697,7 @@ export function EventEditFormClient({ eventId }: Props) {
696697
</Typography>
697698
<Typography type="body16" color="gray200">
698699
{eventDetailData.startDate}~{eventDetailData.endDate} / {eventDetailData.startTime}~
699-
{eventDetailData.endTime}/{eventDetailData.venue}
700+
{eventDetailData.endTime} / {eventDetailData.venue}
700701
</Typography>
701702
</div>
702703
<div className={cx("container")}>

apps/ticket-admin/src/app/events/[eventId]/edit/rounds/add/_clientBoundary/AddRoundFormClient/index.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,28 +208,29 @@ export function AddRoundFormClient({ eventId }: Props) {
208208
</Flex>
209209
<Flex className={cx("row")} direction="column" gap={12}>
210210
<Typography type="body16" weight="bold">
211-
Sales End Date
211+
Sales Start Time
212212
</Typography>
213-
<Select
214-
type="calendar"
215-
placeholder="티켓 차수 판매 종료 날짜를 선택해주세요"
216-
{...roundSalesEndDateField.selectProps}
213+
<TextField
214+
placeholder="티켓 차수 판매 시작 시간을 입력해주세요 (HH:MM)"
215+
value={roundSalesStartTimeField.value}
216+
onChange={roundSalesStartTimeField.handleChange}
217+
error={roundSalesStartTimeField.error}
217218
/>
218219
</Flex>
219220
</Flex>
220221

221222
<Flex gap={24}>
222223
<Flex className={cx("row")} direction="column" gap={12}>
223224
<Typography type="body16" weight="bold">
224-
Sales Start Time
225+
Sales End Date
225226
</Typography>
226-
<TextField
227-
placeholder="티켓 차수 판매 시작 시간을 입력해주세요 (HH:MM)"
228-
value={roundSalesStartTimeField.value}
229-
onChange={roundSalesStartTimeField.handleChange}
230-
error={roundSalesStartTimeField.error}
227+
<Select
228+
type="calendar"
229+
placeholder="티켓 차수 판매 종료 날짜를 선택해주세요"
230+
{...roundSalesEndDateField.selectProps}
231231
/>
232232
</Flex>
233+
233234
<Flex className={cx("row")} direction="column" gap={12}>
234235
<Typography type="body16" weight="bold">
235236
Sales End Time

apps/ticket-admin/src/app/events/[eventId]/edit/ticket-detail/_clientBoundary/EditTicketDetailFormClient/index.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,26 +219,26 @@ export function EditTicketDetailFormClient({ eventId, ticketRoundId }: Props) {
219219
</Flex>
220220
<Flex className={cx("row")} direction="column" gap={12}>
221221
<Typography type="body16" weight="bold">
222-
Sales End Date
222+
Sales Start Time
223223
</Typography>
224-
<Select
225-
type="calendar"
226-
placeholder="티켓 차수 판매 종료 날짜를 선택해주세요"
227-
{...roundSalesEndDateField.selectProps}
224+
<TextField
225+
placeholder="티켓 차수 판매 시작 시간을 입력해주세요 (HH:MM)"
226+
value={roundSalesStartTimeField.value}
227+
onChange={roundSalesStartTimeField.handleChange}
228+
error={roundSalesStartTimeField.error}
228229
/>
229230
</Flex>
230231
</Flex>
231232

232233
<Flex gap={24}>
233234
<Flex className={cx("row")} direction="column" gap={12}>
234235
<Typography type="body16" weight="bold">
235-
Sales Start Time
236+
Sales End Date
236237
</Typography>
237-
<TextField
238-
placeholder="티켓 차수 판매 시작 시간을 입력해주세요 (HH:MM)"
239-
value={roundSalesStartTimeField.value}
240-
onChange={roundSalesStartTimeField.handleChange}
241-
error={roundSalesStartTimeField.error}
238+
<Select
239+
type="calendar"
240+
placeholder="티켓 차수 판매 종료 날짜를 선택해주세요"
241+
{...roundSalesEndDateField.selectProps}
242242
/>
243243
</Flex>
244244
<Flex className={cx("row")} direction="column" gap={12}>

apps/ticket-admin/src/app/events/[eventId]/edit/timeTable/_clientBoundary/TimeTableManagementClient/index.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
"use client";
22

3+
import Link from "next/link";
34
import classNames from "classnames/bind";
45

56
import { Button, Flex, Select, TextField, Typography } from "@permit/design-system";
67
import { useSelect, useTextField } from "@permit/design-system/hooks";
78
import { useTimeTableSuspenseQuery } from "@/data/admin/getTimeTables/queries";
89
import { useTimeTableMutation } from "@/data/admin/patchTimeTables/mutation";
910
import { usePostTimeTableInitial } from "@/data/admin/postTimeTable/mutation";
11+
import { EXTERNAL_PATH } from "@/shared/constants/path";
12+
import { getPathUrl } from "@/shared/helpers/getPathUrl";
1013

1114
import styles from "./index.module.scss";
1215

@@ -24,8 +27,6 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
2427
},
2528
});
2629

27-
console.log("@@timeTableData", timeTableData);
28-
2930
const { mutateAsync: createTimeTable, isPending } = usePostTimeTableInitial({
3031
eventId,
3132
});
@@ -122,8 +123,6 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
122123
alert("타임테이블 생성에 실패했습니다. 다시 시도해주세요.");
123124
}
124125
} else {
125-
console.log("@@@@");
126-
127126
try {
128127
await updateTimeTable({
129128
timetableId: timeTableData.timetableId,
@@ -149,6 +148,13 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
149148
<div className={cx("container")}>
150149
<Typography type="title24">TimeTable</Typography>
151150
{/* TODO: 최초 등록에만 사용해주세요. */}
151+
{timeTableData?.eventId && (
152+
<Link href={getPathUrl(EXTERNAL_PATH.TIMETABLE, { eventId: timeTableData.eventId })}>
153+
<Typography type="body16" weight="bold" style={{ marginTop: "12px", color: "#5640ff" }}>
154+
TimeTable 로 이동하기
155+
</Typography>
156+
</Link>
157+
)}
152158

153159
<Flex direction="column" gap={24} style={{ marginTop: 32 }}>
154160
<Flex gap={24}>
@@ -164,28 +170,29 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
164170
</Flex>
165171
<Flex className={cx("row")} direction="column" gap={12}>
166172
<Typography type="body16" weight="bold">
167-
TimeTable End Date
173+
Start Time
168174
</Typography>
169-
<Select
170-
type="calendar"
171-
placeholder="타임테이블 종료 날짜를 선택해주세요"
172-
{...timeTableEndDateField.selectProps}
175+
<TextField
176+
placeholder="타임테이블 시작 시간을 입력해주세요 (HH:MM)"
177+
value={timeTableStartTimeField.value}
178+
onChange={timeTableStartTimeField.handleChange}
179+
error={timeTableStartTimeField.error}
173180
/>
174181
</Flex>
175182
</Flex>
176183

177184
<Flex gap={24}>
178185
<Flex className={cx("row")} direction="column" gap={12}>
179186
<Typography type="body16" weight="bold">
180-
Start Time
187+
TimeTable End Date
181188
</Typography>
182-
<TextField
183-
placeholder="타임테이블 시작 시간을 입력해주세요 (HH:MM)"
184-
value={timeTableStartTimeField.value}
185-
onChange={timeTableStartTimeField.handleChange}
186-
error={timeTableStartTimeField.error}
189+
<Select
190+
type="calendar"
191+
placeholder="타임테이블 종료 날짜를 선택해주세요"
192+
{...timeTableEndDateField.selectProps}
187193
/>
188194
</Flex>
195+
189196
<Flex className={cx("row")} direction="column" gap={12}>
190197
<Typography type="body16" weight="bold">
191198
End Time

apps/ticket-admin/src/app/events/create/_clientBoundary/EventFormClient/index.tsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
usePutS3Upload,
1515
} from "@/data/admin/postPresignedUrls/mutation";
1616
import { toCDNUrl } from "@/shared/helpers/toCdnUrl";
17+
import { isAxiosErrorResponse } from "@/shared/types/axioxError";
1718

1819
import { EventFormLayout } from "../../_components/EventFormLayout";
1920
import { PreviewMedia } from "../../_components/ImageUploader";
@@ -486,6 +487,27 @@ export function EventFormClient() {
486487
}));
487488
};
488489

490+
const handleRemoveOriginalImage = (url: string) => {
491+
setFormData((prev) => ({
492+
...prev,
493+
images: prev.images.filter((m) => {
494+
return (m.id as unknown as string) !== url && m.imageUrl !== url;
495+
}),
496+
}));
497+
};
498+
499+
const handleRemoveSiteMapImage = (idOrUrl: number | string) => {
500+
setFormData((prev) => {
501+
const current = (prev.siteMapImages as PreviewMedia[] | undefined) ?? [];
502+
const next = current.filter((img) => img.id !== idOrUrl && img.imageUrl !== idOrUrl);
503+
504+
return {
505+
...prev,
506+
siteMapImages: next,
507+
};
508+
});
509+
};
510+
489511
const handleSubmit = async () => {
490512
setIsSubmitting(true);
491513

@@ -594,12 +616,17 @@ export function EventFormClient() {
594616
};
595617

596618
await createEvent(apiData);
619+
alert("이벤트가 생성되었습니다!");
597620

598621
// 성공 시 이벤트 목록으로 이동
599622
router.push("/events");
600623
} catch (error) {
601-
alert("이벤트 생성 중 오류가 발생했습니다. 다시 시도해주세요.");
602-
console.error("Error creating event:", error);
624+
console.log(error);
625+
626+
if (isAxiosErrorResponse(error)) {
627+
alert("이벤트 생성 중 오류가 발생했습니다. 다시 시도해주세요.\n" + error.message);
628+
console.error("Error creating event:", error);
629+
}
603630
} finally {
604631
setIsSubmitting(false);
605632
}
@@ -649,6 +676,8 @@ export function EventFormClient() {
649676
onAddTicket={addTicket}
650677
onUpdateTicket={updateTicket}
651678
onDeleteTicket={deleteTicket}
679+
onRemoveOriginalImage={handleRemoveOriginalImage}
680+
onRemoveSiteMapImage={handleRemoveSiteMapImage}
652681
/>
653682

654683
<div className={cx("floating")}>

apps/ticket-admin/src/app/events/create/_components/EventFormLayout/index.tsx

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,17 @@ export function EventFormLayout({
131131
<Flex className={cx("row")} direction="column" gap={12}>
132132
<Flex align="flex-start" gap={8}>
133133
<Typography type="body16" weight="bold">
134-
Event Exposure End Date
134+
Event Exposure Start Time
135135
</Typography>
136136
<div className={cx("required")}>*</div>
137137
</Flex>
138-
<Select
139-
disabled={isReadOnlyMode}
140-
type="calendar"
141-
placeholder="노출 종료 날짜를 선택해주세요"
142-
{...eventExposureEndDateField}
138+
<TextField
139+
readOnly={isReadOnlyMode}
140+
showBorderinReadOnly={isReadOnlyMode}
141+
placeholder="이벤트 노출 시작 시간을 입력해주세요 (HH:MM)"
142+
value={eventExposureStartTimeField.value}
143+
onChange={eventExposureStartTimeField.handleChange}
144+
error={eventExposureStartTimeField.error}
143145
/>
144146
</Flex>
145147
</Flex>
@@ -148,19 +150,18 @@ export function EventFormLayout({
148150
<Flex className={cx("row")} direction="column" gap={12}>
149151
<Flex align="flex-start" gap={8}>
150152
<Typography type="body16" weight="bold">
151-
Event Exposure Start Time
153+
Event Exposure End Date
152154
</Typography>
153155
<div className={cx("required")}>*</div>
154156
</Flex>
155-
<TextField
156-
readOnly={isReadOnlyMode}
157-
showBorderinReadOnly={isReadOnlyMode}
158-
placeholder="이벤트 노출 시작 시간을 입력해주세요 (HH:MM)"
159-
value={eventExposureStartTimeField.value}
160-
onChange={eventExposureStartTimeField.handleChange}
161-
error={eventExposureStartTimeField.error}
157+
<Select
158+
disabled={isReadOnlyMode}
159+
type="calendar"
160+
placeholder="노출 종료 날짜를 선택해주세요"
161+
{...eventExposureEndDateField}
162162
/>
163163
</Flex>
164+
164165
<Flex className={cx("row")} direction="column" gap={12}>
165166
<Flex align="flex-start" gap={8}>
166167
<Typography type="body16" weight="bold">
@@ -249,15 +250,17 @@ export function EventFormLayout({
249250
<Flex className={cx("row")} direction="column" gap={12}>
250251
<Flex align="flex-start" gap={8}>
251252
<Typography type="body16" weight="bold">
252-
End Date
253+
Start Time
253254
</Typography>
254255
<div className={cx("required")}>*</div>
255256
</Flex>
256-
<Select
257-
disabled={isReadOnlyMode}
258-
type="calendar"
259-
placeholder="이벤트 종료 날짜를 선택해주세요"
260-
{...eventEndDateField}
257+
<TextField
258+
readOnly={isReadOnlyMode}
259+
showBorderinReadOnly={isReadOnlyMode}
260+
placeholder="이벤트 시작 시간을 입력해주세요 (HH:MM)"
261+
value={eventStartTimeField.value}
262+
onChange={eventStartTimeField.handleChange}
263+
error={eventStartTimeField.error}
261264
/>
262265
</Flex>
263266
</Flex>
@@ -266,17 +269,15 @@ export function EventFormLayout({
266269
<Flex className={cx("row")} direction="column" gap={12}>
267270
<Flex align="flex-start" gap={8}>
268271
<Typography type="body16" weight="bold">
269-
Start Time
272+
End Date
270273
</Typography>
271274
<div className={cx("required")}>*</div>
272275
</Flex>
273-
<TextField
274-
readOnly={isReadOnlyMode}
275-
showBorderinReadOnly={isReadOnlyMode}
276-
placeholder="이벤트 시작 시간을 입력해주세요 (HH:MM)"
277-
value={eventStartTimeField.value}
278-
onChange={eventStartTimeField.handleChange}
279-
error={eventStartTimeField.error}
276+
<Select
277+
disabled={isReadOnlyMode}
278+
type="calendar"
279+
placeholder="이벤트 종료 날짜를 선택해주세요"
280+
{...eventEndDateField}
280281
/>
281282
</Flex>
282283
<Flex className={cx("row")} direction="column" gap={12}>
@@ -449,13 +450,15 @@ export function EventFormLayout({
449450
</Flex>
450451
<Flex className={cx("row")} direction="column" gap={12}>
451452
<Typography type="body16" weight="bold">
452-
Exposure End Date
453+
Exposure End Time
453454
</Typography>
454-
<Select
455-
disabled={isReadOnlyMode}
456-
type="calendar"
457-
placeholder="티켓 차수 판매 종료 날짜를 선택해주세요"
458-
{...roundSalesEndDate}
455+
<TextField
456+
readOnly={isReadOnlyMode}
457+
showBorderinReadOnly={isReadOnlyMode}
458+
placeholder="티켓 차수 판매 종료 시간을 입력해주세요 (HH:MM)"
459+
value={roundSalesEndTime.value}
460+
onChange={roundSalesEndTime.handleChange}
461+
error={roundSalesEndTime.error}
459462
/>
460463
</Flex>
461464
</Flex>
@@ -474,17 +477,16 @@ export function EventFormLayout({
474477
error={roundSalesStartTime.error}
475478
/>
476479
</Flex>
480+
477481
<Flex className={cx("row")} direction="column" gap={12}>
478482
<Typography type="body16" weight="bold">
479-
Exposure End Time
483+
Exposure End Date
480484
</Typography>
481-
<TextField
482-
readOnly={isReadOnlyMode}
483-
showBorderinReadOnly={isReadOnlyMode}
484-
placeholder="티켓 차수 판매 종료 시간을 입력해주세요 (HH:MM)"
485-
value={roundSalesEndTime.value}
486-
onChange={roundSalesEndTime.handleChange}
487-
error={roundSalesEndTime.error}
485+
<Select
486+
disabled={isReadOnlyMode}
487+
type="calendar"
488+
placeholder="티켓 차수 판매 종료 날짜를 선택해주세요"
489+
{...roundSalesEndDate}
488490
/>
489491
</Flex>
490492
</Flex>

0 commit comments

Comments
 (0)