From 70bafeacb8652ef5e942fa1ecd3831b152eed688 Mon Sep 17 00:00:00 2001 From: Alex Popa Date: Mon, 30 Dec 2024 19:20:32 +0200 Subject: [PATCH] Action - labels --- .../BeneficiaryResource/Pages/CreateBeneficiary.php | 9 ++++++--- .../Resources/UserResource/Pages/CreateUser.php | 7 +++++++ .../Resources/UserResource/Pages/ListUsers.php | 3 ++- lang/ro/general.php | 5 +++-- lang/ro/user.php | 1 + 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php index d7ef66dc..a8ab1a34 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php @@ -93,7 +93,10 @@ public function form(Form $form): Form ]) ->startOnStep($this->getStartStep()) ->cancelAction($this->getCancelFormAction()) - ->submitAction($this->getSubmitFormAction()) + ->submitAction( + $this->getSubmitFormAction() + ->label(__('general.action.finish')) + ) ->skippable($this->hasSkippableSteps()), ]) ->columns(null); @@ -371,8 +374,8 @@ protected function getSteps(): array return $roles; }) ->disableOptionWhen(fn (Get $get, string $value) => $value === '-1' ? - array_diff($get('roles'), ['-1']): - in_array('-1', $get('roles'))) + array_diff($get('roles'), ['-1']) : + \in_array('-1', $get('roles'))) ->live(), ]), ]), diff --git a/app/Filament/Organizations/Resources/UserResource/Pages/CreateUser.php b/app/Filament/Organizations/Resources/UserResource/Pages/CreateUser.php index d37979d7..b833f9a7 100644 --- a/app/Filament/Organizations/Resources/UserResource/Pages/CreateUser.php +++ b/app/Filament/Organizations/Resources/UserResource/Pages/CreateUser.php @@ -9,6 +9,7 @@ use App\Concerns\PreventSubmitFormOnEnter; use App\Filament\Organizations\Resources\UserResource; use App\Models\User; +use Filament\Actions\Action; use Filament\Facades\Filament; use Filament\Resources\Pages\CreateRecord; use Illuminate\Contracts\Support\Htmlable; @@ -36,6 +37,12 @@ protected function getHeaderActions(): array ]; } + protected function getCreateFormAction(): Action + { + return parent::getCreateFormAction() + ->label(__('user.actions.add_specialist')); + } + protected function afterSave(): void { /** @var User $user */ diff --git a/app/Filament/Organizations/Resources/UserResource/Pages/ListUsers.php b/app/Filament/Organizations/Resources/UserResource/Pages/ListUsers.php index 236f8830..e79e42d6 100644 --- a/app/Filament/Organizations/Resources/UserResource/Pages/ListUsers.php +++ b/app/Filament/Organizations/Resources/UserResource/Pages/ListUsers.php @@ -15,7 +15,8 @@ class ListUsers extends ListRecords protected function getHeaderActions(): array { return [ - Actions\CreateAction::make(), + Actions\CreateAction::make() + ->label(__('user.actions.add_specialist')), ]; } diff --git a/lang/ro/general.php b/lang/ro/general.php index 95852a2b..383dc486 100644 --- a/lang/ro/general.php +++ b/lang/ro/general.php @@ -15,6 +15,7 @@ 'delete' => 'Șterge', 'view_observations' => 'Vezi observații', 'change' => 'Modifică', + 'finish' => 'Finalizează', ], 'filters' => [ @@ -35,6 +36,6 @@ ], 'placeholders' => [ - 'date' => 'zz-ll-aaaa' - ] + 'date' => 'zz-ll-aaaa', + ], ]; diff --git a/lang/ro/user.php b/lang/ro/user.php index 0b88b5de..f101cd00 100644 --- a/lang/ro/user.php +++ b/lang/ro/user.php @@ -64,6 +64,7 @@ 'reset_password' => 'Resetează parola', 'resend_invitation' => 'Retrimite invitația', 'activate' => 'Reactivează cont', + 'add_specialist' => 'Adaugă specialist', ], 'action_resend_invitation_confirm' => [