Skip to content

Commit

Permalink
merge magento/2.4-develop into magento-tsg/2.4-develop-com-pr5
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-mts-svc authored Feb 1, 2020
2 parents 7e91403 + e6e6725 commit 3f5b2f4
Show file tree
Hide file tree
Showing 61 changed files with 1,327 additions and 432 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define([
* @return {String}
*/
this.translate = function (text) {
return _data[text] ? _data[text] : text;
return typeof _data[text] === 'string' ? _data[text] : text;
};

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
use Magento\Framework\Search\Request\IndexScopeResolverInterface;

/**
* Class LinkedProductSelectBuilderByIndexPrice
*
* Provide Select object for retrieve product id by index price.
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class LinkedProductSelectBuilderByIndexPrice implements LinkedProductSelectBuilderInterface
{
/**
Expand Down Expand Up @@ -83,13 +90,13 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function build($productId)
public function build(int $productId, int $storeId) : array
{
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
$productTable = $this->resource->getTableName('catalog_product_entity');
$websiteId = $this->storeManager->getStore()->getWebsiteId();
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
$customerGroupId = $this->customerSession->getCustomerGroupId();

$priceSelect = $this->resource->getConnection()->select()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function __construct(
/**
* @inheritdoc
*/
public function build($productId)
public function build(int $productId, int $storeId) : array
{
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
$priceAttribute = $this->eavConfig->getAttribute(Product::ENTITY, 'price');
Expand Down Expand Up @@ -104,7 +104,7 @@ public function build($productId)

if (!$this->catalogHelper->isPriceGlobal()) {
$priceSelectStore = clone $priceSelect;
$priceSelectStore->where('t.store_id = ?', $this->storeManager->getStore()->getId());
$priceSelectStore->where('t.store_id = ?', $storeId);
$selects[] = $priceSelectStore;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
use Magento\Store\Model\Store;

/**
* LinkedProductSelectBuilderBySpecialPrice
*
* Provide Select object for retrieve product id by special price
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class LinkedProductSelectBuilderBySpecialPrice implements LinkedProductSelectBuilderInterface
Expand Down Expand Up @@ -88,16 +92,16 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function build($productId)
public function build(int $productId, int $storeId) : array
{
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
$connection = $this->resource->getConnection();
$specialPriceAttribute = $this->eavConfig->getAttribute(Product::ENTITY, 'special_price');
$specialPriceFromDate = $this->eavConfig->getAttribute(Product::ENTITY, 'special_from_date');
$specialPriceToDate = $this->eavConfig->getAttribute(Product::ENTITY, 'special_to_date');
$timestamp = $this->localeDate->scopeTimeStamp($this->storeManager->getStore());
$timestamp = $this->localeDate->scopeTimeStamp($this->storeManager->getStore($storeId));
$currentDate = $this->dateTime->formatDate($timestamp, false);
$productTable = $this->resource->getTableName('catalog_product_entity');

Expand Down Expand Up @@ -145,7 +149,7 @@ public function build($productId)

if (!$this->catalogHelper->isPriceGlobal()) {
$priceSelectStore = clone $specialPrice;
$priceSelectStore->where('t.store_id = ?', $this->storeManager->getStore()->getId());
$priceSelectStore->where('t.store_id = ?', $storeId);
$selects[] = $priceSelectStore;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@
use Magento\Framework\App\ObjectManager;
use Magento\Framework\DB\Select;

/**
* LinkedProductSelectBuilderByTierPrice
*
* Provide Select object for retrieve product id by tier price
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class LinkedProductSelectBuilderByTierPrice implements LinkedProductSelectBuilderInterface
{
/**
* Default website id
*
* Constant represents default website id
*/
const DEFAULT_WEBSITE_ID = 0;

Expand Down Expand Up @@ -72,9 +81,9 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function build($productId)
public function build(int $productId, int $storeId) : array
{
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
$productTable = $this->resource->getTableName('catalog_product_entity');
Expand Down Expand Up @@ -103,7 +112,7 @@ public function build($productId)

if (!$this->catalogHelper->isPriceGlobal()) {
$priceSelectStore = clone $priceSelect;
$priceSelectStore->where('t.website_id = ?', $this->storeManager->getStore()->getWebsiteId());
$priceSelectStore->where('t.website_id = ?', $this->storeManager->getStore($storeId)->getWebsiteId());
$selects[] = $priceSelectStore;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Magento\Catalog\Model\ResourceModel\Product;

/**
* Collect Select object for list of products
*/
class LinkedProductSelectBuilderComposite implements LinkedProductSelectBuilderInterface
{
/**
Expand All @@ -22,14 +25,15 @@ public function __construct($linkedProductSelectBuilder)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function build($productId)
public function build(int $productId, int $storeId) : array
{
$selects = [];
foreach ($this->linkedProductSelectBuilder as $productSelectBuilder) {
$selects = array_merge($selects, $productSelectBuilder->build($productId));
$selects[] = $productSelectBuilder->build($productId, $storeId);
}
$selects = array_merge(...$selects);

return $selects;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
interface LinkedProductSelectBuilderInterface
{
/**
* Build Select objects
*
* @param int $productId
* @param int $storeId
* @return \Magento\Framework\DB\Select[]
*/
public function build($productId);
public function build(int $productId, int $storeId) : array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<argument name="value" type="string"/>
</arguments>

<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/>
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.sectionBody}}" visible="false" stepKey="openSeoSection"/>
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/>
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<argument name="value" type="string"/>
</arguments>

<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/>
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.sectionBody}}" visible="false" stepKey="openSeoSection"/>
<uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/>
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/>
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontProductPageSelectDropDownOptionValueActionGroup">
<annotations>
<description>Selects the provided Product Option Value under the provided DropDown Product Option Title on a Storefront Product page.</description>
</annotations>
<arguments>
<argument name="attributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/>
<argument name="optionLabel" type="string" defaultValue="{{productAttributeOption1.label}}"/>
</arguments>

<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect(attributeLabel)}}" userInput="{{optionLabel}}" stepKey="fillDropDownAttributeOption"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontProductPageSelectRadioButtonOptionValueActionGroup">
<annotations>
<description>Selects the provided Product Option Value under the provided Radio Button Product Option Title on a Storefront Product page.</description>
</annotations>
<arguments>
<argument name="attributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/>
<argument name="optionLabel" type="string" defaultValue="{{productAttributeOption1.label}}"/>
</arguments>

<checkOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsRadioButtonByName(attributeLabel, optionLabel)}}" stepKey="fillRadioButtonAttributeOption"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -1,63 +1,72 @@
<?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="RememberPaginationCatalogStorefrontConfig" type="catalog_storefront_config">
<requiredEntity type="grid_per_page_values">GridPerPageValues</requiredEntity>
<requiredEntity type="remember_pagination">RememberCategoryPagination</requiredEntity>
</entity>

