Skip to content

Commit

Permalink
Merge branch 2.3-develop into ENGCOM-3828-magento-magento2-20142
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-engcom-team committed Jan 22, 2019
2 parents 7799935 + 2f30dde commit 28d6d93
Show file tree
Hide file tree
Showing 200 changed files with 4,792 additions and 810 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<element name="save" type="button" selector="#save" timeout="30"/>
<element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/>
<element name="delete" type="button" selector="#delete" timeout="30"/>
<element name="add" type="button" selector="#add" timeout="30"/>
</section>
</sections>
1 change: 1 addition & 0 deletions app/code/Magento/Backend/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<module name="Magento_Backend">
<sequence>
<module name="Magento_Directory"/>
<module name="Magento_Theme"/>
</sequence>
</module>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ? '#' . $block->getTabId($_tab) . '_content' : $block->getTabUrl($_tab) ?>
<li>
<a href="<?= /* @escapeNotVerified */ $_tabHref ?>" id="<?= /* @escapeNotVerified */ $block->getTabId($_tab) ?>" title="<?= /* @escapeNotVerified */ $block->getTabTitle($_tab) ?>" class="<?php $_tabClass ?>" data-tab-type="<?php $_tabType ?>">
<a href="<?= $block->escapeHtmlAttr($_tabHref) ?>" id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>" title="<?= $block->escapeHtmlAttr($block->getTabTitle($_tab)) ?>" class="<?= $block->escapeHtmlAttr($_tabClass) ?>" data-tab-type="<?= $block->escapeHtmlAttr($_tabType) ?>">
<span>
<span class="changed" title="<?= /* @escapeNotVerified */ __('The information in this tab has been changed.') ?>"></span>
<span class="error" title="<?= /* @escapeNotVerified */ __('This tab contains invalid data. Please resolve this before saving.') ?>"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top" />
<columns name="design_config_columns">
<column name="theme_theme_id" component="Magento_Ui/js/grid/columns/select" sortOrder="40">
<settings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $ccType = $block->getInfoData('cc_type');
id="<?= /* @noEscape */ $code ?>_vault"
name="payment[is_active_payment_token_enabler]"
class="admin__control-checkbox"/>
<label class="label" for="<?= /* @noEscape */ $code ?>_vault">
<label class="label admin__field-label" for="<?= /* @noEscape */ $code ?>_vault">
<span><?= $block->escapeHtml(__('Save for later use.')) ?></span>
</label>
</div>
Expand Down
48 changes: 48 additions & 0 deletions app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* 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;
use Magento\Catalog\Model\Product as CatalogProduct;

/**
* Add child identities to product identities on storefront.
*/
class Product
{
/**
* @var Type
*/
private $type;

/**
* @param Type $type
*/
public function __construct(Type $type)
{
$this->type = $type;
}

/**
* Add child identities to product identities
*
* @param CatalogProduct $product
* @param array $identities
* @return array
*/
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;
}
}

return array_unique($identities);
}
}
33 changes: 11 additions & 22 deletions app/code/Magento/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\Stdlib\ArrayUtils;

/**
* Bundle Type Model
Expand Down Expand Up @@ -160,6 +161,11 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
*/
private $selectionCollectionFilterApplier;

/**
* @var ArrayUtils
*/
private $arrayUtility;

/**
* @param \Magento\Catalog\Model\Product\Option $catalogProductOption
* @param \Magento\Eav\Model\Config $eavConfig
Expand All @@ -185,6 +191,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
* @param \Magento\Framework\Serialize\Serializer\Json $serializer
* @param MetadataPool|null $metadataPool
* @param SelectionCollectionFilterApplier|null $selectionCollectionFilterApplier
* @param ArrayUtils|null $arrayUtility
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand Down Expand Up @@ -212,7 +219,8 @@ public function __construct(
\Magento\CatalogInventory\Api\StockStateInterface $stockState,
Json $serializer = null,
MetadataPool $metadataPool = null,
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null,
ArrayUtils $arrayUtility = null
) {
$this->_catalogProduct = $catalogProduct;
$this->_catalogData = $catalogData;
Expand All @@ -232,6 +240,7 @@ public function __construct(

$this->selectionCollectionFilterApplier = $selectionCollectionFilterApplier
?: ObjectManager::getInstance()->get(SelectionCollectionFilterApplier::class);
$this->arrayUtility= $arrayUtility ?: ObjectManager::getInstance()->get(ArrayUtils::class);

parent::__construct(
$catalogProductOption,
Expand Down Expand Up @@ -673,7 +682,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
$options
);

$selectionIds = $this->multiToFlatArray($options);
$selectionIds = array_values($this->arrayUtility->flatten($options));
// If product has not been configured yet then $selections array should be empty
if (!empty($selectionIds)) {
$selections = $this->getSelectionsByIds($selectionIds, $product);
Expand Down Expand Up @@ -814,26 +823,6 @@ private function recursiveIntval(array $array)
return $array;
}

/**
* Convert multi dimensional array to flat
*
* @param array $array
* @return int[]
*/
private function multiToFlatArray(array $array)
{
$flatArray = [];
foreach ($array as $value) {
if (is_array($value)) {
$flatArray = array_merge($flatArray, $this->multiToFlatArray($value));
} else {
$flatArray[] = $value;
}
}

return $flatArray;
}

