feat: upgrade filament to v4 and ensure 100% test coverage
- Upgrade Filament framework from v3 to v4 - Update all Filament resources and pages for v4 compatibility - Fix test suite to maintain 100% pass rate (321 tests passing) - Add visibility condition for ticket close action (only when not closed) - Update dependencies and build assets for new Filament version - Maintain backward compatibility while leveraging v4 improvements
This commit is contained in:
@@ -2,6 +2,17 @@
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use App\Filament\Resources\PlanResource\Pages\ListPlans;
|
||||
use App\Filament\Resources\PlanResource\Pages\CreatePlan;
|
||||
use App\Filament\Resources\PlanResource\Pages\EditPlan;
|
||||
use App\Filament\Resources\PlanResource\Pages;
|
||||
use App\Filament\Resources\PlanResource\RelationManagers;
|
||||
use App\Models\Plan;
|
||||
@@ -9,10 +20,8 @@ use Filament\Forms;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\KeyValue;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Set;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
@@ -28,15 +37,15 @@ class PlanResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Plan::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Web Master';
|
||||
protected static string | \UnitEnum | null $navigationGroup = 'Web Master';
|
||||
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Plan Information')
|
||||
->description('Add a new plan')
|
||||
->schema([
|
||||
@@ -86,7 +95,7 @@ class PlanResource extends Resource
|
||||
])
|
||||
->searchable()
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('payment_method')
|
||||
SelectFilter::make('payment_method')
|
||||
->label('Payment Method')
|
||||
->options([
|
||||
'stripe' => 'Stripe',
|
||||
@@ -108,14 +117,14 @@ class PlanResource extends Resource
|
||||
return $query;
|
||||
}),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\ViewAction::make(),
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
EditAction::make(),
|
||||
DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
@@ -130,9 +139,9 @@ class PlanResource extends Resource
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListPlans::route('/'),
|
||||
'create' => Pages\CreatePlan::route('/create'),
|
||||
'edit' => Pages\EditPlan::route('/{record}/edit'),
|
||||
'index' => ListPlans::route('/'),
|
||||
'create' => CreatePlan::route('/create'),
|
||||
'edit' => EditPlan::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user