Skip to content

Commit 0cdb170

Browse files
simonhampclaude
andcommitted
Add read-only type/tier summary for approved plugins and fix duplicate name display
Show a non-editable type and pricing tier card on the approved plugin edit page. Only show the composer package name subheading when a custom display name is set, preventing the name from appearing twice. Fix preview banner test assertion to match updated text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b133def commit 0cdb170

File tree

9 files changed

+70
-28
lines changed

9 files changed

+70
-28
lines changed

resources/views/cart/show.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ class="flex gap-4 p-6"
228228
{{ $item->plugin->display_name ?? $item->plugin->name }}
229229
</a>
230230
</h3>
231-
<p class="mt-0.5 font-mono text-xs text-gray-500 dark:text-gray-400">{{ $item->plugin->name }}</p>
231+
@if ($item->plugin->display_name)
232+
<p class="mt-0.5 font-mono text-xs text-gray-500 dark:text-gray-400">{{ $item->plugin->name }}</p>
233+
@endif
232234
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
233235
by {{ $item->plugin->user->display_name }}
234236
</p>

resources/views/cart/success.blade.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
</div>
2828
<div class="text-left">
2929
<span class="text-sm font-medium text-gray-900 dark:text-white">{{ $item->plugin->display_name ?? $item->plugin->name }}</span>
30-
<p class="font-mono text-xs text-gray-500 dark:text-gray-400">{{ $item->plugin->name }}</p>
30+
@if ($item->plugin->display_name)
31+
<p class="font-mono text-xs text-gray-500 dark:text-gray-400">{{ $item->plugin->name }}</p>
32+
@endif
3133
@if ($item->plugin->isOfficial() && auth()->user()?->hasUltraAccess())
3234
<p class="text-xs text-green-600 dark:text-green-400">Included with Ultra</p>
3335
@endif
@@ -47,7 +49,9 @@
4749
<x-vaadin-plug class="size-5" />
4850
</div>
4951
<span class="text-sm font-medium text-gray-900 dark:text-white">{{ $plugin->display_name ?? $plugin->name }}</span>
50-
<p class="font-mono text-xs text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
52+
@if ($plugin->display_name)
53+
<p class="font-mono text-xs text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
54+
@endif
5155
</div>
5256
</div>
5357
@endforeach
@@ -213,7 +217,9 @@ class="rounded-lg border border-gray-200 bg-white p-8 text-center dark:border-gr
213217
</div>
214218
<div class="text-left">
215219
<span class="text-sm font-medium text-gray-900 dark:text-white" x-text="license.plugin_display_name || license.plugin_name"></span>
216-
<p class="font-mono text-xs text-gray-500 dark:text-gray-400" x-text="license.plugin_name"></p>
220+
<template x-if="license.plugin_display_name">
221+
<p class="font-mono text-xs text-gray-500 dark:text-gray-400" x-text="license.plugin_name"></p>
222+
</template>
217223
</div>
218224
</div>
219225
<a :href="'/plugins/' + license.plugin_name" class="text-sm font-medium text-indigo-600 hover:text-indigo-700 dark:text-indigo-400 dark:hover:text-indigo-300">

resources/views/components/plugin-card.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class="size-12 shrink-0 rounded-xl object-cover"
3939
<h3 class="text-sm font-semibold text-gray-900 dark:text-white">
4040
{{ $plugin->display_name ?? $plugin->name }}
4141
</h3>
42-
<p class="mt-0.5 font-mono text-xs text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
42+
@if ($plugin->display_name)
43+
<p class="mt-0.5 font-mono text-xs text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
44+
@endif
4345
@if ($plugin->description)
4446
<p class="mt-2 line-clamp-3 text-sm text-gray-600 dark:text-gray-400">
4547
{{ $plugin->description }}

resources/views/customer/team/show.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
<a href="{{ route('plugins.show', $plugin->routeParams()) }}" class="font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300">
5656
{{ $plugin->display_name ?? $plugin->name }}
5757
</a>
58-
<flux:text class="font-mono text-xs">{{ $plugin->name }}</flux:text>
58+
@if ($plugin->display_name)
59+
<flux:text class="font-mono text-xs">{{ $plugin->name }}</flux:text>
60+
@endif
5961
@if($plugin->description)
6062
<flux:text class="text-xs line-clamp-1">{{ $plugin->description }}</flux:text>
6163
@endif

resources/views/customer/ultra/index.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@
153153
<a href="{{ route('plugins.show', $plugin->routeParams()) }}" class="font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300">
154154
{{ $plugin->display_name ?? $plugin->name }}
155155
</a>
156-
<flux:text class="font-mono text-xs">{{ $plugin->name }}</flux:text>
156+
@if ($plugin->display_name)
157+
<flux:text class="font-mono text-xs">{{ $plugin->name }}</flux:text>
158+
@endif
157159
@if($plugin->description)
158160
<flux:text class="text-xs line-clamp-1">{{ $plugin->description }}</flux:text>
159161
@endif

