fix: 1:1문의에서 질문제목을 걷어낸다
문의는 제목 없이 내용만 온다. 목록의 대표 칸은 내용 발췌(60자 말줄임)로, 답변 팝업의 질문제목 필드는 제거(질문내용 칸이 이미 있다), 삭제 확인 문구는 빈 제목 대신 내용 발췌 30자, 검색 대상에서 제목을 뺀다. Co-Authored-By: Claude Opus 5
@614002d3ead7c9cdf0711cdabc079d9a5cf516fb
--- app/(protected)/(basic)/boards/_components/board-post-columns.tsx
+++ app/(protected)/(basic)/boards/_components/board-post-columns.tsx
... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 |
formatAnswerStatusLabel, |
| 12 | 12 |
formatBoardCategoryLabel, |
| 13 | 13 |
formatFaqTypeLabel, |
| 14 |
+ formatContentExcerpt, |
|
| 14 | 15 |
formatInquiryTypeLabel, |
| 15 | 16 |
formatOptionalValue, |
| 16 | 17 |
formatVisibilityLabel, |
... | ... | @@ -192,7 +193,14 @@ |
| 192 | 193 |
// 서버 조인 이름 우선 — 코드표(잠정값)는 이름이 안 온 행의 보루다. |
| 193 | 194 |
render: (row) => row.typeName ?? formatInquiryTypeLabel(row.typeCode), |
| 194 | 195 |
}, |
| 195 |
- { key: 'title', header: '질문제목', width: 280, emphasis: true },
|
|
| 196 |
+ // 1:1문의는 제목이 없다(내용만 온다) — 내용 발췌가 이 줄의 대표 칸이다. |
|
| 197 |
+ {
|
|
| 198 |
+ key: 'content', |
|
| 199 |
+ header: '질문내용', |
|
| 200 |
+ width: 280, |
|
| 201 |
+ emphasis: true, |
|
| 202 |
+ render: (row) => formatContentExcerpt(row.content), |
|
| 203 |
+ }, |
|
| 196 | 204 |
{
|
| 197 | 205 |
key: 'authorName', |
| 198 | 206 |
header: '질문자명', |
--- app/(protected)/(basic)/boards/inquiries/_components/inquiry-answer-modal.tsx
+++ app/(protected)/(basic)/boards/inquiries/_components/inquiry-answer-modal.tsx
... | ... | @@ -99,15 +99,6 @@ |
| 99 | 99 |
<p className={styles.sectionTitle}>게시물의 항목 (조회 전용)</p>
|
| 100 | 100 |
|
| 101 | 101 |
<div className={styles.field}>
|
| 102 |
- <FoxInput |
|
| 103 |
- size="md" |
|
| 104 |
- label="질문제목" |
|
| 105 |
- value={formatOptionalValue(post.title)}
|
|
| 106 |
- readOnly |
|
| 107 |
- /> |
|
| 108 |
- </div> |
|
| 109 |
- |
|
| 110 |
- <div className={styles.field}>
|
|
| 111 | 102 |
<div className={styles.pair}>
|
| 112 | 103 |
<FoxInput |
| 113 | 104 |
size="md" |
--- app/(protected)/(basic)/boards/inquiries/_components/inquiry-row-actions.tsx
+++ app/(protected)/(basic)/boards/inquiries/_components/inquiry-row-actions.tsx
... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 |
import { FoxButtonGroup } from '@fox/core/components/fox-button-group';
|
| 6 | 6 |
import { FoxIconButton } from '@fox/core/components/fox-icon-button';
|
| 7 | 7 |
import { useFeedback } from '@/app/_hooks/use-feedback';
|
| 8 |
-import type { BoardPost } from '@/lib/domain/board-post';
|
|
| 8 |
+import { formatContentExcerpt, type BoardPost } from '@/lib/domain/board-post';
|
|
| 9 | 9 |
import type { CommonCode } from '@/lib/domain/common-code';
|
| 10 | 10 |
import { deleteBoardPostAction, loadBoardPostAction } from '../../_actions';
|
| 11 | 11 |
import { InquiryAnswerModal } from './inquiry-answer-modal';
|
... | ... | @@ -61,7 +61,7 @@ |
| 61 | 61 |
showAlert({
|
| 62 | 62 |
variant: 'danger', |
| 63 | 63 |
title: '문의를 삭제하시겠습니까?', |
| 64 |
- message: `"${post.title}" 문의를 삭제합니다. 삭제 후에는 되돌릴 수 없습니다.`,
|
|
| 64 |
+ message: `"${formatContentExcerpt(post.content, 30)}" 문의를 삭제합니다. 삭제 후에는 되돌릴 수 없습니다.`,
|
|
| 65 | 65 |
actions: ( |
| 66 | 66 |
<FoxButtonGroup size="md"> |
| 67 | 67 |
<FoxButton type="default" size="md" label="취소" onAction={hideAlert} />
|
--- lib/domain/board-post-query.ts
+++ lib/domain/board-post-query.ts
... | ... | @@ -39,8 +39,8 @@ |
| 39 | 39 |
{ value: 'category', label: '구분' },
|
| 40 | 40 |
{ value: 'title', label: '제목' },
|
| 41 | 41 |
], |
| 42 |
+ // 1:1문의는 제목 없이 내용만 쓴다 — 제목 검색은 대상이 없다. |
|
| 42 | 43 |
inquiry: [ |
| 43 |
- { value: 'title', label: '제목' },
|
|
| 44 | 44 |
{ value: 'authorName', label: '질문자명' },
|
| 45 | 45 |
{ value: 'authorPhoneNumber', label: '전화번호' },
|
| 46 | 46 |
{ value: 'content', label: '내용' },
|
--- lib/domain/board-post.ts
+++ lib/domain/board-post.ts
... | ... | @@ -108,6 +108,15 @@ |
| 108 | 108 |
// TODO: 답변완료를 가리키는 코드값. BBS_ANS_CD의 실제 값이 확인되면 교체한다. |
| 109 | 109 |
export const ANSWER_STATUS_DONE = 'DONE'; |
| 110 | 110 |
|
| 111 |
+/** 목록 한 칸·확인 문구에 넣을 본문 발췌 — 줄바꿈을 접고 길면 말줄임한다. */ |
|
| 112 |
+export function formatContentExcerpt(content: string, maxLength = 60): string {
|
|
| 113 |
+ const flat = content.replace(/\s+/g, ' ').trim(); |
|
| 114 |
+ if (flat === '') {
|
|
| 115 |
+ return EMPTY_FIELD_PLACEHOLDER; |
|
| 116 |
+ } |
|
| 117 |
+ return flat.length > maxLength ? `${flat.slice(0, maxLength)}…` : flat;
|
|
| 118 |
+} |
|
| 119 |
+ |
|
| 111 | 120 |
/** 코드 → 라벨. 표에 없는 코드는 지어내지 않고 코드 그대로 노출한다(잘못된 라벨보다 낫다). */ |
| 112 | 121 |
function formatCode(options: readonly CodeOption[], code: string | null): string {
|
| 113 | 122 |
if (code === null || code === '') {
|
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?