diff --git a/frontend/src/components/workflow/panels/PlaceholderPicker.jsx b/frontend/src/components/workflow/panels/PlaceholderPicker.jsx index 3434245..1259aaa 100644 --- a/frontend/src/components/workflow/panels/PlaceholderPicker.jsx +++ b/frontend/src/components/workflow/panels/PlaceholderPicker.jsx @@ -20,15 +20,25 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { const [searchQuery, setSearchQuery] = useState('') const [systemPlaceholders, setSystemPlaceholders] = useState([]) const [loading, setLoading] = useState(true) + const [loadError, setLoadError] = useState(null) // Lade Backend-Platzhalter beim Mount useEffect(() => { async function loadPlaceholders() { try { + console.log('๐Ÿ”„ Loading placeholders from backend...') const catalog = await api.listPlaceholders() + console.log('โœ… Catalog received:', catalog) + console.log('๐Ÿ“Š Catalog keys:', Object.keys(catalog)) + // Konvertiere Katalog zu Flat-Liste const flattened = [] Object.entries(catalog).forEach(([category, items]) => { + console.log(`๐Ÿ“ Category "${category}": ${items?.length || 0} items`) + if (!Array.isArray(items)) { + console.warn(`โš ๏ธ Category "${category}" items is not an array:`, items) + return + } items.forEach(item => { flattened.push({ placeholder: `{{ ${item.key.trim()} }}`, @@ -39,9 +49,11 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { }) }) }) + console.log(`โœ… Loaded ${flattened.length} system placeholders`) setSystemPlaceholders(flattened) } catch (e) { - console.error('Failed to load placeholders:', e) + console.error('โŒ Failed to load placeholders:', e) + setLoadError(e.message) } finally { setLoading(false) } @@ -188,6 +200,20 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { > Lade Platzhalter... + ) : loadError ? ( +
+ โŒ Fehler beim Laden: {loadError} +
+ Workflow-Platzhalter sind trotzdem verfรผgbar. +
+
) : Object.keys(grouped).length === 0 ? (
{ if (node.type === 'end') return // End Node hat keine Outputs const nodeId = node.id - const nodeLabel = node.data.label || nodeId + const nodeLabel = node.data?.label || nodeId + + console.log(`๐Ÿ“ฆ Node ${nodeId}:`, { + type: node.type, + label: node.data?.label, + nodeLabel: nodeLabel, + data: node.data + }) // analysis_core fรผr alle Analysis/Logic/Join Nodes if (node.type === 'analysis' || node.type === 'logic' || node.type === 'join') { + const desc = `${nodeLabel} (${nodeId}) - Hauptausgabe` + console.log(` โž• Adding placeholder: {{ ${nodeId}.analysis_core }} โ†’ "${desc}"`) placeholders.push({ placeholder: `{{ ${nodeId}.analysis_core }}`, - description: `${nodeLabel} (${nodeId}) - Hauptausgabe`, + description: desc, icon: getNodeIcon(node.type), category: 'Workflow - Node Outputs' })