mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-06-22 22:50:24 +00:00
🎨 Refactor Livewire views and tests for updated storage benefits on Blossom Media
- Removed unused `copyRelayUrl` and `copyWatchtowerUrl` methods in `Profile` Livewire component. - Updated storage details in `association.profile` and `association.benefits` views with size and file limits. - Enhanced `BenefitsTest` to validate new storage capacity information.
This commit is contained in:
@@ -399,6 +399,10 @@ new class extends Component
|
||||
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
||||
Dein eigener Speicher für Bilder & Videos auf Nostr – betrieben vom Verein.
|
||||
</p>
|
||||
<div class="mt-2 flex flex-wrap items-center gap-1.5">
|
||||
<flux:badge color="rose" size="sm" icon="circle-stack">5 GB Speicher</flux:badge>
|
||||
<flux:badge color="zinc" size="sm" icon="arrow-up-tray">max. 1 GB pro Datei</flux:badge>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -434,6 +438,12 @@ new class extends Component
|
||||
Vereinsserver.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<p>
|
||||
<strong>Dein Kontingent:</strong> 5 GB Speicherplatz pro Mitglied, einzelne Dateien
|
||||
bis maximal 1 GB. Deine hochgeladenen Medien kannst du jederzeit auf
|
||||
<flux:link href="https://media.einundzwanzig.space" target="_blank">media.einundzwanzig.space</flux:link>
|
||||
ansehen und verwalten.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Sicher:</strong> Die Anmeldung passiert automatisch über deinen Nostr-Schlüssel –
|
||||
nur Vereinsmitglieder können hochladen, und deine privaten Schlüssel verlassen
|
||||
|
||||
@@ -620,20 +620,6 @@ new class extends Component {
|
||||
->unique('id')
|
||||
->toArray();
|
||||
}
|
||||
|
||||
public function copyRelayUrl(): void
|
||||
{
|
||||
$relayUrl = 'wss://nostr.einundzwanzig.space';
|
||||
$this->js("navigator.clipboard.writeText('{$relayUrl}')");
|
||||
Flux::toast('Relay-Adresse in die Zwischenablage kopiert!');
|
||||
}
|
||||
|
||||
public function copyWatchtowerUrl(): void
|
||||
{
|
||||
$watchtowerUrl = '03a09f56bba3d2c200cc55eda2f1f069564a97c1fb74345e1560e2868a8ab3d7d0@62.171.139.240:9911';
|
||||
$this->js("navigator.clipboard.writeText('{$watchtowerUrl}')");
|
||||
Flux::toast('Watchtower-Adresse in die Zwischenablage kopiert!');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -696,6 +682,7 @@ new class extends Component {
|
||||
<flux:badge color="rose" size="sm">NEU</flux:badge>
|
||||
</div>
|
||||
<p class="text-xs text-text-secondary">Eigener Speicher für Bilder & Videos auf Nostr.</p>
|
||||
<p class="text-xs text-text-tertiary mt-0.5">5 GB Speicher · max. 1 GB pro Datei</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -4,30 +4,18 @@ use App\Models\EinundzwanzigPleb;
|
||||
use App\Support\NostrAuth;
|
||||
use Livewire\Livewire;
|
||||
|
||||
function activePaidPleb(): EinundzwanzigPleb
|
||||
{
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->create();
|
||||
|
||||
$pleb->paymentEvents()->create([
|
||||
'year' => date('Y'),
|
||||
'amount' => 21000,
|
||||
'event_id' => 'event-benefits',
|
||||
'paid' => true,
|
||||
]);
|
||||
|
||||
return $pleb;
|
||||
}
|
||||
|
||||
it('shows the locked state with all four services for guests', function () {
|
||||
Livewire::test('association.benefits')
|
||||
->assertSet('currentYearIsPaid', false)
|
||||
->assertSee('Dienste gesperrt')
|
||||
->assertSee('Blossom-Medienserver')
|
||||
->assertSee('5 GB Speicher')
|
||||
->assertSee('max. 1 GB pro Datei')
|
||||
->assertDontSee('https://blossom.einundzwanzig.space');
|
||||
});
|
||||
|
||||
it('unlocks the blossom server for active paid members', function () {
|
||||
$pleb = activePaidPleb();
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.benefits')
|
||||
@@ -38,7 +26,7 @@ it('unlocks the blossom server for active paid members', function () {
|
||||
});
|
||||
|
||||
it('copies the blossom url for active members', function () {
|
||||
$pleb = activePaidPleb();
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.benefits')
|
||||
|
||||
Reference in New Issue
Block a user