Paket 2: konfigurierbare Inhaltsart an Identitaet
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7820bececb
commit
1a2b1298b5
8 files changed
+233
-1
No files matched your search
@@ -4,6 +4,7 @@
|
||||
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\EditorialContentKind;
|
||||
use App\Domain\Catalog\CompositionVersion;
|
||||
use App\Domain\Catalog\ContentElementVersion;
|
||||
use App\Domain\Catalog\ContentService;
|
||||
@@ -44,6 +45,11 @@ public function form(Schema $schema): Schema
|
||||
TextInput::make('designation')->label('Bezeichnung')->required(),
|
||||
Select::make('kind')->label('Art')->options(CompositionKind::options())->required()
|
||||
->helperText('Übung, Kurs und fachliche Kombination sind verschiedene Zusammenstellungen. Die Art lässt sich hier ändern.'),
|
||||
Select::make('editorial_content_kind_id')
|
||||
->label('Inhaltsart')
|
||||
->options(fn (): array => EditorialContentKind::selectOptions())
|
||||
->nullable()
|
||||
->helperText('Optional für Bibliothek und Website. Ändert weder die technische Art noch eine Fassung.'),
|
||||
Placeholder::make('history')->label('Aktuelle Fassung')->content(function (): HtmlString {
|
||||
/** @var Composition $composition */
|
||||
$composition = $this->getRecord();
|
||||
@@ -110,6 +116,7 @@ protected function mutateFormDataBeforeFill(array $data): array
|
||||
return [
|
||||
'designation' => $composition->designation,
|
||||
'kind' => $kind instanceof CompositionKind ? $kind->value : $kind,
|
||||
'editorial_content_kind_id' => $composition->editorial_content_kind_id,
|
||||
'members' => $members,
|
||||
'note' => null,
|
||||
];
|
||||
@@ -125,6 +132,9 @@ protected function handleRecordUpdate(Model $record, array $data): Model
|
||||
$kind = CompositionKind::from($data['kind']);
|
||||
$record->designation = trim((string) $data['designation']);
|
||||
$record->kind = $kind;
|
||||
$record->editorial_content_kind_id = filled($data['editorial_content_kind_id'] ?? null)
|
||||
? (int) $data['editorial_content_kind_id']
|
||||
: null;
|
||||
$record->save();
|
||||
|
||||
$members = [];
|
||||
|
||||
Reference in new issue
Block a user