Skip to content

Commit

Permalink
files tooltip for activity logs (#938)
Browse files Browse the repository at this point in the history
* add files tooltip to activity logs

* fix when "files" isn't an array
  • Loading branch information
Boy132 authored Jan 24, 2025
1 parent 6a49632 commit fef19b9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function table(Table $table): Table
$properties = $activityLog->wrapProperties();

return trans_choice('activity.'.str($state)->replace(':', '.'), array_get($properties, 'count', 1), $properties);
})
->tooltip(function (ActivityLog $activityLog) {
$files = array_get($activityLog->properties, 'files', []);

return is_array($files) ? implode(',', $files) : null;
}),
TextColumn::make('user')
->state(fn (ActivityLog $activityLog) => $activityLog->actor instanceof User ? $activityLog->actor->username : 'System')
Expand Down

0 comments on commit fef19b9

Please sign in to comment.