diff --git a/resources/views/widgets/itemHistory.blade.php b/resources/views/widgets/itemHistory.blade.php
index dbfdae4..4b67591 100644
--- a/resources/views/widgets/itemHistory.blade.php
+++ b/resources/views/widgets/itemHistory.blade.php
@@ -3,7 +3,7 @@
@foreach($entries as $entry)
-
- {{ $entry['action'] }}
+ {{ ucfirst($entry['action']) }}
@if($entry['user'])
by {{ $entry['user']->getDisplayName() }}
diff --git a/src/Widgets/ItemHistoryWidget.php b/src/Widgets/ItemHistoryWidget.php
index c84596c..4a2e652 100644
--- a/src/Widgets/ItemHistoryWidget.php
+++ b/src/Widgets/ItemHistoryWidget.php
@@ -33,14 +33,14 @@ public function addEntry(string $action, \DateTime $datetime, AdminUser $user =
return $this;
}
- public function addCreateEntry(\DateTime $datetime, AdminUser $user = null): ItemHistoryWidgetContract
+ public function addCreatedEntry(\DateTime $datetime, AdminUser $user = null): ItemHistoryWidgetContract
{
- return $this->addEntry('create', $datetime, $user);
+ return $this->addEntry('created', $datetime, $user);
}
- public function addUpdateEntry(\DateTime $datetime, AdminUser $user = null): ItemHistoryWidgetContract
+ public function addUpdatedEntry(\DateTime $datetime, AdminUser $user = null): ItemHistoryWidgetContract
{
- return $this->addEntry('update', $datetime, $user);
+ return $this->addEntry('updated', $datetime, $user);
}
public function isAuthorized(Authorizable $user = null): bool
diff --git a/tests/Feature/Fakes/UserlandController.php b/tests/Feature/Fakes/UserlandController.php
index 5b42124..bf12b4a 100644
--- a/tests/Feature/Fakes/UserlandController.php
+++ b/tests/Feature/Fakes/UserlandController.php
@@ -42,7 +42,8 @@ public function edit($id)
{
$widget = app(ItemHistoryWidget::class);
$this->registerAdminWidget($widget);
- $widget->addCreateEntry(new \DateTime(), Auth::guard(config('kontour.guard'))->user());
+ $widget->addCreatedEntry(new \DateTime(), Auth::guard(config('kontour.guard'))->user());
+ $widget->addUpdatedEntry(new \DateTime(), Auth::guard(config('kontour.guard'))->user());
return view('userland::index');
}
diff --git a/tests/Feature/UserlandControllerTest.php b/tests/Feature/UserlandControllerTest.php
index 6df0fbf..f8d7af7 100644
--- a/tests/Feature/UserlandControllerTest.php
+++ b/tests/Feature/UserlandControllerTest.php
@@ -86,6 +86,7 @@ public function test_item_history_widget()
{
$response = $this->actingAs($this->user)->get(route('userland.edit', 1));
$response->assertSee('');
- $response->assertSee('
- ');
+ $response->assertSee('
- ');
+ $response->assertSee('
- ');
}
}