From de98b863a09749cf20521a93fdb155f8b26fb444 Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Tue, 13 Jan 2026 21:21:59 +0100 Subject: [PATCH] hotfixes --- .../FormGeneratorList/FormGeneratorList.tsx | 8 +++++--- .../FormGeneratorTable/FormGeneratorTable.tsx | 14 +++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/FormGenerator/FormGeneratorList/FormGeneratorList.tsx b/src/components/FormGenerator/FormGeneratorList/FormGeneratorList.tsx index 06dec35..f95d514 100644 --- a/src/components/FormGenerator/FormGeneratorList/FormGeneratorList.tsx +++ b/src/components/FormGenerator/FormGeneratorList/FormGeneratorList.tsx @@ -54,11 +54,11 @@ export interface FormGeneratorListProps { actionButtons?: { type: 'edit' | 'delete' | 'download' | 'view' | 'copy' | 'connect' | 'play'; onAction?: (row: T) => Promise | void; - disabled?: (row: T) => boolean | { disabled: boolean; message?: string }; - loading?: (row: T) => boolean; + disabled?: (row: T, hookData?: any) => boolean | { disabled: boolean; message?: string }; + loading?: (row: T, hookData?: any) => boolean; title?: string | ((row: T) => string); className?: string; - isProcessing?: (row: T) => boolean; + isProcessing?: (row: T, hookData?: any) => boolean; idField?: string; nameField?: string; typeField?: string; @@ -69,6 +69,8 @@ export interface FormGeneratorListProps { refreshOperationName?: string; loadingStateName?: string; navigateTo?: string; + mode?: string; // Mode to set (e.g., 'prompt', 'workflow') + fetchItemFunctionName?: string; // Name of the function to fetch a single item (for edit button) }[]; onDelete?: (row: T) => void; onDeleteMultiple?: (rows: T[]) => void; diff --git a/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx b/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx index 690b612..5976703 100644 --- a/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx +++ b/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx @@ -104,25 +104,29 @@ export interface FormGeneratorTableProps { onInlineUpdate?: (row: T, field: string, newValue: any) => Promise | void; // Called when inline edit occurs inlineEditingRows?: Set; // Set of row IDs currently being edited (for loading state) idField?: string; // Field name for unique row identifier (default: 'id') - // Standard action buttons (edit, delete, view, copy) + // Standard action buttons (edit, delete, view, copy, connect, play) actionButtons?: { - type: 'edit' | 'delete' | 'view' | 'copy'; + type: 'edit' | 'delete' | 'view' | 'copy' | 'connect' | 'play'; onAction?: (row: T) => Promise | void; // Optional for delete buttons since they handle their own logic - disabled?: (row: T) => boolean | { disabled: boolean; message?: string }; - loading?: (row: T) => boolean; + disabled?: (row: T, hookData?: any) => boolean | { disabled: boolean; message?: string }; + loading?: (row: T, hookData?: any) => boolean; title?: string | ((row: T) => string); className?: string; // For view buttons - isProcessing?: (row: T) => boolean; + isProcessing?: (row: T, hookData?: any) => boolean; // Field mappings for flexible data access idField?: string; // Field name for the unique identifier nameField?: string; // Field name for display name typeField?: string; // Field name for type/mime type contentField?: string; // Field name for content (used by copy button) + statusField?: string; // Field name for status (used by connect action) // Operation and loading state names operationName?: string; // Name of the operation function in hookData loadingStateName?: string; // Name of the loading state in hookData fetchItemFunctionName?: string; // Name of the function to fetch a single item (for edit button) + // Navigation and mode (for play action) + navigateTo?: string; // Path to navigate to after action + mode?: string; // Mode to set (e.g., 'prompt', 'workflow') }[]; // Custom action buttons (entity-specific actions like download, connect, play, sendPasswordLink) customActions?: {