Skip to content

Commit 1c8aa8e

Browse files
committed
test logging
1 parent 85e3f54 commit 1c8aa8e

1 file changed

Lines changed: 31 additions & 23 deletions

File tree

app/Filament/Resources/PluginResource/Pages/EditPlugin.php

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,32 @@ protected function getHeaderActions(): array
2727
Actions\Action::make('approve')
2828
->icon('heroicon-o-check')
2929
->color('success')
30-
->visible(fn () => $this->record->isPending())
31-
->action(fn () => $this->record->approve(auth()->id()))
30+
->visible(fn() => $this->record->isPending())
31+
->action(fn() => $this->record->approve(auth()->id()))
3232
->requiresConfirmation()
3333
->modalHeading('Approve Plugin')
34-
->modalDescription(fn () => "Are you sure you want to approve '{$this->record->name}'?"),
34+
->modalDescription(fn() => "Are you sure you want to approve '{$this->record->name}'?"),
3535

3636
Actions\Action::make('reject')
3737
->icon('heroicon-o-x-mark')
3838
->color('danger')
39-
->visible(fn () => $this->record->isPending() || $this->record->isApproved())
39+
->visible(fn() => $this->record->isPending() || $this->record->isApproved())
4040
->form([
4141
Forms\Components\Textarea::make('rejection_reason')
4242
->label('Reason for Rejection')
4343
->required()
4444
->rows(3)
4545
->placeholder('Please explain why this plugin is being rejected...'),
4646
])
47-
->action(fn (array $data) => $this->record->reject($data['rejection_reason'], auth()->id()))
47+
->action(fn(array $data) => $this->record->reject($data['rejection_reason'], auth()->id()))
4848
->modalHeading('Reject Plugin')
49-
->modalDescription(fn () => "Are you sure you want to reject '{$this->record->name}'?"),
49+
->modalDescription(fn() => "Are you sure you want to reject '{$this->record->name}'?"),
5050

5151
Actions\Action::make('convertToPaid')
5252
->label('Convert to Paid')
5353
->icon('heroicon-o-currency-dollar')
5454
->color('success')
55-
->visible(fn () => $this->record->isFree())
55+
->visible(fn() => $this->record->isFree())
5656
->form([
5757
Forms\Components\Select::make('tier')
5858
->label('Pricing Tier')
@@ -75,17 +75,17 @@ protected function getHeaderActions(): array
7575
->send();
7676
})
7777
->modalHeading('Convert Plugin to Paid')
78-
->modalDescription(fn () => "This will convert '{$this->record->name}' from free to paid, set up pricing, and trigger a Satis build so it's available via Composer.")
78+
->modalDescription(fn() => "This will convert '{$this->record->name}' from free to paid, set up pricing, and trigger a Satis build so it's available via Composer.")
7979
->modalSubmitActionLabel('Convert & Ingest'),
8080

8181
Actions\Action::make('syncToSatis')
82-
->label(fn () => $this->record->isSatisSynced() ? 'Re-sync to Satis' : 'Sync to Satis')
82+
->label(fn() => $this->record->isSatisSynced() ? 'Re-sync to Satis' : 'Sync to Satis')
8383
->icon('heroicon-o-arrow-path')
8484
->color('warning')
85-
->visible(fn () => $this->record->isPaid())
85+
->visible(fn() => $this->record->isPaid())
8686
->requiresConfirmation()
87-
->modalHeading(fn () => $this->record->isSatisSynced() ? 'Re-sync to Satis' : 'Sync to Satis')
88-
->modalDescription(fn () => $this->record->isSatisSynced()
87+
->modalHeading(fn() => $this->record->isSatisSynced() ? 'Re-sync to Satis' : 'Sync to Satis')
88+
->modalDescription(fn() => $this->record->isSatisSynced()
8989
? "Last synced: {$this->record->satis_synced_at->diffForHumans()}. This will trigger a new Satis build for '{$this->record->name}'."
9090
: "This will trigger a Satis build for '{$this->record->name}' so it's available via Composer.")
9191
->action(function (): void {
@@ -112,7 +112,7 @@ protected function getHeaderActions(): array
112112
->orWhere('email', 'like', "%{$search}%")
113113
->limit(50)
114114
->get()
115-
->mapWithKeys(fn (User $user) => [$user->id => "{$user->name} ({$user->email})"])
115+
->mapWithKeys(fn(User $user) => [$user->id => "{$user->name} ({$user->email})"])
116116
->toArray();
117117
})
118118
->required(),
@@ -150,33 +150,33 @@ protected function getHeaderActions(): array
150150
->send();
151151
})
152152
->modalHeading('Grant Plugin to User')
153-
->modalDescription(fn () => "Grant '{$this->record->name}' to a user for free.")
153+
->modalDescription(fn() => "Grant '{$this->record->name}' to a user for free.")
154154
->modalSubmitActionLabel('Grant'),
155155

