Skip to content

Commit

Permalink
Use Filament labels. (#906)
Browse files Browse the repository at this point in the history
* Use Filament labels.

* use `trans`

* Show more files

No reason for this to be its own pr...
  • Loading branch information
notAreYouScared authored Jan 13, 2025
1 parent 8078f2c commit e145fcd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Filament/Admin/Resources/EggResource/Pages/EditEgg.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ protected function getHeaderActions(): array
return [
DeleteAction::make()
->disabled(fn (Egg $egg): bool => $egg->servers()->count() > 0)
->label(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? 'Delete' : 'In Use'),
->label(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? trans('filament-actions::delete.single.label') : 'In Use'),
ExportEggAction::make(),
ImportEggAction::make(),
$this->getSaveFormAction()->formId('form'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ protected function getHeaderActions(): array
return [
Actions\DeleteAction::make()
->disabled(fn (Node $node) => $node->servers()->count() > 0)
->label(fn (Node $node) => $node->servers()->count() > 0 ? 'Node Has Servers' : 'Delete'),
->label(fn (Node $node) => $node->servers()->count() > 0 ? 'Node Has Servers' : trans('filament-actions::delete.single.label')),
$this->getSaveFormAction()->formId('form'),
];
}
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Components/Actions/ExportEggAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function setUp(): void
{
parent::setUp();

$this->label('Export');
$this->label(trans('filament-actions::export.modal.actions.export.label'));

$this->authorize(fn () => auth()->user()->can('export egg'));

Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Components/Actions/ImportEggAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function setUp(): void
{
parent::setUp();

$this->label('Import');
$this->label(trans('filament-actions::import.modal.actions.import.label'));

$this->authorize(fn () => auth()->user()->can('import egg'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function table(Table $table): Table
$server = Filament::getTenant();

return $table
->paginated([15, 25, 50, 100])
->defaultPaginationPageOption(15)
->paginated([25, 50, 100, 250])
->defaultPaginationPageOption(50)
->query(fn () => File::get($server, $this->path)->orderByDesc('is_directory'))
->defaultSort('name')
->columns([
Expand Down Expand Up @@ -116,7 +116,6 @@ public function table(Table $table): Table
->url(fn (File $file) => self::getUrl(['path' => join_paths($this->path, $file->name)])),
EditAction::make('edit')
->authorize(fn () => auth()->user()->can(Permission::ACTION_FILE_READ_CONTENT, $server))
->label('Edit')
->icon('tabler-edit')
->visible(fn (File $file) => $file->canEdit())
->url(fn (File $file) => EditFiles::getUrl(['path' => join_paths($this->path, $file->name)])),
Expand Down

0 comments on commit e145fcd

Please sign in to comment.