From 03a35a935f178856d25fc319e7788c408132563e Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 1 Feb 2023 12:41:25 -0400 Subject: [PATCH 1/3] chore: before tools configurable area --- docs/datatable/configurable-areas.md | 3 ++- resources/views/components/wrapper.blade.php | 4 ++++ src/Traits/ComponentUtilities.php | 1 + tests/Traits/Helpers/ComponentHelpersTest.php | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/datatable/configurable-areas.md b/docs/datatable/configurable-areas.md index 4b36ce1f2..e2ee45627 100644 --- a/docs/datatable/configurable-areas.md +++ b/docs/datatable/configurable-areas.md @@ -15,6 +15,7 @@ You can use the `setConfigurableAreas` method to set the areas that you want to public function configure(): void { $this->setConfigurableAreas([ + 'before-tools' => 'path.to.my.view', 'toolbar-left-start' => 'path.to.my.view', 'toolbar-left-end' => 'path.to.my.view', 'toolbar-right-start' => 'path.to.my.view', @@ -182,4 +183,4 @@ Before Pagination ![Before Pagination](https://imgur.com/lVIGpDW.png) After Pagination -![After Pagination](https://imgur.com/wJR2LEJ.png) \ No newline at end of file +![After Pagination](https://imgur.com/wJR2LEJ.png) diff --git a/resources/views/components/wrapper.blade.php b/resources/views/components/wrapper.blade.php index fdfe063fd..e833b7041 100644 --- a/resources/views/components/wrapper.blade.php +++ b/resources/views/components/wrapper.blade.php @@ -5,6 +5,10 @@ $theme = $component->getTheme(); @endphp +@if ($component->hasConfigurableAreaFor('before-tools')) + @include($component->getConfigurableAreaFor('before-tools'), $component->getParametersForConfigurableArea('before-tools')) +@endif +
merge($this->getComponentWrapperAttributes()) }} diff --git a/src/Traits/ComponentUtilities.php b/src/Traits/ComponentUtilities.php index 516b7ef1a..a6e7d167e 100644 --- a/src/Traits/ComponentUtilities.php +++ b/src/Traits/ComponentUtilities.php @@ -37,6 +37,7 @@ trait ComponentUtilities protected array $additionalSelects = []; protected bool $hideConfigurableAreasWhenReorderingStatus = true; protected array $configurableAreas = [ + 'before-tools' => null, 'toolbar-left-start' => null, 'toolbar-left-end' => null, 'toolbar-right-start' => null, diff --git a/tests/Traits/Helpers/ComponentHelpersTest.php b/tests/Traits/Helpers/ComponentHelpersTest.php index 7b78c4756..0e465d756 100644 --- a/tests/Traits/Helpers/ComponentHelpersTest.php +++ b/tests/Traits/Helpers/ComponentHelpersTest.php @@ -167,6 +167,7 @@ public function can_get_additional_selects(): void public function can_get_configurable_areas(): void { $this->assertEquals([ + 'before-tools' => null, 'toolbar-left-start' => null, 'toolbar-left-end' => null, 'toolbar-right-start' => null, From d99a7486914fa8dfb34d6b6c46d3c3b98b8ffa3b Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 1 Feb 2023 12:46:51 -0400 Subject: [PATCH 2/3] chore: move before-tools section --- resources/views/components/wrapper.blade.php | 4 ---- resources/views/datatable.blade.php | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/views/components/wrapper.blade.php b/resources/views/components/wrapper.blade.php index e833b7041..fdfe063fd 100644 --- a/resources/views/components/wrapper.blade.php +++ b/resources/views/components/wrapper.blade.php @@ -5,10 +5,6 @@ $theme = $component->getTheme(); @endphp -@if ($component->hasConfigurableAreaFor('before-tools')) - @include($component->getConfigurableAreaFor('before-tools'), $component->getParametersForConfigurableArea('before-tools')) -@endif -
merge($this->getComponentWrapperAttributes()) }} diff --git a/resources/views/datatable.blade.php b/resources/views/datatable.blade.php index 65cdb6b98..b573c4e3d 100644 --- a/resources/views/datatable.blade.php +++ b/resources/views/datatable.blade.php @@ -1,4 +1,9 @@ + + @if ($component->hasConfigurableAreaFor('before-tools')) + @include($component->getConfigurableAreaFor('before-tools'), $component->getParametersForConfigurableArea('before-tools')) + @endif + From e0a31d10387eceeabe31e4405788267bd5cb4aa2 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 1 Feb 2023 12:54:09 -0400 Subject: [PATCH 3/3] chore: variable name fix --- resources/views/datatable.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/datatable.blade.php b/resources/views/datatable.blade.php index b573c4e3d..69cb4869c 100644 --- a/resources/views/datatable.blade.php +++ b/resources/views/datatable.blade.php @@ -1,7 +1,7 @@ - @if ($component->hasConfigurableAreaFor('before-tools')) - @include($component->getConfigurableAreaFor('before-tools'), $component->getParametersForConfigurableArea('before-tools')) + @if ($this->hasConfigurableAreaFor('before-tools')) + @include($this->getConfigurableAreaFor('before-tools'), $this->getParametersForConfigurableArea('before-tools')) @endif