Sichere den Redaktions-Arbeitsstand ab und entferne den Parallel-Editor.
- Speichern löst nur Zuordnungen, die beim Laden da waren; zwischenzeitlich
anderswo ergänzte bleiben erhalten.
- Eine belegte Einzelrolle (Titelbild, Hero, Hover) wird im Picker
ausdrücklich ausgetauscht, mit Banner und benanntem Ersatz.
- Gemeinsamer Bestätigungsdialog statt Browser-confirm(); Warnung beim
Verlassen der Seite mit ungespeicherten Änderungen.
- „Ausgabe prüfen“ am Medium benennt, welche Angaben aktuell und welche
gespeichert sind.
- Das frühere Gesamtformular für Medien leitet in die Redaktion; „Löschen“
steht unter „Weitere Aktionen“, die Medienliste öffnet die Redaktion.
- Vorschaubild aus vorhandenem Bild wieder über den gemeinsamen Picker
wählbar (Oberfläche war seit 72130d6 entfallen).
- Vorgemerkte Upload-Dateien bleiben sichtbar, Brotkrumen führen zur Liste,
die Redaktion lässt sich über die Adresse nicht ohne Recht öffnen.
- Agentenregeln und CLAUDE.md verweisen auf die gemeinsamen Bausteine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
872f156d7d
commit
e7b0932e54
21 files changed
+481
-47
No files matched your search
@@ -224,14 +224,11 @@ public function test_a_description_does_not_create_a_version_and_an_older_versio
|
||||
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
$this->actingAs($editor, 'staff');
|
||||
|
||||
Livewire::test(EditContentElement::class, ['record' => $element->getKey()])
|
||||
->fillForm([
|
||||
'working_title' => 'Übungsfilm',
|
||||
'description' => 'Für die Gruppe',
|
||||
'pillars' => [],
|
||||
])
|
||||
->call('save')
|
||||
->assertHasNoFormErrors();
|
||||
Livewire::test(ViewContentElement::class, ['record' => $element->getKey()])
|
||||
->call('openRedaktion')
|
||||
->set('descriptionText', 'Für die Gruppe')
|
||||
->call('saveRedaktion')
|
||||
->assertSee('Es gibt keine neue Fassung.');
|
||||
|
||||
$this->assertSame(2, $element->versions()->count());
|
||||
$this->assertSame('Für die Gruppe', $element->fresh()->description);
|
||||
@@ -268,16 +265,13 @@ public function test_usage_and_license_notes_stay_on_the_medium_and_in_the_list(
|
||||
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(EditContentElement::class, ['record' => $element->getKey()])
|
||||
->fillForm([
|
||||
'working_title' => 'Lara im Park',
|
||||
'description' => 'Lara spielt im Park.',
|
||||
'usage_note' => 'Vor dem Film den Abstand ansprechen.',
|
||||
'license_note' => 'Nur intern: Archivmaterial der Produktion.',
|
||||
'pillars' => [],
|
||||
])
|
||||
->call('save')
|
||||
->assertHasNoFormErrors();
|
||||
->test(ViewContentElement::class, ['record' => $element->getKey()])
|
||||
->call('openRedaktion')
|
||||
->set('descriptionText', 'Lara spielt im Park.')
|
||||
->set('usageNote', 'Vor dem Film den Abstand ansprechen.')
|
||||
->set('licenseNote', 'Nur intern: Archivmaterial der Produktion.')
|
||||
->call('saveRedaktion')
|
||||
->assertSee('Es gibt keine neue Fassung.');
|
||||
|
||||
$element->refresh();
|
||||
$this->assertSame(1, $element->versions()->count());
|
||||
|
||||
@@ -68,7 +68,7 @@ public function test_the_library_opens_as_tiles_and_keeps_filters_when_the_view_
|
||||
->assertSee('Lara im Park')
|
||||
->assertDontSee('Trainerhinweis')
|
||||
->assertSee('Ansehen')
|
||||
->assertSee('Bearbeiten')
|
||||
->assertSee('Redaktion')
|
||||
->call('resetFilters')
|
||||
->assertSet('suche', '')
|
||||
->assertSet('ansicht', 'liste')
|
||||
@@ -263,7 +263,7 @@ public function test_a_catalog_keeper_can_open_the_library_but_cannot_edit(): vo
|
||||
->assertOk()
|
||||
->assertSee('Hinweis')
|
||||
->assertSee('Ansehen')
|
||||
->assertDontSee('Bearbeiten')
|
||||
->assertDontSee('redaktion=1')
|
||||
->assertDontSee('Medium anlegen');
|
||||
}
|
||||
|
||||
@@ -310,7 +310,11 @@ public function test_an_editor_can_open_a_medium_from_the_library(): void
|
||||
->get(ContentElementResource::getUrl('index'))
|
||||
->assertOk()
|
||||
->assertSee(ContentElementResource::getUrl('view', ['record' => $element]), false)
|
||||
->assertSee(ContentElementResource::getUrl('edit', ['record' => $element]), false);
|
||||
->assertSee(e(ContentElementResource::getUrl('view', ['record' => $element, 'redaktion' => 1])), false);
|
||||
|
||||
$this->actingAs($editor, 'staff')
|
||||
->get(ContentElementResource::getUrl('edit', ['record' => $element]))
|
||||
->assertRedirect(ContentElementResource::getUrl('view', ['record' => $element, 'redaktion' => 1]));
|
||||
}
|
||||
|
||||
private function editor(): User
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Domain\Catalog\ArticleService;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\ContentElement;
|
||||
use App\Domain\Catalog\ContentService;
|
||||
@@ -10,6 +11,8 @@
|
||||
use App\Domain\Catalog\PresentationMedia;
|
||||
use App\Filament\Resources\ContentElements\Pages\ViewContentElement;
|
||||
use App\Filament\Resources\Exercises\Pages\EditExercise;
|
||||
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
|
||||
use App\Filament\Resources\LicenseArticles\Pages\ViewLicenseArticle;
|
||||
use App\Models\User;
|
||||
use Filament\Facades\Filament;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -27,6 +30,141 @@ protected function setUp(): void
|
||||
Filament::setCurrentPanel(Filament::getPanel('verwaltung'));
|
||||
}
|
||||
|
||||
public function test_saving_keeps_an_assignment_that_someone_else_added_meanwhile(): void
|
||||
{
|
||||
$film = $this->film();
|
||||
$mine = $this->picture('Meine Galerie');
|
||||
$theirs = $this->picture('Fremde Galerie');
|
||||
|
||||
$page = Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->call('openRedaktion', 'medien');
|
||||
|
||||
app(PresentationMedia::class)->assign($film, 'galerie', $theirs->id, null);
|
||||
|
||||
$page->call('openPresentationPicker', 'galerie')
|
||||
->call('assignFromPicker', 'medium:'.$mine->id)
|
||||
->call('saveRedaktion');
|
||||
|
||||
$this->assertEqualsCanonicalizing([$theirs->id, $mine->id], $this->order($film, 'galerie'));
|
||||
}
|
||||
|
||||
public function test_adding_to_an_occupied_single_role_is_an_exchange(): void
|
||||
{
|
||||
$film = $this->film();
|
||||
$old = $this->picture('Altes Titelbild');
|
||||
$new = $this->picture('Neues Titelbild');
|
||||
app(PresentationMedia::class)->assign($film, 'titelbild', $old->id, null);
|
||||
|
||||
Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->call('openRedaktion', 'medien')
|
||||
->call('openPresentationPicker', 'titelbild')
|
||||
->assertSee('Wird ersetzt')
|
||||
->assertSee('Diese Rolle hat nur ein Medium.')
|
||||
->call('markPicker', 'medium:'.$new->id, true)
|
||||
->assertSee('Austauschen')
|
||||
->call('confirmPicker')
|
||||
->assertSee('„Neues Titelbild“ ersetzt „Altes Titelbild“ an derselben Stelle')
|
||||
->call('saveRedaktion');
|
||||
|
||||
$this->assertSame([$new->id], $this->order($film, 'titelbild'));
|
||||
$this->assertNotNull($old->fresh());
|
||||
}
|
||||
|
||||
public function test_a_stock_image_can_become_the_preview_image_through_the_shared_picker(): void
|
||||
{
|
||||
$film = $this->film();
|
||||
$image = $this->picture('Szenenbild');
|
||||
|
||||
Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->call('openThumbnailPicker')
|
||||
->assertSee('Vorschaubild aus dem Bestand')
|
||||
->assertSee('Szenenbild')
|
||||
->call('markPicker', 'medium:'.$image->id, true)
|
||||
->assertSee('Als Vorschaubild übernehmen')
|
||||
->call('confirmPicker')
|
||||
->assertSet('pickerOpen', false)
|
||||
->assertSet('pictureFeedback', 'Vorschaubild übernommen. Es gibt keine neue Fassung. Für die Website ist es damit nicht freigegeben.');
|
||||
|
||||
$this->assertSame($image->thumbnail_path, $film->fresh()->thumbnail_path);
|
||||
$this->assertSame(1, $film->fresh()->versions()->count());
|
||||
}
|
||||
|
||||
public function test_confirmations_use_the_shared_dialog_and_only_known_actions(): void
|
||||
{
|
||||
$film = $this->film();
|
||||
$film->teaser = 'Gespeichert';
|
||||
$film->save();
|
||||
|
||||
Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->call('openRedaktion')
|
||||
->set('teaser', 'Offen')
|
||||
->call('askConfirmation', 'discardRedaktion')
|
||||
->assertSee('Änderungen der Redaktion verwerfen?')
|
||||
->call('cancelConfirmation')
|
||||
->assertSet('teaser', 'Offen')
|
||||
->call('askConfirmation', 'discardRedaktion')
|
||||
->call('confirmConfirmation')
|
||||
->assertSet('teaser', 'Gespeichert')
|
||||
->call('askConfirmation', 'saveRedaktionTexte')
|
||||
->assertSet('bestaetigung', null);
|
||||
}
|
||||
|
||||
public function test_only_editors_change_the_redaktion_and_the_address_does_not_bypass_it(): void
|
||||
{
|
||||
$film = $this->film();
|
||||
$keeper = User::factory()->katalogverwalter()->create();
|
||||
$keeper->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
Livewire::actingAs($keeper, 'staff')
|
||||
->withQueryParams(['redaktion' => '1'])
|
||||
->test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->assertSet('redaktionOpen', false)
|
||||
->assertDontSee('Redaktion bearbeiten')
|
||||
->call('saveRedaktion')
|
||||
->assertForbidden();
|
||||
|
||||
foreach (['removePresentation' => ['a1'], 'confirmPicker' => [], 'openPresentationPicker' => []] as $method => $arguments) {
|
||||
Livewire::actingAs($keeper, 'staff')
|
||||
->test(ViewContentElement::class, ['record' => $film->getKey()])
|
||||
->set('pickerMarked', ['medium:1' => 'x'])
|
||||
->call($method, ...$arguments)
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
$this->assertSame(0, PresentationAssignment::query()->count());
|
||||
}
|
||||
|
||||
public function test_the_license_article_needs_the_catalog_role_and_offers_no_global_release_there(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$film = $this->film();
|
||||
$version = $film->versions()->first();
|
||||
$articles = app(ArticleService::class);
|
||||
$article = $articles->create('LARA-PARK', 'Alltag');
|
||||
$articles->publishRelease($article, $version, 'Derselbe Unterrichtsfilm');
|
||||
$image = $this->picture('Artikelbild');
|
||||
app(PresentationMedia::class)->assign($article, 'titelbild', $image->id, null);
|
||||
|
||||
$this->actingAs($this->editor(), 'staff')
|
||||
->get(LicenseArticleResource::getUrl('view', ['record' => $article]))
|
||||
->assertForbidden();
|
||||
|
||||
$keeper = User::factory()->katalogverwalter()->create();
|
||||
$keeper->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
Livewire::actingAs($keeper, 'staff')
|
||||
->test(ViewLicenseArticle::class, ['record' => $article->getKey()])
|
||||
->call('openRedaktion', 'medien')
|
||||
->assertSee('Artikelbild')
|
||||
->assertSee('Medium öffnen')
|
||||
->assertDontSee('Für die Website freigeben')
|
||||
->assertDontSee('Website-Freigabe zurücknehmen');
|
||||
}
|
||||
|
||||
public function test_redaktion_return_keeps_open_composition_inputs_and_saves_only_editorial_text(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
@@ -247,7 +385,7 @@ public function test_exchange_keeps_the_position_and_reordering_stays_within_its
|
||||
->call('markPicker', 'medium:'.$replacement->id, true)
|
||||
->assertSee('Austauschen')
|
||||
->call('confirmPicker')
|
||||
->assertSee('ersetzt die bisherige Zuordnung an derselben Stelle')
|
||||
->assertSee('ersetzt „Bild zwei“ an derselben Stelle')
|
||||
->call('movePresentation', $keyOf($three), -1)
|
||||
->call('movePresentation', $keyOf($one), -1)
|
||||
->call('saveRedaktion');
|
||||
@@ -324,6 +462,15 @@ public function test_a_missing_working_title_is_shown_at_the_field_and_nothing_i
|
||||
$this->assertSame('Lara im Park', $film->fresh()->working_title);
|
||||
}
|
||||
|
||||
private function film(): ContentElement
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$film = $content->createElement('film', 'film', 'Lara im Park');
|
||||
$content->publishElementVersion($film, 'Filmfassung');
|
||||
|
||||
return $film->fresh();
|
||||
}
|
||||
|
||||
private function picture(string $title): ContentElement
|
||||
{
|
||||
$image = app(ContentService::class)->createElement('bild', 'bild', $title);
|
||||
|
||||
Reference in new issue
Block a user