fix: 가맹몰 상세 목록 검색·행 버튼·메뉴 설명 줄바꿈·메뉴 화면 업체명을 고친다
- 상단 업체명 검색이 안 됐다 — 목록 컨테이너의 검색 상자는 onQueryChange로만 알리는데 링크만 넘기고 있었다. 백엔드 조건(searchFrcsNm)은 있으나 목록을 합쳐 프론트에서 거르므로 그대로 쓴다. - 상세가 없는 행의 [비활성]·[삭제]를 잠근다. - 메뉴 설명의 줄바꿈을 표에서 살린다(pre-line, 3줄 뒤 말줄임). - 단건 조회가 업체명 대신 코드를 줄 때 가맹점 목록에서 채우는 것을 Repository로 옮겨 메뉴 등록·수정 화면의 「대상 업체」에도 이름이 나온다. Co-Authored-By: Claude Fable 5.1
@26fc7680f7506c8984044084739fe98e30b3e9cf
--- app/(protected)/(basic)/system/merchant-details/[frcsNo]/page.tsx
+++ app/(protected)/(basic)/system/merchant-details/[frcsNo]/page.tsx
... | ... | @@ -36,16 +36,14 @@ |
| 36 | 36 |
return <MerchantDetailForm merchant={merchant} categories={await categoriesPromise} />;
|
| 37 | 37 |
} |
| 38 | 38 |
|
| 39 |
- const [products, categories, badgeCodes, merchant] = await Promise.all([ |
|
| 39 |
+ const [products, categories, badgeCodes] = await Promise.all([ |
|
| 40 | 40 |
fetchMerchantProducts(frcsNo), |
| 41 | 41 |
categoriesPromise, |
| 42 | 42 |
fetchCommonCodes(CODE_GROUP.merchantProductBadge), |
| 43 |
- // 상세 응답에 업체명이 빠지는 백엔드 결함 — 코드만 왔으면 가맹점 목록에서 이름을 채운다. |
|
| 44 |
- detail.name === detail.id ? fetchMerchantSummary(frcsNo) : Promise.resolve(null), |
|
| 45 | 43 |
]); |
| 46 | 44 |
return ( |
| 47 | 45 |
<MerchantDetailForm |
| 48 |
- detail={merchant ? { ...detail, name: merchant.name } : detail}
|
|
| 46 |
+ detail={detail}
|
|
| 49 | 47 |
products={products}
|
| 50 | 48 |
categories={categories}
|
| 51 | 49 |
badgeCodes={badgeCodes}
|
--- app/(protected)/(basic)/system/merchant-details/_components/merchant-detail-list.tsx
+++ app/(protected)/(basic)/system/merchant-details/_components/merchant-detail-list.tsx
... | ... | @@ -382,6 +382,10 @@ |
| 382 | 382 |
...(patch.page !== undefined ? { page: patch.page } : {}),
|
| 383 | 383 |
}) |
| 384 | 384 |
} |
| 385 |
+ // 검색 상자는 링크가 아니라 콜백으로만 알린다(FoxListSearch.onSearch) — 페이지는 위 링크가 맡는다. |
|
| 386 |
+ onQueryChange={(patch) => {
|
|
| 387 |
+ if (patch.keyword !== undefined) go({ keyword: String(patch.keyword) });
|
|
| 388 |
+ }} |
|
| 385 | 389 |
/> |
| 386 | 390 |
); |
| 387 | 391 |
} |
--- app/(protected)/(basic)/system/merchant-details/_components/merchant-detail-row-actions.tsx
+++ app/(protected)/(basic)/system/merchant-details/_components/merchant-detail-row-actions.tsx
... | ... | @@ -18,8 +18,8 @@ |
| 18 | 18 |
|
| 19 | 19 |
/** |
| 20 | 20 |
* 기획 BO-MAL-001 관리 열 — 모든 행에 [수정] [비활성|노출] [삭제](시안대로, 사용자 확정). [수정]은 그 |
| 21 |
- * 가맹점의 상세 화면으로 가고(상세가 없으면 거기서 처음 만든다), 상세가 없는 행의 [비활성]·[삭제]는 |
|
| 22 |
- * 백엔드가 NOT_FOUND로 거절해 사유가 토스트로 올라온다. |
|
| 21 |
+ * 가맹점의 상세 화면으로 가고(상세가 없으면 거기서 처음 만든다), 상세가 없는 행은 [비활성]·[삭제]가 |
|
| 22 |
+ * 잠긴다 — 지울 상세가 없기 때문이다. |
|
| 23 | 23 |
*/ |
| 24 | 24 |
export function MerchantDetailRowActions({ row }: MerchantDetailRowActionsProps) {
|
| 25 | 25 |
const router = useRouter(); |
... | ... | @@ -76,14 +76,14 @@ |
| 76 | 76 |
type="default" |
| 77 | 77 |
size="sm" |
| 78 | 78 |
label={row.isVisible === false ? '노출' : '비활성'}
|
| 79 |
- disabled={isBusy}
|
|
| 79 |
+ disabled={isBusy || !row.hasDetail}
|
|
| 80 | 80 |
onAction={toggleVisibility}
|
| 81 | 81 |
/> |
| 82 | 82 |
<FoxButton |
| 83 | 83 |
type="default" |
| 84 | 84 |
size="sm" |
| 85 | 85 |
label="삭제" |
| 86 |
- disabled={isBusy}
|
|
| 86 |
+ disabled={isBusy || !row.hasDetail}
|
|
| 87 | 87 |
onAction={confirmDelete}
|
| 88 | 88 |
/> |
| 89 | 89 |
</FoxButtonGroup> |
--- app/(protected)/(basic)/system/merchant-details/_components/merchant-product-table.module.scss
+++ app/(protected)/(basic)/system/merchant-details/_components/merchant-product-table.module.scss
... | ... | @@ -29,11 +29,13 @@ |
| 29 | 29 |
overflow-x: auto; |
| 30 | 30 |
} |
| 31 | 31 |
|
| 32 |
+// 입력한 줄바꿈을 살린다(기획 BO-MAL-004 ⑤ 2~3줄). 넘치면 말줄임. |
|
| 32 | 33 |
.description {
|
| 33 | 34 |
display: -webkit-box; |
| 34 | 35 |
overflow: hidden; |
| 35 | 36 |
-webkit-box-orient: vertical; |
| 36 |
- -webkit-line-clamp: 2; |
|
| 37 |
+ -webkit-line-clamp: 3; |
|
| 38 |
+ white-space: pre-line; |
|
| 37 | 39 |
} |
| 38 | 40 |
|
| 39 | 41 |
.badges {
|
--- lib/data/repositories/merchant-detail-repository.ts
+++ lib/data/repositories/merchant-detail-repository.ts
... | ... | @@ -254,7 +254,13 @@ |
| 254 | 254 |
if (result.code === 404) return null; |
| 255 | 255 |
throw new BackendRequestError(result); |
| 256 | 256 |
} |
| 257 |
- return toDetail(result.data, withImages); |
|
| 257 |
+ const detail = await toDetail(result.data, withImages); |
|
| 258 |
+ // 결함 1 — 응답에 업체명이 없어 코드만 왔으면 가맹점 목록에서 이름을 채운다. |
|
| 259 |
+ if (detail && detail.name === detail.id) {
|
|
| 260 |
+ const merchant = await fetchMerchantSummary(frcsNo); |
|
| 261 |
+ if (merchant) return { ...detail, name: merchant.name };
|
|
| 262 |
+ } |
|
| 263 |
+ return detail; |
|
| 258 | 264 |
} |
| 259 | 265 |
|
| 260 | 266 |
async function fetchPage<T>( |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?