From 9624494fa0e127dfb7c242a475d4cb5228c082c7 Mon Sep 17 00:00:00 2001 From: whqtker Date: Sat, 27 Jun 2026 17:40:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20=ED=98=B8=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=8C=80=ED=95=99=EA=B5=90=20=ED=91=9C=EC=8B=9C=EB=AA=85=20?= =?UTF-8?q?=EC=98=81=EB=AC=B8=EB=AA=85=20=EA=B8=B0=EB=B0=98=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../univ-apply-infos/tabs/HostUniversityTab.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx b/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx index b2f6e675..7096c6ac 100644 --- a/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx +++ b/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx @@ -19,18 +19,25 @@ import { normalizeImageUrlToUploadCdn } from "@/lib/utils/cdnUrl"; type ModalState = { open: false } | { open: true; mode: "create" } | { open: true; mode: "edit"; id: number }; -interface HostUniversityFormState extends HostUniversityPayload { +interface HostUniversityFormState extends Omit { logoImageUrl: string; backgroundImageUrl: string; } -const REQUIRED_FIELDS = ["koreanName", "englishName", "formatName", "countryCode", "regionCode"] as const; +function toFormatName(englishName: string): string { + return englishName + .trim() + .toLowerCase() + .replace(/[^a-z0-9]+/g, "_") + .replace(/^_+|_+$/g, ""); +} + +const REQUIRED_FIELDS = ["koreanName", "englishName", "countryCode", "regionCode"] as const; const OPTIONAL_FIELDS = ["homepageUrl", "englishCourseUrl", "accommodationUrl"] as const; const FIELD_LABELS: Record = { koreanName: "한글명", englishName: "영문명", - formatName: "표시명", countryCode: "국가코드", regionCode: "권역코드", homepageUrl: "홈페이지 URL", @@ -42,7 +49,6 @@ const FIELD_LABELS: Record = { const EMPTY_FORM: HostUniversityFormState = { koreanName: "", englishName: "", - formatName: "", logoImageUrl: "", backgroundImageUrl: "", countryCode: "", @@ -57,7 +63,6 @@ function detailToForm(detail: HostUniversityDetailResponse): HostUniversityFormS return { koreanName: detail.koreanName, englishName: detail.englishName, - formatName: detail.formatName, logoImageUrl: detail.logoImageUrl, backgroundImageUrl: detail.backgroundImageUrl, countryCode: detail.countryCode, @@ -73,7 +78,7 @@ function toPayload(form: HostUniversityFormState): HostUniversityPayload { return { koreanName: form.koreanName, englishName: form.englishName, - formatName: form.formatName, + formatName: toFormatName(form.englishName), countryCode: form.countryCode, regionCode: form.regionCode, homepageUrl: form.homepageUrl || undefined, From 46dcb15ac66958d4b26b009756fd8f3b91092d71 Mon Sep 17 00:00:00 2001 From: whqtker Date: Sat, 27 Jun 2026 17:49:06 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EB=8C=80=ED=95=99=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC=20(=ED=98=91=EC=A0=95=20=EB=8C=80=ED=95=99=E2=86=92?= =?UTF-8?q?=EA=B5=AD=EB=82=B4=20=EB=8C=80=ED=95=99,=20=ED=98=B8=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=8C=80=ED=95=99=EA=B5=90=E2=86=92=ED=95=B4?= =?UTF-8?q?=EC=99=B8=20=EB=8C=80=ED=95=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../HomeUniversitiesPageContent.tsx | 24 +++++++++---------- .../UnivApplyInfosPageContent.tsx | 8 ++----- .../tabs/HostUniversityTab.test.tsx | 4 +--- .../tabs/HostUniversityTab.tsx | 14 +++++------ .../tabs/UnivApplyInfoImportTab.tsx | 8 +++---- .../tabs/UnivApplyInfoManageTab.tsx | 12 +++++----- .../src/components/layout/AdminSidebar.tsx | 2 +- 7 files changed, 32 insertions(+), 40 deletions(-) diff --git a/apps/admin/src/components/features/home-universities/HomeUniversitiesPageContent.tsx b/apps/admin/src/components/features/home-universities/HomeUniversitiesPageContent.tsx index 68169d9c..94567d28 100644 --- a/apps/admin/src/components/features/home-universities/HomeUniversitiesPageContent.tsx +++ b/apps/admin/src/components/features/home-universities/HomeUniversitiesPageContent.tsx @@ -35,9 +35,9 @@ export function HomeUniversitiesPageContent() { await invalidate(); setName(""); setMaxChoiceCount(""); - toast.success("협정 대학을 생성했습니다."); + toast.success("국내 대학을 생성했습니다."); }, - onError: () => toast.error("협정 대학 생성에 실패했습니다."), + onError: () => toast.error("국내 대학 생성에 실패했습니다."), }); const updateMutation = useMutation({ @@ -46,18 +46,18 @@ export function HomeUniversitiesPageContent() { onSuccess: async () => { await invalidate(); setEditingId(null); - toast.success("협정 대학을 수정했습니다."); + toast.success("국내 대학을 수정했습니다."); }, - onError: () => toast.error("협정 대학 수정에 실패했습니다."), + onError: () => toast.error("국내 대학 수정에 실패했습니다."), }); const deleteMutation = useMutation({ mutationFn: adminApi.deleteHomeUniversity, onSuccess: async () => { await invalidate(); - toast.success("협정 대학을 삭제했습니다."); + toast.success("국내 대학을 삭제했습니다."); }, - onError: () => toast.error("협정 대학 삭제에 실패했습니다."), + onError: () => toast.error("국내 대학 삭제에 실패했습니다."), }); const handleCreate = (e: FormEvent) => { @@ -88,7 +88,7 @@ export function HomeUniversitiesPageContent() { }; const handleDelete = (id: number, univName: string) => { - if (!window.confirm(`협정 대학 "${univName}"을 삭제할까요?`)) return; + if (!window.confirm(`국내 대학 "${univName}"을 삭제할까요?`)) return; deleteMutation.mutate(id); }; @@ -97,14 +97,14 @@ export function HomeUniversitiesPageContent() { return (
-

협정 대학

+

국내 대학

예: 인하대학교

총 {universities.length.toLocaleString()}건

@@ -144,13 +144,13 @@ export function HomeUniversitiesPageContent() { ) : query.isError ? ( - 협정 대학을 불러오지 못했습니다. + 국내 대학을 불러오지 못했습니다. ) : universities.length === 0 ? ( - 협정 대학이 없습니다. + 국내 대학이 없습니다. ) : ( diff --git a/apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx b/apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx index bc1c3322..c1043da2 100644 --- a/apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx +++ b/apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx @@ -8,15 +8,11 @@ import { UnivApplyInfoManageTab } from "./tabs/UnivApplyInfoManageTab"; export function UnivApplyInfosPageContent() { return ( - +
- 호스트 대학교 + 해외 대학 지원 대학 가져오기 지원 대학 관리 diff --git a/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.test.tsx b/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.test.tsx index d5c2fbf1..ed894e6f 100644 --- a/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.test.tsx +++ b/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.test.tsx @@ -28,7 +28,7 @@ function renderTab() { async function openCreateModal() { renderTab(); - fireEvent.click(await screen.findByRole("button", { name: "호스트 대학교 생성" })); + fireEvent.click(await screen.findByRole("button", { name: "해외 대학 생성" })); } describe("HostUniversityTab image uploads", () => { @@ -78,7 +78,6 @@ describe("HostUniversityTab image uploads", () => { fireEvent.change(screen.getByLabelText("한글명 *"), { target: { value: "테스트 대학교" } }); fireEvent.change(screen.getByLabelText("영문명 *"), { target: { value: "Test University" } }); - fireEvent.change(screen.getByLabelText("표시명 *"), { target: { value: "Test U" } }); fireEvent.change(screen.getByLabelText("국가코드 *"), { target: { value: "JP" } }); fireEvent.change(screen.getByLabelText("권역코드 *"), { target: { value: "ASIA" } }); @@ -94,7 +93,6 @@ describe("HostUniversityTab image uploads", () => { fireEvent.change(screen.getByLabelText("한글명 *"), { target: { value: "테스트 대학교" } }); fireEvent.change(screen.getByLabelText("영문명 *"), { target: { value: "Test University" } }); - fireEvent.change(screen.getByLabelText("표시명 *"), { target: { value: "Test U" } }); fireEvent.change(screen.getByLabelText("국가코드 *"), { target: { value: "JP" } }); fireEvent.change(screen.getByLabelText("권역코드 *"), { target: { value: "ASIA" } }); diff --git a/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx b/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx index 7096c6ac..cab132af 100644 --- a/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx +++ b/apps/admin/src/components/features/univ-apply-infos/tabs/HostUniversityTab.tsx @@ -146,7 +146,7 @@ export function HostUniversityTab() { onSuccess: async () => { await invalidate(); closeModal(); - toast.success("호스트 대학교를 생성했습니다."); + toast.success("해외 대학을 생성했습니다."); }, onError: (e: unknown) => { const msg = e instanceof Error ? e.message : "생성에 실패했습니다."; @@ -169,7 +169,7 @@ export function HostUniversityTab() { onSuccess: async () => { await invalidate(); closeModal(); - toast.success("호스트 대학교를 수정했습니다."); + toast.success("해외 대학을 수정했습니다."); }, onError: (e: unknown) => { const msg = e instanceof Error ? e.message : "수정에 실패했습니다."; @@ -181,7 +181,7 @@ export function HostUniversityTab() { mutationFn: (id: number) => adminApi.deleteHostUniversity(id), onSuccess: async () => { await invalidate(); - toast.success("호스트 대학교를 삭제했습니다."); + toast.success("해외 대학을 삭제했습니다."); }, onError: (e: unknown) => { const msg = e instanceof Error ? e.message : "삭제에 실패했습니다."; @@ -271,9 +271,9 @@ export function HostUniversityTab() {
-

호스트 대학교

+

해외 대학

@@ -437,9 +437,7 @@ export function HostUniversityTab() { className="relative flex max-h-[90vh] w-full max-w-lg flex-col overflow-y-auto rounded-xl bg-k-0 shadow-xl" >
-

- {modal.mode === "create" ? "호스트 대학교 생성" : "호스트 대학교 수정"} -

+

{modal.mode === "create" ? "해외 대학 생성" : "해외 대학 수정"}

diff --git a/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoImportTab.tsx b/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoImportTab.tsx index 5b3099c9..9985d859 100644 --- a/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoImportTab.tsx +++ b/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoImportTab.tsx @@ -124,7 +124,7 @@ export function UnivApplyInfoImportTab() { const univId = Number(homeUniversityId); const term = Number(termId); if (!univId || !term) { - toast.error("협정 대학과 학기를 선택해주세요."); + toast.error("국내 대학과 학기를 선택해주세요."); return; } if (!markdown.trim()) { @@ -206,7 +206,7 @@ export function UnivApplyInfoImportTab() {
{homeUniversitiesQuery.isLoading &&

불러오는 중...

} {homeUniversitiesQuery.isError && ( -

협정 대학을 불러오지 못했습니다.

+

국내 대학을 불러오지 못했습니다.

)}
diff --git a/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx b/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx index 3050e268..5c313279 100644 --- a/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx +++ b/apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx @@ -183,7 +183,7 @@ export function UnivApplyInfoManageTab() { e.preventDefault(); const { termId, homeUniversityId, hostUniversityId } = createForm; if (!termId || !homeUniversityId || !hostUniversityId) { - toast.error("학기, 협정 대학, 호스트 대학교는 필수입니다."); + toast.error("학기, 국내 대학, 해외 대학는 필수입니다."); return; } @@ -278,7 +278,7 @@ export function UnivApplyInfoManageTab() { ID 학기 대학명 - 협정대학 + 국내 대학 국가 정원 작업 @@ -502,7 +502,7 @@ export function UnivApplyInfoManageTab() {
{hostSearchQuery2.data?.content.map((u) => (