Skip to content

Commit

Permalink
Merge branch '2.3-develop' into feature/271-Customer-Attributes-Valid…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
furseyev committed Jun 22, 2019
2 parents cc69055 + 890bf89 commit 7ee6a1a
Show file tree
Hide file tree
Showing 423 changed files with 14,463 additions and 4,585 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Magento 2 development team or community maintainers will review all issues a
During the review we might require clarifications from the contributor.
If there is no response from the contributor within two weeks, the pull request will be closed.

For more detialed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
For more detailed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).

## Contribution requirements

Expand Down
12 changes: 7 additions & 5 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\AdminNotification\Model;

use Magento\Framework\Escaper;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Config\ConfigOptionsListConstants;

/**
Expand All @@ -26,7 +28,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';

/**
* @var \Magento\Framework\Escaper
* @var Escaper
*/
private $escaper;

Expand Down Expand Up @@ -82,7 +84,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
* @param \Magento\Framework\Escaper|null $escaper
* @param Escaper|null $escaper
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -97,7 +99,7 @@ public function __construct(
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = [],
\Magento\Framework\Escaper $escaper = null
Escaper $escaper = null
) {
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
$this->_backendConfig = $backendConfig;
Expand All @@ -106,8 +108,8 @@ public function __construct(
$this->_deploymentConfig = $deploymentConfig;
$this->productMetadata = $productMetadata;
$this->urlBuilder = $urlBuilder;
$this->escaper = $escaper ?? \Magento\Framework\App\ObjectManager::getInstance()->get(
\Magento\Framework\Escaper::class
$this->escaper = $escaper ?? ObjectManager::getInstance()->get(
Escaper::class
);
}

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

use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
use Magento\Framework\Stdlib\ArrayManager;
use Magento\Framework\GraphQL\DataObjectConverter;

/**
* DataProvider Model for Authorizenet
*/
class AuthorizenetDataProvider implements AdditionalDataProviderInterface
{
private const PATH_ADDITIONAL_DATA = 'input/payment_method/additional_data/authorizenet_acceptjs';
private const PATH_ADDITIONAL_DATA = 'authorizenet_acceptjs';

/**
* @var ArrayManager
Expand All @@ -36,12 +35,12 @@ public function __construct(
/**
* Return additional data
*
* @param array $args
* @param array $data
* @return array
*/
public function getData(array $args): array
public function getData(array $data): array
{
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $args) ?? [];
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
foreach ($additionalData as $key => $value) {
$additionalData[$this->snakeCaseToCamelCase($key)] = $value;
unset($additionalData[$key]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
<!-- Used for page not found error -->
<element name="pageNotFoundTitle" type="text" selector=".page-title span"/>
</section>
</sections>
7 changes: 2 additions & 5 deletions app/code/Magento/Backend/Test/Mftf/Test/AdminLoginTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@
<group value="login"/>
</annotations>

<amOnPage url="{{AdminLoginPage.url}}" stepKey="amOnAdminLoginPage"/>
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickOnSignIn"/>
<closeAdminNotification stepKey="closeAdminNotification"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/>
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ define([

self.$selector.validate().form();
self.$selector.trigger('afterValidate.beforeSubmit');
$('body').trigger('processStop');

// validate parent form
if (self.$selector.validate().errorList.length) {
$('body').trigger('processStop');

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!-- go to bundle product creation page-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!-- go to bundle product creation page-->
Expand Down
8 changes: 5 additions & 3 deletions app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
*/
namespace Magento\Catalog\Block\Adminhtml\Product;

use Magento\Framework\Escaper;

/**
* Class Edit
*/
class Edit extends \Magento\Backend\Block\Widget
{
/**
* @var \Magento\Framework\Escaper
* @var Escaper
*/
private $escaper;

Expand Down Expand Up @@ -55,7 +57,7 @@ class Edit extends \Magento\Backend\Block\Widget
* @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory
* @param \Magento\Framework\Registry $registry
* @param \Magento\Catalog\Helper\Product $productHelper
* @param \Magento\Framework\Escaper $escaper
* @param Escaper $escaper
* @param array $data
*/
public function __construct(
Expand All @@ -64,7 +66,7 @@ public function __construct(
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory,
\Magento\Framework\Registry $registry,
\Magento\Catalog\Helper\Product $productHelper,
\Magento\Framework\Escaper $escaper,
Escaper $escaper,
array $data = []
) {
$this->_productHelper = $productHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Magento\Framework\App\ResourceConnection;
use Magento\Catalog\Model\Product\Attribute\Source\Status;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Store\Model\Store;

/**
Expand All @@ -31,19 +32,28 @@ class Eraser
*/
protected $storeManager;

/**
* @var MetadataPool
*/
private $metadataPool;

/**
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\Catalog\Helper\Product\Flat\Indexer $productHelper
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param MetadataPool|null $metadataPool
*/
public function __construct(
\Magento\Framework\App\ResourceConnection $resource,
\Magento\Catalog\Helper\Product\Flat\Indexer $productHelper,
\Magento\Store\Model\StoreManagerInterface $storeManager
\Magento\Store\Model\StoreManagerInterface $storeManager,
MetadataPool $metadataPool = null
) {
$this->productIndexerHelper = $productHelper;
$this->connection = $resource->getConnection();
$this->storeManager = $storeManager;
$this->metadataPool = $metadataPool ?:
\Magento\Framework\App\ObjectManager::getInstance()->get(MetadataPool::class);
}

/**
Expand Down Expand Up @@ -81,17 +91,24 @@ public function removeDisabledProducts(array &$ids, $storeId)
/* @var $statusAttribute \Magento\Eav\Model\Entity\Attribute */
$statusAttribute = $this->productIndexerHelper->getAttribute('status');

/** @var \Magento\Framework\EntityManager\EntityMetadataInterface $metadata */
$metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class);

$select = $this->getSelectForProducts($ids);
$select->joinLeft(
['status_global_attr' => $statusAttribute->getBackendTable()],
' status_global_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID,
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID
. ' AND status_global_attr.' . $statusAttribute->getEntityIdField() . '='
. 'product_table.' . $metadata->getLinkField(),
[]
);
$select->joinLeft(
['status_attr' => $statusAttribute->getBackendTable()],
' status_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
. ' AND status_attr.store_id = ' . $storeId,
. ' AND status_attr.store_id = ' . $storeId
. ' AND status_attr.' . $statusAttribute->getEntityIdField() . '='
. 'product_table.' . $metadata->getLinkField(),
[]
);
$select->where('IFNULL(status_attr.value, status_global_attr.value) = ?', Status::STATUS_DISABLED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ private function getUsedImagesSelect(): Select
'value as filepath'
)->joinInner(
['image_value' => $this->resourceConnection->getTableName(Gallery::GALLERY_VALUE_TABLE)],
'images.value_id = image_value.value_id'
'images.value_id = image_value.value_id',
[]
)->where(
'images.disabled = 0 AND image_value.disabled = 0'
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AdminFillProductAttributePropertiesActionGroup">
<arguments>
<argument name="attributeName" type="string"/>
<argument name="attributeType" type="string"/>
</arguments>
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{attributeType}}" stepKey="selectInputType"/>
</actionGroup>
</actionGroups>
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.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenAttributeSetByNameActionGroup">
<arguments>
<argument name="attributeSetName" type="string" defaultValue="Default"/>
</arguments>
<click selector="{{AdminProductAttributeSetGridSection.AttributeSetName(attributeSetName)}}" stepKey="chooseAttributeSet"/>
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminOpenAttributeSetGridPageActionGroup">
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminOpenProductAttributePageActionGroup">
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToAttributePage"/>
<waitForPageLoad stepKey="waitForAttributePageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AdminOpenProductIndexPageActionGroup">
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndexPage"/>
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertStorefrontCustomProductAttributeActionGroup">
<arguments>
<argument name="attributeLabel" type="string"/>
<argument name="attributeValue" type="string"/>
</arguments>
<see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.customAttributeLabel(attributeLabel)}}" stepKey="seeAttributeLabel" />
<see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.customAttributeValue(attributeLabel)}}" stepKey="seeAttributeValue" />
</actionGroup>
</actionGroups>
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.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="OpenStorefrontProductPageByProductNameActionGroup">
<arguments>
<argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/>
</arguments>
<amOnPage url="{{productName}}.html" stepKey="amOnProductPage"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
</actionGroup>
</actionGroups>
7 changes: 7 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,11 @@
<data key="is_active">false</data>
<data key="include_in_menu">false</data>
</entity>
<!-- Category from file "prepared-for-sample-data.csv"-->
<entity name="Gear" type="category">
<data key="name">Gear</data>
<data key="name_lwr">gear</data>
<data key="is_active">true</data>
<data key="include_in_menu">true</data>
</entity>
</entities>
Loading

0 comments on commit 7ee6a1a

Please sign in to comment.