From 9850aef24701cde5ca8f47c42b1dfa274e47127a Mon Sep 17 00:00:00 2001 From: Nathan Silveira Date: Wed, 1 Nov 2023 12:39:57 -0300 Subject: [PATCH] Change block default order to 10000 (#41100) * Change block default order to 10000 * Update tests --- plugins/woocommerce/changelog/update-block-def-order | 4 ++++ .../Internal/Admin/BlockTemplates/AbstractBlock.php | 2 +- .../Admin/BlockTemplates/BlockTemplateTest.php | 4 ++-- .../src/Internal/Admin/BlockTemplates/BlockTest.php | 8 ++++---- .../Internal/Admin/BlockTemplates/CustomBlockTest.php | 10 +++++----- 5 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 plugins/woocommerce/changelog/update-block-def-order diff --git a/plugins/woocommerce/changelog/update-block-def-order b/plugins/woocommerce/changelog/update-block-def-order new file mode 100644 index 00000000000..e676526400c --- /dev/null +++ b/plugins/woocommerce/changelog/update-block-def-order @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Update product editor default block order to 10000 diff --git a/plugins/woocommerce/src/Internal/Admin/BlockTemplates/AbstractBlock.php b/plugins/woocommerce/src/Internal/Admin/BlockTemplates/AbstractBlock.php index f85673b772c..f0ecb9f6e74 100644 --- a/plugins/woocommerce/src/Internal/Admin/BlockTemplates/AbstractBlock.php +++ b/plugins/woocommerce/src/Internal/Admin/BlockTemplates/AbstractBlock.php @@ -31,7 +31,7 @@ class AbstractBlock implements BlockInterface { * * @var int */ - private $order = 10; + private $order = 10000; /** * The block attributes. diff --git a/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTemplateTest.php b/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTemplateTest.php index 7fa1345c2d3..c761a169e0e 100644 --- a/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTemplateTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTemplateTest.php @@ -469,7 +469,7 @@ class BlockTemplateTest extends WC_Unit_Test_Case { 'inserted-block', [ '_templateBlockId' => 'inserted-block-1', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], ], @@ -627,7 +627,7 @@ class BlockTemplateTest extends WC_Unit_Test_Case { 'inserted-block', [ '_templateBlockId' => 'inserted-block-1', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], ], diff --git a/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTest.php b/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTest.php index 683e0e2f1a0..47f39485cce 100644 --- a/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/BlockTest.php @@ -461,7 +461,7 @@ class BlockTest extends WC_Unit_Test_Case { 'attr-1' => 'value-1', 'attr-2' => 'value-2', '_templateBlockId' => 'test-block-id', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, '_templateBlockHideConditions' => [ [ 'expression' => 'foo === bar', @@ -475,14 +475,14 @@ class BlockTest extends WC_Unit_Test_Case { 'attr-3' => 'value-3', 'attr-4' => 'value-4', '_templateBlockId' => 'test-block-id-2', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], [ 'test-block-name-3', [ '_templateBlockId' => 'test-block-id-3', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], ], @@ -544,7 +544,7 @@ class BlockTest extends WC_Unit_Test_Case { 'test-block-name', [ '_templateBlockId' => 'test-block-name-1', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], [ [ diff --git a/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/CustomBlockTest.php b/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/CustomBlockTest.php index 3875f1dbe8f..d5d5a8adc89 100644 --- a/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/CustomBlockTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/Admin/BlockTemplates/CustomBlockTest.php @@ -39,7 +39,7 @@ class CustomBlockTest extends WC_Unit_Test_Case { 'test-block-name', [ '_templateBlockId' => 'test-block-name-1', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], [ [ @@ -47,7 +47,7 @@ class CustomBlockTest extends WC_Unit_Test_Case { [ 'title' => 'a', '_templateBlockId' => 'custom-inner-block-1', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], [ @@ -55,7 +55,7 @@ class CustomBlockTest extends WC_Unit_Test_Case { [ 'title' => 'b', '_templateBlockId' => 'custom-inner-block-2', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], ], @@ -81,7 +81,7 @@ class CustomBlockTest extends WC_Unit_Test_Case { 'test-block-name', [ '_templateBlockId' => 'test-block-name-1', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], [ [ @@ -89,7 +89,7 @@ class CustomBlockTest extends WC_Unit_Test_Case { [ 'title' => 'b', '_templateBlockId' => 'custom-inner-block-2', - '_templateBlockOrder' => 10, + '_templateBlockOrder' => 10000, ], ], ],