Skip to content

Commit

Permalink
Merge branch '2.4-develop' into 2.4-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-sviziev committed Sep 17, 2020
2 parents 47761ec + 57c527e commit 2844fbf
Show file tree
Hide file tree
Showing 669 changed files with 18,554 additions and 2,921 deletions.
10 changes: 5 additions & 5 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#ini_set('display_errors', 1);

/* PHP version validation */
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) {
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70300) {
if (PHP_SAPI == 'cli') {
echo 'Magento supports PHP 7.1.3 or later. ' .
'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html';
echo 'Magento supports PHP 7.3.0 or later. ' .
'Please read https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html';
} else {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<p>Magento supports PHP 7.1.3 or later. Please read
<a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html">
<p>Magento supports PHP 7.3.0 or later. Please read
<a target="_blank" href="https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html">
Magento System Requirements</a>.
</div>
HTML;
Expand Down
19 changes: 19 additions & 0 deletions app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,24 @@
<value id="adobedtm" type="host">assets.adobedtm.com</value>
</values>
</policy>
<policy id="img-src">
<values>
<value id="adobedtm" type="host">assets.adobedtm.com</value>
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
<value id="everesttech" type="host">cm.everesttech.net</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
</values>
</policy>
<policy id="frame-src">
<values>
<value id="amcdemdex" type="host">fast.amc.demdex.net</value>
</values>
</policy>
</policies>
</csp_whitelist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminNotificationToolbarSection">
<element name="notification" type="block" selector=".notifications-wrapper.admin__action-dropdown-wrap"/>
<element name="notificationCounter" type="block" selector=".notifications-action.admin__action-dropdown .notifications-counter"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminSystemNotificationToolbarBlockAclTest">
<annotations>
<features value="AdminNotification"/>
<stories value="Acl notification toolbar"/>
<title value="Admin system notification toolbar block acl test"/>
<description value="Admin should not see system notification toolbar block if acl not restricted"/>
<severity value="MAJOR"/>
<testCaseId value="MC-36011"/>
<group value="menu"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>

<actionGroup ref="AdminFillUserRoleRequiredDataActionGroup" stepKey="fillUserRoleRequiredData">
<argument name="User" value="adminRole"/>
<argument name="restrictedRole" value="Stores"/>
</actionGroup>
<actionGroup ref="AdminUserClickRoleResourceTabActionGroup" stepKey="goToRoleResourcesTab" />
<actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleStores">
<argument name="User" value="adminRole"/>
<argument name="restrictedRole" value="Products"/>
</actionGroup>
<actionGroup ref="AdminUserSaveRoleActionGroup" stepKey="saveUserRole" />

<actionGroup ref="AdminCreateUserActionGroup" stepKey="createAdminUser">
<argument name="role" value="adminRole"/>
<argument name="User" value="admin2"/>
</actionGroup>

<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<!--Delete created data-->
<actionGroup ref="AdminUserOpenAdminRolesPageActionGroup" stepKey="navigateToUserRoleGrid"/>
<actionGroup ref="AdminDeleteRoleActionGroup" stepKey="deleteUserRole">
<argument name="role" value="adminRole"/>
</actionGroup>
<actionGroup ref="AdminOpenAdminUsersPageActionGroup" stepKey="goToAllUsersPage"/>
<actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="deleteUser">
<argument name="userName" value="{{admin2.username}}"/>
</actionGroup>
</after>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser">
<argument name="username" value="{{admin2.username}}"/>
<argument name="password" value="{{admin2.password}}"/>
</actionGroup>

<waitForPageLoad stepKey="waitBeforePageLoad"/>
<dontSeeElement selector="{{AdminNotificationToolbarSection.notification}}" stepKey="doNotSeeNotificationBellIcon"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
template="Magento_AdminNotification::notification/window.phtml"/>
</referenceContainer>
<referenceContainer name="header">
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="Magento_AdminNotification::toolbar_entry.phtml"/>
<block class="Magento\AdminNotification\Block\ToolbarEntry"
name="notification.messages"
before="user"
aclResource="Magento_AdminNotification::show_toolbar"
template="Magento_AdminNotification::toolbar_entry.phtml"/>
</referenceContainer>
</body>
</page>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;

/**
* Class AdvancedPricing
* Import advanced pricing class
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand All @@ -19,43 +19,27 @@
class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
{
const VALUE_ALL_GROUPS = 'ALL GROUPS';

const VALUE_ALL_WEBSITES = 'All Websites';

const COL_SKU = 'sku';

const COL_TIER_PRICE_WEBSITE = 'tier_price_website';

const COL_TIER_PRICE_CUSTOMER_GROUP = 'tier_price_customer_group';

const COL_TIER_PRICE_QTY = 'tier_price_qty';

const COL_TIER_PRICE = 'tier_price';

const COL_TIER_PRICE_PERCENTAGE_VALUE = 'percentage_value';

const COL_TIER_PRICE_TYPE = 'tier_price_value_type';

const TIER_PRICE_TYPE_FIXED = 'Fixed';

const TIER_PRICE_TYPE_PERCENT = 'Discount';

const TABLE_TIER_PRICE = 'catalog_product_entity_tier_price';

const DEFAULT_ALL_GROUPS_GROUPED_PRICE_VALUE = '0';

const ENTITY_TYPE_CODE = 'advanced_pricing';

const VALIDATOR_MAIN = 'validator';

const VALIDATOR_WEBSITE = 'validator_website';

/**
* @deprecated
* @see VALIDATOR_TIER_PRICE
*/
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';

private const VALIDATOR_TIER_PRICE = 'validator_tier_price';

/**
Expand Down Expand Up @@ -176,10 +160,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
* @param \Magento\ImportExport\Helper\Data $importExportData
* @param \Magento\ImportExport\Model\ResourceModel\Import\Data $importData
* @param \Magento\Eav\Model\Config $config
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
* @param \Magento\Framework\Stdlib\StringUtils $string
* @param ProcessingErrorAggregatorInterface $errorAggregator
* @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
* @param \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory
Expand All @@ -197,10 +179,8 @@ public function __construct(
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Magento\ImportExport\Helper\Data $importExportData,
\Magento\ImportExport\Model\ResourceModel\Import\Data $importData,
\Magento\Eav\Model\Config $config,
\Magento\Framework\App\ResourceConnection $resource,
\Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper,
\Magento\Framework\Stdlib\StringUtils $string,
ProcessingErrorAggregatorInterface $errorAggregator,
\Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as RowValidatorInterface;
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
use Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory as ResourceFactory;
use Magento\Eav\Model\Config;
use Magento\Eav\Model\Entity\Type;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Adapter\AdapterInterface;
Expand All @@ -26,7 +25,6 @@
use Magento\Framework\Json\Helper\Data;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Framework\Stdlib\StringUtils;
use Magento\ImportExport\Model\Import;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
use Magento\ImportExport\Model\ResourceModel\Helper;
Expand Down Expand Up @@ -99,11 +97,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
*/
protected $dataSourceModel;

/**
* @var Config
*/
protected $eavConfig;

/**
* @var TimezoneInterface|MockObject
*/
Expand Down Expand Up @@ -139,11 +132,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
*/
protected $advancedPricing;

/**
* @var StringUtils
*/
protected $stringObject;

/**
* @var ProcessingErrorAggregatorInterface
*/
Expand All @@ -165,10 +153,8 @@ protected function setUp(): void
);
$this->resource->method('getConnection')->willReturn($this->connection);
$this->dataSourceModel = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class);
$this->eavConfig = $this->createMock(Config::class);
$entityType = $this->createMock(Type::class);
$entityType->method('getEntityTypeId')->willReturn('');
$this->eavConfig->method('getEntityType')->willReturn($entityType);
$this->resourceFactory = $this->getMockBuilder(
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory::class
)
Expand All @@ -193,7 +179,6 @@ protected function setUp(): void
$this->tierPriceValidator = $this->createMock(
TierPrice::class
);
$this->stringObject = $this->createMock(StringUtils::class);
$this->errorAggregator = $this->getErrorAggregatorObject();
$this->dateTime = $this->getMockBuilder(DateTime::class)
->disableOriginalConstructor()
Expand Down Expand Up @@ -1070,10 +1055,8 @@ private function getAdvancedPricingMock($methods = [])
$this->jsonHelper,
$this->importExportData,
$this->dataSourceModel,
$this->eavConfig,
$this->resource,
$this->resourceHelper,
$this->stringObject,
$this->errorAggregator,
$this->dateTime,
$this->resourceFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="AdminOpenConfigGeneralAnalyticsPageActionGroup">
<annotations>
<description>Open Config General Analytics Page.</description>
</annotations>