<entity name="GridPerPageValues" type="grid_per_page_values">
<data key="value">9,12,20,24</data>
</entity>

<entity name="RememberCategoryPagination" type="remember_pagination">
<data key="value">1</data>
</entity>

<entity name="DefaultCatalogStorefrontConfiguration" type="default_catalog_storefront_config">
<requiredEntity type="catalogStorefrontFlagZero">DefaultCatalogStorefrontFlagZero</requiredEntity>
<data key="list_allow_all">DefaultListAllowAll</data>
<data key="flat_catalog_product">DefaultFlatCatalogProduct</data>
</entity>

<entity name="DefaultCatalogStorefrontFlagZero" type="catalogStorefrontFlagZero">
<data key="value">0</data>
</entity>

<entity name="DefaultListAllowAll" type="list_allow_all">
<data key="value">0</data>
</entity>

<entity name="DefaultFlatCatalogProduct" type="flat_catalog_product">
<data key="value">0</data>
</entity>

<entity name="UseFlatCatalogCategoryAndProduct" type="catalog_storefront_config">
<requiredEntity type="flat_catalog_product">UseFlatCatalogProduct</requiredEntity>
<requiredEntity type="flat_catalog_category">UseFlatCatalogCategory</requiredEntity>
</entity>

<entity name="UseFlatCatalogProduct" type="flat_catalog_product">
<data key="value">1</data>
</entity>

<entity name="UseFlatCatalogCategory" type="flat_catalog_category">
<data key="value">1</data>
</entity>

