Ergänze die gemeinsame redaktionelle Basis an den Fachobjekten.
CI Feature / test (push) Successful in 54s
Deploy Test / test (push) Successful in 47s
Deploy Test / deploy (push) Successful in 24s

Texte, Materialart und Präsentationsmedien bleiben am Medium, Modul, Programm und Lizenzartikel und werden von Verwaltung und Karten aus derselben Quelle gelesen, ohne Fassung oder Lizenz zu verändern.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-19 07:54:36 +01:00
1 parent c4be6ed8dc
commit f29ea58fd5
40 files changed
+2311 -20

No files matched your search

@@ -23,6 +23,7 @@
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\EditorialCatalog;
use App\Filament\Support\ManagesEditorialSurface;
use App\Filament\Support\MediumForm;
use App\Http\Controllers\ContentPreviewController;
use App\Jobs\DeriveCompositionFrame;
@@ -41,6 +42,7 @@
abstract class EditComposition extends EditRecord
{
use ManagesEditorialSurface;
use WithFileUploads;
protected string $view = 'filament.editorial.edit';
@@ -49,8 +51,12 @@ abstract class EditComposition extends EditRecord
public string $displayTitle = '';
public string $teaser = '';
public string $summary = '';
public string $searchTerms = '';
public string $description = '';
public string $learningGoal = '';
@@ -84,6 +90,8 @@ abstract class EditComposition extends EditRecord
public bool $pickerOpen = false;
public string $pickerPurpose = 'aufbau';
public string $pickerQuery = '';
public string $pickerKind = 'alle';
@@ -315,11 +323,51 @@ public function openPicker(): void
$this->closePart();
}
$this->pickerPurpose = 'aufbau';
$this->pickerOpen = true;
$this->textOpen = false;
$this->pickerSelected = '';
}
public function openPresentationPicker(): void
{
$this->guardEditorial();
if ($this->partOpen) {
$this->closePart();
}
$this->pickerPurpose = 'praesentation';
$this->pickerOpen = true;
$this->moduleOpen = false;
$this->textOpen = false;
$this->pickerSelected = '';
}
public function assignFromPicker(string $target): void
{
$this->guardEditorial();
if (preg_match('/^element:(\d+)$/', $target, $match) !== 1) {
$this->deskFeedback = 'Präsentationsmedien sind Medien aus dem Bestand. Ein Modul bleibt Bestandteil des Aufbaus.';
return;
}
$version = ContentElementVersion::query()->find((int) $match[1]);
if (! $version instanceof ContentElementVersion) {
$this->deskFeedback = 'Dieses Medium ist nicht verfügbar.';
return;
}
$this->rememberAssignment((int) $version->content_element_id, $target);
$this->pickerOpen = false;
$this->pickerPurpose = 'aufbau';
$this->pickerSelected = '';
}
public function closePicker(): void
{
$this->pickerOpen = false;
@@ -1003,7 +1051,9 @@ public function openModule(): void
$this->moduleSnapshot = [
'designation' => $this->designation,
'displayTitle' => $this->displayTitle,
'teaser' => $this->teaser,
'summary' => $this->summary,
'searchTerms' => $this->searchTerms,
'description' => $this->description,
'learningGoal' => $this->learningGoal,
'durationMinutes' => $this->durationMinutes,
@@ -1574,7 +1624,9 @@ protected function loadEditor(): void
$version = $this->currentReadyVersion();
$this->designation = $composition->designation;
$this->displayTitle = (string) ($composition->display_title ?? '');
$this->teaser = (string) ($composition->teaser ?? '');
$this->summary = (string) ($composition->summary ?? '');
$this->searchTerms = (string) ($composition->search_terms ?? '');
$this->description = (string) ($composition->description ?? '');
$this->thumbnailPath = $composition->thumbnail_path;
$this->thumbnailAlt = (string) ($composition->thumbnail_alt ?? '');
@@ -1829,7 +1881,9 @@ protected function persistPresentation(): bool
$record->designation = $name;
app(IdentityProfile::class)->fill($record, [
'display_title' => $this->displayTitle,
'teaser' => $this->teaser,
'summary' => $this->summary,
'search_terms' => $this->searchTerms,
'description' => $this->description,
'thumbnail_alt' => $this->thumbnailAlt,
], $this->actor());
@@ -2,6 +2,7 @@
namespace App\Filament\Resources\ContentElements\Pages;
use App\Domain\Catalog\EditorialContentKind;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\MediaLibrary;
use App\Filament\Support\MediumForm;
@@ -46,6 +47,9 @@ class ListContentElements extends ListRecords
#[Url(as: 'saeule', except: '')]
public string $saeule = '';
#[Url(as: 'inhaltsart', except: '')]
public string $inhaltsart = '';
#[Url(as: 'einordnung', except: '')]
public string $einordnung = '';
@@ -112,6 +116,14 @@ public function classificationOptions(): array
return app(MediaLibrary::class)->classifications();
}
/**
* @return array<int, string>
*/
public function contentKindOptions(): array
{
return EditorialContentKind::selectOptions();
}
public function filtersActive(): bool
{
return trim($this->suche) !== ''
@@ -122,6 +134,7 @@ public function filtersActive(): bool
|| $this->nutzung !== ''
|| $this->saeule !== ''
|| $this->einordnung !== ''
|| $this->inhaltsart !== ''
|| $this->verarbeitung !== ''
|| $this->archiv !== 'aktiv';
}
@@ -136,6 +149,7 @@ public function resetFilters(): void
$this->nutzung = '';
$this->saeule = '';
$this->einordnung = '';
$this->inhaltsart = '';
$this->verarbeitung = '';
$this->archiv = 'aktiv';
}
@@ -154,6 +168,7 @@ private function libraryFilters(): array
'nutzung' => $this->nutzung,
'saeule' => $this->saeule,
'einordnung' => $this->einordnung,
'inhaltsart' => $this->inhaltsart,
'verarbeitung' => $this->verarbeitung,
'archiv' => $this->archiv,
];
@@ -22,6 +22,7 @@
use App\Filament\Support\CatalogReading;
use App\Filament\Support\EditorialCatalog;
use App\Filament\Support\ElementRevision;
use App\Filament\Support\ManagesEditorialSurface;
use App\Filament\Support\MediaLibrary;
use App\Filament\Support\ReportsDomainRules;
use App\Http\Controllers\ContentPreviewController;
@@ -39,6 +40,7 @@
class ViewContentElement extends ViewRecord
{
use ManagesEditorialSurface;
use ReportsDomainRules;
use WithFileUploads;
@@ -62,8 +64,12 @@ class ViewContentElement extends ViewRecord
public string $displayTitle = '';
public string $teaser = '';
public string $summary = '';
public string $searchTerms = '';
public string $descriptionText = '';
public string $usageNote = '';
@@ -109,7 +115,7 @@ public function mount(int|string $record): void
}
$bereich = (string) request()->query('bereich', 'beschreibung');
$this->bereich = in_array($bereich, ['beschreibung', 'inhalt', 'fassungen', 'verwendung', 'vorschau'], true)
$this->bereich = in_array($bereich, ['beschreibung', 'inhalt', 'fassungen', 'praesentation', 'verwendung', 'vorschau'], true)
? $bereich
: 'beschreibung';
$this->thumbnailAlt = (string) ($this->getRecord()->thumbnail_alt ?? '');
@@ -458,7 +464,9 @@ public function saveEditorial(): void
app(IdentityProfile::class)->fill($element, [
'working_title' => $title,
'display_title' => $this->displayTitle,
'teaser' => $this->teaser,
'summary' => $this->summary,
'search_terms' => $this->searchTerms,
'description' => $this->descriptionText,
'usage_note' => $this->usageNote,
'license_note' => $this->licenseNote,
@@ -665,8 +673,10 @@ public function editorialHistory(): array
$labels = [
'working_title' => 'Arbeitstitel',
'display_title' => 'Anzeigename',
'teaser' => 'Teaser',
'description' => 'Beschreibung',
'summary' => 'Kurzbeschreibung',
'search_terms' => 'Suchbegriffe',
'usage_note' => 'Einsatzhinweis',
'license_note' => 'Interner Lizenzvermerk',
'website_credit' => 'Quellenzeile',
@@ -709,7 +719,9 @@ private function fillEditorial(): void
$element = $this->getRecord();
$this->workingTitle = (string) $element->working_title;
$this->displayTitle = (string) ($element->display_title ?? '');
$this->teaser = (string) ($element->teaser ?? '');
$this->summary = (string) ($element->summary ?? '');
$this->searchTerms = (string) ($element->search_terms ?? '');
$this->descriptionText = (string) ($element->description ?? '');
$this->usageNote = (string) ($element->usage_note ?? '');
$this->licenseNote = (string) ($element->license_note ?? '');
@@ -12,6 +12,7 @@
use Filament\Infolists\Components\TextEntry;
use Filament\Resources\Resource;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\View;
use Filament\Schemas\Schema;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
@@ -62,6 +63,7 @@ public static function infolist(Schema $schema): Schema
TextEntry::make('context')->hiddenLabel()->listWithLineBreaks()
->state(fn (LicenseArticle $record): array => app(CatalogReading::class)->articleContext($record)),
]),
View::make('filament.editorial.license-desk'),
]);
}
@@ -5,9 +5,15 @@
use App\Domain\Catalog\ArticleService;
use App\Domain\Catalog\CompositionVersion;
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\EditorialDimension;
use App\Domain\Catalog\EditorialDimensionValue;
use App\Domain\Catalog\IdentityDimension;
use App\Domain\Catalog\IdentityDimensionValue;
use App\Domain\Catalog\IdentityProfile;
use App\Domain\Catalog\LicenseArticle;
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
use App\Filament\Support\CatalogOptions;
use App\Filament\Support\ManagesEditorialSurface;
use App\Filament\Support\ReportsDomainRules;
use Filament\Actions\Action;
use Filament\Forms\Components\Select;
@@ -17,10 +23,118 @@
class ViewLicenseArticle extends ViewRecord
{
use ManagesEditorialSurface;
use ReportsDomainRules;
protected static string $resource = LicenseArticleResource::class;
public string $workingTitle = '';
public string $displayTitle = '';
public string $teaser = '';
public string $summary = '';
public string $descriptionText = '';
public string $searchTerms = '';
public int|string|null $kindId = null;
/** @var list<int|string> */
public array $dimensionIds = [];
public function mount(int|string $record): void
{
parent::mount($record);
$this->fillLicenseEditorial();
}
public function canEditEditorial(): bool
{
return LicenseArticleResource::keeper();
}
public function saveLicenseEditorial(): void
{
$this->guardEditorial();
/** @var LicenseArticle $article */
$article = $this->getRecord();
$releaseId = $article->current_release_id;
$releases = $article->releases()->count();
app(IdentityProfile::class)->fill($article, [
'working_title' => $this->workingTitle,
'display_title' => $this->displayTitle,
'teaser' => $this->teaser,
'summary' => $this->summary,
'description' => $this->descriptionText,
'search_terms' => $this->searchTerms,
'editorial_content_kind_id' => filled($this->kindId) ? (int) $this->kindId : null,
], auth()->user());
$ids = array_map(intval(...), $this->dimensionIds);
IdentityDimensionValue::query()
->where('subject_type', $article->getMorphClass())
->where('subject_id', $article->id)
->where('origin', 'direkt')
->whereNotIn('editorial_dimension_value_id', $ids === [] ? [0] : $ids)
->delete();
foreach (EditorialDimensionValue::query()->whereIn('id', $ids)->get() as $value) {
app(IdentityDimension::class)->assign($article, $value, 'direkt');
}
$article->refresh();
$this->fillLicenseEditorial();
$this->deskFeedback = $article->current_release_id === $releaseId && $article->releases()->count() === $releases
? 'Gespeichert. Stand, Preis und Rechte bleiben unverändert.'
: 'Gespeichert. Prüfe den Artikelstand, er hat sich geändert.';
}
/**
* @return list<array{label: string, values: list<array{id: int, label: string}>}>
*/
public function licenseDimensionGroups(): array
{
$groups = [];
foreach (EditorialDimension::query()->with('values')->orderBy('label')->get() as $dimension) {
$values = [];
foreach ($dimension->values as $value) {
$values[] = ['id' => $value->id, 'label' => $value->label];
}
if ($values !== []) {
$groups[] = ['label' => $dimension->label, 'values' => $values];
}
}
return $groups;
}
private function fillLicenseEditorial(): void
{
/** @var LicenseArticle $article */
$article = $this->getRecord();
$this->workingTitle = (string) ($article->working_title ?? '');
$this->displayTitle = (string) ($article->display_title ?? '');
$this->teaser = (string) ($article->teaser ?? '');
$this->summary = (string) ($article->summary ?? '');
$this->descriptionText = (string) ($article->description ?? '');
$this->searchTerms = (string) ($article->search_terms ?? '');
$this->kindId = $article->editorial_content_kind_id;
$this->dimensionIds = IdentityDimensionValue::query()
->where('subject_type', $article->getMorphClass())
->where('subject_id', $article->id)
->where('origin', 'direkt')
->pluck('editorial_dimension_value_id')
->all();
}
protected function getHeaderActions(): array
{
return [
+10
View File
@@ -210,6 +210,8 @@ public function search(string $query, string $scope, int $exceptCompositionId):
$builder->where('working_title', 'like', $like)
->orWhere('display_title', 'like', $like)
->orWhere('teaser', 'like', $like)
->orWhere('search_terms', 'like', $like)
->orWhere('summary', 'like', $like);
})
->orderByDesc('id')
@@ -242,6 +244,8 @@ public function search(string $query, string $scope, int $exceptCompositionId):
$builder->where(function ($inner) use ($like): void {
$inner->where('designation', 'like', $like)
->orWhere('display_title', 'like', $like)
->orWhere('teaser', 'like', $like)
->orWhere('search_terms', 'like', $like)
->orWhere('summary', 'like', $like);
});
})
@@ -317,6 +321,8 @@ public function browse(string $query, string $kind, string $dimension, int $exce
$builder->where(function ($inner) use ($like): void {
$inner->where('designation', 'like', $like)
->orWhere('display_title', 'like', $like)
->orWhere('teaser', 'like', $like)
->orWhere('search_terms', 'like', $like)
->orWhere('summary', 'like', $like);
});
})
@@ -468,6 +474,8 @@ private function constrainElement($builder, string $query, string $like, string
$builder->where(function ($inner) use ($like): void {
$inner->where('working_title', 'like', $like)
->orWhere('display_title', 'like', $like)
->orWhere('teaser', 'like', $like)
->orWhere('search_terms', 'like', $like)
->orWhere('summary', 'like', $like)
->orWhere('description', 'like', $like);
});
@@ -749,6 +757,8 @@ public function mediaPictures(string $query): array
->where(function ($builder) use ($like): void {
$builder->where('working_title', 'like', $like)
->orWhere('display_title', 'like', $like)
->orWhere('teaser', 'like', $like)
->orWhere('search_terms', 'like', $like)
->orWhere('summary', 'like', $like);
})
->orderBy('working_title')
@@ -0,0 +1,282 @@
<?php
namespace App\Filament\Support;
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Catalog\EditorialProfile;
use App\Domain\Catalog\EditorialProfileReader;
use App\Domain\Catalog\EditorialTextVariant;
use App\Domain\Catalog\PresentationMedia;
use App\Domain\Catalog\PresentationRole;
use App\Domain\Media\WebsiteRelease;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
/**
* Gemeinsame Bedienung für Präsentationsmedien und abweichende Formulierungen.
* Die Texte selbst bleiben an den vorhandenen Feldern der jeweiligen Seite.
*/
trait ManagesEditorialSurface
{
public string $presentationRole = 'titelbild';
public string $presentationQuery = '';
public string $presentationPick = '';
public bool $bindToVersion = true;
public string $deskFeedback = '';
public string $variantAudience = 'kachel';
public string $variantField = 'teaser';
public string $variantBody = '';
public function editorialSubject(): Model
{
return $this->getRecord();
}
public function editorialProfile(?string $audience = null): EditorialProfile
{
return app(EditorialProfileReader::class)->read($this->editorialSubject(), $audience);
}
/**
* @return list<string>
*/
public function editorialGaps(): array
{
$profile = $this->editorialProfile();
$gaps = [];
foreach ([
'display_title' => 'Anzeigename',
'teaser' => 'Teaser',
'summary' => 'Kurzbeschreibung',
'description' => 'Ausführliche Beschreibung',
] as $field => $label) {
if ($profile->value($field) === null) {
$gaps[] = $label;
}
}
return $gaps;
}
/**
* @return list<array<string, mixed>>
*/
public function presentationRows(): array
{
return app(PresentationMedia::class)->rows($this->editorialSubject());
}
/**
* @return array<string, string>
*/
public function presentationRoleOptions(): array
{
return PresentationRole::selectOptions();
}
/**
* @return array{items: list<array<string, mixed>>, more: bool}
*/
public function presentationChoices(): array
{
return app(EditorialCatalog::class)->browse($this->presentationQuery, 'alle', '', 0, elementsOnly: true);
}
public function assignPickedPresentation(): void
{
$this->guardEditorial();
$row = app(EditorialCatalog::class)->rowForTarget($this->presentationPick, 0, allowDraft: true);
if ($row === null || ! isset($row['element_id'])) {
$this->deskFeedback = 'Bitte ein Medium aus dem Bestand wählen.';
return;
}
$this->rememberAssignment((int) $row['element_id'], isset($row['target']) ? (string) $row['target'] : null);
$this->presentationPick = '';
}
public function detachPresentation(int $assignmentId): void
{
$this->guardEditorial();
$this->deskFeedback = $this->reportPresentation(
fn (): string => app(PresentationMedia::class)->detach($this->editorialSubject(), $assignmentId, $this->deskActor()),
);
}
public function movePresentation(int $assignmentId, int $direction): void
{
$this->guardEditorial();
$this->deskFeedback = $this->reportPresentation(function () use ($assignmentId, $direction): string {
app(PresentationMedia::class)->move($this->editorialSubject(), $assignmentId, $direction, $this->deskActor());
return 'Die Reihenfolge ist gespeichert.';
});
}
public function releaseAssigned(int $elementId): void
{
abort_unless(ContentElementResource::editor(), 403);
$element = ContentElement::query()->find($elementId);
if (! $element instanceof ContentElement) {
$this->deskFeedback = 'Das Medium fehlt.';
return;
}
$this->deskFeedback = app(WebsiteRelease::class)->release($element, $this->deskActor());
}
public function withdrawAssigned(int $elementId): void
{
abort_unless(ContentElementResource::editor(), 403);
$element = ContentElement::query()->find($elementId);
if (! $element instanceof ContentElement) {
$this->deskFeedback = 'Das Medium fehlt.';
return;
}
$this->deskFeedback = app(WebsiteRelease::class)->withdraw($element, $this->deskActor());
}
/**
* @return list<EditorialTextVariant>
*/
public function variantRows(): array
{
$subject = $this->editorialSubject();
return EditorialTextVariant::query()
->where('subject_type', $subject->getMorphClass())
->where('subject_id', $subject->getKey())
->orderBy('audience')
->orderBy('field')
->get()
->all();
}
public function saveVariant(): void
{
$this->guardEditorial();
$this->deskFeedback = $this->reportPresentation(
fn (): string => app(EditorialProfileReader::class)->putVariant(
$this->editorialSubject(),
$this->variantField,
$this->variantAudience,
$this->variantBody,
$this->deskActor(),
),
);
$this->variantBody = '';
}
public function forgetVariant(int $variantId): void
{
$this->guardEditorial();
$variant = EditorialTextVariant::query()->find($variantId);
if (! $variant instanceof EditorialTextVariant) {
$this->deskFeedback = 'Diese Abweichung gibt es nicht mehr.';
return;
}
$this->reportPresentation(function () use ($variant): string {
app(EditorialProfileReader::class)->forgetVariant($this->editorialSubject(), $variant, $this->deskActor());
return 'Die abweichende Formulierung ist entfernt.';
});
$this->deskFeedback = 'Die abweichende Formulierung ist entfernt. Es gilt wieder die zentrale Angabe.';
}
public function variantFieldLabel(string $field): string
{
return match ($field) {
'display_title' => 'Anzeigename',
'teaser' => 'Teaser',
'summary' => 'Kurzbeschreibung',
'description' => 'Ausführliche Beschreibung',
default => $field,
};
}
public function canReleasePresentation(): bool
{
return ContentElementResource::editor();
}
public function canEditEditorial(): bool
{
return ContentElementResource::editor();
}
protected function rememberAssignment(int $elementId, ?string $target): void
{
$sourceId = null;
if ($this->bindToVersion && in_array($this->presentationRole, PresentationRole::BOUND_ROLES, true)) {
$subject = $this->editorialSubject();
$sourceId = $subject instanceof ContentElement
? $subject->versions()->where('status', ContentVersionStatus::Bereit)->orderByDesc('number')->value('id')
: $this->versionIdFromTarget($target);
}
$this->deskFeedback = $this->reportPresentation(
fn (): string => app(PresentationMedia::class)->assign(
$this->editorialSubject(),
$this->presentationRole,
$elementId,
$sourceId !== null ? (int) $sourceId : null,
$this->deskActor(),
),
);
}
protected function versionIdFromTarget(?string $target): ?int
{
if (is_string($target) && preg_match('/^element:(\d+)$/', $target, $match) === 1) {
return (int) $match[1];
}
return null;
}
protected function guardEditorial(): void
{
abort_unless($this->canEditEditorial(), 403);
}
protected function deskActor(): ?User
{
$user = auth()->user();
return $user instanceof User ? $user : null;
}
/**
* @param callable(): string $action
*/
protected function reportPresentation(callable $action): string
{
try {
return $action();
} catch (DomainRuleException $exception) {
return $exception->getMessage();
}
}
}
+10 -2
View File
@@ -75,7 +75,7 @@ public function classifications(): array
*/
public function cardFor(ContentElement $element, bool $canEdit): array
{
$element->loadMissing(['versions', 'pillars']);
$element->loadMissing(['versions', 'pillars', 'editorialContentKind']);
$versionIds = $element->versions->pluck('id')->all();
return $this->card(
@@ -95,7 +95,7 @@ public function cards(array $filters, bool $canEdit): array
{
$filters = $this->normalize($filters);
$elements = ContentElement::query()
->with(['versions', 'pillars'])
->with(['versions', 'pillars', 'editorialContentKind'])
->orderBy('working_title')
->get();
$versionIds = $elements->flatMap(fn (ContentElement $element) => $element->versions->pluck('id'))->all();
@@ -140,6 +140,7 @@ private function normalize(array $filters): array
'nutzung' => $this->choice($filters['nutzung'] ?? '', ['verwendet', 'unbenutzt']),
'saeule' => ctype_digit($filters['saeule'] ?? '') ? $filters['saeule'] : '',
'einordnung' => ctype_digit($filters['einordnung'] ?? '') ? $filters['einordnung'] : '',
'inhaltsart' => ctype_digit($filters['inhaltsart'] ?? '') ? $filters['inhaltsart'] : '',
'verarbeitung' => $this->choice($filters['verarbeitung'] ?? '', ['fehler', 'uebernahme']),
'archiv' => $this->choice($filters['archiv'] ?? '', ['aktiv', 'archiviert', 'alle'], 'aktiv'),
];
@@ -418,6 +419,10 @@ private function matches(ContentElement $element, array $portrait, array $uses,
return false;
}
if ($filters['inhaltsart'] !== '' && (int) $element->editorial_content_kind_id !== (int) $filters['inhaltsart']) {
return false;
}
if ($filters['verarbeitung'] === 'fehler' && $portrait['processing'] !== 'Verarbeitungsfehler') {
return false;
}
@@ -451,6 +456,8 @@ private function haystack(ContentElement $element): string
$element->display_title,
$element->description,
$element->summary,
$element->teaser,
$element->search_terms,
$element->usage_note,
], fn (mixed $value): bool => is_string($value) && trim($value) !== '')));
}
@@ -473,6 +480,7 @@ private function card(ContentElement $element, array $portrait, array $uses, arr
'id' => $element->id,
'title' => $element->working_title,
'type' => $this->catalog->outputLabel((string) $element->output_class),
'editorialKind' => $element->editorialContentKind?->label,
'typeKey' => $typeKey,
'description' => $description === '' ? null : $description,
'usageNote' => $usageNote === '' ? null : $usageNote,