Skip to content

Commit

Permalink
Fix: old/new value filter label translation (Z3d0X#42)
Browse files Browse the repository at this point in the history
* Fix: old/new value filter label translation

* fix: add new translation keys to translation file
  • Loading branch information
Z3d0X authored Mar 13, 2023
1 parent 4b4e8a9 commit 93b9569
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions resources/lang/en/filament-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
'resource.label.properties' => 'Properties',
'resource.label.old' => 'Old',
'resource.label.new' => 'New',
'resource.label.old_value' => 'Old Value',
'resource.label.new_value' => 'New Value',
];
10 changes: 7 additions & 3 deletions src/Resources/ActivityResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ public static function table(Table $table): Table
SelectFilter::make('log_name')
->label(__('filament-logger::filament-logger.resource.label.type'))
->options(static::getLogNameList()),

SelectFilter::make('subject_type')
->label(__('filament-logger::filament-logger.resource.label.subject_type'))
->options(static::getSubjectTypeList()),
Filter::make('properties->old')
->label('Old Value')

Filter::make('properties->old')
->label(__('filament-logger::filament-logger.resource.label.old_value'))
->indicateUsing(function (array $data): ?string {
if (!$data['old']) {
return null;
Expand All @@ -182,8 +184,9 @@ public static function table(Table $table): Table

return $query->where('properties->old', 'like', "%{$data['old']}%");
}),

Filter::make('properties->attributes')
->label('New Value')
->label(__('filament-logger::filament-logger.resource.label.new_value'))
->indicateUsing(function (array $data): ?string {
if (!$data['new']) {
return null;
Expand All @@ -201,6 +204,7 @@ public static function table(Table $table): Table

return $query->where('properties->attributes', 'like', "%{$data['new']}%");
}),

Filter::make('created_at')
->form([
DatePicker::make('logged_at')
Expand Down

0 comments on commit 93b9569

Please sign in to comment.