Merge lane/H: presentation (07-01, 08-02, 08-04, 08-05, 08-07~08-13, 11-02, F-10)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # config/contracts/registry-change-evidence.json
This commit is contained in:
@@ -88,7 +88,8 @@ export const REFERENCE_FEATURE_CONTRACT = Object.freeze({
|
||||
}),
|
||||
REFERENCE_RESOURCE_DETAIL: Object.freeze({
|
||||
routeId: "REFERENCE_RESOURCE_DETAIL",
|
||||
path: "/examples/reference-resources/:resourceId",
|
||||
// 08-13. `items/` keeps an id such as `new` or `status` off the static routes.
|
||||
path: "/examples/reference-resources/items/:resourceId",
|
||||
paramsSchema: "ReferenceResourceParams",
|
||||
searchSchema: null,
|
||||
access: "session-required",
|
||||
|
||||
@@ -8,6 +8,41 @@ export const REFERENCE_MESSAGE_CATALOGS = Object.freeze({
|
||||
"route.REFERENCE_RESOURCE_FORM.title": "Create reference resource",
|
||||
"route.REFERENCE_RESOURCE_STATUS.navigation": "Reference status",
|
||||
"route.REFERENCE_RESOURCE_STATUS.title": "Reference resource status",
|
||||
"reference.list.eyebrow": "제거 가능한 수직 슬라이스",
|
||||
"reference.list.description":
|
||||
"URL codec, application input, HTTP/schema/mapper와 query 상태를 한 경로로 검증합니다.",
|
||||
"reference.list.create": "새 항목 만들기",
|
||||
"reference.list.refresh": "새로고침",
|
||||
"reference.list.resultCount": "총 {count}개 항목",
|
||||
"reference.form.back": "목록으로 돌아가기",
|
||||
"reference.form.title": "Reference resource 만들기",
|
||||
"reference.form.description":
|
||||
"presentation schema, command mapper, 422/conflict와 dirty navigation 정책을 실행합니다.",
|
||||
"reference.form.name": "새 항목 이름",
|
||||
"reference.form.nameDescription":
|
||||
"앞뒤 공백은 command mapper 전에 제거됩니다.",
|
||||
"reference.form.note": "설명",
|
||||
"reference.form.noteDescription":
|
||||
"선택 입력이며 비어 있으면 command에 포함되지 않습니다.",
|
||||
"reference.form.cancel": "취소",
|
||||
"reference.form.save": "저장",
|
||||
"reference.form.saving": "저장 중…",
|
||||
"reference.form.reset": "초기화",
|
||||
"reference.form.reloadList": "목록을 새로 불러와 확인",
|
||||
"reference.form.saved": "저장했습니다.",
|
||||
"reference.form.conflict": "충돌을 해결한 뒤 다시 제출할 수 있습니다.",
|
||||
"reference.form.privacy":
|
||||
"form value는 URL, storage, telemetry에 저장되지 않고 submit 시에만 application command로 변환됩니다.",
|
||||
"reference.detail.description":
|
||||
"route param과 detail query의 reset 경계를 확인합니다.",
|
||||
"reference.detail.summaryPending": "요약 정보를 준비하고 있습니다.",
|
||||
"reference.detail.sectionSlot":
|
||||
"이 영역에는 제품별 상세 section을 조립할 수 있습니다.",
|
||||
"reference.detail.aside": "상세 페이지의 관련 정보 slot입니다.",
|
||||
"reference.status.title": "잠시 사용할 수 없습니다.",
|
||||
"reference.status.description":
|
||||
"도메인 데이터나 raw 오류를 노출하지 않는 중립적인 상태 페이지 예시입니다.",
|
||||
"reference.status.back": "목록으로 이동",
|
||||
}),
|
||||
"en-US": Object.freeze({
|
||||
"route.REFERENCE_RESOURCE_LIST.navigation": "Reference feature",
|
||||
@@ -18,5 +53,40 @@ export const REFERENCE_MESSAGE_CATALOGS = Object.freeze({
|
||||
"route.REFERENCE_RESOURCE_FORM.title": "Create reference resource",
|
||||
"route.REFERENCE_RESOURCE_STATUS.navigation": "Reference status",
|
||||
"route.REFERENCE_RESOURCE_STATUS.title": "Reference resource status",
|
||||
"reference.list.eyebrow": "Removable vertical slice",
|
||||
"reference.list.description":
|
||||
"Checks the URL codec, application input, HTTP/schema/mapper and query state along one path.",
|
||||
"reference.list.create": "Create item",
|
||||
"reference.list.refresh": "Refresh",
|
||||
"reference.list.resultCount": "Total items: {count}",
|
||||
"reference.form.back": "Back to the list",
|
||||
"reference.form.title": "Create a reference resource",
|
||||
"reference.form.description":
|
||||
"Runs the presentation schema, command mapper, 422/conflict and dirty navigation policies.",
|
||||
"reference.form.name": "New item name",
|
||||
"reference.form.nameDescription":
|
||||
"Leading and trailing spaces are removed before the command mapper.",
|
||||
"reference.form.note": "Description",
|
||||
"reference.form.noteDescription":
|
||||
"Optional. An empty value is left out of the command.",
|
||||
"reference.form.cancel": "Cancel",
|
||||
"reference.form.save": "Save",
|
||||
"reference.form.saving": "Saving…",
|
||||
"reference.form.reset": "Reset",
|
||||
"reference.form.reloadList": "Reload the list to check",
|
||||
"reference.form.saved": "Saved.",
|
||||
"reference.form.conflict": "Resolve the conflict, then submit again.",
|
||||
"reference.form.privacy":
|
||||
"Form values are never written to the URL, storage or telemetry; they become an application command only on submit.",
|
||||
"reference.detail.description":
|
||||
"Checks the reset boundary between the route parameter and the detail query.",
|
||||
"reference.detail.summaryPending": "Preparing the summary.",
|
||||
"reference.detail.sectionSlot":
|
||||
"Product-specific detail sections can be assembled here.",
|
||||
"reference.detail.aside": "Related information slot of the detail page.",
|
||||
"reference.status.title": "Temporarily unavailable.",
|
||||
"reference.status.description":
|
||||
"An example of a neutral status page that exposes no domain data or raw errors.",
|
||||
"reference.status.back": "Go to the list",
|
||||
}),
|
||||
} as const);
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function ReferenceResourceDetailPage() {
|
||||
heading={{
|
||||
eyebrow: "DetailPage",
|
||||
title: resource?.title ?? "Reference detail",
|
||||
description: "route param과 detail query의 reset 경계를 확인합니다.",
|
||||
description: message("reference.detail.description"),
|
||||
}}
|
||||
metadata={
|
||||
resource ? (
|
||||
@@ -41,7 +41,7 @@ export default function ReferenceResourceDetailPage() {
|
||||
</dd>
|
||||
</dl>
|
||||
) : (
|
||||
<p>요약 정보를 준비하고 있습니다.</p>
|
||||
<p>{message("reference.detail.summaryPending")}</p>
|
||||
)
|
||||
}
|
||||
feedback={
|
||||
@@ -51,11 +51,11 @@ export default function ReferenceResourceDetailPage() {
|
||||
onRetry={query.retry}
|
||||
>
|
||||
{resource ? (
|
||||
<p>이 영역에는 제품별 상세 section을 조립할 수 있습니다.</p>
|
||||
<p>{message("reference.detail.sectionSlot")}</p>
|
||||
) : null}
|
||||
</AsyncSurface>
|
||||
}
|
||||
aside={<p>상세 페이지의 관련 정보 slot입니다.</p>}
|
||||
aside={<p>{message("reference.detail.aside")}</p>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
useAppForm,
|
||||
useDirtyNavigationGuard,
|
||||
} from "../../../presentation/design-system/index.ts";
|
||||
import { useLocale } from "../../../presentation/i18n/index.ts";
|
||||
import { useQueryInvalidationCoordinator } from "../../../presentation/adapters/query/query-invalidation-provider.tsx";
|
||||
import { REFERENCE_RESOURCE_INVALIDATION_TOPIC } from "../contracts/reference-feature-contract.ts";
|
||||
import {
|
||||
@@ -25,13 +26,13 @@ import {
|
||||
import { useReferenceFailureAction } from "./use-reference-failure-action.ts";
|
||||
import { useReferenceCreate } from "./use-reference-feature.ts";
|
||||
|
||||
const FIELD_LABELS = Object.freeze({
|
||||
name: "새 항목 이름",
|
||||
note: "설명",
|
||||
}) satisfies Record<keyof ReferenceResourceFormValues, string>;
|
||||
|
||||
export default function ReferenceResourceFormPage() {
|
||||
const navigate = useNavigate();
|
||||
const { message } = useLocale();
|
||||
const fieldLabels = {
|
||||
name: message("reference.form.name"),
|
||||
note: message("reference.form.note"),
|
||||
} satisfies Record<keyof ReferenceResourceFormValues, string>;
|
||||
const mutation = useReferenceCreate();
|
||||
const invalidation = useQueryInvalidationCoordinator();
|
||||
const submit = useCallback(
|
||||
@@ -72,20 +73,19 @@ export default function ReferenceResourceFormPage() {
|
||||
type="button"
|
||||
onClick={() => navigate("/examples/reference-resources")}
|
||||
>
|
||||
목록으로 돌아가기
|
||||
{message("reference.form.back")}
|
||||
</button>
|
||||
}
|
||||
heading={{
|
||||
eyebrow: "FormPage",
|
||||
title: "Reference resource 만들기",
|
||||
description:
|
||||
"presentation schema, command mapper, 422/conflict와 dirty navigation 정책을 실행합니다.",
|
||||
title: message("reference.form.title"),
|
||||
description: message("reference.form.description"),
|
||||
}}
|
||||
errorSummary={
|
||||
<ErrorSummary
|
||||
fieldErrors={form.fieldErrors}
|
||||
formErrors={form.formErrors}
|
||||
fieldLabels={FIELD_LABELS}
|
||||
fieldLabels={fieldLabels}
|
||||
fieldId={form.fieldId}
|
||||
onFocusField={form.focusField}
|
||||
/>
|
||||
@@ -94,15 +94,15 @@ export default function ReferenceResourceFormPage() {
|
||||
<>
|
||||
<FormField
|
||||
{...form.field("name")}
|
||||
label={FIELD_LABELS.name}
|
||||
description="앞뒤 공백은 command mapper 전에 제거됩니다."
|
||||
label={fieldLabels.name}
|
||||
description={message("reference.form.nameDescription")}
|
||||
autoComplete="off"
|
||||
required
|
||||
/>
|
||||
<FormField
|
||||
{...form.field("note")}
|
||||
label={FIELD_LABELS.note}
|
||||
description="선택 입력이며 비어 있으면 command에 포함되지 않습니다."
|
||||
label={fieldLabels.note}
|
||||
description={message("reference.form.noteDescription")}
|
||||
autoComplete="off"
|
||||
/>
|
||||
</>
|
||||
@@ -114,20 +114,22 @@ export default function ReferenceResourceFormPage() {
|
||||
onClick={() => navigate("/examples/reference-resources")}
|
||||
disabled={form.pending || mutationBlocked}
|
||||
>
|
||||
취소
|
||||
{message("reference.form.cancel")}
|
||||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={form.pending || mutationBlocked}
|
||||
>
|
||||
{form.pending ? "저장 중…" : "저장"}
|
||||
{form.pending
|
||||
? message("reference.form.saving")
|
||||
: message("reference.form.save")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => form.reset()}
|
||||
disabled={!form.dirty || form.pending || mutationBlocked}
|
||||
>
|
||||
초기화
|
||||
{message("reference.form.reset")}
|
||||
</Button>
|
||||
</FormActions>
|
||||
}
|
||||
@@ -163,21 +165,18 @@ export default function ReferenceResourceFormPage() {
|
||||
.catch(() => {});
|
||||
}}
|
||||
>
|
||||
목록을 새로 불러와 확인
|
||||
{message("reference.form.reloadList")}
|
||||
</Link>
|
||||
</p>
|
||||
</>
|
||||
) : form.result === "success" ? (
|
||||
<p role="status">저장했습니다.</p>
|
||||
<p role="status">{message("reference.form.saved")}</p>
|
||||
) : form.result === "conflict" ? (
|
||||
<p role="status">충돌을 해결한 뒤 다시 제출할 수 있습니다.</p>
|
||||
<p role="status">{message("reference.form.conflict")}</p>
|
||||
) : null
|
||||
}
|
||||
aside={
|
||||
<p>
|
||||
form value는 URL, storage, telemetry에 저장되지 않고 submit 시에만
|
||||
application command로 변환됩니다.
|
||||
</p>
|
||||
<p>{message("reference.form.privacy")}</p>
|
||||
}
|
||||
guard={<DirtyNavigationDialog guard={guard} />}
|
||||
/>
|
||||
|
||||
@@ -5,7 +5,7 @@ export const referenceResourceFormSchema = z
|
||||
name: z
|
||||
.string()
|
||||
.trim()
|
||||
.min(2, "이름은 두 글자 이상이어야 합니다.")
|
||||
.min(2)
|
||||
.max(120),
|
||||
note: z.string().trim().max(500).default(""),
|
||||
})
|
||||
|
||||
@@ -5,26 +5,30 @@ import {
|
||||
Button,
|
||||
CollectionPage,
|
||||
} from "../../../presentation/design-system/index.ts";
|
||||
import {
|
||||
resolveMessage,
|
||||
useLocale,
|
||||
} from "../../../presentation/i18n/index.ts";
|
||||
import { useReferenceFailureAction } from "./use-reference-failure-action.ts";
|
||||
import { useReferenceFeature } from "./use-reference-feature.ts";
|
||||
|
||||
export default function ReferenceResourcePage() {
|
||||
const navigate = useNavigate();
|
||||
const { locale, message } = useLocale();
|
||||
const { filters, query } = useReferenceFeature();
|
||||
const failureAction = useReferenceFailureAction(query.state.failure);
|
||||
|
||||
return (
|
||||
<CollectionPage
|
||||
heading={{
|
||||
eyebrow: "제거 가능한 수직 슬라이스",
|
||||
eyebrow: message("reference.list.eyebrow"),
|
||||
title: "Reference feature",
|
||||
description:
|
||||
"URL codec, application input, HTTP/schema/mapper와 query 상태를 한 경로로 검증합니다.",
|
||||
description: message("reference.list.description"),
|
||||
}}
|
||||
actions={[
|
||||
{
|
||||
kind: "button",
|
||||
label: "새 항목 만들기",
|
||||
label: message("reference.list.create"),
|
||||
onAction: () => navigate("/examples/reference-resources/new"),
|
||||
},
|
||||
]}
|
||||
@@ -34,9 +38,20 @@ export default function ReferenceResourcePage() {
|
||||
{filters.tags?.length ? ` · tags ${filters.tags.join(", ")}` : ""}
|
||||
</p>
|
||||
}
|
||||
toolbar={<Button onClick={() => void query.retry()}>새로고침</Button>}
|
||||
toolbar={
|
||||
<Button onClick={() => void query.retry()}>
|
||||
{message("reference.list.refresh")}
|
||||
</Button>
|
||||
}
|
||||
resultCount={
|
||||
query.data ? `총 ${query.data.length}개 항목` : "결과 확인 중"
|
||||
// 08-09. Counted only from a settled result: a loading, idle or
|
||||
// failed list has nothing to count. Feature keys carry no parameter
|
||||
// types, so the count goes through the untyped resolver.
|
||||
query.state.base === "success" || query.state.base === "empty"
|
||||
? resolveMessage(locale, "reference.list.resultCount", {
|
||||
count: query.data?.length ?? 0,
|
||||
})
|
||||
: null
|
||||
}
|
||||
>
|
||||
<AsyncSurface
|
||||
@@ -48,7 +63,7 @@ export default function ReferenceResourcePage() {
|
||||
{(query.data ?? []).map((resource) => (
|
||||
<li key={resource.resourceId}>
|
||||
<Link
|
||||
to={`/examples/reference-resources/${encodeURIComponent(resource.resourceId)}`}
|
||||
to={`/examples/reference-resources/items/${encodeURIComponent(resource.resourceId)}`}
|
||||
>
|
||||
{resource.title}
|
||||
</Link>
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import { StatusPage } from "../../../presentation/design-system/index.ts";
|
||||
import { useLocale } from "../../../presentation/i18n/index.ts";
|
||||
|
||||
export default function ReferenceResourceStatusPage() {
|
||||
const navigate = useNavigate();
|
||||
const { message } = useLocale();
|
||||
|
||||
return (
|
||||
<StatusPage
|
||||
variant="maintenance"
|
||||
heading={{
|
||||
eyebrow: "StatusPage · maintenance",
|
||||
title: "잠시 사용할 수 없습니다.",
|
||||
description:
|
||||
"도메인 데이터나 raw 오류를 노출하지 않는 중립적인 상태 페이지 예시입니다.",
|
||||
title: message("reference.status.title"),
|
||||
description: message("reference.status.description"),
|
||||
}}
|
||||
primaryAction={{
|
||||
kind: "button",
|
||||
label: "목록으로 이동",
|
||||
label: message("reference.status.back"),
|
||||
onAction: () => navigate("/examples/reference-resources"),
|
||||
}}
|
||||
supportReference="REFERENCE-STATUS-DEMO"
|
||||
|
||||
Reference in New Issue
Block a user