From a5f724dfa6db63d95d9ceb1832222e2e18af6ed7 Mon Sep 17 00:00:00 2001 From: rostyslav-hymon Date: Thu, 11 Feb 2021 11:03:44 +0200 Subject: [PATCH 1/7] MC-40502: Website dropdown issue in admin customer listing page --- .../Customer/view/adminhtml/ui_component/customer_listing.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index 97ae9a9953eb6..a9f01d1cf9620 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -189,6 +189,7 @@ + select select From 63f6716dc39c09e8971ed5709fa926b0bbdde7bc Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" Date: Fri, 12 Feb 2021 14:33:40 +0200 Subject: [PATCH 2/7] MC-40502: Website dropdown issue in admin customer listing page --- .../Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml index 17a4a283c2648..f90a01a56841a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml @@ -19,5 +19,6 @@ + From 2d2faa2d57d865ad3f1670fce8e07b1e2c4fcd39 Mon Sep 17 00:00:00 2001 From: rostyslav-hymon Date: Mon, 15 Feb 2021 14:39:11 +0200 Subject: [PATCH 3/7] MC-40859: Tier Price input field width is too small (only 2 digits) --- .../backend/Magento_Catalog/web/css/source/_module.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less index 650fe6177d04b..0bd7264a23835 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less @@ -99,6 +99,13 @@ .admin__field + .admin__field { margin-left: @indent__s; margin-top: 0; + .admin__field-control { + .admin__control-addon { + .admin__control-text { + min-width: 6rem; + } + } + } } } } From 6d0767ad32fb2d43e23c46ae5a546bb2c1c86595 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" Date: Tue, 16 Feb 2021 18:01:08 +0200 Subject: [PATCH 4/7] MC-40859: Tier Price input field width is too small (only 2 digits) --- ...AdvancedPricingAddTierPriceActionGroup.xml | 27 +++++++++++++++++++ ...iceToProductWithPercentageDiscountTest.xml | 6 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml new file mode 100644 index 0000000000000..f1b8b8d17d795 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml @@ -0,0 +1,27 @@ + + + + + + + Check tier price on Advanced Pricing dialog on the Admin Product creation/edit page. + + + + + + + + + $priceMinWidth + 60px + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 0b29d2edb6615..57ad2d254cf85 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -32,7 +32,7 @@ - + @@ -41,6 +41,10 @@ + + + + From f4536e57c7ca164e6444b862cbda2ae75d5f88d8 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" Date: Wed, 17 Feb 2021 11:46:57 +0200 Subject: [PATCH 5/7] MC-40859: Tier Price input field width is too small (only 2 digits) --- ...rtAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml | 2 ++ .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml index f1b8b8d17d795..64acee0b077c5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml @@ -17,6 +17,8 @@ + + $priceMinWidth diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 57ad2d254cf85..bd60c214b141e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -42,7 +42,7 @@ - + From 3e5d6f6b5bb2b1db49b183dbf6bde94ec524f22d Mon Sep 17 00:00:00 2001 From: Vasya Tsviklinskyi Date: Fri, 19 Feb 2021 17:21:01 +0200 Subject: [PATCH 6/7] MC-40920: Empty request to graphql in 2.4.2 throws 500 instead of previous 200 --- .../HttpVerbValidator.php | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php b/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php index f73c0747d48c4..7fe82c13ae4c4 100644 --- a/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php +++ b/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php @@ -31,23 +31,25 @@ public function validate(HttpRequestInterface $request) : void /** @var Http $request */ if (false === $request->isPost()) { $query = $request->getParam('query', ''); - $operationType = null; - $queryAst = \GraphQL\Language\Parser::parse(new \GraphQL\Language\Source($query ?: '', 'GraphQL')); - \GraphQL\Language\Visitor::visit( - $queryAst, - [ - 'leave' => [ - NodeKind::OPERATION_DEFINITION => function (Node $node) use (&$operationType) { - $operationType = $node->operation; - } + if (!empty($query)) { + $operationType = null; + $queryAst = \GraphQL\Language\Parser::parse(new \GraphQL\Language\Source($query ?: '', 'GraphQL')); + \GraphQL\Language\Visitor::visit( + $queryAst, + [ + 'leave' => [ + NodeKind::OPERATION_DEFINITION => function (Node $node) use (&$operationType) { + $operationType = $node->operation; + } + ] ] - ] - ); - - if (strtolower($operationType) === 'mutation') { - throw new GraphQlInputException( - new \Magento\Framework\Phrase('Mutation requests allowed only for POST requests') ); + + if (strtolower($operationType) === 'mutation') { + throw new GraphQlInputException( + new \Magento\Framework\Phrase('Mutation requests allowed only for POST requests') + ); + } } } } From 204a2cc1ae18ab72f405be2ea07e01303cd386ef Mon Sep 17 00:00:00 2001 From: Vasya Tsviklinskyi Date: Mon, 22 Feb 2021 11:27:49 +0200 Subject: [PATCH 7/7] MC-40920: Empty request to graphql in 2.4.2 throws 500 instead of previous 200 --- .../HttpVerbValidatorTest.php | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php diff --git a/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php b/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php new file mode 100644 index 0000000000000..8570242c65841 --- /dev/null +++ b/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php @@ -0,0 +1,97 @@ +requestMock = $this->getMockBuilder(HttpRequestInterface::class) + ->disableOriginalConstructor() + ->onlyMethods( + [ + 'isPost', + ] + )->addMethods( + [ + 'getParam', + ] + ) + ->getMockForAbstractClass(); + + $this->httpVerbValidator = $objectManager->getObject( + HttpVerbValidator::class + ); + } + + /** + * Test for validate method + * + * @param string $query + * @param bool $needException + * @dataProvider validateDataProvider + */ + public function testValidate(string $query, bool $needException): void + { + $this->requestMock + ->expects($this->once()) + ->method('isPost') + ->willReturn(false); + + $this->requestMock + ->method('getParam') + ->with('query', '') + ->willReturn($query); + + if ($needException) { + $this->expectExceptionMessage('Syntax Error: Unexpected '); + } + + $this->httpVerbValidator->validate($this->requestMock); + } + + /** + * @return array + */ + public function validateDataProvider(): array + { + return [ + [ + 'query' => '', + 'needException' => false, + ], + [ + 'query' => ' ', + 'needException' => true + ], + ]; + } +}