/**
* Retrieve message for specify option(s)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

namespace Magento\Bundle\Setup\Patch\Data;

use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchVersionInterface;
use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Eav\Setup\EavSetup;

/**
* Class UpdateBundleRelatedEntityTytpes
* Class UpdateBundleRelatedEntityTypes
*
* @package Magento\Bundle\Setup\Patch
*/
class UpdateBundleRelatedEntityTytpes implements DataPatchInterface, PatchVersionInterface
class UpdateBundleRelatedEntityTypes implements DataPatchInterface, PatchVersionInterface
{
/**
* @var ModuleDataSetupInterface
Expand All @@ -31,7 +31,7 @@ class UpdateBundleRelatedEntityTytpes implements DataPatchInterface, PatchVersio
private $eavSetupFactory;

/**
* UpdateBundleRelatedEntityTytpes constructor.
* UpdateBundleRelatedEntityTypes constructor.
* @param ModuleDataSetupInterface $moduleDataSetup
* @param EavSetupFactory $eavSetupFactory
*/
Expand All @@ -44,7 +44,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function apply()
{
Expand Down Expand Up @@ -177,7 +177,7 @@ private function upgradeShipmentType(EavSetup $eavSetup)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getDependencies()
{
Expand All @@ -187,15 +187,15 @@ public static function getDependencies()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getVersion()
{
return '2.0.2';
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAliases()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,74 @@
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/>
</actionGroup>

<actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts">
<remove keyForRemoval="openProductFilters2"/>
<remove keyForRemoval="fillProductSkuFilter2"/>
<remove keyForRemoval="clickApplyFilters2"/>
<remove keyForRemoval="waitForFilteredGridLoad2"/>
<remove keyForRemoval="selectProduct2"/>
<remove keyForRemoval="selectProduct2"/>
<remove keyForRemoval="fillQuantity1"/>
<remove keyForRemoval="fillQuantity2"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/>
</actionGroup>

<actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts">
<arguments>
<argument name="prodTreeSku" type="string"/>
</arguments>
<remove keyForRemoval="fillQuantity1"/>
<remove keyForRemoval="fillQuantity2"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/>
</actionGroup>

<actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts">
<arguments>
<argument name="prodTreeSku" type="string"/>
<argument name="prodFourSku" type="string"/>
<argument name="prodFiveSku" type="string"/>
<argument name="prodSixSku" type="string"/>
</arguments>
<remove keyForRemoval="fillQuantity1"/>
<remove keyForRemoval="fillQuantity2"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>

<!--Trigger SEO drop down-->
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
<scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/>
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/>
<waitForPageLoad stepKey="WaitForDropDownSEO"/>

<!--Fill URL input-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="BundleProductsSummary" type="Quote">
<data key="subtotal">1,968.00</data>
<data key="shipping">5.00</data>
<data key="total">1,973.00</data>
<data key="shippingMethod">Flat Rate - Fixed</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
<element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/>
<element name="bundlePriceValue" type="input" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]"/>
<!--Select"url Key"InputForm-->
<element name="urlKey" type="input" selector="//input[@name='product[url_key]']" timeout="30"/>
<!--AddSelectedProducts-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontBundledSection">
<element name="productCheckbox" type="select" selector="//*[@id='customizeTitle']/following-sibling::div[{{arg1}}]//div[{{arg2}}][@class='field choice']/input" parameterized="true"/>
<element name="bundleProductsPrice" type="text" selector="//*[@class='bundle-info']//*[contains(@id,'product-price')]/span"/>
<element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/>
<element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/>
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/>
Expand Down
Loading

0 comments on commit 28d6d93

Please sign in to comment.