From f04154e54a1a5d62932934971acdd07118f98d40 Mon Sep 17 00:00:00 2001 From: Jasper Zeinstra Date: Wed, 21 Nov 2018 16:53:11 +0100 Subject: [PATCH 01/29] Add child identities of bundle and configurable products on frontend instead of parent identities --- .../Bundle/Model/Plugin/Frontend/Product.php | 45 +++++++++++++++ app/code/Magento/Bundle/etc/frontend/di.xml | 3 + .../Frontend/ProductIdentitiesExtender.php | 57 +++++++++++++++++++ .../ConfigurableProduct/etc/frontend/di.xml | 3 + 4 files changed, 108 insertions(+) create mode 100644 app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php create mode 100644 app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php diff --git a/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php b/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php new file mode 100644 index 0000000000000..452a338e96fcd --- /dev/null +++ b/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php @@ -0,0 +1,45 @@ +type = $type; + } + + /** + * Add child identities to product identities + * + * @param CatalogProduct $product + * @param array $identities + * @return string[] + */ + public function afterGetIdentities( + CatalogProduct $product, + array $identities + ) { + foreach ($this->type->getChildrenIds($product->getEntityId()) as $optionId => $childIds) { + foreach ($childIds as $childId) { + $identities[] = CatalogProduct::CACHE_TAG . '_' . $childId; + } + } + + return array_unique($identities); + } +} diff --git a/app/code/Magento/Bundle/etc/frontend/di.xml b/app/code/Magento/Bundle/etc/frontend/di.xml index 54f6d3b4b0f42..fc820ff87a129 100644 --- a/app/code/Magento/Bundle/etc/frontend/di.xml +++ b/app/code/Magento/Bundle/etc/frontend/di.xml @@ -13,4 +13,7 @@ + + + diff --git a/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php b/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php new file mode 100644 index 0000000000000..513a7330c9d5c --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php @@ -0,0 +1,57 @@ +configurableType = $configurableType; + $this->productRepository = $productRepository; + } + + /** + * Add child identities to product identities + * + * @param Product $subject + * @param array $identities + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetIdentities(Product $subject, array $identities): array + { + foreach ($this->configurableType->getChildrenIds($subject->getId()) as $key => $childIds) { + foreach ($childIds as $childId) { + $identities[] = Product::CACHE_TAG . '_' . $childId; + } + } + + return array_unique($identities); + } +} diff --git a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml index bb830c36b929d..df96829b354c8 100644 --- a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml @@ -10,4 +10,7 @@ + + + From edd9d4c7583f9e86a48389897cd7a59a3ab8e479 Mon Sep 17 00:00:00 2001 From: Jasper Zeinstra Date: Wed, 21 Nov 2018 21:43:06 +0100 Subject: [PATCH 02/29] Make code more strict --- .../Magento/Bundle/Model/Plugin/Frontend/Product.php | 12 ++++++------ .../Plugin/Frontend/ProductIdentitiesExtender.php | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php b/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php index 452a338e96fcd..c1cb0e8b1bb8b 100644 --- a/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php +++ b/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Plugin\Frontend; use Magento\Bundle\Model\Product\Type; @@ -28,13 +30,11 @@ public function __construct(Type $type) * * @param CatalogProduct $product * @param array $identities - * @return string[] + * @return array */ - public function afterGetIdentities( - CatalogProduct $product, - array $identities - ) { - foreach ($this->type->getChildrenIds($product->getEntityId()) as $optionId => $childIds) { + public function afterGetIdentities(CatalogProduct $product, array $identities): array + { + foreach ($this->type->getChildrenIds($product->getEntityId()) as $childIds) { foreach ($childIds as $childId) { $identities[] = CatalogProduct::CACHE_TAG . '_' . $childId; } diff --git a/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php b/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php index 513a7330c9d5c..2c002acf938f4 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php +++ b/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php @@ -42,11 +42,10 @@ public function __construct(Configurable $configurableType, ProductRepositoryInt * @param Product $subject * @param array $identities * @return array - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetIdentities(Product $subject, array $identities): array { - foreach ($this->configurableType->getChildrenIds($subject->getId()) as $key => $childIds) { + foreach ($this->configurableType->getChildrenIds($subject->getId()) as $childIds) { foreach ($childIds as $childId) { $identities[] = Product::CACHE_TAG . '_' . $childId; } From c6fdd50a082d1aae5de76958c35aa9da3e1e6212 Mon Sep 17 00:00:00 2001 From: Jasper Zeinstra Date: Fri, 23 Nov 2018 14:39:25 +0100 Subject: [PATCH 03/29] Add unit test classes --- .../Model/Plugin/Frontend/ProductTest.php | 73 ++++++++++++++++++ .../Frontend/ProductIdentitiesExtender.php | 10 +-- .../ProductIdentitiesExtenderTest.php | 77 +++++++++++++++++++ 3 files changed, 151 insertions(+), 9 deletions(-) create mode 100644 app/code/Magento/Bundle/Test/Unit/Model/Plugin/Frontend/ProductTest.php create mode 100644 app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Plugin/Frontend/ProductTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Plugin/Frontend/ProductTest.php new file mode 100644 index 0000000000000..ee08618eab5dd --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/Plugin/Frontend/ProductTest.php @@ -0,0 +1,73 @@ +product = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->setMethods(['getEntityId']) + ->getMock(); + + $this->type = $this->getMockBuilder(Type::class) + ->disableOriginalConstructor() + ->setMethods(['getChildrenIds']) + ->getMock(); + + $this->plugin = new ProductPlugin($this->type); + } + + public function testAfterGetIdentities() + { + $baseIdentities = [ + 'SomeCacheId', + 'AnotherCacheId', + ]; + $id = 12345; + $childIds = [ + 1 => [1, 2, 5, 100500], + 12 => [7, 22, 45, 24612] + ]; + $expectedIdentities = [ + 'SomeCacheId', + 'AnotherCacheId', + Product::CACHE_TAG . '_' . 1, + Product::CACHE_TAG . '_' . 2, + Product::CACHE_TAG . '_' . 5, + Product::CACHE_TAG . '_' . 100500, + Product::CACHE_TAG . '_' . 7, + Product::CACHE_TAG . '_' . 22, + Product::CACHE_TAG . '_' . 45, + Product::CACHE_TAG . '_' . 24612, + ]; + $this->product->expects($this->once()) + ->method('getEntityId') + ->will($this->returnValue($id)); + $this->type->expects($this->once()) + ->method('getChildrenIds') + ->with($id) + ->will($this->returnValue($childIds)); + $identities = $this->plugin->afterGetIdentities($this->product, $baseIdentities); + $this->assertEquals($expectedIdentities, $identities); + } +} diff --git a/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php b/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php index 2c002acf938f4..92b7ab0d88ea8 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php +++ b/app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php @@ -8,7 +8,6 @@ namespace Magento\ConfigurableProduct\Model\Plugin\Frontend; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; -use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product; /** @@ -21,19 +20,12 @@ class ProductIdentitiesExtender */ private $configurableType; - /** - * @var ProductRepositoryInterface - */ - private $productRepository; - /** * @param Configurable $configurableType - * @param ProductRepositoryInterface $productRepository */ - public function __construct(Configurable $configurableType, ProductRepositoryInterface $productRepository) + public function __construct(Configurable $configurableType) { $this->configurableType = $configurableType; - $this->productRepository = $productRepository; } /** diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php new file mode 100644 index 0000000000000..b4fb5ccfaa558 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php @@ -0,0 +1,77 @@ +product = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMock(); + + $this->configurableTypeMock = $this->getMockBuilder(Configurable::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->plugin = new ProductIdentitiesExtender($this->configurableTypeMock); + } + + public function testAfterGetIdentities() + { + $identities = [ + 'SomeCacheId', + 'AnotherCacheId', + ]; + $productId = 12345; + $childIdentities = [ + 0 => [1, 2, 5, 100500] + ]; + $expectedIdentities = [ + 'SomeCacheId', + 'AnotherCacheId', + Product::CACHE_TAG . '_' . 1, + Product::CACHE_TAG . '_' . 2, + Product::CACHE_TAG . '_' . 5, + Product::CACHE_TAG . '_' . 100500, + ]; + + $this->product->expects($this->once()) + ->method('getId') + ->willReturn($productId); + + $this->configurableTypeMock->expects($this->once()) + ->method('getChildrenIds') + ->with($productId) + ->willReturn($childIdentities); + + $productIdentities = $this->plugin->afterGetIdentities($this->product, $identities); + $this->assertEquals($expectedIdentities, $productIdentities); + } +} From 00f4f7dcbc1a9e236eb6c9c84001efcd49c92df1 Mon Sep 17 00:00:00 2001 From: Burlacu Vasilii Date: Sun, 1 Apr 2018 13:48:22 +0300 Subject: [PATCH 04/29] Updated Magento_Rule rules.js file Added calendar initializaton for Conditional Rules when a rule is created for the 1st time --- app/code/Magento/Rule/view/adminhtml/web/rules.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Rule/view/adminhtml/web/rules.js b/app/code/Magento/Rule/view/adminhtml/web/rules.js index b094b9818364a..8e36562ebd7fe 100644 --- a/app/code/Magento/Rule/view/adminhtml/web/rules.js +++ b/app/code/Magento/Rule/view/adminhtml/web/rules.js @@ -220,6 +220,8 @@ define([ var elem = Element.down(elemContainer, 'input.input-text'); + jQuery(elem).trigger('contentUpdated'); + if (elem) { elem.focus(); From 40086305aef6638d1004e8b4b0f86bc051732714 Mon Sep 17 00:00:00 2001 From: Vasilii Burlacu Date: Sat, 11 Aug 2018 20:42:10 +0300 Subject: [PATCH 05/29] Disabled autocomplete for datepicker (calendar) input field --- lib/web/mage/calendar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/web/mage/calendar.js b/lib/web/mage/calendar.js index ac154b333801d..e86bac6718112 100644 --- a/lib/web/mage/calendar.js +++ b/lib/web/mage/calendar.js @@ -379,6 +379,9 @@ .addClass('v-middle') .text('') // Remove jQuery UI datepicker generated image .append('' + pickerButtonText + ''); + + $(element).attr('autocomplete', 'off'); + this._setCurrentDate(element); }, From e6323fb113d97e6e03bfec9eb2760e584cc8f8a4 Mon Sep 17 00:00:00 2001 From: Vasilii Burlacu Date: Thu, 8 Nov 2018 12:51:38 +0200 Subject: [PATCH 06/29] magento/magento2:#4136 - Widget condition with unexpected character not preventing from saving - Restricted user to change date input value - Open datepicker popup once user click on the date to be changed --- .../Model/Condition/AbstractCondition.php | 3 +++ .../Magento/backend/web/css/styles-old.less | 20 +++++++++++++++++++ .../Data/Form/Element/AbstractElement.php | 1 + .../Framework/Data/Form/Element/Date.php | 2 +- .../Unit/Form/Element/AbstractElementTest.php | 1 + lib/web/mage/calendar.js | 2 -- 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index a1987f67e47f2..dcf742ee91103 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -615,6 +615,9 @@ public function getValueElement() // date format intentionally hard-coded $elementParams['input_format'] = \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT; $elementParams['date_format'] = \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT; + $elementParams['placeholder'] = \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT; + $elementParams['autocomplete'] = 'off'; + $elementParams['readonly'] = 'true'; } return $this->getForm()->addField( $this->getPrefix() . '__' . $this->getId() . '__value', diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 74098f127eb73..7dd80c158534d 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -3840,6 +3840,26 @@ .rule-param-edit .element { display: inline; + position: relative; + } + + .rule-param-edit .element input.input-date, + .rule-param-edit .element input.input-date[readonly] { + background-color: @color-white; + min-width: 140px; + width: 140px !important; + cursor: pointer; + text-align: center; + opacity: 1; + margin-right: 10px; + padding-right: 40px; + + + .ui-datepicker-trigger { + position: absolute; + width: 140px; + text-align: right; + left: 0; + } } .rule-param-edit .element .addafter { diff --git a/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php b/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php index a8451e43ade20..ac9cdd3822ec5 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php @@ -238,6 +238,7 @@ public function getHtmlAttributes() 'onchange', 'disabled', 'readonly', + 'autocomplete', 'tabindex', 'placeholder', 'data-form-part', diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Date.php b/lib/internal/Magento/Framework/Data/Form/Element/Date.php index ed5457edc7f3f..1920115ff0a3a 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Date.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Date.php @@ -146,7 +146,7 @@ public function getValueInstance() */ public function getElementHtml() { - $this->addClass('admin__control-text input-text'); + $this->addClass('admin__control-text input-text input-date'); $dateFormat = $this->getDateFormat() ?: $this->getFormat(); $timeFormat = $this->getTimeFormat(); if (empty($dateFormat)) { diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php index e29b1dcf441e4..a85c1f4aa450c 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php @@ -195,6 +195,7 @@ public function testGetHtmlAttributes() 'onchange', 'disabled', 'readonly', + 'autocomplete', 'tabindex', 'placeholder', 'data-form-part', diff --git a/lib/web/mage/calendar.js b/lib/web/mage/calendar.js index e86bac6718112..6724a11b7b5b0 100644 --- a/lib/web/mage/calendar.js +++ b/lib/web/mage/calendar.js @@ -380,8 +380,6 @@ .text('') // Remove jQuery UI datepicker generated image .append('' + pickerButtonText + ''); - $(element).attr('autocomplete', 'off'); - this._setCurrentDate(element); }, From 80fed1b5348ee1f5038700ad4e7966c45ae805f4 Mon Sep 17 00:00:00 2001 From: Vasilii Burlacu Date: Tue, 13 Nov 2018 09:30:40 +0200 Subject: [PATCH 07/29] magento/magento2:#4136 - Widget condition with unexpected character not preventing from saving - Added autocomplete option for calendar.js --- lib/web/mage/calendar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/web/mage/calendar.js b/lib/web/mage/calendar.js index 6724a11b7b5b0..a9ccf2cf787f9 100644 --- a/lib/web/mage/calendar.js +++ b/lib/web/mage/calendar.js @@ -66,6 +66,9 @@ * Widget calendar */ $.widget('mage.calendar', { + options: { + autoComplete: true + }, /** * Merge global options with options passed to widget invoke @@ -380,6 +383,8 @@ .text('') // Remove jQuery UI datepicker generated image .append('' + pickerButtonText + ''); + $(element).attr('autocomplete', this.options.autoComplete ? 'on' : 'off'); + this._setCurrentDate(element); }, From 2f3396f7a852a3a820c9d9093029f8d389189e7b Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Thu, 6 Dec 2018 15:02:40 +0200 Subject: [PATCH 08/29] Fix static test. --- app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php b/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php index c1cb0e8b1bb8b..499f0cd2ca9c5 100644 --- a/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php +++ b/app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php @@ -10,6 +10,9 @@ use Magento\Bundle\Model\Product\Type; use Magento\Catalog\Model\Product as CatalogProduct; +/** + * Add child identities to product identities on storefront. + */ class Product { /** From 373fa092a62511a3aa357658e9ca33124aa8ceec Mon Sep 17 00:00:00 2001 From: Abrar pathan Date: Sat, 15 Dec 2018 18:11:50 +0530 Subject: [PATCH 09/29] Catalog category merchandiser product list missing move cursor in tile view --- .../Magento_VisualMerchandiser/web/css/source/_module.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less index 1cd867efdd13b..8eee978318d83 100644 --- a/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less @@ -71,10 +71,12 @@ display: block; float: left; text-decoration: none; + cursor: move; } a:last-child { float: right; + cursor: pointer; } } From 4ed79dc73482011e1a9023c9e33a7866b56a05c9 Mon Sep 17 00:00:00 2001 From: kunj1988 Date: Thu, 27 Dec 2018 18:34:40 +0530 Subject: [PATCH 10/29] #19974 Resolved varibale in doc type --- .../Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php b/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php index 4d2878b0b1e84..6fcce20eb3152 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php @@ -29,7 +29,7 @@ class DataBuilder * Add Item Data * * @param string $label - * @param string $label + * @param string $value * @param int $count * @return void */ From ae9daaba0dafbe11ad56bb4605f7362801643e32 Mon Sep 17 00:00:00 2001 From: Devesh <38776269+ddevesh@users.noreply.github.com> Date: Wed, 2 Jan 2019 15:25:40 +0530 Subject: [PATCH 11/29] typos error fixed --- .../view/adminhtml/web/catalog/product/composite/configure.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index a2804a8723ce0..949742c718214 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -91,8 +91,8 @@ define([ /** * Add product list types as scope and their urls - * expamle: addListType('product_to_add', {urlFetch: 'http://magento...'}) - * expamle: addListType('wishlist', {urlSubmit: 'http://magento...'}) + * example: addListType('product_to_add', {urlFetch: 'http://magento...'}) + * example: addListType('wishlist', {urlSubmit: 'http://magento...'}) * * @param type types as scope * @param urls obj can be From 62994050ea5f1d52f252283c0aef07c2c2db803d Mon Sep 17 00:00:00 2001 From: Devesh <38776269+ddevesh@users.noreply.github.com> Date: Wed, 2 Jan 2019 15:28:50 +0530 Subject: [PATCH 12/29] typo error fixed Multiple use of expamle rather than "example" . --- .../view/adminhtml/web/catalog/product/composite/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index 949742c718214..1ac2a4ffadaae 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -112,7 +112,7 @@ define([ /** * Adds complex list type - that is used to submit several list types at once * Only urlSubmit is possible for this list type - * expamle: addComplexListType(['wishlist', 'product_list'], 'http://magento...') + * example: addComplexListType(['wishlist', 'product_list'], 'http://magento...') * * @param type types as scope * @param urls obj can be From b0cd9b7b01614db985eb3d0979644e232f279dda Mon Sep 17 00:00:00 2001 From: Devesh <38776269+ddevesh@users.noreply.github.com> Date: Wed, 2 Jan 2019 15:35:37 +0530 Subject: [PATCH 13/29] typo-error-fixed-trailing@63 trailig was used rather than trailing in line number 63 --- app/code/Magento/Catalog/view/base/web/js/price-utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/base/web/js/price-utils.js b/app/code/Magento/Catalog/view/base/web/js/price-utils.js index e2ea42f7d5fe3..7b83d12cc9804 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-utils.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-utils.js @@ -60,7 +60,7 @@ define([ pattern = pattern.indexOf('{sign}') < 0 ? s + pattern : pattern.replace('{sign}', s); // we're avoiding the usage of to fixed, and using round instead with the e representation to address - // numbers like 1.005 = 1.01. Using ToFixed to only provide trailig zeroes in case we have a whole number + // numbers like 1.005 = 1.01. Using ToFixed to only provide trailing zeroes in case we have a whole number i = parseInt( amount = Number(Math.round(Math.abs(+amount || 0) + 'e+' + precision) + ('e-' + precision)), 10 From fd1a404de47cfe74d731b07973b4326530a0fca4 Mon Sep 17 00:00:00 2001 From: Devesh <38776269+ddevesh@users.noreply.github.com> Date: Wed, 2 Jan 2019 15:39:12 +0530 Subject: [PATCH 14/29] typo-error-fixed-Retrieve@325 typo error fixed at line number 325 where " Rerieve " was used rather than "Retrieve", --- .../Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php index c8153df41430e..23b927598e8e7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php @@ -322,7 +322,7 @@ protected function _prepareColumns() } /** - * Rerieve grid URL + * Retrieve grid URL * * @return string */ From 2f0c383b82156058fd1a814d81eee7fb6b3afee5 Mon Sep 17 00:00:00 2001 From: Eayshwary <31269039+Eayshwary@users.noreply.github.com> Date: Thu, 3 Jan 2019 20:02:48 +0530 Subject: [PATCH 15/29] Typo corrected Acstract -> Abstract --- .../view/adminhtml/web/js/form/element/action-delete.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js index 97f978de47b60..f829c66c4011c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js @@ -5,10 +5,10 @@ define([ 'underscore', 'Magento_Ui/js/form/element/abstract' -], function (_, Acstract) { +], function (_, Abstract) { 'use strict'; - return Acstract.extend({ + return Abstract.extend({ defaults: { prefixName: '', prefixElementName: '', From 0edcd206c7ed18a3cae4332488d1cf52a877d181 Mon Sep 17 00:00:00 2001 From: NazarKlovanych Date: Mon, 5 Nov 2018 18:39:01 +0200 Subject: [PATCH 16/29] Fix issue - Image custom attribute type could not display on frontend. --- app/code/Magento/Eav/Model/Entity/Attribute.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index c605f3ce17e30..998a2d208c4e7 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -295,6 +295,12 @@ public function beforeSave() } } + if ($this->getFrontendInput() == 'media_image') { + if (!$this->getFrontendModel()) { + $this->setFrontendModel(\Magento\Catalog\Model\Product\Attribute\Frontend\Image::class); + } + } + if ($this->getBackendType() == 'gallery') { if (!$this->getBackendModel()) { $this->setBackendModel(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class); From 82e51caf89389c9ffbfb1d85b33421a65b491012 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Tue, 8 Jan 2019 12:57:30 +0200 Subject: [PATCH 17/29] Fix static test. --- .../Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php b/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php index 6fcce20eb3152..07c9c2eaa2491 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ +namespace Magento\Catalog\Model\Layer\Filter\Item; + /** * Item Data Builder */ -namespace Magento\Catalog\Model\Layer\Filter\Item; - class DataBuilder { /** From 9aa1aebc0647c85670b58bca7ca8191938016c9c Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 8 Jan 2019 14:57:08 +0200 Subject: [PATCH 18/29] ENGCOM-3797: Static test fix. --- app/code/Magento/Eav/Model/Entity/Attribute.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index 998a2d208c4e7..06a4abb985802 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -3,7 +3,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Eav\Model\Entity; use Magento\Framework\Api\AttributeValueFactory; @@ -322,7 +321,7 @@ public function afterSave() } /** - * @return $this + * @inheritdoc * @since 100.0.7 */ public function afterDelete() From 3b22449a98f9bdb2986093882d4252bd7cd9db48 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Tue, 8 Jan 2019 15:44:38 +0200 Subject: [PATCH 19/29] Add integration tests for frontend product and identities extender plugins. --- .../Model/Plugin/Frontend/ProductTest.php | 71 ++++++++++++++++++ .../ProductIdentitiesExtenderTest.php | 73 +++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/Model/Plugin/Frontend/ProductTest.php create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Plugin/Frontend/ProductTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Plugin/Frontend/ProductTest.php new file mode 100644 index 0000000000000..91dcd5f3e8d5b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Plugin/Frontend/ProductTest.php @@ -0,0 +1,71 @@ +get(PluginList::class) + ->get(\Magento\Catalog\Model\Product::class, []); + $this->assertSame(Product::class, $pluginInfo['bundle']['instance']); + } + + /** + * Check plugin will add children ids to bundle product identities on storefront. + * + * @magentoDataFixture Magento/Bundle/_files/product.php + * @magentoAppArea frontend + * @return void + */ + public function testGetIdentitiesForBundleProductOnStorefront(): void + { + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + $bundleProduct = $productRepository->get('bundle-product'); + $simpleProduct = $productRepository->get('simple'); + $expectedIdentities = [ + 'cat_p_' . $bundleProduct->getId(), + 'cat_p', + 'cat_p_' . $simpleProduct->getId(), + + ]; + $this->assertEquals($expectedIdentities, $bundleProduct->getIdentities()); + } + + /** + * Check plugin won't add children ids to bundle product identities in admin area. + * + * @magentoDataFixture Magento/Bundle/_files/product.php + * @magentoAppArea adminhtml + * @return void + */ + public function testGetIdentitiesForBundleProductInAdminArea(): void + { + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + $bundleProduct = $productRepository->get('bundle-product'); + $expectedIdentities = [ + 'cat_p_' . $bundleProduct->getId(), + ]; + $this->assertEquals($expectedIdentities, $bundleProduct->getIdentities()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php new file mode 100644 index 0000000000000..1fffd701c509f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php @@ -0,0 +1,73 @@ +get(PluginList::class) + ->get(\Magento\Catalog\Model\Product::class, []); + $this->assertSame(ProductIdentitiesExtender::class, $pluginInfo['product_identities_extender']['instance']); + } + + /** + * Check plugin will add children ids to configurable product identities on storefront. + * + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * @magentoAppArea frontend + * @return void + */ + public function testGetIdentitiesForConfigurableProductOnStorefront(): void + { + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + $configurableProduct = $productRepository->get('configurable'); + $simpleProduct1 = $productRepository->get('simple_10'); + $simpleProduct2 = $productRepository->get('simple_20'); + $expectedIdentities = [ + 'cat_p_' . $configurableProduct->getId(), + 'cat_p', + 'cat_p_' . $simpleProduct1->getId(), + 'cat_p_' . $simpleProduct2->getId(), + + ]; + $this->assertEquals($expectedIdentities, $configurableProduct->getIdentities()); + } + + /** + * Check plugin won't add children ids to configurable product identities in admin area. + * + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * @magentoAppArea adminhtml + * @return void + */ + public function testGetIdentitiesForConfigurableProductInAdminArea(): void + { + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + $configurableProduct = $productRepository->get('configurable'); + $expectedIdentities = [ + 'cat_p_' . $configurableProduct->getId(), + ]; + $this->assertEquals($expectedIdentities, $configurableProduct->getIdentities()); + } +} From 85607c85ee1a3a90e8c7a577167f2c1b22c8717d Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 8 Jan 2019 16:44:05 +0200 Subject: [PATCH 20/29] Typo corrected Acstract -> Abstract --- .../Catalog/view/adminhtml/web/js/form/element/input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js index 2f6703cc92eac..4bbdea066b762 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js @@ -5,10 +5,10 @@ define([ 'underscore', 'Magento_Ui/js/form/element/abstract' -], function (_, Acstract) { +], function (_, Abstract) { 'use strict'; - return Acstract.extend({ + return Abstract.extend({ defaults: { prefixName: '', prefixElementName: '', From 7f4dffdbd5b58a39ae043a9b47a5c75e19f6a552 Mon Sep 17 00:00:00 2001 From: rajneesh1dev Date: Tue, 8 Jan 2019 22:50:26 +0530 Subject: [PATCH 21/29] Update uploader.php fix issue 20098 --- .../Magento/CatalogImportExport/Model/Import/Uploader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php b/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php index 7e6ada724a81a..3ac7f98818d70 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php @@ -180,9 +180,9 @@ public function move($fileName, $renameFileOff = false) } $fileName = preg_replace('/[^a-z0-9\._-]+/i', '', $fileName); - $filePath = $this->_directory->getRelativePath($filePath . $fileName); + $relativePath = $this->_directory->getRelativePath($filePath . $fileName); $this->_directory->writeFile( - $filePath, + $relativePath, $read->readAll() ); } From 9c2c4e64b11943b1a75d4439c7a4486a48827669 Mon Sep 17 00:00:00 2001 From: Yashwant 2jcommerce Date: Wed, 9 Jan 2019 12:13:01 +0530 Subject: [PATCH 22/29] Review-Details-Detailed-Rating-misaligned --- .../Magento/backend/Magento_Review/web/css/source/_module.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Review/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Review/web/css/source/_module.less index 17be2ca706076..08606402f7a0e 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Review/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Review/web/css/source/_module.less @@ -34,7 +34,7 @@ .admin__field-control { direction: rtl; display: inline-block; - margin: -4px 0 0; + margin: -1px 0 0; unicode-bidi: bidi-override; vertical-align: top; width: 125px; From c060b57a5e65c2dedf3a935db1d82f0cd63926f0 Mon Sep 17 00:00:00 2001 From: Arvinda kumar Date: Thu, 10 Jan 2019 13:11:38 +0530 Subject: [PATCH 23/29] issus fixed #20158 Store switcher not aligned proper in tab view issus fixed #20158 Store switcher not aligned proper in tab view --- .../Magento_Theme/web/css/source/_module.less | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less index bafe1be57ee35..456cef112dcef 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less @@ -312,6 +312,23 @@ } } } + .page-header{ + .switcher { + .options { + ul.dropdown { + right: 0; + &:before{ + right: 10px; + left: auto; + } + &:after { + right: 9px; + left: auto; + } + } + } + } + } // // Widgets From e1abd4a0274e241e7ef50fa0e5b43dd5530bafab Mon Sep 17 00:00:00 2001 From: amol 2jcommerce Date: Thu, 10 Jan 2019 17:18:51 +0530 Subject: [PATCH 24/29] Changes for Product-per-row-not-proper-on-listing-page --- .../web/css/source/module/_listings.less | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 6bf766b7400a7..3cb3d4af53189 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -42,7 +42,7 @@ .products-grid & { display: inline-block; - width: 100%/2; + width: 100%/2.04; } &:extend(.abs-add-box-sizing all); @@ -363,7 +363,7 @@ .products-grid { .product-item { margin-bottom: @indent__base; - width: 100%/3; + width: 100%/3.04; } } @@ -374,7 +374,7 @@ .page-products.page-layout-3columns { .products-grid { .product-item { - width: 100%/3; + width: 100%/3.04; } } } @@ -388,7 +388,7 @@ .page-products { .products-grid { .product-item { - width: 100%/3; + width: 100%/3.04; } } } @@ -443,7 +443,7 @@ .product-item { margin-left: calc(~'(100% - 4 * 24.439%) / 3'); padding: 5px; - width: 24.439%; + width: 24.09%; &:nth-child(4n + 1) { margin-left: 0; From 740fbd09d12a6d9175d45b88ec35e4bc1e8c1c77 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 11 Jan 2019 12:32:17 +0200 Subject: [PATCH 25/29] ENGCOM-3558: MTF test fix. --- .../Model/Condition/AbstractCondition.php | 79 +++++++++++++++++-- .../Mtf/Client/Element/ConditionsElement.php | 27 +++++-- .../Mtf/Client/Element/DatepickerElement.php | 7 +- .../Data/Form/Element/AbstractElement.php | 4 + 4 files changed, 103 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index dcf742ee91103..d2be99757df47 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -62,7 +62,8 @@ abstract class AbstractCondition extends \Magento\Framework\DataObject implement protected $_layout; /** - * Base name for hidden elements + * Base name for hidden elements. + * * @var string */ protected $elementName = 'rule'; @@ -116,8 +117,9 @@ public function getDefaultOperatorInputByType() } /** - * Default operator options getter - * Provides all possible operator options + * Default operator options getter. + * + * Provides all possible operator options. * * @return array */ @@ -141,6 +143,8 @@ public function getDefaultOperatorOptions() } /** + * Get rule form. + * * @return Form */ public function getForm() @@ -149,6 +153,8 @@ public function getForm() } /** + * Get condition as array. + * * @param array $arrAttributes * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -195,6 +201,8 @@ public function getMappedSqlField() } /** + * Get condition as xml. + * * @return string */ public function asXml() @@ -214,6 +222,8 @@ public function asXml() } /** + * Load condition from array. + * * @param array $arr * @return $this * @SuppressWarnings(PHPMD.NPathComplexity) @@ -229,6 +239,8 @@ public function loadArray($arr) } /** + * Load condition from xml. + * * @param string|array $xml * @return $this */ @@ -242,6 +254,8 @@ public function loadXml($xml) } /** + * Load attribute options. + * * @return $this */ public function loadAttributeOptions() @@ -250,6 +264,8 @@ public function loadAttributeOptions() } /** + * Get attribute options. + * * @return array */ public function getAttributeOptions() @@ -258,6 +274,8 @@ public function getAttributeOptions() } /** + * Get attribute select options. + * * @return array */ public function getAttributeSelectOptions() @@ -270,6 +288,8 @@ public function getAttributeSelectOptions() } /** + * Get attribute name. + * * @return string */ public function getAttributeName() @@ -278,6 +298,8 @@ public function getAttributeName() } /** + * Load operator options. + * * @return $this */ public function loadOperatorOptions() @@ -300,6 +322,8 @@ public function getInputType() } /** + * Get operator select options. + * * @return array */ public function getOperatorSelectOptions() @@ -316,6 +340,8 @@ public function getOperatorSelectOptions() } /** + * Get operator name. + * * @return array */ public function getOperatorName() @@ -324,6 +350,8 @@ public function getOperatorName() } /** + * Load value options. + * * @return $this */ public function loadValueOptions() @@ -333,6 +361,8 @@ public function loadValueOptions() } /** + * Get value select options. + * * @return array */ public function getValueSelectOptions() @@ -380,6 +410,8 @@ public function isArrayOperatorType() } /** + * Get value. + * * @return mixed */ public function getValue() @@ -395,6 +427,8 @@ public function getValue() } /** + * Get value name. + * * @return array|string * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ @@ -446,6 +480,8 @@ public function getNewChildSelectOptions() } /** + * Get new child name. + * * @return string */ public function getNewChildName() @@ -454,6 +490,8 @@ public function getNewChildName() } /** + * Get this condition as html. + * * @return string */ public function asHtml() @@ -467,6 +505,8 @@ public function asHtml() } /** + * Get this condition with subconditions as html. + * * @return string */ public function asHtmlRecursive() @@ -475,6 +515,8 @@ public function asHtmlRecursive() } /** + * Get type element. + * * @return AbstractElement */ public function getTypeElement() @@ -493,6 +535,8 @@ public function getTypeElement() } /** + * Get type element html. + * * @return string */ public function getTypeElementHtml() @@ -501,6 +545,8 @@ public function getTypeElementHtml() } /** + * Get attribute element. + * * @return $this */ public function getAttributeElement() @@ -528,6 +574,8 @@ public function getAttributeElement() } /** + * Get attribute element html. + * * @return string */ public function getAttributeElementHtml() @@ -536,8 +584,9 @@ public function getAttributeElementHtml() } /** - * Retrieve Condition Operator element Instance - * If the operator value is empty - define first available operator value as default + * Retrieve Condition Operator element Instance. + * + * If the operator value is empty - define first available operator value as default. * * @return \Magento\Framework\Data\Form\Element\Select */ @@ -568,6 +617,8 @@ public function getOperatorElement() } /** + * Get operator element html. + * * @return string */ public function getOperatorElementHtml() @@ -587,6 +638,8 @@ public function getValueElementType() } /** + * Get value element renderer. + * * @return \Magento\Rule\Block\Editable */ public function getValueElementRenderer() @@ -598,6 +651,8 @@ public function getValueElementRenderer() } /** + * Get value element. + * * @return $this */ public function getValueElement() @@ -629,6 +684,8 @@ public function getValueElement() } /** + * Get value element html. + * * @return string */ public function getValueElementHtml() @@ -637,6 +694,8 @@ public function getValueElementHtml() } /** + * Get add link html. + * * @return string */ public function getAddLinkHtml() @@ -646,6 +705,8 @@ public function getAddLinkHtml() } /** + * Get remove link html. + * * @return string */ public function getRemoveLinkHtml() @@ -658,6 +719,8 @@ public function getRemoveLinkHtml() } /** + * Get chooser container html. + * * @return string */ public function getChooserContainerHtml() @@ -667,6 +730,8 @@ public function getChooserContainerHtml() } /** + * Get this condition as string. + * * @param string $format * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -677,6 +742,8 @@ public function asString($format = '') } /** + * Get this condition with subconditions as string. + * * @param int $level * @return string */ @@ -819,6 +886,8 @@ protected function _compareValues($validatedValue, $value, $strict = true) } /** + * Validate model. + * * @param \Magento\Framework\Model\AbstractModel $model * @return bool */ diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php index d1fd351302414..6dbf2b1aa6a12 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php @@ -6,9 +6,9 @@ namespace Magento\Mtf\Client\Element; -use Magento\Mtf\ObjectManager; -use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\ElementInterface; +use Magento\Mtf\Client\Locator; +use Magento\Mtf\ObjectManager; /** * Typified element class for conditions. @@ -135,6 +135,13 @@ class ConditionsElement extends SimpleElement */ protected $chooserGridLocator = 'div[id*=chooser]'; + /** + * Datepicker xpath. + * + * @var string + */ + private $datepicker = './/*[contains(@class,"ui-datepicker-trigger")]'; + /** * Key of last find param. * @@ -189,10 +196,7 @@ class ConditionsElement extends SimpleElement protected $exception; /** - * Set value to conditions. - * - * @param string $value - * @return void + * @inheritdoc */ public function setValue($value) { @@ -411,7 +415,16 @@ protected function fillText($rule, ElementInterface $param) { $value = $param->find('input', Locator::SELECTOR_TAG_NAME); if ($value->isVisible()) { - $value->setValue($rule); + if (!$value->getAttribute('readonly')) { + $value->setValue($rule); + } else { + $datepicker = $param->find( + $this->datepicker, + Locator::SELECTOR_XPATH, + DatepickerElement::class + ); + $datepicker->setValue($rule); + } $apply = $param->find('.//*[@class="rule-param-apply"]', Locator::SELECTOR_XPATH); if ($apply->isVisible()) { diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/DatepickerElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/DatepickerElement.php index a0e350cb3da43..eb277c2cc43dd 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/DatepickerElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/DatepickerElement.php @@ -66,13 +66,16 @@ public function setValue($value) $date = $this->parseDate($value); $date[1] = ltrim($date[1], '0'); $this->click(); - $this->find($this->datePickerButton, Locator::SELECTOR_XPATH)->click(); $datapicker = $this->find($this->datePickerBlock, Locator::SELECTOR_XPATH); + $datepickerClose = $datapicker->find($this->datePickerButtonClose, Locator::SELECTOR_XPATH); + if (!$datepickerClose->isVisible()) { + $this->find($this->datePickerButton, Locator::SELECTOR_XPATH)->click(); + } $datapicker->find($this->datePickerYear, Locator::SELECTOR_XPATH, 'select')->setValue($date[2]); $datapicker->find($this->datePickerMonth, Locator::SELECTOR_XPATH, 'select')->setValue($date[0]); $datapicker->find(sprintf($this->datePickerCalendar, $date[1]), Locator::SELECTOR_XPATH)->click(); if ($datapicker->isVisible()) { - $datapicker->find($this->datePickerButtonClose, Locator::SELECTOR_XPATH)->click(); + $datepickerClose->click(); } } diff --git a/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php b/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php index ac9cdd3822ec5..3638ff921fa9d 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php @@ -201,6 +201,8 @@ public function setType($type) } /** + * Set form. + * * @param AbstractForm $form * @return $this */ @@ -327,6 +329,8 @@ public function getRenderer() } /** + * Get Ui Id. + * * @param null|string $suffix * @return string */ From 1e7bae1eda1148fab178e9ae43366f6ae35d876f Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 11 Jan 2019 14:45:45 +0200 Subject: [PATCH 26/29] ENGCOM-3825: Static test fix. --- .../luma/Magento_Theme/web/css/source/_module.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less index 456cef112dcef..2ef30ee9e40aa 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less @@ -312,18 +312,18 @@ } } } - .page-header{ + .page-header { .switcher { .options { ul.dropdown { right: 0; - &:before{ - right: 10px; + &:before { left: auto; + right: 10px; } &:after { - right: 9px; left: auto; + right: 9px; } } } From ff786af483f9ad6f1d5e7150632199978a46b71d Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 11 Jan 2019 15:27:33 +0200 Subject: [PATCH 27/29] ENGCOM-3821: Static test fix. --- .../Magento_VisualMerchandiser/web/css/source/_module.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less index 8eee978318d83..554b6394a1094 100644 --- a/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less @@ -68,15 +68,15 @@ a { color: @color-gray85; + cursor: move; display: block; float: left; text-decoration: none; - cursor: move; } a:last-child { - float: right; cursor: pointer; + float: right; } } From 5598b97e47bb6d25b13e198d5acfc23bc8101440 Mon Sep 17 00:00:00 2001 From: Kajal Solanki Date: Sat, 12 Jan 2019 11:16:16 +0530 Subject: [PATCH 28/29] checkbox alignment issue resolved --- .../Magento/Braintree/view/adminhtml/templates/form/cc.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml index 535a5a852fe70..4c15fffa8189f 100644 --- a/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml +++ b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml @@ -83,7 +83,7 @@ $ccType = $block->getInfoData('cc_type'); id="_vault" name="payment[is_active_payment_token_enabler]" class="admin__control-checkbox"/> -