Skip to content

Commit 7dcada3

Browse files
simonhampclaude
andauthored
Add plugin submission checks and require support channel (#305)
* Add license file and release version checks, require support channel on submission - Add automated checks for license file (LICENSE/LICENSE.md/LICENSE.txt) and release version (GitHub releases/tags) in ReviewPluginRepository - Block plugin approval in Filament admin until required checks pass - Split customer-facing review checks into required and additional sections - Remove automated support email extraction from README - Make support channel required on plugin submission with email/URL validation - Allow users to edit support channel from their plugin dashboard - Update all related tests and notifications Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add webhook to required review checks, remove dead customer plugin controller - Include webhook_installed in required approval checks (Plugin model, Filament admin, notifications, customer dashboard) - Move webhook setup instructions into the review checks section - Update best-practices docs: replace support email with support channel, add license/release/webhook requirements - Delete dead code: CustomerPluginController, its form requests, and old customer/plugins Blade views (replaced by Livewire components) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b455b4b commit 7dcada3

File tree

21 files changed

+489
-1706
lines changed

21 files changed

+489
-1706
lines changed

app/Filament/Resources/PluginResource.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ public static function form(Schema $schema): Schema
9191
->label('Last Reviewed')
9292
->content(fn (?Plugin $record) => $record?->reviewed_at?->diffForHumans() ?? 'Never'),
9393

94+
Forms\Components\Placeholder::make('review_license')
95+
->label('License File (required)')
96+
->content(fn (?Plugin $record) => ($record?->review_checks['has_license_file'] ?? false) ? '✅ Found' : '❌ Missing'),
97+
98+
Forms\Components\Placeholder::make('review_release')
99+
->label('Release Version (required)')
100+
->content(fn (?Plugin $record) => ($record?->review_checks['has_release_version'] ?? false)
101+
? ''.($record->review_checks['release_version'] ?? '')
102+
: '❌ Missing'),
103+
104+
Forms\Components\Placeholder::make('review_webhook')
105+
->label('Webhook Configured (required)')
106+
->content(fn (?Plugin $record) => $record?->webhook_installed ? '✅ Configured' : '❌ Not configured'),
107+
94108
Forms\Components\Placeholder::make('review_ios')
95109
->label('iOS Support')
96110
->content(fn (?Plugin $record) => ($record?->review_checks['supports_ios'] ?? false) ? '✅ Found' : '❌ Missing'),
@@ -103,12 +117,6 @@ public static function form(Schema $schema): Schema
103117
->label('JS Support')
104118
->content(fn (?Plugin $record) => ($record?->review_checks['supports_js'] ?? false) ? '✅ Found' : '❌ Missing'),
105119

106-
Forms\Components\Placeholder::make('review_email')
107-
->label('Support Email')
108-
->content(fn (?Plugin $record) => ($record?->review_checks['has_support_email'] ?? false)
109-
? ''.($record->review_checks['support_email'] ?? '')
110-
: '❌ Missing'),
111-
112120
Forms\Components\Placeholder::make('review_sdk')
113121
->label('Requires nativephp/mobile')
114122
->content(fn (?Plugin $record) => ($record?->review_checks['requires_mobile_sdk'] ?? false)
@@ -368,10 +376,11 @@ public static function table(Table $table): Table
368376
}
369377

370378
$lines = collect([
379+
['License file *', $checks['has_license_file']],
380+
['Release version *', $checks['has_release_version'] ? $checks['release_version'] : false],
371381
['iOS support', $checks['supports_ios']],
372382
['Android support', $checks['supports_android']],
373383
['JS support', $checks['supports_js']],
374-
['Support email', $checks['has_support_email'] ? $checks['support_email'] : false],
375384
['Requires nativephp/mobile', $checks['requires_mobile_sdk'] ? $checks['mobile_sdk_constraint'] : false],
376385
['iOS min_version', $checks['has_ios_min_version'] ? $checks['ios_min_version'] : false],
377386
['Android min_version', $checks['has_android_min_version'] ? $checks['android_min_version'] : false],
@@ -388,16 +397,17 @@ public static function table(Table $table): Table
388397
})->implode('<br>');
389398

390399
$passed = collect($checks)->only([
400+
'has_license_file', 'has_release_version',
391401
'supports_ios', 'supports_android', 'supports_js',
392-
'has_support_email', 'requires_mobile_sdk',
402+
'requires_mobile_sdk',
393403
'has_ios_min_version', 'has_android_min_version',
394404
])->filter()->count();
395405

396406
Notification::make()
397-
->title("Review checks complete ({$passed}/7 passed)")
407+
->title("Review checks complete ({$passed}/8 passed)")
398408
->body(new HtmlString($lines))
399409
->duration(15000)
400-
->color($passed === 7 ? 'success' : 'warning')
410+
->color($passed === 8 ? 'success' : 'warning')
401411
->send();
402412
}),
403413
])

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ protected function getHeaderActions(): array
2929
->icon('heroicon-o-check')
3030
->color('success')
3131
->visible(fn () => $this->record->isPending())
32+
->disabled(fn () => ! $this->record->passesRequiredReviewChecks())
3233
->action(fn () => $this->record->approve(auth()->id()))
3334
->requiresConfirmation()
3435
->modalHeading('Approve Plugin')
35-
->modalDescription(fn () => "Are you sure you want to approve '{$this->record->name}'?"),
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}'?"),
3639

3740
Actions\Action::make('reject')
3841
->icon('heroicon-o-x-mark')
@@ -192,11 +195,15 @@ protected function getHeaderActions(): array
192195
return;
193196
}
194197

198+
$webhookConfigured = $this->record->webhook_installed;
199+
195200
$lines = collect([
201+
['License file *', $checks['has_license_file']],
202+
['Release version *', $checks['has_release_version'] ? $checks['release_version'] : false],
203+
['Webhook *', $webhookConfigured],
196204
['iOS support', $checks['supports_ios']],
197205
['Android support', $checks['supports_android']],
198206
['JS support', $checks['supports_js']],
199-
['Support email', $checks['has_support_email'] ? $checks['support_email'] : false],
200207
['Requires nativephp/mobile', $checks['requires_mobile_sdk'] ? $checks['mobile_sdk_constraint'] : false],
201208
['iOS min_version', $checks['has_ios_min_version'] ? $checks['ios_min_version'] : false],
202209
['Android min_version', $checks['has_android_min_version'] ? $checks['android_min_version'] : false],
@@ -213,16 +220,17 @@ protected function getHeaderActions(): array
213220
})->implode('<br>');
214221

215222
$passed = collect($checks)->only([
223+
'has_license_file', 'has_release_version',
216224
'supports_ios', 'supports_android', 'supports_js',
217-
'has_support_email', 'requires_mobile_sdk',
225+
'requires_mobile_sdk',
218226
'has_ios_min_version', 'has_android_min_version',
219-
])->filter()->count();
227+
])->filter()->count() + ($webhookConfigured ? 1 : 0);
220228

221229
Notification::make()
222-
->title("Review checks complete ({$passed}/7 passed)")
230+
->title("Review checks complete ({$passed}/9 passed)")
223231
->body(new HtmlString($lines))
224232
->duration(15000)
225-
->color($passed === 7 ? 'success' : 'warning')
233+
->color($passed === 9 ? 'success' : 'warning')
226234
->send();
227235
}),
228236

0 commit comments

Comments
 (0)