Refactor SickLeaveForm and SickLeaveInfolist to enhance layout and organization. Introduce new sections in SickLeaveInfolist for better information categorization, update date picker functionality, and improve localization for medical institution labels across multiple languages.
This commit is contained in:
1 parent
0b6ef45a40
commit
986ca397c0
5 files changed
+69
-40
No files matched your search
@@ -12,14 +12,21 @@ class SickLeaveForm
|
|||||||
public static function configure(Schema $schema): Schema
|
public static function configure(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return $schema
|
return $schema
|
||||||
|
->columns(3)
|
||||||
->components([
|
->components([
|
||||||
HrForm::employeeSelect(),
|
HrForm::employeeSelect(),
|
||||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date'))
|
||||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
->native(false),
|
||||||
HrForm::leaveDaysDisplay(),
|
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date'))
|
||||||
|
->native(false),
|
||||||
|
|
||||||
TextInput::make('medical_institution')
|
TextInput::make('medical_institution')
|
||||||
->label(__('hr.fields.institution'))
|
->label(__('hr.fields.institution'))
|
||||||
->maxLength(255),
|
->maxLength(255)
|
||||||
|
->columnSpan(2),
|
||||||
|
|
||||||
|
HrForm::leaveDaysDisplay(),
|
||||||
|
|
||||||
Textarea::make('reason')
|
Textarea::make('reason')
|
||||||
->label(__('hr.fields.reason'))
|
->label(__('hr.fields.reason'))
|
||||||
->rows(3)
|
->rows(3)
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Filament\Resources\SickLeaves\Schemas;
|
namespace App\Filament\Resources\SickLeaves\Schemas;
|
||||||
|
|
||||||
use App\Models\SickLeave;
|
use App\Models\SickLeave;
|
||||||
use Filament\Infolists\Components\TextEntry;
|
use Filament\Infolists\Components\TextEntry;
|
||||||
|
use Filament\Schemas\Components\Section;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
|
|
||||||
class SickLeaveInfolist
|
class SickLeaveInfolist
|
||||||
@@ -12,39 +15,55 @@ public static function configure(Schema $schema): Schema
|
|||||||
{
|
{
|
||||||
return $schema
|
return $schema
|
||||||
->components([
|
->components([
|
||||||
TextEntry::make('employee.id')
|
Section::make(__('hr.sections.basic_info'))
|
||||||
->label(__('hr.fields.employee')),
|
->schema([
|
||||||
TextEntry::make('start_date')
|
TextEntry::make('employee.full_name')
|
||||||
->label(__('hr.fields.start_date'))
|
->label(__('hr.fields.employee')),
|
||||||
->date(),
|
])
|
||||||
TextEntry::make('end_date')
|
->columns(1),
|
||||||
->label(__('hr.fields.end_date'))
|
Section::make(__('hr.sections.dates'))
|
||||||
->date(),
|
->schema([
|
||||||
TextEntry::make('days')
|
TextEntry::make('start_date')
|
||||||
->label(__('hr.fields.days'))
|
->label(__('hr.fields.start_date'))
|
||||||
->numeric(),
|
->date('d.m.Y'),
|
||||||
TextEntry::make('medical_institution')
|
TextEntry::make('end_date')
|
||||||
->label(__('hr.fields.institution'))
|
->label(__('hr.fields.end_date'))
|
||||||
->placeholder('-'),
|
->date('d.m.Y'),
|
||||||
TextEntry::make('reason')
|
TextEntry::make('days')
|
||||||
->label(__('hr.fields.reason'))
|
->label(__('hr.fields.days'))
|
||||||
->placeholder('-')
|
->suffix(' '.__('hr.messages.days_suffix')),
|
||||||
->columnSpanFull(),
|
])
|
||||||
TextEntry::make('document_path')
|
->columns(2),
|
||||||
->label(__('hr.fields.medical_document'))
|
Section::make(__('hr.sections.medical_details'))
|
||||||
->placeholder('-'),
|
->schema([
|
||||||
TextEntry::make('created_at')
|
TextEntry::make('medical_institution')
|
||||||
->label(__('hr.fields.created_at'))
|
->label(__('hr.fields.institution'))
|
||||||
->dateTime()
|
->placeholder('—'),
|
||||||
->placeholder('-'),
|
TextEntry::make('document_path')
|
||||||
TextEntry::make('updated_at')
|
->label(__('hr.fields.medical_document'))
|
||||||
->label(__('hr.fields.updated_at'))
|
->formatStateUsing(fn (?string $state): string => filled($state) ? basename($state) : '—'),
|
||||||
->dateTime()
|
TextEntry::make('reason')
|
||||||
->placeholder('-'),
|
->label(__('hr.fields.reason'))
|
||||||
TextEntry::make('deleted_at')
|
->placeholder('—')
|
||||||
->label(__('hr.fields.deleted_at'))
|
->columnSpanFull(),
|
||||||
->dateTime()
|
])
|
||||||
->visible(fn (SickLeave $record): bool => $record->trashed()),
|
->columns(2),
|
||||||
|
Section::make(__('hr.sections.metadata'))
|
||||||
|
->schema([
|
||||||
|
TextEntry::make('created_at')
|
||||||
|
->label(__('hr.fields.created_at'))
|
||||||
|
->dateTime('d.m.Y H:i')
|
||||||
|
->placeholder('—'),
|
||||||
|
TextEntry::make('updated_at')
|
||||||
|
->label(__('hr.fields.updated_at'))
|
||||||
|
->dateTime('d.m.Y H:i')
|
||||||
|
->placeholder('—'),
|
||||||
|
TextEntry::make('deleted_at')
|
||||||
|
->label(__('hr.fields.deleted_at'))
|
||||||
|
->dateTime('d.m.Y H:i')
|
||||||
|
->visible(fn (SickLeave $record): bool => $record->trashed()),
|
||||||
|
])
|
||||||
|
->columns(2),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-1
@@ -119,7 +119,7 @@
|
|||||||
'report_date' => 'Report Date',
|
'report_date' => 'Report Date',
|
||||||
'start_date' => 'Start Date',
|
'start_date' => 'Start Date',
|
||||||
'end_date' => 'End Date',
|
'end_date' => 'End Date',
|
||||||
'institution' => 'Institution',
|
'institution' => 'Medical Institution',
|
||||||
'code' => 'Code',
|
'code' => 'Code',
|
||||||
'password' => 'Password',
|
'password' => 'Password',
|
||||||
'roles' => 'Roles',
|
'roles' => 'Roles',
|
||||||
@@ -160,6 +160,7 @@
|
|||||||
'dates' => 'Dates',
|
'dates' => 'Dates',
|
||||||
'approval' => 'Approval',
|
'approval' => 'Approval',
|
||||||
'metadata' => 'Metadata',
|
'metadata' => 'Metadata',
|
||||||
|
'medical_details' => 'Medical Details',
|
||||||
],
|
],
|
||||||
|
|
||||||
'messages' => [
|
'messages' => [
|
||||||
|
|||||||
+2
-1
@@ -119,7 +119,7 @@
|
|||||||
'report_date' => 'Дата отчёта',
|
'report_date' => 'Дата отчёта',
|
||||||
'start_date' => 'Дата начала',
|
'start_date' => 'Дата начала',
|
||||||
'end_date' => 'Дата окончания',
|
'end_date' => 'Дата окончания',
|
||||||
'institution' => 'Учреждение',
|
'institution' => 'Медицинское учреждение',
|
||||||
'code' => 'Код',
|
'code' => 'Код',
|
||||||
'password' => 'Пароль',
|
'password' => 'Пароль',
|
||||||
'roles' => 'Роли',
|
'roles' => 'Роли',
|
||||||
@@ -160,6 +160,7 @@
|
|||||||
'dates' => 'Даты',
|
'dates' => 'Даты',
|
||||||
'approval' => 'Утверждение',
|
'approval' => 'Утверждение',
|
||||||
'metadata' => 'Метаданные',
|
'metadata' => 'Метаданные',
|
||||||
|
'medical_details' => 'Медицинские данные',
|
||||||
],
|
],
|
||||||
|
|
||||||
'messages' => [
|
'messages' => [
|
||||||
|
|||||||
+2
-1
@@ -119,7 +119,7 @@
|
|||||||
'report_date' => 'Hasabat senesi',
|
'report_date' => 'Hasabat senesi',
|
||||||
'start_date' => 'Başlanan senesi',
|
'start_date' => 'Başlanan senesi',
|
||||||
'end_date' => 'Tamamlanan senesi',
|
'end_date' => 'Tamamlanan senesi',
|
||||||
'institution' => 'Gurama',
|
'institution' => 'Lukmançylyk gurama',
|
||||||
'code' => 'Kod',
|
'code' => 'Kod',
|
||||||
'password' => 'Parol',
|
'password' => 'Parol',
|
||||||
'roles' => 'Rollar',
|
'roles' => 'Rollar',
|
||||||
@@ -160,6 +160,7 @@
|
|||||||
'dates' => 'Seneler',
|
'dates' => 'Seneler',
|
||||||
'approval' => 'Tassyklama',
|
'approval' => 'Tassyklama',
|
||||||
'metadata' => 'Maglumat',
|
'metadata' => 'Maglumat',
|
||||||
|
'medical_details' => 'Lukmançylyk maglumatlary',
|
||||||
],
|
],
|
||||||
|
|
||||||
'messages' => [
|
'messages' => [
|
||||||
|
|||||||
Reference in new issue
Block a user