CI Feature / test (push) Successful in 4m18s
Der Aufbau eines Formulars zeigt Bereiche als Karten, Teilbereiche als eingerahmte Einheit darin und Felder als Zeilen (Frage, Art der Antwort, Pflicht). Hilfetext, Auswahlwerte, Bedingung und weitere Einstellungen öffnen als Pop-up. Bereiche, Teilbereiche und Felder lassen sich ziehen (SortableJS aus Filament) oder per Pfeiltasten und über "Verschieben nach" ordnen; Rückgängig nimmt Änderungen bis zum Speichern zurück. Der Browser führt den Baum und übergibt ihn beim Speichern als Text; FormEditor prüft ihn (validateTree) und überführt ihn über fromTree in dieselbe flache Ansicht wie bisher. Entwurf, Katalog und Engine bleiben unverändert, keine Migration. Tests: Die Livewire-Tests des Editors setzen jetzt den Baumtext (editor_json) statt der Builder-Blöcke; neu sind Baumumwandlung ohne Verlust, Teilbereich mit Feldern, Prüfung und Konfiguration. Das ist bewusst: Der Builder entfällt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
58 lines
1.9 KiB
PHP
58 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Communication\Templates;
|
|
|
|
use App\Domain\Communication\InquiryTemplate;
|
|
use App\Filament\Resources\Communication\CommunicationResource;
|
|
use App\Filament\Resources\Communication\Templates\Pages\EditInquiryTemplate;
|
|
use App\Filament\Resources\Communication\Templates\Pages\ListInquiryTemplates;
|
|
use App\Filament\Resources\Communication\Templates\RelationManagers\VersionsRelationManager;
|
|
use App\Filament\Support\TemplateEditor;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
/**
|
|
* Formulare & Befragungen (Anfragevorlagen): ein vollständiger fachlicher Anfrageprozess, bearbeitet im Formular-Editor (ADR-61). Der Entwurf ist frei bearbeitbar; wirksam wird nur eine
|
|
* bewusst veröffentlichte, unveränderliche Fassung.
|
|
*/
|
|
class InquiryTemplateResource extends CommunicationResource
|
|
{
|
|
protected static ?string $model = InquiryTemplate::class;
|
|
|
|
protected static ?string $navigationLabel = 'Formulare & Befragungen';
|
|
|
|
protected static ?string $modelLabel = 'Formular';
|
|
|
|
protected static ?string $pluralModelLabel = 'Formulare & Befragungen';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
protected static ?string $slug = 'kommunikation/vorlagen';
|
|
|
|
protected static ?int $navigationSort = 2;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return $schema->components(TemplateEditor::schema($schema->getRecord()?->getKey()));
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table->columns([TextColumn::make('name')->label('Bezeichnung')]);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [VersionsRelationManager::class];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListInquiryTemplates::route('/'),
|
|
'edit' => EditInquiryTemplate::route('/{record}'),
|
|
];
|
|
}
|
|
}
|