Ordne Paket, Rechteprofil, Säulen, Kombinationen und Benutzer in die gemeinsamen Muster ein.
- Gemeinsame Katalog-Objektseite (catalog/objekt): Kopf, Hauptabschnitte, Begleitinformation. Angebot, Paket und Rechteprofil nutzen sie; lesbare Bezeichnungen zentral in CatalogLabels. - Paket: eine Maske für erste und geänderte Fassung, bei einer Änderung mit der neuesten veröffentlichten Fassung vorbelegt; Wirkung unverändert BundleService::publish (frühere Fassungen bleiben veröffentlicht). - Rechteprofil: erlaubte Handlungen lesbar, Verwendung in Angeboten, Fassungen; der doppelte Titel „… ansehen ansehen“ entfällt. - Fachliche Säulen, Fachliche Kombinationen und Benutzer in der gemeinsamen Bestandsliste; Säulen mit Website-Zustand und Medienzahl, Konten mit Status und Rollen. - Gefüllte Filament-Hauptknöpfe überall im Verwaltungsgrün (auch Formularfuß, etwa „Speichern“ der Säule). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3aa1bad859
commit
51d58ac55c
14 files changed
+675
-198
No files matched your search
@@ -9,8 +9,11 @@
|
||||
use App\Domain\Catalog\ContentService;
|
||||
use App\Domain\Catalog\LicenseArticle;
|
||||
use App\Domain\Catalog\OfferService;
|
||||
use App\Domain\Catalog\PillarService;
|
||||
use App\Filament\Pages\EditorialDesk;
|
||||
use App\Filament\Resources\Bundles\Pages\ListBundles;
|
||||
use App\Filament\Resources\Bundles\Pages\ViewBundle;
|
||||
use App\Filament\Resources\Combinations\Pages\ListCombinations;
|
||||
use App\Filament\Resources\ContentElements\Pages\ListContentElements;
|
||||
use App\Filament\Resources\Courses\Pages\ListCourses;
|
||||
use App\Filament\Resources\Exercises\ExerciseResource;
|
||||
@@ -20,7 +23,10 @@
|
||||
use App\Filament\Resources\Offers\OfferResource;
|
||||
use App\Filament\Resources\Offers\Pages\ListOffers;
|
||||
use App\Filament\Resources\Offers\Pages\ViewOffer;
|
||||
use App\Filament\Resources\Pillars\Pages\ListPillars;
|
||||
use App\Filament\Resources\RightsProfiles\Pages\ListRightsProfiles;
|
||||
use App\Filament\Resources\RightsProfiles\Pages\ViewRightsProfile;
|
||||
use App\Filament\Resources\Users\Pages\ListUsers;
|
||||
use App\Filament\Support\Bestand;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -266,6 +272,95 @@ public function test_one_offer_mask_activates_the_first_version_and_is_prefilled
|
||||
$this->assertSame(['beendet', 'aktiv'], $statuses);
|
||||
}
|
||||
|
||||
public function test_a_bundle_change_is_prefilled_and_keeps_the_published_version(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$articles = app(ArticleService::class);
|
||||
$sheet = $content->publishElementVersion($content->createElement('pdf', 'pdf', 'Merkblatt'), 'Hinweis');
|
||||
$first = $articles->create('demo-a', 'Erprobung');
|
||||
$articles->publishRelease($first, $sheet, 'A.');
|
||||
$second = $articles->create('demo-b', 'Erprobung');
|
||||
$articles->publishRelease($second, $sheet, 'B.');
|
||||
$bundle = app(BundleService::class)->create('Demo Basis');
|
||||
app(BundleService::class)->publish($bundle, [$first->fresh()]);
|
||||
|
||||
$component = Livewire::actingAs($this->keeper(), 'staff')
|
||||
->test(ViewBundle::class, ['record' => $bundle->getKey()])
|
||||
->assertSee('Fassung 1 veröffentlicht')
|
||||
->assertSee('Lizenzartikel demo-a')
|
||||
->assertSee('Geänderte Fassung veröffentlichen')
|
||||
->mountAction('publish');
|
||||
$this->assertSame('Paket ändern: Fassung 2 veröffentlichen', $component->instance()->getMountedAction()->getModalHeading());
|
||||
$this->assertSame([$first->id], array_map('intval', $component->get('mountedActions.0.data.articles')));
|
||||
|
||||
$component->fillForm(['articles' => [$first->id, $second->id]])
|
||||
->callMountedAction()
|
||||
->assertHasNoFormErrors()
|
||||
->assertSee('Fassung 2 veröffentlicht')
|
||||
->assertSee('Lizenzartikel demo-b');
|
||||
|
||||
$this->assertSame(2, $bundle->versions()->where('status', 'veroeffentlicht')->count());
|
||||
$this->assertSame(1, $bundle->versions()->where('number', 1)->firstOrFail()->items()->count());
|
||||
}
|
||||
|
||||
public function test_a_rights_profile_reads_as_allowed_actions_and_names_its_offers(): void
|
||||
{
|
||||
$offers = app(OfferService::class);
|
||||
$content = app(ContentService::class);
|
||||
$articles = app(ArticleService::class);
|
||||
$sheet = $content->publishElementVersion($content->createElement('pdf', 'pdf', 'Merkblatt'), 'Hinweis');
|
||||
$article = $articles->create('demo-merkblatt', 'Erprobung');
|
||||
$articles->publishRelease($article, $sheet, 'A.');
|
||||
$rights = $offers->createRightsProfile('Abstand ansehen', 'ehrenamtlich', ['pdf' => ['ansehen', 'laden']]);
|
||||
$offer = $offers->create('Kostenlos');
|
||||
$offers->activate($offer, [['target' => $article->fresh(), 'rights' => $rights]], ['grant_kind' => 'auf_abruf']);
|
||||
|
||||
Livewire::actingAs($this->keeper(), 'staff')
|
||||
->test(ViewRightsProfile::class, ['record' => $rights->rights_profile_id])
|
||||
->assertSee('Abstand ansehen')
|
||||
->assertDontSee('Abstand ansehen ansehen')
|
||||
->assertSee('PDF ansehen')
|
||||
->assertSee('PDF herunterladen')
|
||||
->assertDontSee('pdf: ansehen')
|
||||
->assertSee('Kostenlos · Fassung 1')
|
||||
->assertSee('festgeschrieben seit');
|
||||
}
|
||||
|
||||
public function test_pillars_combinations_and_accounts_use_the_same_list(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$content->createComposition('Materialsatz Alltag', CompositionKind::Kombination);
|
||||
$content->createComposition('Modul Abstand', CompositionKind::Uebung);
|
||||
app(PillarService::class)->create('Sicher handeln im Alltag');
|
||||
$editor = $this->editor();
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(ListPillars::class)
|
||||
->assertSee('Sicher handeln im Alltag')
|
||||
->assertSee('Intern')
|
||||
->assertSee('0 Medien')
|
||||
->assertSeeHtml('wire:partial="action-modals"');
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(ListCombinations::class)
|
||||
->assertSee('Materialsatz Alltag')
|
||||
->assertDontSee('Modul Abstand')
|
||||
->assertSeeHtml('wire:partial="action-modals"')
|
||||
->assertSee('Kombination anlegen');
|
||||
|
||||
$admin = User::factory()->systemverwalter()->create(['name' => 'Anna Admin', 'email' => 'anna@example.test']);
|
||||
$admin->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
Livewire::actingAs($admin, 'staff')
|
||||
->test(ListUsers::class)
|
||||
->assertSee('Anna Admin')
|
||||
->assertSee('anna@example.test')
|
||||
->assertSee('Benutzer anlegen')
|
||||
->set('suche', 'anna@')
|
||||
->assertSee('Anna Admin')
|
||||
->assertDontSee($editor->email);
|
||||
}
|
||||
|
||||
private function keeper(): User
|
||||
{
|
||||
$keeper = User::factory()->katalogverwalter()->create();
|
||||
|
||||
Reference in new issue
Block a user