diff --git a/src/features/tech-log/presentation/studio/components/document-list.tsx b/src/features/tech-log/presentation/studio/components/document-list.tsx index c233541..22c29d3 100644 --- a/src/features/tech-log/presentation/studio/components/document-list.tsx +++ b/src/features/tech-log/presentation/studio/components/document-list.tsx @@ -2,12 +2,33 @@ import { useEffect, useState, type FormEvent } from "react"; import type { ListDocumentsQuery } from "../../../application/ports/studio-gateway.ts"; import type { DocumentPage } from "../../../contracts/studio/contract.ts"; +import type { components } from "../../../contracts/studio/generated.ts"; import { managementFailureMessage } from "../../../application/ports/management-gateway-error.ts"; import { useStudio } from "../use-studio.ts"; import { GuardedStudioLink } from "./guarded-studio-link.tsx"; import { StudioPagination } from "./studio-pagination.tsx"; import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts"; +type RecordKind = components["schemas"]["RecordKind"]; + +/* + 작업본 목록이 거를 수 있는 종류. 손으로 나열하지 않고 `Record` 에서 뽑는다 — + 종류가 늘면 컴파일러가 빈 자리를 잡는다. +*/ +const STUDIO_KIND_ORDER: Record = { + CASE: 1, + CONCEPT: 2, + REFERENCE: 3, + QUESTION: 4, + PROJECT_DECISION: 5, +}; + +const STUDIO_KINDS: ReadonlyArray = Object.freeze( + (Object.keys(STUDIO_KIND_ORDER) as RecordKind[]).sort( + (left, right) => STUDIO_KIND_ORDER[left] - STUDIO_KIND_ORDER[right], + ), +); + const publicationLabel = { NEVER_PUBLISHED: "게시 전", PUBLISHED: "게시 중", @@ -193,10 +214,16 @@ export function DocumentList() { } > - - - - + {/* + 이름은 공용 표에서 가져온다. 여기 손으로 적어 두었을 때 개념이 통째로 빠져 있었고 + — 개념 작업본은 만들 수는 있는데 걸러 볼 수가 없었다 — 이름도 영문이라 목록 안의 + 배지와 어긋났다. 같은 문서가 한 화면에서 두 이름으로 보였다. + */} + {STUDIO_KINDS.map((value) => ( + + ))}