Ergaenze Stammdaten, Suche, Dimensionen, Abdeckung und Ausgabenachweis
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7b54c38623
commit
5e763d15ec
23 files changed
+661
-5
No files matched your search
@@ -6,6 +6,7 @@
|
||||
use App\Domain\Catalog\ContentService;
|
||||
use App\Domain\Catalog\DomainRuleException;
|
||||
use App\Domain\Catalog\EditorialContentKind;
|
||||
use App\Domain\Catalog\IdentityProfile;
|
||||
use App\Domain\Catalog\Pillar;
|
||||
use App\Domain\Catalog\PillarService;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
@@ -47,6 +48,9 @@ public function form(Schema $schema): Schema
|
||||
return new HtmlString('<a href="'.e($url).'">Medium und Fassungen ansehen</a>');
|
||||
}),
|
||||
TextInput::make('working_title')->label('Arbeitstitel')->required(),
|
||||
TextInput::make('display_title')->label('Anzeigetitel')
|
||||
->helperText('Erscheint in der Bibliothek. Leer lässt den Arbeitstitel stehen. Speichern legt keine Fassung an.'),
|
||||
Textarea::make('summary')->label('Kurzbeschreibung')->rows(3),
|
||||
Textarea::make('description')->label('Beschreibung')->rows(4)
|
||||
->helperText('Gilt für das Medium, nicht für eine einzelne Fassung.'),
|
||||
Select::make('editorial_content_kind_id')
|
||||
@@ -121,7 +125,9 @@ protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
return [
|
||||
'working_title' => $this->getRecord()->working_title,
|
||||
'display_title' => $this->getRecord()->display_title,
|
||||
'description' => $this->getRecord()->description,
|
||||
'summary' => $this->getRecord()->summary,
|
||||
'pillars' => $this->getRecord()->pillars()->pluck('pillars.id')->all(),
|
||||
];
|
||||
}
|
||||
@@ -134,6 +140,10 @@ protected function handleRecordUpdate(Model $record, array $data): Model
|
||||
/** @var ContentElement $record */
|
||||
try {
|
||||
app(ContentService::class)->describe($record, (string) $data['working_title'], $data['description'] ?? null);
|
||||
app(IdentityProfile::class)->fill($record, [
|
||||
'display_title' => $data['display_title'] ?? null,
|
||||
'summary' => $data['summary'] ?? null,
|
||||
], auth()->user());
|
||||
app(PillarService::class)->assign($record, array_map(intval(...), $data['pillars'] ?? []));
|
||||
} catch (DomainRuleException $exception) {
|
||||
Notification::make()->title($exception->getMessage())->danger()->send();
|
||||
|
||||
Reference in new issue
Block a user