Skip to content

Commit

Permalink
ENGCOM-4336: Fixed Massaction design with submenu on grid pages #20938
Browse files Browse the repository at this point in the history
 - Merge Pull Request #20938 from ananth-iyer/magento2:bugfix/massaction-grid-issue
 - Merged commits:
   1. facfa44
   2. 314d3a8
   3. 631c6b1
   4. 524eef3
  • Loading branch information
magento-engcom-team committed Mar 12, 2019
2 parents e9c30ac + 524eef3 commit 6bef5b5
Show file tree
Hide file tree
Showing 392 changed files with 11,033 additions and 1,137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
->processCountNewPrices($tierPrices);

$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
if ($listSku) {
$this->setUpdatedAt($listSku);
Expand Down Expand Up @@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)

$tableName = $this->_resourceFactory->create()->getTable($table);
$productEntityLinkField = $this->getProductEntityLinkField();
$existingPrices = $this->_connection->fetchAssoc(
$existingPrices = $this->_connection->fetchAll(
$this->_connection->select()->from(
$tableName,
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
)->where(
$productEntityLinkField . ' IN (?)',
$existProductIds
)
);
foreach ($existingPrices as $existingPrice) {
foreach ($prices as $sku => $skuPrices) {
Expand All @@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
foreach ($prices as $price) {
if ($existingPrice['all_groups'] == $price['all_groups']
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
&& (int) $existingPrice['qty'] === (int) $price['qty']
) {
$this->countItemsUpdated++;
continue;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
);
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
$this->connection->expects($this->once())
->method('fetchAssoc')
->method('fetchAll')
->willReturn($existingPrices);
$this->connection->expects($this->once())
->method('select')
Expand All @@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
->method('from')
->with(
self::TABLE_NAME,
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
)->willReturnSelf();
$this->advancedPricing->expects($this->once())
->method('retrieveOldSkus')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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="AdminAdvancedReportingSection">
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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="AdminAdvancedReportingButtonTest">
<annotations>
<stories value="AdvancedReporting"/>
<title value="AdvancedReportingButtonTest"/>
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
<testCaseId value="MC-14800"/>
<severity value="CRITICAL"/>
<group value="analytics"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
<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"/>
</test>
</tests>
7 changes: 7 additions & 0 deletions app/code/Magento/AuthorizenetAcceptjs/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<dev>
<js>
<minify_exclude>
<authorizenet_acceptjs>\.authorize\.net/v1/Accept</authorizenet_acceptjs>
</minify_exclude>
</js>
</dev>
<payment>
<authorizenet_acceptjs>
<active>0</active>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
*/

var config = {
map: {
'*': {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
acceptjs: 'https://js.authorize.net/v1/Accept.js'
shim: {
acceptjs: {
exports: 'Accept'
},
acceptjssandbox: {
exports: 'Accept'
}
},
paths: {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
acceptjs: 'https://js.authorize.net/v1/Accept'
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define([
dependency = 'acceptjssandbox';
}

require([dependency], function () {
require([dependency], function (accept) {
var $body = $('body');

/*
Expand All @@ -26,16 +26,7 @@ define([
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
*/
$body.on('handshake.acceptjs', function () {
/*
* Accept.js doesn't return the library when loading
* and requirejs "shim" can't be used because it only works with the "paths" config option
* and we can't use "paths" because require will try to load ".min.js" in production
* and that doesn't work because it doesn't exist
* and we can't add a query string to force a URL because accept.js will reject it
* and we can't include it locally because they check in the script before loading more scripts
* So, we use the global version as "shim" would
*/
deferred.resolve(window.Accept);
deferred.resolve(accept);
$body.off('handshake.acceptjs');
});
},
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Backend/App/Request/BackendValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ private function createException(
$exception = new InvalidRequestException($response);
} else {
//For regular requests.
$startPageUrl = $this->backendUrl->getStartupPageUrl();
$response = $this->redirectFactory->create()
->setUrl($this->backendUrl->getStartupPageUrl());
->setUrl($this->backendUrl->getUrl($startPageUrl));
$exception = new InvalidRequestException(
$response,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<data key="name" unique="suffix">databaseBackup</data>
<data key="type">Database</data>
</entity>
</entities>
<entity name="WebSetupWizardBackup" type="backup">
<data key="name">WebSetupWizard</data>
<data key="type">Database</data>
</entity>
</entities>
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="VerifyProductTypeOrder">
<seeElement stepKey="seeBundleInOrder" selector="{{AdminProductDropdownOrderSection.bundleProduct}}"/>
</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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductDropdownOrderSection">
<element name="bundleProduct" type="text" selector="//li[not(preceding-sibling::li[span[@title='Downloadable Product']]) and not(following-sibling::li[span[@title='Simple Product']]) and not(following-sibling::li[span[@title='Configurable Product']]) and not(following-sibling::li[span[@title='Grouped Product']]) and not(following-sibling::li[span[@title='Virtual Product']])]/span[@title='Bundle Product']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<!-- Delete the bundled product we created in the test body -->
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
<argument name="sku" value="{{BundleProduct.sku}}"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!--Go to bundle product creation page-->
Expand Down
10 changes: 7 additions & 3 deletions app/code/Magento/Catalog/Api/ProductRenderListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Api;

/**
* Interface which provides product renders information for products
* Interface which provides product renders information for products.
*
* @api
* @since 101.1.0
*/
interface ProductRenderListInterface
{
/**
* Collect and retrieve the list of product render info
* This info contains raw prices and formated prices, product name, stock status, store_id, etc
* Collect and retrieve the list of product render info.
*
* This info contains raw prices and formatted prices, product name, stock status, store_id, etc.
*
* @see \Magento\Catalog\Api\Data\ProductRenderInfoDtoInterface
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
Expand Down
23 changes: 17 additions & 6 deletions app/code/Magento/Catalog/Block/Product/ListProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ private function getDefaultListingMode()
}

/**
* Need use as _prepareLayout - but problem in declaring collection from
* another block (was problem with search result)
* Need use as _prepareLayout - but problem in declaring collection from another block.
* (was problem with search result)
*
* @return $this
*/
protected function _beforeToHtml()
Expand All @@ -188,7 +189,9 @@ protected function _beforeToHtml()

$this->addToolbarBlock($collection);

$collection->load();
if (!$collection->isLoaded()) {
$collection->load();
}

return parent::_beforeToHtml();
}
Expand Down Expand Up @@ -262,6 +265,8 @@ public function getToolbarHtml()
}

/**
* Set collection.
*
* @param AbstractCollection $collection
* @return $this
*/
Expand All @@ -272,7 +277,9 @@ public function setCollection($collection)
}

/**
* @param array|string|integer| Element $code
* Add attribute.
*
* @param array|string|integer|Element $code
* @return $this
*/
public function addAttribute($code)
Expand All @@ -282,6 +289,8 @@ public function addAttribute($code)
}

/**
* Get price block template.
*
* @return mixed
*/
public function getPriceBlockTemplate()
Expand Down Expand Up @@ -371,6 +380,8 @@ public function getAddToCartPostParams(Product $product)
}

/**
* Get product price.
*
* @param Product $product
* @return string
*/
Expand All @@ -396,8 +407,8 @@ public function getProductPrice(Product $product)
}

/**
* Specifies that price rendering should be done for the list of products
* i.e. rendering happens in the scope of product list, but not single product
* Specifies that price rendering should be done for the list of products.
* (rendering happens in the scope of product list, but not single product)
*
* @return Render
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/

namespace Magento\Catalog\Block\Product\View\Options;

use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;

/**
* Product aoptions section abstract block.
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -46,7 +49,7 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
* @param \Magento\Catalog\Helper\Data $catalogData,
* @param \Magento\Catalog\Helper\Data $catalogData
* @param array $data
*/
public function __construct(
Expand Down Expand Up @@ -123,6 +126,8 @@ public function getFormattedPrice()
}

/**
* Retrieve formatted price.
*
* @return string
*
* @deprecated
Expand All @@ -134,7 +139,7 @@ public function getFormatedPrice()
}

/**
* Return formated price
* Return formatted price
*
* @param array $value
* @param bool $flag
Expand Down
Loading

0 comments on commit 6bef5b5

Please sign in to comment.