NOW MANAGED ON CODEBERG
Fixed incorrect recents pages on homescreen
Dan Brown5e7a4c7fb512
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.phpindex e20c89e06..489396df6 100644--- a/app/Http/Controllers/HomeController.php+++ b/app/Http/Controllers/HomeController.php@@ -24,7 +24,6 @@ class HomeController extends Controller/*** Display the homepage.- ** @return Response*/public function index()diff --git a/resources/views/home.blade.php b/resources/views/home.blade.phpindex 8aaae1e1b..f840be965 100644--- a/resources/views/home.blade.php+++ b/resources/views/home.blade.php@@ -33,10 +33,14 @@<div class="col-sm-4"><h3><a class="no-color" href="/pages/recently-created">Recently Created Pages</a></h3>- @include('partials/entity-list', ['entities' => $recentlyCreatedPages, 'style' => 'compact'])+ <div id="recently-created-pages">+ @include('partials/entity-list', ['entities' => $recentlyCreatedPages, 'style' => 'compact'])+ </div><h3><a class="no-color" href="/pages/recently-updated">Recently Updated Pages</a></h3>- @include('partials/entity-list', ['entities' => $recentlyCreatedPages, 'style' => 'compact'])+ <div id="recently-updated-pages">+ @include('partials/entity-list', ['entities' => $recentlyUpdatedPages, 'style' => 'compact'])+ </div></div><div class="col-sm-4" id="recent-activity">diff --git a/tests/EntityTest.php b/tests/EntityTest.phpindex 2936fc047..30858f8d9 100644--- a/tests/EntityTest.php+++ b/tests/EntityTest.php@@ -225,4 +225,22 @@ class EntityTest extends TestCase->seePageIs($newPageUrl);}+ public function test_recently_updated_pages_on_home()+ {+ $page = \BookStack\Page::orderBy('updated_at', 'asc')->first();+ $this->asAdmin()->visit('/')+ ->dontSeeInElement('#recently-updated-pages', $page->name);+ $this->visit($page->getUrl() . '/edit')+ ->press('Save Page')+ ->visit('/')+ ->seeInElement('#recently-updated-pages', $page->name);+ }++ public function test_recently_created_pages_on_home()+ {+ $entityChain = $this->createEntityChainBelongingToUser($this->getNewUser());+ $this->asAdmin()->visit('/')+ ->seeInElement('#recently-created-pages', $entityChain['page']->name);+ }+}