Add labels for various fields across HR resources to improve localization and user experience.

This commit is contained in:
Mekan1206
2026-08-02 20:10:48 +05:00
parent 8147f23750
commit e3ec83686c
52 changed files with 363 additions and 26 deletions

View File

@@ -18,16 +18,20 @@ class DisciplinaryReportForm
->components([
HrForm::employeeSelect(),
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),

View File

@@ -15,24 +15,33 @@ class DisciplinaryReportInfolist
TextEntry::make('employee.id')
->label(__('hr.fields.employee')),
TextEntry::make('report_date')
->label(__('hr.fields.report_date'))
->date(),
TextEntry::make('title'),
TextEntry::make('title')
->label(__('hr.fields.title')),
TextEntry::make('description')
->label(__('hr.fields.description'))
->columnSpanFull(),
TextEntry::make('severity')
->label(__('hr.fields.severity'))
->badge(),
TextEntry::make('attachment_path')
->label(__('hr.fields.attachment'))
->placeholder('-'),
TextEntry::make('created_by')
->label(__('hr.fields.created_by'))
->numeric()
->placeholder('-'),
TextEntry::make('created_at')
->label(__('hr.fields.created_at'))
->dateTime()
->placeholder('-'),
TextEntry::make('updated_at')
->label(__('hr.fields.updated_at'))
->dateTime()
->placeholder('-'),
TextEntry::make('deleted_at')
->label(__('hr.fields.deleted_at'))
->dateTime()
->visible(fn (DisciplinaryReport $record): bool => $record->trashed()),
]);

View File

@@ -27,12 +27,15 @@ class DisciplinaryReportsTable
->searchable()
->sortable(),
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())
@@ -48,20 +51,24 @@ class DisciplinaryReportsTable
->sortable()
->toggleable(),
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),
])
->filters([
SelectFilter::make('severity')
->label(__('hr.fields.severity'))
->options(DisciplinarySeverity::class),
TrashedFilter::make(),
])