<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<waitForPageLoad stepKey="waitPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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="AssertAdminAdvancedReportingPageUrlActionGroup">
<annotations>
<description>Assert admin advanced reporting page url.</description>
</annotations>

<switchToNextTab stepKey="switchToNewTab"/>
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
<actionGroup ref="AssertAdminAdvancedReportingPageUrlActionGroup" stepKey="assertAdvancedReportingPageUrl"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/>
<argument name="submenuUiId" value="{{AdminMenuReportsBusinessIntelligenceAdvancedReporting.dataUiId}}"/>
</actionGroup>
<switchToNextTab stepKey="switchToNewTab"/>
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
<actionGroup ref="AssertAdminAdvancedReportingPageUrlActionGroup" stepKey="assertAdvancedReportingPageUrl"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
<testCaseId value="MAGETWO-63981"/>
<group value="analytics"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<actionGroup ref="AdminOpenConfigGeneralAnalyticsPageActionGroup" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustry}}" userInput="--Please Select--" stepKey="selectAdvancedReportingIndustry"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
<testCaseId value="MAGETWO-66465"/>
<group value="analytics"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<actionGroup ref="AdminOpenConfigGeneralAnalyticsPageActionGroup" stepKey="amOnAdminConfig"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingServiceLabel}}" userInput="Advanced Reporting Service" stepKey="seeAdvancedReportingServiceLabelEnabled"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
<testCaseId value="MAGETWO-63898"/>
<group value="analytics"/>
</annotations>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="AdminOpenConfigGeneralAnalyticsPageActionGroup" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustry}}" userInput="Apps and Games" stepKey="selectAdvancedReportingIndustry"/>
Expand Down
Loading

0 comments on commit 2844fbf

Please sign in to comment.