Implement HasLabel interface in multiple enum classes, refactor label methods to improve localization consistency, and update default phone configuration in HR settings. Enhance employee form with phone number formatting and localization tests for enum options.
This commit is contained in:
1 parent
eed46157cd
commit
e16402b23f
13 files changed
+102
-26
No files matched your search
@@ -2,12 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Enums\EmploymentStatus;
|
||||
use App\Enums\Gender;
|
||||
use App\Enums\NavigationGroup;
|
||||
use App\Filament\Resources\ActivityLogs\ActivityLogResource;
|
||||
use App\Filament\Resources\Departments\DepartmentResource;
|
||||
use App\Models\User;
|
||||
use BezhanSalleh\LanguageSwitch\Events\LocaleChanged;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
@@ -35,6 +37,21 @@
|
||||
expect(NavigationGroup::LeaveManagement->getLabel())->toBe('Dynç alyş dolandyryşy');
|
||||
});
|
||||
|
||||
it('returns translated enum options for filament selects', function (): void {
|
||||
App::setLocale('tk');
|
||||
|
||||
$options = Select::make('employment_status')
|
||||
->options(EmploymentStatus::class)
|
||||
->getOptions();
|
||||
|
||||
expect($options)->toBe([
|
||||
'active' => 'Işleýär',
|
||||
'inactive' => 'Wagtlaýyn işlemeýär',
|
||||
'terminated' => 'Işden boşadyldy',
|
||||
'on_leave' => 'Rugsatda',
|
||||
]);
|
||||
});
|
||||
|
||||
it('returns translated filament navigation group labels at request time', function (): void {
|
||||
$admin = createAdminUser(['locale' => 'tk']);
|
||||
|
||||
|
||||
Reference in new issue
Block a user