neil.keena
neil.keena
FFilament
Created by neil.keena on 2/19/2024 in #❓┊help
Assert Table Action is Disabled
I have the following test that fails and I don't know why. Any one have an idea what I'm missing? Or is this a bug as it does not seem to be evaluating isDisabled() on the action
it('cannot delete program type in use', function () {
$record = ProgramType::factory()->has(\App\Models\Program::factory())->create();

expect($record->programs->count())->toBe(1);

livewire(ListProgramTypes::class)
->assertTableActionExists('delete')
->assertTableActionDisabled('delete', $record);
});
it('cannot delete program type in use', function () {
$record = ProgramType::factory()->has(\App\Models\Program::factory())->create();

expect($record->programs->count())->toBe(1);

livewire(ListProgramTypes::class)
->assertTableActionExists('delete')
->assertTableActionDisabled('delete', $record);
});
And the DeleteAction in the table is disabled using the following closure:
DeleteAction::make()
->iconButton()
->color('gray')
->disabled(fn ($record) => $record->programs_count > 0)
->tooltip('Delete')
->modalIconColor('danger')
->modalHeading(fn ($record) => "Delete program type: \"{$record->name}\"")
->modalSubmitAction(
fn ($action) => $action
->color('danger')
->label('Delete')
),
DeleteAction::make()
->iconButton()
->color('gray')
->disabled(fn ($record) => $record->programs_count > 0)
->tooltip('Delete')
->modalIconColor('danger')
->modalHeading(fn ($record) => "Delete program type: \"{$record->name}\"")
->modalSubmitAction(
fn ($action) => $action
->color('danger')
->label('Delete')
),
The programs_count attribute does exist and this works in the browser but the test failes.
TextColumn::make('programs_count')->label('Programs')->counts('programs')->alignEnd(),
TextColumn::make('programs_count')->label('Programs')->counts('programs')->alignEnd(),
Any help would be greatly appreciated 🙏🏼
1 replies
FFilament
Created by neil.keena on 1/17/2024 in #❓┊help
Page scroll disabled after closing nested modals
I'm experiencing an issue with page scrolling being disabled after closing nested modals. There are no console errors so I'm thinking a CSS issue? I've replicated this on a fresh install and without the minimal theme @Zep Fietje and also happens when doing npm run build or npm run dev. Any ideas?
6 replies
FFilament
Created by neil.keena on 1/13/2024 in #❓┊help
Unwanted top padding on Tabs & Wizards in Minimal Theme
No description
10 replies
FFilament
Created by neil.keena on 11/11/2023 in #❓┊help
Create Option Form Wizard
How would you use a wizard when using the createOptionForm method on a select component? With most actions you use the steps() method but when I add it to the $action instance within in the createOptionAction method it doesn't work. I don't see the + button added to the select component. Any ideas if this is possible or what I might be missing?
2 replies