Skip to content

Commit

Permalink
Simplify FQCN
Browse files Browse the repository at this point in the history
  • Loading branch information
dissto committed Oct 4, 2024
1 parent 6a26936 commit d540504
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/src/Resources/DummyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DummyResource extends Resource
protected static ?string $model = Dummy::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
$defaultTitle = 'Hoorraayy! Your request has been approved! 🎉';
Expand Down
33 changes: 17 additions & 16 deletions tests/src/Resources/DummyResource/Pages/ViewDummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodeWithDennis\SimpleAlert\Tests\Resources\DummyResource\Pages;

use CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert;
use CodeWithDennis\SimpleAlert\Tests\Resources\DummyResource;
use Filament\Infolists\Infolist;
use Filament\Resources\Pages\ViewRecord;
Expand All @@ -21,70 +22,70 @@ public function infolist(Infolist $infolist): Infolist

return $infolist
->schema([
\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_only_title')
SimpleAlert::make('alert_only_title')
->title($defaultTitle),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_only_title_closure')
SimpleAlert::make('alert_only_title_closure')
->title(fn () => $defaultTitle),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_only_description')
SimpleAlert::make('alert_only_description')
->description($defaultDescription),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_only_description_closure')
SimpleAlert::make('alert_only_description_closure')
->description(fn () => $defaultDescription),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_and_description')
SimpleAlert::make('alert_title_and_description')
->title($defaultTitle)
->description($defaultDescription),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_description_icon')
SimpleAlert::make('alert_title_description_icon')
->title($defaultTitle)
->description($defaultDescription)
->icon($defaultIcon),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_description_icon_closure')
SimpleAlert::make('alert_title_description_icon_closure')
->title($defaultTitle)
->description($defaultDescription)
->icon(fn () => 'heroicon-o-check'),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_description_icon_color')
SimpleAlert::make('alert_title_description_icon_color')
->title($defaultTitle)
->description($defaultDescription)
->icon($defaultIcon)
->color('success'),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_description_icon_color_closure')
SimpleAlert::make('alert_title_description_icon_color_closure')
->title($defaultTitle)
->description($defaultDescription)
->icon($defaultIcon)
->color(fn () => 'success'),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_link')
SimpleAlert::make('alert_title_link')
->title($defaultTitle)
->link('https://filamentphp.com/docs'),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_link_closure')
SimpleAlert::make('alert_title_link_closure')
->title($defaultTitle)
->link(fn () => 'https://filamentphp.com/docs'),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_title_link_linkLabel')
SimpleAlert::make('alert_title_link_linkLabel')
->title($defaultTitle)
->link('https://filamentphp.com/docs')
->linkLabel('Visit Filament Docs'),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_simple_danger')
SimpleAlert::make('alert_simple_danger')
->title($defaultTitle)
->danger(),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_simple_info')
SimpleAlert::make('alert_simple_info')
->title($defaultTitle)
->info(),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_simple_success')
SimpleAlert::make('alert_simple_success')
->title($defaultTitle)
->success(),

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('alert_simple_warning')
SimpleAlert::make('alert_simple_warning')
->title($defaultTitle)
->warning(),
]);
Expand Down

0 comments on commit d540504

Please sign in to comment.