resources/views/livewire/customer/developer/dashboard.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969
<div class="flex items-center justify-between">
7070
<div class="min-w-0 flex-1">
7171
<p class="truncate font-medium text-gray-900 dark:text-white">{{ $plugin->display_name ?? $plugin->name }}</p>
72-
<p class="truncate font-mono text-xs text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
72+
@if ($plugin->display_name)
73+
<p class="truncate font-mono text-xs text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
74+
@endif
7375
</div>
7476
<div class="ml-4 text-right">
7577
<flux:text class="font-medium">{{ $plugin->licenses_count }} sales</flux:text>

resources/views/livewire/customer/plugins/show.blade.php

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,30 @@ class="block text-sm text-gray-500 file:mr-4 file:rounded-md file:border-0 file:
433433
</flux:tab.group>
434434
@elseif ($plugin->isApproved())
435435
{{-- Editable fields for Approved plugins (no tabs) --}}
436+
437+
{{-- Read-only Type & Tier --}}
438+
<flux:card class="mb-6">
439+
<div class="flex items-center justify-between">
440+
<div>
441+
<flux:heading size="lg">Type</flux:heading>
442+
<flux:text class="mt-1">
443+
@if ($plugin->isPaid() && $plugin->tier)
444+
@php
445+
$prices = $plugin->tier->getPrices();
446+
$subscriberPrice = $prices[\App\Enums\PriceTier::Subscriber->value] / 100;
447+
$regularPrice = $prices[\App\Enums\PriceTier::Regular->value] / 100;
448+
@endphp
449+
Paid &mdash; {{ $plugin->tier->label() }} (${{ number_format($subscriberPrice) }} – ${{ number_format($regularPrice) }})
450+
@elseif ($plugin->isPaid())
451+
Paid
452+
@else
453+
Free
454+
@endif
455+
</flux:text>
456+
</div>
457+
</div>
458+
</flux:card>
459+
436460
<form wire:submit="save" class="space-y-6">
437461
{{-- Display Name --}}
438462
<flux:card>
@@ -449,22 +473,6 @@ class="block text-sm text-gray-500 file:mr-4 file:rounded-md file:border-0 file:
449473
</div>
450474
</flux:card>
451475

452-
{{-- Support Channel --}}
453-
<flux:card>
454-
<flux:heading size="lg">Support</flux:heading>
455-
<flux:text class="mt-1">How can users get support for your plugin? Provide an email address or a URL.</flux:text>
456-
457-
<div class="mt-4">
458-
<flux:input
459-
wire:model="supportChannel"
460-
placeholder="support@example.com or https://..."
461-
/>
462-
@error('supportChannel')
463-
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
464-
@enderror
465-
</div>
466-
</flux:card>
467-
468476
{{-- Description --}}
469477
<flux:card>
470478
<flux:heading size="lg">Description</flux:heading>
@@ -574,6 +582,22 @@ class="block text-sm text-gray-500 file:mr-4 file:rounded-md file:border-0 file:
574582
</div>
575583
</flux:card>
576584

585+
{{-- Support Channel --}}
586+
<flux:card>
587+
<flux:heading size="lg">Support</flux:heading>
588+
<flux:text class="mt-1">How can users get support for your plugin? Provide an email address or a URL.</flux:text>
589+
590+
<div class="mt-4">
591+
<flux:input
592+
wire:model="supportChannel"
593+
placeholder="support@example.com or https://..."
594+
/>
595+
@error('supportChannel')
596+
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
597+
@enderror
598+
</div>
599+
</flux:card>
600+
577601
{{-- Save Button --}}
578602
<div class="flex items-center justify-end">
579603
<flux:button type="submit" variant="primary">Save Changes</flux:button>

resources/views/plugin-show.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ class="text-2xl font-bold sm:text-3xl"
8787
>
8888
{{ $plugin->display_name ?? $plugin->name }}
8989
</h1>
90-
<p class="mt-1 font-mono text-sm text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
90+
@if ($plugin->display_name)
91+
<p class="mt-1 font-mono text-sm text-gray-500 dark:text-gray-400">{{ $plugin->name }}</p>
92+
@endif
9193
@if ($plugin->description)
9294
<p class="mt-1 text-gray-600 dark:text-gray-400">
9395
{{ $plugin->description }}

tests/Feature/AdminPluginPreviewTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function test_admin_sees_preview_banner_on_pending_plugin(): void
5959

6060
$this->actingAs($admin)
6161
->get(route('plugins.show', $plugin->routeParams()))
62-
->assertSee('Admin Preview')
62+
->assertSee('Preview')
6363
->assertSee('Pending Review');
6464
}
6565

@@ -68,7 +68,7 @@ public function test_approved_plugin_does_not_show_preview_banner(): void
6868
$plugin = Plugin::factory()->approved()->create();
6969

7070
$this->get(route('plugins.show', $plugin->routeParams()))
71-
->assertDontSee('Admin Preview');
71+
->assertDontSee('This plugin is not publicly visible');
7272
}
7373

7474
public function test_admin_can_view_approved_plugin_without_preview_banner(): void
@@ -81,6 +81,6 @@ public function test_admin_can_view_approved_plugin_without_preview_banner(): vo
8181
$this->actingAs($admin)
8282
->get(route('plugins.show', $plugin->routeParams()))
8383
->assertStatus(200)
84-
->assertDontSee('Admin Preview');
84+
->assertDontSee('This plugin is not publicly visible');
8585
}
8686
}

0 commit comments

Comments
 (0)