Halte deaktivierte Bestandteile im Aufbau, damit die Freigabe sie anzeigt.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d12ba67b45
commit
dd67741f35
7 files changed
+93
-26
No files matched your search
@@ -40,7 +40,7 @@ public function rows(CompositionVersion $version, int $exceptCompositionId): arr
|
||||
$target = $member->content_element_version_id
|
||||
? 'element:'.$member->content_element_version_id
|
||||
: 'composition:'.$member->nested_composition_version_id;
|
||||
$row = $this->rowForTarget($target, $exceptCompositionId, allowSelf: true, allowDraft: true);
|
||||
$row = $this->rowForTarget($target, $exceptCompositionId, allowSelf: true, allowDraft: true, allowBlocked: true);
|
||||
|
||||
if ($row === null) {
|
||||
continue;
|
||||
@@ -57,7 +57,7 @@ public function rows(CompositionVersion $version, int $exceptCompositionId): arr
|
||||
/**
|
||||
* @return array<string, string|null>|null
|
||||
*/
|
||||
public function rowForTarget(string $target, int $exceptCompositionId, bool $allowSelf = false, bool $allowDraft = false): ?array
|
||||
public function rowForTarget(string $target, int $exceptCompositionId, bool $allowSelf = false, bool $allowDraft = false, bool $allowBlocked = false): ?array
|
||||
{
|
||||
if (preg_match('/^composition-draft:(\d+)$/', $target, $draftMatch) === 1) {
|
||||
return $this->draftCompositionRow((int) $draftMatch[1], $exceptCompositionId, $allowSelf);
|
||||
@@ -77,6 +77,10 @@ public function rowForTarget(string $target, int $exceptCompositionId, bool $all
|
||||
$acceptable[] = ContentVersionStatus::Entwurf;
|
||||
}
|
||||
|
||||
if ($allowBlocked) {
|
||||
$acceptable[] = ContentVersionStatus::Gesperrt;
|
||||
}
|
||||
|
||||
if (! $version instanceof ContentElementVersion || ! in_array($version->status, $acceptable, true)) {
|
||||
return null;
|
||||
}
|
||||
@@ -98,7 +102,11 @@ public function rowForTarget(string $target, int $exceptCompositionId, bool $all
|
||||
'license_note' => (string) ($element->license_note ?? ''),
|
||||
'tone' => $this->tone((string) $element->output_class, $kind),
|
||||
'image' => $this->cardUrl('element', $element->id, $element->thumbnail_path),
|
||||
'version_label' => $version->status === ContentVersionStatus::Entwurf ? 'Entwurf' : 'Fassung '.$version->number,
|
||||
'version_label' => match ($version->status) {
|
||||
ContentVersionStatus::Entwurf => 'Entwurf',
|
||||
ContentVersionStatus::Gesperrt => 'deaktiviert',
|
||||
default => 'Fassung '.$version->number,
|
||||
},
|
||||
'committed' => app(ContentService::class)->isCommitted($version),
|
||||
'identity' => 'medium:'.$element->id,
|
||||
'open_url' => route('content.preview', $version),
|
||||
@@ -111,7 +119,13 @@ public function rowForTarget(string $target, int $exceptCompositionId, bool $all
|
||||
->with('composition.editorialContentKind')
|
||||
->find($match[2]);
|
||||
|
||||
if (! $version instanceof CompositionVersion || $version->status !== ContentVersionStatus::Bereit) {
|
||||
$acceptable = [ContentVersionStatus::Bereit];
|
||||
|
||||
if ($allowBlocked) {
|
||||
$acceptable[] = ContentVersionStatus::Gesperrt;
|
||||
}
|
||||
|
||||
if (! $version instanceof CompositionVersion || ! in_array($version->status, $acceptable, true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -130,7 +144,9 @@ public function rowForTarget(string $target, int $exceptCompositionId, bool $all
|
||||
'summary' => (string) ($composition->summary ?? ''),
|
||||
'tone' => $this->tone('', $kind),
|
||||
'image' => $this->cardUrl('komposition', $composition->id, $composition->thumbnail_path),
|
||||
'version_label' => 'Fassung '.$version->number,
|
||||
'version_label' => $version->status === ContentVersionStatus::Gesperrt
|
||||
? 'deaktiviert'
|
||||
: 'Fassung '.$version->number,
|
||||
'identity' => 'zusammenstellung:'.$composition->id,
|
||||
'open_url' => route('editorial.preview', ['composition' => $composition, 'version' => $version]),
|
||||
'open_label' => 'Aufbau ansehen',
|
||||
|
||||
Reference in new issue
Block a user