<entity name="DefaultFlatCatalogCategoryAndProduct" type="catalog_storefront_config">
<requiredEntity type="flat_catalog_product">DefaultFlatCatalogProduct</requiredEntity>
<requiredEntity type="flat_catalog_category">DefaultFlatCatalogCategory</requiredEntity>
</entity>

<entity name="DefaultFlatCatalogCategory" type="flat_catalog_category">
<data key="value">0</data>
</entity>
</entities>
<?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="RememberPaginationCatalogStorefrontConfig" type="catalog_storefront_config">
<requiredEntity type="grid_per_page_values">GridPerPageValues</requiredEntity>
<requiredEntity type="remember_pagination">RememberCategoryPagination</requiredEntity>
</entity>

<entity name="GridPerPageValues" type="grid_per_page_values">
<data key="value">9,12,20,24</data>
</entity>

<entity name="RememberCategoryPagination" type="remember_pagination">
<data key="value">1</data>
</entity>

<entity name="DefaultCatalogStorefrontConfiguration" type="default_catalog_storefront_config">
<requiredEntity type="catalogStorefrontFlagZero">DefaultCatalogStorefrontFlagZero</requiredEntity>
<data key="list_allow_all">DefaultListAllowAll</data>
<data key="flat_catalog_product">DefaultFlatCatalogProduct</data>
</entity>

<entity name="DefaultCatalogStorefrontFlagZero" type="catalogStorefrontFlagZero">
<data key="value">0</data>
</entity>

<entity name="DefaultListAllowAll" type="list_allow_all">
<data key="value">0</data>
</entity>

<entity name="DefaultFlatCatalogProduct" type="flat_catalog_product">
<data key="value">0</data>
</entity>

<entity name="UseFlatCatalogCategoryAndProduct" type="catalog_storefront_config">
<requiredEntity type="flat_catalog_product">UseFlatCatalogProduct</requiredEntity>
<requiredEntity type="flat_catalog_category">UseFlatCatalogCategory</requiredEntity>
</entity>

<entity name="UseFlatCatalogProduct" type="flat_catalog_product">
<data key="value">1</data>
</entity>

<entity name="UseFlatCatalogCategory" type="flat_catalog_category">
<data key="value">1</data>
</entity>

<entity name="DefaultFlatCatalogCategoryAndProduct" type="catalog_storefront_config">
<requiredEntity type="flat_catalog_product">DefaultFlatCatalogProduct</requiredEntity>
<requiredEntity type="flat_catalog_category">DefaultFlatCatalogCategory</requiredEntity>
</entity>

<entity name="DefaultFlatCatalogCategory" type="flat_catalog_category">
<data key="value">0</data>
</entity>

<entity name="DefaultGridPerPageValuesConfigData">
<data key="path">catalog/frontend/grid_per_page_values</data>
<data key="value">12,24,36</data>
</entity>
<entity name="CustomGridPerPageValuesConfigData">
<data key="path">catalog/frontend/grid_per_page_values</data>
<data key="value">1,2</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminCategorySEOSection">
<element name="SectionHeader" type="button" selector="div[data-index='search_engine_optimization']" timeout="30"/>
<element name="SectionHeader" type="button" selector="div[data-index='search_engine_optimization'] .fieldset-wrapper-title" timeout="30"/>
<element name="sectionBody" type="text" selector="div[data-index='search_engine_optimization'] .admin__fieldset-wrapper-content"/>
<element name="UrlKeyInput" type="input" selector="input[name='url_key']"/>
<element name="UrlKeyDefaultValueCheckbox" type="button" selector="input[name='use_default[url_key]']"/>
<element name="UrlKeyRedirectCheckbox" type="button" selector="[data-index='url_key_create_redirect'] input[type='checkbox']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<element name="previousPage" type="button" selector=".//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'previous')]" timeout="30"/>
<element name="pageNumber" type="text" selector="//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'page')]//span[2][contains(text() ,'{{var1}}')]" parameterized="true"/>
<element name="perPage" type="select" selector="//*[@class='toolbar toolbar-products'][2]//select[@id='limiter']"/>
<element name="currentPage" type="text" selector=".products.wrapper + .toolbar-products .pages .current span:nth-of-type(2)"/>
</section>
</sections>
Loading

0 comments on commit 3f5b2f4

Please sign in to comment.