feat: enhance dynamic form service and interactive screen viewer
- Updated the `DynamicFormService` to allow retrieval of both 'component' and 'v2-button-primary' types in screen layouts, improving flexibility in component handling. - Introduced a new variable to streamline button component identification, enhancing code readability and maintainability. - Modified the `InteractiveScreenViewer` to pass the `screenInfo.id` when deleting form data, ensuring accurate context during deletion operations. Made-with: Cursor
This commit is contained in:
parent
62a5ae5f4b
commit
000484349b
|
|
@ -1715,8 +1715,8 @@ export class DynamicFormService {
|
|||
`SELECT component_id, properties
|
||||
FROM screen_layouts
|
||||
WHERE screen_id = $1
|
||||
AND component_type = $2`,
|
||||
[screenId, "component"]
|
||||
AND component_type IN ('component', 'v2-button-primary')`,
|
||||
[screenId]
|
||||
);
|
||||
|
||||
console.log(`📋 화면 컴포넌트 조회 결과:`, screenLayouts.length);
|
||||
|
|
@ -1747,8 +1747,12 @@ export class DynamicFormService {
|
|||
(triggerType === "delete" && buttonActionType === "delete") ||
|
||||
((triggerType === "insert" || triggerType === "update") && buttonActionType === "save");
|
||||
|
||||
const isButtonComponent =
|
||||
properties?.componentType === "button-primary" ||
|
||||
properties?.componentType === "v2-button-primary";
|
||||
|
||||
if (
|
||||
properties?.componentType === "button-primary" &&
|
||||
isButtonComponent &&
|
||||
isMatchingAction &&
|
||||
properties?.webTypeConfig?.enableDataflowControl === true
|
||||
) {
|
||||
|
|
@ -1877,7 +1881,7 @@ export class DynamicFormService {
|
|||
{
|
||||
sourceData: [savedData],
|
||||
dataSourceType: "formData",
|
||||
buttonId: "save-button",
|
||||
buttonId: `${triggerType}-button`,
|
||||
screenId: screenId,
|
||||
userId: userId,
|
||||
companyCode: companyCode,
|
||||
|
|
|
|||
|
|
@ -1850,7 +1850,7 @@ export const InteractiveScreenViewer: React.FC<InteractiveScreenViewerProps> = (
|
|||
try {
|
||||
// console.log("🗑️ 삭제 실행:", { recordId, tableName, formData });
|
||||
|
||||
const result = await dynamicFormApi.deleteFormDataFromTable(recordId, tableName);
|
||||
const result = await dynamicFormApi.deleteFormDataFromTable(recordId, tableName, screenInfo?.id);
|
||||
|
||||
if (result.success) {
|
||||
alert("삭제되었습니다.");
|
||||
|
|
|
|||
Loading…
Reference in New Issue