156156
Actions\Action::make('viewListing')
157157
->label('View Listing Page')
158158
->icon('heroicon-o-eye')
159159
->color('gray')
160-
->url(fn () => route('plugins.show', $this->record->routeParams()))
160+
->url(fn() => route('plugins.show', $this->record->routeParams()))
161161
->openUrlInNewTab()
162-
->visible(fn () => $this->record->isApproved()),
162+
->visible(fn() => $this->record->isApproved()),
163163

164164
Actions\Action::make('viewPackagist')
165165
->label('View on Packagist')
166166
->icon('heroicon-o-arrow-top-right-on-square')
167167
->color('gray')
168-
->url(fn () => $this->record->getPackagistUrl())
168+
->url(fn() => $this->record->getPackagistUrl())
169169
->openUrlInNewTab()
170-
->visible(fn () => $this->record->isFree()),
170+
->visible(fn() => $this->record->isFree()),
171171

172172
Actions\Action::make('runReviewChecks')
173173
->label('Run Review Checks')
174174
->icon('heroicon-o-clipboard-document-check')
175175
->color('primary')
176-
->visible(fn () => $this->record->repository_url !== null)
176+
->visible(fn() => $this->record->repository_url !== null)
177177
->requiresConfirmation()
178178
->modalHeading('Run Review Checks')
179-
->modalDescription(fn () => "This will fetch the repository tree, README, and composer.json for '{$this->record->name}' and run automated checks.")
179+
->modalDescription(fn() => "This will fetch the repository tree, README, and composer.json for '{$this->record->name}' and run automated checks.")
180180
->action(function (): void {
181181
$checks = (new ReviewPluginRepository($this->record))->handle();
182182

@@ -221,14 +221,22 @@ protected function getHeaderActions(): array
221221
->send();
222222
}),
223223

224+
Actions\Action::make('test')
225+
->label('Test')
226+
->icon('heroicon-o-code')
227+
->color('primary')
228+
->action(function (): void {
229+
logger('TEST');
230+
}),
231+
224232
Actions\Action::make('resync')
225233
->label('Re-sync from GitHub')
226234
->icon('heroicon-o-arrow-path')
227235
->color('primary')
228-
->visible(fn () => $this->record->repository_url !== null)
236+
->visible(fn() => $this->record->repository_url !== null)
229237
->requiresConfirmation()
230238
->modalHeading('Re-sync Plugin')
231-
->modalDescription(fn () => "This will re-fetch the README, composer.json, nativephp.json, license, and latest version from GitHub for '{$this->record->name}'.")
239+
->modalDescription(fn() => "This will re-fetch the README, composer.json, nativephp.json, license, and latest version from GitHub for '{$this->record->name}'.")
232240
->action(function (): void {
233241
SyncPlugin::dispatch($this->record);
234242

@@ -243,7 +251,7 @@ protected function getHeaderActions(): array
243251
->label('View on GitHub')
244252
->icon('heroicon-o-arrow-top-right-on-square')
245253
->color('gray')
246-
->url(fn () => $this->record->getGithubUrl())
254+
->url(fn() => $this->record->getGithubUrl())
247255
->openUrlInNewTab(),
248256
])
249257
->icon('heroicon-m-ellipsis-vertical'),

0 commit comments

Comments
 (0)