feat: Enhance screen group deletion functionality with optional numbering rules deletion

- Added a new query parameter `deleteNumberingRules` to the `deleteScreenGroup` function, allowing users to specify if numbering rules should be deleted when a root screen group is removed.
- Updated the `deleteScreenGroup` controller to handle the deletion of numbering rules conditionally based on the new parameter.
- Enhanced the frontend `ScreenGroupTreeView` component to include a checkbox for users to confirm the deletion of numbering rules when deleting a root group, improving user control and clarity during deletion operations.
- Implemented appropriate warnings and messages to inform users about the implications of deleting numbering rules, ensuring better user experience and data integrity awareness.
This commit is contained in:
kjs
2026-03-04 18:42:44 +09:00
parent 93d9df3e5a
commit f97edad1ea
7 changed files with 158 additions and 58 deletions

View File

@@ -513,6 +513,15 @@ export class TableManagementService {
detailSettingsStr = JSON.stringify(settings.detailSettings);
}
// 입력타입에 해당하지 않는 설정값은 NULL로 강제 초기화
const inputType = settings.inputType;
const referenceTable = inputType === "entity" ? (settings.referenceTable || null) : null;
const referenceColumn = inputType === "entity" ? (settings.referenceColumn || null) : null;
const displayColumn = inputType === "entity" ? (settings.displayColumn || null) : null;
const codeCategory = inputType === "code" ? (settings.codeCategory || null) : null;
const codeValue = inputType === "code" ? (settings.codeValue || null) : null;
const categoryRef = inputType === "category" ? (settings.categoryRef || null) : null;
await query(
`INSERT INTO table_type_columns (
table_name, column_name, column_label, input_type, detail_settings,
@@ -525,11 +534,11 @@ export class TableManagementService {
column_label = COALESCE(EXCLUDED.column_label, table_type_columns.column_label),
input_type = COALESCE(EXCLUDED.input_type, table_type_columns.input_type),
detail_settings = COALESCE(EXCLUDED.detail_settings, table_type_columns.detail_settings),
code_category = COALESCE(EXCLUDED.code_category, table_type_columns.code_category),
code_value = COALESCE(EXCLUDED.code_value, table_type_columns.code_value),
reference_table = COALESCE(EXCLUDED.reference_table, table_type_columns.reference_table),
reference_column = COALESCE(EXCLUDED.reference_column, table_type_columns.reference_column),
display_column = COALESCE(EXCLUDED.display_column, table_type_columns.display_column),
code_category = EXCLUDED.code_category,
code_value = EXCLUDED.code_value,
reference_table = EXCLUDED.reference_table,
reference_column = EXCLUDED.reference_column,
display_column = EXCLUDED.display_column,
display_order = COALESCE(EXCLUDED.display_order, table_type_columns.display_order),
is_visible = COALESCE(EXCLUDED.is_visible, table_type_columns.is_visible),
category_ref = EXCLUDED.category_ref,
@@ -538,17 +547,17 @@ export class TableManagementService {
tableName,
columnName,
settings.columnLabel,
settings.inputType,
inputType,
detailSettingsStr,
settings.codeCategory,
settings.codeValue,
settings.referenceTable,
settings.referenceColumn,
settings.displayColumn,
codeCategory,
codeValue,
referenceTable,
referenceColumn,
displayColumn,
settings.displayOrder || 0,
settings.isVisible !== undefined ? settings.isVisible : true,
companyCode,
settings.categoryRef || null,
categoryRef,
]
);
@@ -849,16 +858,26 @@ export class TableManagementService {
...detailSettings,
};
// table_type_columns 테이블에서 업데이트 (company_code 추가)
// 입력타입 변경 시 이전 타입의 설정값 초기화
const clearEntity = finalInputType !== "entity";
const clearCode = finalInputType !== "code";
const clearCategory = finalInputType !== "category";
await query(
`INSERT INTO table_type_columns (
table_name, column_name, input_type, detail_settings,
table_name, column_name, input_type, detail_settings,
is_nullable, display_order, company_code, created_date, updated_date
) VALUES ($1, $2, $3, $4, 'Y', 0, $5, now(), now())
ON CONFLICT (table_name, column_name, company_code)
DO UPDATE SET
ON CONFLICT (table_name, column_name, company_code)
DO UPDATE SET
input_type = EXCLUDED.input_type,
detail_settings = EXCLUDED.detail_settings,
reference_table = CASE WHEN $6 THEN NULL ELSE table_type_columns.reference_table END,
reference_column = CASE WHEN $6 THEN NULL ELSE table_type_columns.reference_column END,
display_column = CASE WHEN $6 THEN NULL ELSE table_type_columns.display_column END,
code_category = CASE WHEN $7 THEN NULL ELSE table_type_columns.code_category END,
code_value = CASE WHEN $7 THEN NULL ELSE table_type_columns.code_value END,
category_ref = CASE WHEN $8 THEN NULL ELSE table_type_columns.category_ref END,
updated_date = now()`,
[
tableName,
@@ -866,6 +885,9 @@ export class TableManagementService {
finalInputType,
JSON.stringify(finalDetailSettings),
companyCode,
clearEntity,
clearCode,
clearCategory,
]
);