Skip to content

Commit 1d0ae0a

Browse files
committed
Fix report widget
1 parent cd38eb8 commit 1d0ae0a

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

reportwidgets/LogBookModelChanges.php

+14-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
namespace Jacob\Logbook\ReportWidgets;
44

55
use Backend\Classes\ReportWidgetBase;
6+
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
67
use Jacob\Logbook\Models\Log;
78

89
class LogBookModelChanges extends ReportWidgetBase
910
{
11+
/** @var LengthAwarePaginator */
12+
public $logs;
13+
14+
/** @var bool */
15+
public $showUndoChangesButton;
16+
1017
public function defineProperties(): array
1118
{
1219
return [
@@ -37,11 +44,12 @@ public function onLogBookChangePage(): array
3744

3845
private function getLogBookPartial($page = 1): string
3946
{
40-
return $this->makePartial('$/jacob/logbook/formwidgets/logbook/partials/_logbook.htm', [
41-
'showUndoChangesButton' => false,
42-
'logs' => Log::query()
43-
->orderBy('updated_at', 'desc')
44-
->paginate($this->property('limitPerPage', 20), $page),
45-
]);
47+
$this->logs = Log::query()
48+
->orderBy('updated_at', 'desc')
49+
->paginate($this->property('limitPerPage', 20), $page);
50+
51+
$this->showUndoChangesButton = false;
52+
53+
return $this->makePartial('$/jacob/logbook/formwidgets/logbook/partials/_logbook.htm');
4654
}
4755
}

updates/version.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
- Add support for soft deleted models, cleanup code and drop support for php 7.0
1313
2.0.1:
1414
- Remove php 7.4 property types
15+
2.0.2:
16+
- Fix report widget

0 commit comments

Comments
 (0)