diff --git a/src/components/Automation2FlowEditor/nodes/shared/clickupFormSync.ts b/src/components/Automation2FlowEditor/nodes/shared/clickupFormSync.ts index 48faf0a..41cc91c 100644 --- a/src/components/Automation2FlowEditor/nodes/shared/clickupFormSync.ts +++ b/src/components/Automation2FlowEditor/nodes/shared/clickupFormSync.ts @@ -225,12 +225,20 @@ export function buildSyncFromClickUpList(args: { { name: PAYLOAD_TIME_H, label: 'Zeitschätzung (Stunden)', type: 'number', required: false }, ]; + const statusTriggerRow: TriggerFormFieldRow | null = + statusOpts.length > 0 + ? { + name: PAYLOAD_STATUS, + label: 'Status', + type: 'clickup_status', + statusOptions: statusOpts, + } + : null; + const standardTrigger: TriggerFormFieldRow[] = [ { name: PAYLOAD_TITLE, label: 'Titel', type: 'text' }, { name: PAYLOAD_DESCRIPTION, label: 'Beschreibung', type: 'text' }, - ...(statusOpts.length > 0 - ? [{ name: PAYLOAD_STATUS, label: 'Status', type: 'clickup_status', statusOptions: statusOpts }] - : []), + ...(statusTriggerRow ? [statusTriggerRow] : []), { name: PAYLOAD_PRIORITY, label: 'Priorität (1–4)', type: 'number' }, { name: PAYLOAD_DUE, label: 'Fälligkeit', type: 'date' }, { name: PAYLOAD_TIME_H, label: 'Zeitschätzung (Stunden)', type: 'number' }, @@ -247,8 +255,9 @@ export function buildSyncFromClickUpList(args: { if (inf) customInput.push(inf); if (tr) customTrigger.push(tr); const fid = String((f as ClickUpFieldLike).id ?? ''); - if (fid && inf) { - customRefs[fid] = createRef(formNodeId, ['payload', inf.name]); + const payloadKey = inf?.name; + if (fid && payloadKey) { + customRefs[fid] = createRef(formNodeId, ['payload', payloadKey]); } } diff --git a/src/components/FolderTree/FolderTree.tsx b/src/components/FolderTree/FolderTree.tsx index d4f92ef..3712664 100644 --- a/src/components/FolderTree/FolderTree.tsx +++ b/src/components/FolderTree/FolderTree.tsx @@ -13,7 +13,7 @@ import React, { useState, useCallback, useRef, useEffect, useMemo } from 'react'; import { FaFolder, FaFolderOpen, FaPlus, FaPen, FaTrash, FaChevronRight, FaGlobe, FaSyncAlt, FaDownload } from 'react-icons/fa'; -import { usePrompt } from '../../hooks/usePrompt'; +import { usePrompt, type PromptOptions } from '../../hooks/usePrompt'; import styles from './FolderTree.module.css'; /* ── Public types ──────────────────────────────────────────────────────── */ @@ -331,7 +331,7 @@ interface TreeNodeProps { showFiles: boolean; filesByFolder: Map; sel: SelectionCtx; - promptFolderName: (message: string) => Promise; + promptFolderName: (message: string, options?: PromptOptions) => Promise; onToggle: (id: string) => void; onSelect: (id: string | null) => void; onCreateFolder?: (name: string, parentId: string | null) => Promise; diff --git a/src/hooks/usePrompt.tsx b/src/hooks/usePrompt.tsx index c0c8837..38218d6 100644 --- a/src/hooks/usePrompt.tsx +++ b/src/hooks/usePrompt.tsx @@ -8,7 +8,7 @@ * // Render once in the component tree. */ -import React, { useState, useCallback, useRef, useEffect } from 'react'; +import React, { useState, useCallback, useRef } from 'react'; export interface PromptOptions { title?: string;