Add labels for various fields across HR resources to improve localization and user experience.
This commit is contained in:
@@ -37,19 +37,23 @@ class BonusesRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
Select::make('bonus_type')
|
||||
->label(__('hr.fields.bonus_type'))
|
||||
->options(BonusType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
->minValue(0)
|
||||
->step(0.01),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
@@ -61,6 +65,7 @@ class BonusesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('bonus_date')
|
||||
->columns([
|
||||
TextColumn::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('bonus_type')
|
||||
@@ -70,9 +75,11 @@ class BonusesRelationManager extends RelationManager
|
||||
->formatStateUsing(fn (BonusType $state): string => $state->label())
|
||||
->sortable(),
|
||||
TextColumn::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->money('TMT')
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->limit(40)
|
||||
->toggleable(),
|
||||
])
|
||||
|
||||
@@ -39,16 +39,20 @@ class DisciplinaryReportsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->required()
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
Select::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->options(DisciplinarySeverity::class)
|
||||
->required()
|
||||
->native(false),
|
||||
@@ -65,12 +69,15 @@ class DisciplinaryReportsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('title')
|
||||
->columns([
|
||||
TextColumn::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->badge()
|
||||
->color(fn (DisciplinarySeverity $state): string => $state->color())
|
||||
->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label())
|
||||
@@ -86,6 +93,7 @@ class DisciplinaryReportsRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->options(DisciplinarySeverity::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -39,10 +39,12 @@ class DocumentsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('document_type')
|
||||
->label(__('hr.fields.document_type'))
|
||||
->options(DocumentType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
HrForm::fileUpload('file_path')
|
||||
@@ -65,9 +67,11 @@ class DocumentsRelationManager extends RelationManager
|
||||
->formatStateUsing(fn (DocumentType $state): string => $state->label())
|
||||
->sortable(),
|
||||
TextColumn::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('uploaded_at')
|
||||
->label(__('hr.fields.uploaded_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -36,12 +36,15 @@ class ExplanationsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->required()
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
@@ -58,12 +61,15 @@ class ExplanationsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('reason')
|
||||
->columns([
|
||||
TextColumn::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->searchable()
|
||||
->limit(40),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->limit(50)
|
||||
->toggleable(),
|
||||
IconColumn::make('attachment_path')
|
||||
|
||||
@@ -34,6 +34,7 @@ class GiftsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('gift_name')
|
||||
@@ -41,6 +42,7 @@ class GiftsRelationManager extends RelationManager
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
@@ -48,6 +50,7 @@ class GiftsRelationManager extends RelationManager
|
||||
->step(0.01)
|
||||
->default(0),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
@@ -59,6 +62,7 @@ class GiftsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('gift_name')
|
||||
->columns([
|
||||
TextColumn::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('gift_name')
|
||||
@@ -66,9 +70,11 @@ class GiftsRelationManager extends RelationManager
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->money('TMT')
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->limit(40)
|
||||
->toggleable(),
|
||||
])
|
||||
|
||||
@@ -34,12 +34,14 @@ class SickLeavesRelationManager extends RelationManager
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
TextInput::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->maxLength(255),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
HrForm::fileUpload('document_path')
|
||||
@@ -55,15 +57,19 @@ class SickLeavesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('start_date')
|
||||
->columns([
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
IconColumn::make('document_path')
|
||||
|
||||
@@ -38,10 +38,11 @@ class UnpaidLeavesRelationManager extends RelationManager
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
@@ -53,15 +54,19 @@ class UnpaidLeavesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('start_date')
|
||||
->columns([
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge()
|
||||
->color(fn (ApprovalStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
|
||||
@@ -72,6 +77,7 @@ class UnpaidLeavesRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->options(ApprovalStatus::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -42,15 +42,17 @@ class VacationsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(VacationType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
DatePicker::make('return_date')
|
||||
->label(__('hr.fields.return_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
HrForm::fileUpload('attachment_path')
|
||||
@@ -66,20 +68,25 @@ class VacationsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('start_date')
|
||||
->columns([
|
||||
TextColumn::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->badge()
|
||||
->color(fn (VacationType $state): string => $state->color())
|
||||
->formatStateUsing(fn (VacationType $state): string => $state->label())
|
||||
->sortable(),
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge()
|
||||
->color(fn (ApprovalStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
|
||||
@@ -90,8 +97,10 @@ class VacationsRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->options(ApprovalStatus::class),
|
||||
SelectFilter::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(VacationType::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -29,26 +29,32 @@ class EmployeeForm
|
||||
->avatar()
|
||||
->imageEditor(),
|
||||
TextInput::make('employee_number')
|
||||
->label(__('hr.fields.employee_number'))
|
||||
->required()
|
||||
->maxLength(50)
|
||||
->unique(ignoreRecord: true),
|
||||
TextInput::make('full_name')
|
||||
->label(__('hr.fields.full_name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('national_id')
|
||||
->label(__('hr.fields.national_id'))
|
||||
->maxLength(50),
|
||||
Select::make('gender')
|
||||
->label(__('hr.fields.gender'))
|
||||
->options(Gender::class)
|
||||
->required()
|
||||
->native(false),
|
||||
DatePicker::make('birth_date')
|
||||
->label(__('hr.fields.birth_date'))
|
||||
->required(),
|
||||
TextInput::make('phone')
|
||||
->label(__('hr.fields.phone'))
|
||||
->tel()
|
||||
->default(config('hr.default_phone'))
|
||||
->required(),
|
||||
Textarea::make('address')
|
||||
->label(__('hr.fields.address'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
])
|
||||
@@ -56,29 +62,36 @@ class EmployeeForm
|
||||
Tab::make(__('hr.tabs.employment'))
|
||||
->schema([
|
||||
Select::make('department_id')
|
||||
->label(__('hr.fields.department'))
|
||||
->relationship('department', 'name')
|
||||
->searchable()
|
||||
->preload()
|
||||
->required(),
|
||||
Select::make('position_id')
|
||||
->label(__('hr.fields.position'))
|
||||
->relationship('position', 'name')
|
||||
->searchable()
|
||||
->preload()
|
||||
->required(),
|
||||
Select::make('shift_id')
|
||||
->label(__('hr.fields.shift'))
|
||||
->relationship('shift', 'name')
|
||||
->searchable()
|
||||
->preload()
|
||||
->required(),
|
||||
Select::make('employment_status')
|
||||
->label(__('hr.fields.employment_status'))
|
||||
->options(EmploymentStatus::class)
|
||||
->default(EmploymentStatus::Active)
|
||||
->required()
|
||||
->native(false),
|
||||
DatePicker::make('hire_date')
|
||||
->label(__('hr.fields.hire_date'))
|
||||
->required(),
|
||||
DatePicker::make('termination_date'),
|
||||
DatePicker::make('termination_date')
|
||||
->label(__('hr.fields.termination_date')),
|
||||
Textarea::make('notes')
|
||||
->label(__('hr.fields.notes'))
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
])
|
||||
|
||||
@@ -38,18 +38,23 @@ class EmployeeInfolist
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('employee_number')
|
||||
->label(__('hr.fields.employee_number')),
|
||||
TextEntry::make('full_name'),
|
||||
TextEntry::make('full_name')
|
||||
->label(__('hr.fields.full_name')),
|
||||
TextEntry::make('national_id')
|
||||
->label(__('hr.fields.national_id'))
|
||||
->placeholder('—'),
|
||||
TextEntry::make('gender')
|
||||
->label(__('hr.fields.gender'))
|
||||
->badge()
|
||||
->color(fn (Gender $state): string => $state->color())
|
||||
->formatStateUsing(fn (Gender $state): string => $state->label()),
|
||||
TextEntry::make('birth_date')
|
||||
->label(__('hr.fields.birth_date'))
|
||||
->date(),
|
||||
TextEntry::make('phone'),
|
||||
TextEntry::make('phone')
|
||||
->label(__('hr.fields.phone')),
|
||||
TextEntry::make('address')
|
||||
->label(__('hr.fields.address'))
|
||||
->placeholder('—')
|
||||
->columnSpanFull(),
|
||||
])
|
||||
@@ -69,6 +74,7 @@ class EmployeeInfolist
|
||||
->badge()
|
||||
->color('gray'),
|
||||
TextEntry::make('employment_status')
|
||||
->label(__('hr.fields.employment_status'))
|
||||
->badge()
|
||||
->color(fn (EmploymentStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (EmploymentStatus $state): string => $state->label())
|
||||
@@ -92,6 +98,7 @@ class EmployeeInfolist
|
||||
? $record->hire_date->diffForHumans(now(), true)
|
||||
: '—'),
|
||||
TextEntry::make('notes')
|
||||
->label(__('hr.fields.notes'))
|
||||
->placeholder('—')
|
||||
->columnSpanFull(),
|
||||
])
|
||||
|
||||
@@ -32,6 +32,7 @@ class EmployeesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('full_name')
|
||||
->label(__('hr.fields.full_name'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('national_id')
|
||||
@@ -39,11 +40,13 @@ class EmployeesTable
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
TextColumn::make('gender')
|
||||
->label(__('hr.fields.gender'))
|
||||
->badge()
|
||||
->color(fn (Gender $state): string => $state->color())
|
||||
->formatStateUsing(fn (Gender $state): string => $state->label())
|
||||
->searchable(),
|
||||
TextColumn::make('phone')
|
||||
->label(__('hr.fields.phone'))
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
TextColumn::make('department.name')
|
||||
@@ -72,21 +75,26 @@ class EmployeesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('hire_date')
|
||||
->label(__('hr.fields.hire_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('termination_date')
|
||||
->label(__('hr.fields.termination_date'))
|
||||
->date()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
Reference in New Issue
Block a user