From 3f3ff187aa7eba6d5046f5d6159471823d6a3dc9 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 12 Jan 2024 10:18:02 +0000 Subject: [PATCH] Copy across recent changes from v5.x --- CHANGELOG.md | 7 +++++++ tests/ResourceTest.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5810cf4d..60859e10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v5.6.1 (2024-01-09) + +### What's fixed +* Fix "Listable: Hidden" fields not showing in column picker #392 by @caseydwyer + + + ## v5.6.0 (2023-12-23) ### What's improved diff --git a/tests/ResourceTest.php b/tests/ResourceTest.php index 1a949dbc..2d34e45e 100644 --- a/tests/ResourceTest.php +++ b/tests/ResourceTest.php @@ -189,4 +189,32 @@ public function can_get_listable_columns() 'seo_description', ], $resource->listableColumns()->toArray()); } + + /** @test */ + public function can_get_title_field() + { + $blueprint = Blueprint::make()->setContents([ + 'tabs' => [ + 'main' => [ + 'sections' => [ + [ + 'fields' => [ + ['handle' => 'values->listable_hidden_field', 'field' => ['type' => 'text', 'listable' => 'hidden']], + ['handle' => 'values->listable_shown_field', 'field' => ['type' => 'text', 'listable' => true]], + ['handle' => 'values->not_listable_field', 'field' => ['type' => 'text', 'listable' => false]], + ], + ], + ], + ], + ], + ]); + + Blueprint::shouldReceive('find')->with('runway::post')->andReturn($blueprint); + + Runway::discoverResources(); + + $resource = Runway::findResource('post'); + + $this->assertEquals('values->listable_shown_field', $resource->titleField()); + } }