yxcx
This commit is contained in:
@@ -287,10 +287,15 @@
|
|||||||
log('PLACEHOLDER INFO', 'Keine Tabellen – DB Placeholder Block wird nicht angezeigt.', '#888');
|
log('PLACEHOLDER INFO', 'Keine Tabellen – DB Placeholder Block wird nicht angezeigt.', '#888');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const firstTable = tables[0] || {};
|
||||||
|
const tableName = firstTable.name || 'tabelle';
|
||||||
|
const columns = Array.isArray(firstTable.columns) ? firstTable.columns : [];
|
||||||
|
const firstColumn = columns.length ? columns[0].name : 'feld';
|
||||||
|
const placeholderLabel = `${tableName}.${firstColumn}`.toUpperCase();
|
||||||
addOnce(bm, 'cust-placeholder-db', {
|
addOnce(bm, 'cust-placeholder-db', {
|
||||||
id: 'cust-placeholder-db',
|
id: 'cust-placeholder-db',
|
||||||
label: '🗄️ Placeholder (DB)',
|
label: '🗄️ Placeholder (DB)',
|
||||||
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="database" data-placeholder-table="${tables[0].name}" data-placeholder-column="${tables[0].columns?.[0]?.name || ''}">{{${(tables[0].name + '.' + (tables[0].columns?.[0]?.name || '')).toUpperCase()}}}</span>`
|
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="database" data-placeholder-table="${tableName}" data-placeholder-column="${firstColumn}">{{${placeholderLabel}}}</span>`
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user