Update UserActions to enhance localization and tooltips for user management actions. Added labels and tooltips for change password and delete actions, ensuring consistent user experience in both English and Turkish. Updated localization files to include new keys for user actions.

This commit is contained in:
Ümit Tunç
2025-09-30 01:02:14 -03:00
parent f6b355bb9e
commit dc0abb83da
3 changed files with 11 additions and 4 deletions
@@ -16,20 +16,23 @@ class UserActions
{ {
return [ return [
EditAction::make() EditAction::make()
->label('')
->tooltip(__('users.edit'))
->visible(fn () => Auth::user()?->can('Update:User')), ->visible(fn () => Auth::user()?->can('Update:User')),
Action::make('change_password') Action::make('change_password')
->label(__('filament-users::user.resource.change_password')) ->label('')
->tooltip(__('users.change_password'))
->icon('heroicon-o-key') ->icon('heroicon-o-key')
->color('warning') ->color('warning')
->form([ ->form([
TextInput::make('password') TextInput::make('password')
->label(__('filament-users::user.resource.password')) ->label(__('users.password'))
->password() ->password()
->required() ->required()
->confirmed(), ->confirmed(),
TextInput::make('password_confirmation') TextInput::make('password_confirmation')
->label(__('filament-users::user.resource.password_confirmation')) ->label(__('users.password_confirmation'))
->password() ->password()
->required(), ->required(),
]) ])
@@ -39,13 +42,15 @@ class UserActions
]); ]);
Notification::make() Notification::make()
->title(__('filament-users::user.resource.change_password_success')) ->title(__('users.password_changed_successfully'))
->success() ->success()
->send(); ->send();
}) })
->visible(fn () => Auth::user()?->can('Update:User')), ->visible(fn () => Auth::user()?->can('Update:User')),
DeleteAction::make() DeleteAction::make()
->label('')
->tooltip(__('users.delete'))
->visible(fn () => Auth::user()?->can('Delete:User')), ->visible(fn () => Auth::user()?->can('Delete:User')),
]; ];
} }
+1
View File
@@ -12,6 +12,7 @@ return [
'delete' => 'Delete User', 'delete' => 'Delete User',
'restore' => 'Restore User', 'restore' => 'Restore User',
'force_delete' => 'Force Delete User', 'force_delete' => 'Force Delete User',
'change_password' => 'Change Password',
// Form fields // Form fields
'name' => 'Full Name', 'name' => 'Full Name',
+1
View File
@@ -12,6 +12,7 @@ return [
'delete' => 'Kullanıcı Sil', 'delete' => 'Kullanıcı Sil',
'restore' => 'Kullanıcıyı Geri Yükle', 'restore' => 'Kullanıcıyı Geri Yükle',
'force_delete' => 'Kullanıcıyı Kalıcı Olarak Sil', 'force_delete' => 'Kullanıcıyı Kalıcı Olarak Sil',
'change_password' => 'Şifre Değiştir',
// Form fields // Form fields
'name' => 'Ad Soyad', 'name' => 'Ad Soyad',