From 482ea7910b8543bd0a24e8074fc8aee2ceec14d9 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Fri, 31 May 2024 11:42:07 +0200 Subject: [PATCH] related #35591 - bug 10 : remove only Done button --- .../js/components/grid/extension/position-extension.ts | 10 ++++++---- .../Factory/AttributeGridDefinitionFactory.php | 3 +++ .../Factory/AttributeGroupGridDefinitionFactory.php | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/admin-dev/themes/new-theme/js/components/grid/extension/position-extension.ts b/admin-dev/themes/new-theme/js/components/grid/extension/position-extension.ts index cfe3e5db7ec1d..2db4ab3e34bae 100644 --- a/admin-dev/themes/new-theme/js/components/grid/extension/position-extension.ts +++ b/admin-dev/themes/new-theme/js/components/grid/extension/position-extension.ts @@ -293,10 +293,12 @@ export default class PositionExtension { */ private setReorderButtonLabel(): void { const rearrangeButton = this.getReorderButton(); - const label = this.isPositionsReorderActive() - ? rearrangeButton.data('label-save') - : rearrangeButton.data('label-reorder'); - rearrangeButton.html(label); + + if (this.isPositionsReorderActive()) { + rearrangeButton.hide(); + } else { + rearrangeButton.data('label-reorder'); + } } /** diff --git a/src/Core/Grid/Definition/Factory/AttributeGridDefinitionFactory.php b/src/Core/Grid/Definition/Factory/AttributeGridDefinitionFactory.php index 75824c688058e..6efc57c917a0a 100644 --- a/src/Core/Grid/Definition/Factory/AttributeGridDefinitionFactory.php +++ b/src/Core/Grid/Definition/Factory/AttributeGridDefinitionFactory.php @@ -243,6 +243,9 @@ protected function getFilters() ]) ->setAssociatedColumn('name') ) + ->add((new Filter('position', ReorderPositionsButtonType::class)) + ->setAssociatedColumn('position') + ) ->add((new Filter('actions', SearchAndResetType::class)) ->setAssociatedColumn('actions') ->setTypeOptions([ diff --git a/src/Core/Grid/Definition/Factory/AttributeGroupGridDefinitionFactory.php b/src/Core/Grid/Definition/Factory/AttributeGroupGridDefinitionFactory.php index 53a673def99d9..95435272ec119 100644 --- a/src/Core/Grid/Definition/Factory/AttributeGroupGridDefinitionFactory.php +++ b/src/Core/Grid/Definition/Factory/AttributeGroupGridDefinitionFactory.php @@ -198,6 +198,9 @@ protected function getFilters() ]) ->setAssociatedColumn('name') ) + ->add((new Filter('position', ReorderPositionsButtonType::class)) + ->setAssociatedColumn('position') + ) ->add((new Filter('actions', SearchAndResetType::class)) ->setAssociatedColumn('actions') ->setTypeOptions([