diff options
| author | 0-Zz-ang <s1998319@gmail.com> | 2025-08-04 14:59:15 +0900 |
|---|---|---|
| committer | 0-Zz-ang <s1998319@gmail.com> | 2025-08-04 14:59:15 +0900 |
| commit | 59b5715ebb3e1fd7bd4eb02ce50399715734f865 (patch) | |
| tree | 39ccd16482c1b90b6583ead73384822157254d88 /lib/docu-list-rule/code-groups/table | |
| parent | f0213de0d2fb5fcb931b3ddaddcbb6581cab5d28 (diff) | |
(박서영) docu-list-rule detail sheet 컴포넌트 추가 및 검색 필터 기능 오류 수정
Diffstat (limited to 'lib/docu-list-rule/code-groups/table')
3 files changed, 22 insertions, 9 deletions
diff --git a/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx b/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx index 660adfed..bf044f1a 100644 --- a/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx +++ b/lib/docu-list-rule/code-groups/table/code-groups-add-dialog.tsx @@ -19,6 +19,7 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, @@ -39,8 +40,8 @@ const createCodeGroupSchema = z.object({ description: z.string().min(1, "Description은 필수입니다."), codeFormat: z.string().optional().refine((val) => { if (!val) return true; // 빈 값은 허용 - return /^[AN]*$/.test(val); - }, "Code Format은 A(영어 대문자) 또는 N(숫자)만 입력 가능합니다."), + return /^[ANX]*$/.test(val); + }, "Code Format은 A(영어 대문자), N(숫자), X(영어/숫자)만 입력 가능합니다."), controlType: z.string().min(1, "Control Type은 필수입니다."), }) @@ -80,6 +81,8 @@ export function CodeGroupsAddDialog({ onSuccess }: CodeGroupsAddDialogProps) { expression += `[A-Z]{${count}}` } else if (currentChar === 'N') { expression += `[0-9]{${count}}` + } else if (currentChar === 'X') { + expression += `[A-Z0-9]{${count}}` } currentChar = codeFormat[i] count = 1 @@ -91,6 +94,8 @@ export function CodeGroupsAddDialog({ onSuccess }: CodeGroupsAddDialogProps) { expression += `[A-Z]{${count}}` } else if (currentChar === 'N') { expression += `[0-9]{${count}}` + } else if (currentChar === 'X') { + expression += `[A-Z0-9]{${count}}` } expression += '$' @@ -177,11 +182,14 @@ export function CodeGroupsAddDialog({ onSuccess }: CodeGroupsAddDialogProps) { <FormLabel>Code Format</FormLabel> <FormControl> <Input - placeholder="예: AANNN (A:영어대문자, N:숫자)" + placeholder="예: AANNN (A:영어대문자, N:숫자, X:영어/숫자)" {...field} onBlur={() => form.trigger('codeFormat')} /> </FormControl> + <FormDescription> + A: 영어 대문자, N: 숫자, X: 영어 대문자 또는 숫자 + </FormDescription> <FormMessage /> </FormItem> )} diff --git a/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx b/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx index 28aebd54..74ebc05a 100644 --- a/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx +++ b/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx @@ -19,6 +19,7 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, @@ -41,8 +42,8 @@ const updateCodeGroupSchema = z.object({ description: z.string().min(1, "Description은 필수입니다."), codeFormat: z.string().optional().refine((val) => { if (!val) return true; // 빈 값은 허용 - return /^[AN]*$/.test(val); - }, "Code Format은 A(영어 대문자) 또는 N(숫자)만 입력 가능합니다."), + return /^[ANX]*$/.test(val); + }, "Code Format은 A(영어 대문자), N(숫자), X(영어/숫자)만 입력 가능합니다."), controlType: z.string().min(1, "Control Type은 필수입니다."), isActive: z.boolean().default(true), }) @@ -92,6 +93,8 @@ export function CodeGroupsEditSheet({ expression += `[A-Z]{${count}}` } else if (currentChar === 'N') { expression += `[0-9]{${count}}` + } else if (currentChar === 'X') { + expression += `[A-Z0-9]{${count}}` } currentChar = codeFormat[i] count = 1 @@ -103,6 +106,8 @@ export function CodeGroupsEditSheet({ expression += `[A-Z]{${count}}` } else if (currentChar === 'N') { expression += `[0-9]{${count}}` + } else if (currentChar === 'X') { + expression += `[A-Z0-9]{${count}}` } expression += '$' @@ -183,11 +188,14 @@ export function CodeGroupsEditSheet({ <FormLabel>Code Format</FormLabel> <FormControl> <Input - placeholder="예: AANNN (A:영어대문자, N:숫자)" + placeholder="예: AANNN (A:영어대문자, N:숫자, X:영어/숫자)" {...field} onBlur={() => form.trigger('codeFormat')} /> </FormControl> + <FormDescription> + A: 영어 대문자, N: 숫자, X: 영어 대문자 또는 숫자 + </FormDescription> <FormMessage /> </FormItem> )} diff --git a/lib/docu-list-rule/code-groups/table/code-groups-table.tsx b/lib/docu-list-rule/code-groups/table/code-groups-table.tsx index c10d3445..8873c34c 100644 --- a/lib/docu-list-rule/code-groups/table/code-groups-table.tsx +++ b/lib/docu-list-rule/code-groups/table/code-groups-table.tsx @@ -48,8 +48,6 @@ export function CodeGroupsTable({ promises }: CodeGroupsTableProps) { id: "controlType", label: "Control Type", type: "select", options: [ { label: "Textbox", value: "textbox" }, { label: "Combobox", value: "combobox" }, - { label: "Date", value: "date" }, - { label: "Number", value: "number" }, ] }, { @@ -69,7 +67,6 @@ export function CodeGroupsTable({ promises }: CodeGroupsTableProps) { enablePinning: true, enableAdvancedFilter: true, initialState: { - sorting: [{ id: "createdAt", desc: true }], columnPinning: { right: ["actions"] }, }, getRowId: (originalRow) => String(originalRow.groupId), |
