Lasse Präsentationsmedien ohne Inhaltsfassung zu.
Bilder, Filme und Hörstücke lassen sich zuordnen und für die Website freigeben, ohne eine fachliche Fassung anzulegen. Unterrichtsfilme behalten die Teaserfassung an ihrer bereitgestellten Fassung. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5590225f4f
commit
7b325f0d66
25 files changed
+734
-93
No files matched your search
@@ -17,6 +17,7 @@
|
||||
use App\Domain\Catalog\IdentityDimension;
|
||||
use App\Domain\Catalog\IdentityDimensionValue;
|
||||
use App\Domain\Catalog\Offer;
|
||||
use App\Domain\Catalog\Pillar;
|
||||
use App\Domain\Catalog\PresentationAssignment;
|
||||
use App\Domain\Catalog\PresentationMedia;
|
||||
use App\Domain\Catalog\ReleaseStatus;
|
||||
@@ -25,6 +26,7 @@
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Domain\Cms\Widgets\Support\WebsiteImage;
|
||||
use App\Domain\Media\MediaRendition;
|
||||
use App\Domain\Media\PresentationFile;
|
||||
use App\Domain\Media\WebsiteMedia;
|
||||
use App\Domain\Media\WebsiteRelease;
|
||||
use App\Filament\Resources\ContentElements\Pages\ViewContentElement;
|
||||
@@ -150,9 +152,24 @@ public function test_a_module_description_does_not_version_the_composition_or_cr
|
||||
);
|
||||
$this->assertSame($textsBefore, ContentElement::query()->where('output_class', 'text')->count());
|
||||
|
||||
$cover = $this->image('Modulbild');
|
||||
app(PresentationMedia::class)->assign($module, 'titelbild', $cover->id, null, $this->editor());
|
||||
$this->assertSame(1, $module->fresh()->versions()->count());
|
||||
$cover = $this->pictureWithoutVersion('Modulbild ohne Fassung');
|
||||
Livewire::test(EditExercise::class, ['record' => $module->getKey()])
|
||||
->assertSet('teaser', 'Kurz in das Modul.')
|
||||
->set('teaser', 'Geändertes Modul.')
|
||||
->call('saveDisplay')
|
||||
->assertSee('Die Fassung bleibt unverändert.')
|
||||
->call('openPresentationPicker')
|
||||
->set('pickerQuery', 'Modulbild ohne')
|
||||
->assertSee('Modulbild ohne Fassung')
|
||||
->call('assignFromPicker', 'medium:'.$cover->id);
|
||||
|
||||
$module->refresh();
|
||||
$version->refresh();
|
||||
$this->assertSame('Geändertes Modul.', $module->teaser);
|
||||
$this->assertSame('Eine Grenze erkennen und sagen.', $version->learning_goal);
|
||||
$this->assertSame(0, $cover->fresh()->versions()->count());
|
||||
$this->assertSame(1, $module->versions()->count());
|
||||
$this->assertNull(PresentationAssignment::query()->where('content_element_id', $cover->id)->value('source_version_id'));
|
||||
$this->assertSame(
|
||||
1,
|
||||
CompositionMember::query()->where('composition_version_id', $version->id)->count()
|
||||
@@ -264,10 +281,36 @@ public function test_a_license_article_overrides_only_its_own_presentation(): vo
|
||||
$this->assertSame($offers, Offer::query()->count());
|
||||
$this->assertSame(1, $film->fresh()->versions()->count());
|
||||
|
||||
$cover = $this->image('Artikelbild');
|
||||
app(PresentationMedia::class)->assign($article, 'titelbild', $cover->id, null, $keeper);
|
||||
$cover = $this->pictureWithoutVersion('Artikelbild ohne Fassung');
|
||||
Livewire::test(ViewLicenseArticle::class, ['record' => $article->getKey()])
|
||||
->assertSet('summary', 'Eigene Artikelbeschreibung')
|
||||
->set('descriptionText', 'Nur dieser Artikel')
|
||||
->call('saveLicenseEditorial')
|
||||
->set('presentationQuery', 'Artikelbild ohne')
|
||||
->set('presentationRole', 'titelbild')
|
||||
->set('presentationPick', 'medium:'.$cover->id)
|
||||
->call('assignPickedPresentation')
|
||||
->assertSee('Artikelbild ohne Fassung');
|
||||
|
||||
$overridden = app(EditorialProfileReader::class)->read($article->fresh(), 'artikel');
|
||||
$this->assertSame('eigen', $overridden->origin('description'));
|
||||
$this->assertSame('Nur dieser Artikel', $overridden->value('description'));
|
||||
$this->assertSame('quelle', $overridden->origin('teaser'));
|
||||
$this->assertSame('Teaser der Fassung', $overridden->value('teaser'));
|
||||
$this->assertSame('Lang aus dem Film', $film->fresh()->description);
|
||||
$this->assertSame(0, $cover->fresh()->versions()->count());
|
||||
|
||||
Livewire::test(ViewLicenseArticle::class, ['record' => $article->getKey()])
|
||||
->set('summary', '')
|
||||
->call('saveLicenseEditorial');
|
||||
$restored = app(EditorialProfileReader::class)->read($article->fresh(), 'artikel');
|
||||
$this->assertSame('quelle', $restored->origin('summary'));
|
||||
$this->assertSame('Kurz aus dem Film', $restored->value('summary'));
|
||||
$this->assertSame('eigen', $restored->origin('description'));
|
||||
$this->assertSame($release->id, $article->fresh()->current_release_id);
|
||||
$this->assertSame(1, ArticleRelease::query()->count());
|
||||
$this->assertSame($offers, Offer::query()->count());
|
||||
$this->assertSame(ReleaseStatus::Veroeffentlicht, $release->fresh()->status);
|
||||
|
||||
$ambiguous = $articles->create('UNDEUTIG');
|
||||
$program = $content->createComposition('Zweite Wurzel', CompositionKind::Kurs);
|
||||
@@ -285,6 +328,50 @@ public function test_a_license_article_overrides_only_its_own_presentation(): vo
|
||||
$this->assertSame('leer', app(EditorialProfileReader::class)->read($ambiguous->fresh())->origin('summary'));
|
||||
}
|
||||
|
||||
public function test_content_elements_do_not_offer_the_pillar_dimension_a_second_time(): void
|
||||
{
|
||||
$pillar = Pillar::query()->create(['name' => 'Nähe', 'slug' => 'naehe', 'sort_order' => 1]);
|
||||
$dimension = EditorialDimension::query()->where('slug', 'saeule')->firstOrFail();
|
||||
$value = EditorialDimensionValue::query()->create([
|
||||
'editorial_dimension_id' => $dimension->id,
|
||||
'slug' => 'pfeiler-'.$pillar->id,
|
||||
'label' => 'Nähe als Dimension',
|
||||
]);
|
||||
$content = app(ContentService::class);
|
||||
$film = $content->createElement('film', 'film', 'Film mit Säule');
|
||||
$content->publishElementVersion($film, 'Film');
|
||||
app(IdentityDimension::class)->assign($film, $value);
|
||||
$kinder = $this->dimensionValue('zielgruppe', 'kinder');
|
||||
$this->actingAs($this->editor(), 'staff');
|
||||
|
||||
$html = Livewire::test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->set('bereich', 'beschreibung')
|
||||
->set('dimensionIds', [$kinder->id])
|
||||
->call('saveEditorial')
|
||||
->html();
|
||||
|
||||
$this->assertStringContainsString('Fachliche Säulen', $html);
|
||||
$this->assertStringNotContainsString('>Fachliche Säule<', $html);
|
||||
$assigned = IdentityDimensionValue::query()
|
||||
->where('subject_type', $film->getMorphClass())
|
||||
->where('subject_id', $film->id)
|
||||
->pluck('editorial_dimension_value_id')
|
||||
->all();
|
||||
$this->assertContains($value->id, $assigned);
|
||||
$this->assertContains($kinder->id, $assigned);
|
||||
|
||||
$module = $content->createComposition('Modul mit Säule');
|
||||
$content->publishComposition($module, [[
|
||||
'role' => 'Film',
|
||||
'target' => $film->versions()->first(),
|
||||
]]);
|
||||
Livewire::test(EditExercise::class, ['record' => $module->getKey()])
|
||||
->call('openModule')
|
||||
->set('moduleTab', 'einordnung')
|
||||
->assertSee('Nähe als Dimension')
|
||||
->assertDontSee('Fachliche Säulen');
|
||||
}
|
||||
|
||||
public function test_classification_is_filterable_and_does_not_change_use_or_release(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
@@ -453,6 +540,19 @@ public function test_a_kachel_variant_does_not_replace_the_central_teaser(): voi
|
||||
$this->assertSame('Zentral', $program->fresh()->teaser);
|
||||
}
|
||||
|
||||
private function pictureWithoutVersion(string $title): ContentElement
|
||||
{
|
||||
Storage::fake('cms_incoming');
|
||||
$path = 'inhalte/'.md5($title).'.jpg';
|
||||
Storage::disk('cms_incoming')->put($path, 'bild');
|
||||
$element = app(ContentService::class)->createElement('bild', 'bild', $title);
|
||||
$element->display_title = $title;
|
||||
$element->save();
|
||||
app(PresentationFile::class)->store($element, $path);
|
||||
|
||||
return $element->fresh();
|
||||
}
|
||||
|
||||
private function image(string $title): ContentElement
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
|
||||
Reference in new issue
Block a user