Add labels for various fields across HR resources to improve localization and user experience.
This commit is contained in:
@@ -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(),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user