feat(helpdesk): add user-select to schema editor field type dropdown

Adds 'user-select' to FIELD_TYPES so it appears in the schema editor
dropdown as 'Benutzerauswahl' / 'User selection'. Preview renders a
placeholder select. Translations added to both i18n files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
aminovfariz
2026-06-08 11:04:25 +02:00
parent 9bc8799b6b
commit 2968d5e386
4 changed files with 10 additions and 1 deletions

View File

@@ -6,7 +6,7 @@
*/
import { resolveHost } from '/js/core/app-dom.js';
const FIELD_TYPES = ['heading', 'paragraph', 'text', 'textarea', 'number', 'date', 'checkbox', 'select'];
const FIELD_TYPES = ['heading', 'paragraph', 'text', 'textarea', 'number', 'date', 'checkbox', 'select', 'user-select'];
const DISPLAY_ONLY_TYPES = ['heading', 'paragraph'];
const EMPTY_API = Object.freeze({ destroy: () => {} });
@@ -385,6 +385,12 @@ function init(root) {
option.textContent = opt.label || '';
input.appendChild(option);
});
} else if (field.type === 'user-select') {
input = document.createElement('select');
const placeholder = document.createElement('option');
placeholder.value = '';
placeholder.textContent = t['type_user-select'] || 'User selection';
input.appendChild(placeholder);
} else {
input = document.createElement('input');
input.type = field.type === 'number' ? 'number' : field.type === 'date' ? 'date' : 'text';