@@ -24,34 +24,34 @@ class EditPlugin extends EditRecord
2424 protected function getHeaderActions (): array
2525 {
2626 return [
27- Actions \ActionGroup::make ([
28- Actions \Action::make ('approve ' )
29- ->icon ('heroicon-o-check ' )
30- ->color ('success ' )
31- ->visible (fn () => $ this ->record ->isPending ())
32- ->disabled (fn () => ! $ this ->record ->passesRequiredReviewChecks ())
33- ->action (fn () => $ this ->record ->approve (auth ()->id ()))
34- ->requiresConfirmation ()
35- ->modalHeading ('Approve Plugin ' )
36- ->modalDescription (fn () => ! $ this ->record ->passesRequiredReviewChecks ()
37- ? "Cannot approve ' {$ this ->record ->name }' — required checks are failing: " .implode (', ' , $ this ->record ->getFailingRequiredChecks ())
38- : "Are you sure you want to approve ' {$ this ->record ->name }'? " ),
27+ Actions \Action::make ('approve ' )
28+ ->icon ('heroicon-o-check ' )
29+ ->color ('success ' )
30+ ->visible (fn () => $ this ->record ->isPending ())
31+ ->disabled (fn () => ! $ this ->record ->passesRequiredReviewChecks ())
32+ ->action (fn () => $ this ->record ->approve (auth ()->id ()))
33+ ->requiresConfirmation ()
34+ ->modalHeading ('Approve Plugin ' )
35+ ->modalDescription (fn () => ! $ this ->record ->passesRequiredReviewChecks ()
36+ ? "Cannot approve ' {$ this ->record ->name }' — required checks are failing: " .implode (', ' , $ this ->record ->getFailingRequiredChecks ())
37+ : "Are you sure you want to approve ' {$ this ->record ->name }'? " ),
3938
40- Actions \Action::make ('reject ' )
41- ->icon ('heroicon-o-x-mark ' )
42- ->color ('danger ' )
43- ->visible (fn () => $ this ->record ->isPending () || $ this ->record ->isApproved ())
44- ->form ([
45- Forms \Components \Textarea::make ('rejection_reason ' )
46- ->label ('Reason for Rejection ' )
47- ->required ()
48- ->rows (3 )
49- ->placeholder ('Please explain why this plugin is being rejected... ' ),
50- ])
51- ->action (fn (array $ data ) => $ this ->record ->reject ($ data ['rejection_reason ' ], auth ()->id ()))
52- ->modalHeading ('Reject Plugin ' )
53- ->modalDescription (fn () => "Are you sure you want to reject ' {$ this ->record ->name }'? " ),
39+ Actions \Action::make ('reject ' )
40+ ->icon ('heroicon-o-x-mark ' )
41+ ->color ('danger ' )
42+ ->visible (fn () => $ this ->record ->isPending () || $ this ->record ->isApproved ())
43+ ->form ([
44+ Forms \Components \Textarea::make ('rejection_reason ' )
45+ ->label ('Reason for Rejection ' )
46+ ->required ()
47+ ->rows (3 )
48+ ->placeholder ('Please explain why this plugin is being rejected... ' ),
49+ ])
50+ ->action (fn (array $ data ) => $ this ->record ->reject ($ data ['rejection_reason ' ], auth ()->id ()))
51+ ->modalHeading ('Reject Plugin ' )
52+ ->modalDescription (fn () => "Are you sure you want to reject ' {$ this ->record ->name }'? " ),
5453
54+ Actions \ActionGroup::make ([
5555 Actions \Action::make ('convertToPaid ' )
5656 ->label ('Convert to Paid ' )
5757 ->icon ('heroicon-o-currency-dollar ' )
@@ -106,6 +106,7 @@ protected function getHeaderActions(): array
106106 ->label ('Grant to User ' )
107107 ->icon ('heroicon-o-gift ' )
108108 ->color ('success ' )
109+ ->visible (fn () => $ this ->record ->isApproved ())
109110 ->form ([
110111 Forms \Components \Select::make ('user_id ' )
111112 ->label ('User ' )
@@ -158,14 +159,6 @@ protected function getHeaderActions(): array
158159 ->modalDescription (fn () => "Grant ' {$ this ->record ->name }' to a user for free. " )
159160 ->modalSubmitActionLabel ('Grant ' ),
160161
161- Actions \Action::make ('viewListing ' )
162- ->label ('View Listing Page ' )
163- ->icon ('heroicon-o-eye ' )
164- ->color ('gray ' )
165- ->url (fn () => route ('plugins.show ' , $ this ->record ->routeParams ()))
166- ->openUrlInNewTab ()
167- ->visible (fn () => $ this ->record ->isApproved () || $ this ->record ->isPending ()),
168-
169162 Actions \Action::make ('viewPackagist ' )
170163 ->label ('View on Packagist ' )
171164 ->icon ('heroicon-o-arrow-top-right-on-square ' )
@@ -259,6 +252,14 @@ protected function getHeaderActions(): array
259252 ->visible (fn () => $ this ->record ->repository_url !== null )
260253 ->url (fn () => $ this ->record ->getGithubUrl ())
261254 ->openUrlInNewTab (),
255+
256+ Actions \Action::make ('viewListing ' )
257+ ->label ('View Listing Page ' )
258+ ->icon ('heroicon-o-eye ' )
259+ ->color ('gray ' )
260+ ->url (fn () => route ('plugins.show ' , $ this ->record ->routeParams ()))
261+ ->openUrlInNewTab ()
262+ ->visible (fn () => $ this ->record ->isApproved () || $ this ->record ->isPending ()),
262263 ])
263264 ->icon ('heroicon-m-ellipsis-vertical ' ),
264265 ];
0 commit comments