Ergaenze Stammdaten, Suche, Dimensionen, Abdeckung und Ausgabenachweis
Deploy Test / test (push) Successful in 17s
Deploy Test / deploy (push) Successful in 25s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-16 08:24:23 +01:00
1 parent 7b54c38623
commit 5e763d15ec
23 files changed
+661 -5

No files matched your search

@@ -11,6 +11,7 @@
use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Catalog\EditorialContentKind;
use App\Domain\Catalog\IdentityProfile;
use App\Filament\Resources\Combinations\CombinationResource;
use App\Filament\Resources\Courses\CourseResource;
use App\Filament\Resources\Exercises\ExerciseResource;
@@ -22,6 +23,7 @@
use Filament\Forms\Components\Placeholder;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
@@ -44,6 +46,9 @@ public function form(Schema $schema): Schema
{
return $schema->columns(1)->components([
TextInput::make('designation')->label('Bezeichnung')->required(),
TextInput::make('display_title')->label('Anzeigetitel')
->helperText('Erscheint in der Bibliothek. Leer lässt die Bezeichnung stehen.'),
Textarea::make('summary')->label('Kurzbeschreibung')->rows(3),
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')
@@ -153,6 +158,8 @@ protected function mutateFormDataBeforeFill(array $data): array
return [
'designation' => $composition->designation,
'display_title' => $composition->display_title,
'summary' => $composition->summary,
'kind' => $kind instanceof CompositionKind ? $kind->value : $kind,
'editorial_content_kind_id' => $composition->editorial_content_kind_id,
'members' => $members,
@@ -169,6 +176,10 @@ protected function handleRecordUpdate(Model $record, array $data): Model
try {
$kind = CompositionKind::from($data['kind']);
$record->designation = trim((string) $data['designation']);
app(IdentityProfile::class)->fill($record, [
'display_title' => $data['display_title'] ?? null,
'summary' => $data['summary'] ?? null,
], auth()->user());
$record->kind = $kind;
$record->editorial_content_kind_id = filled($data['editorial_content_kind_id'] ?? null)
? (int) $data['editorial_content_kind_id']
@@ -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();