Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.3-devel…
Browse files Browse the repository at this point in the history
…op latest changes

Accepted Community Pull Requests:
 - #24111: MFTF Low stock reports sections and page. (by @nmalevanec)
 - #24117: #24116: Webapi schema generation fail in case when Ge� (by @swnsma)
 - #24109: Update _icons.less (by @Bartlomiejsz)


Fixed GitHub Issues:
 - #24116: Webapi Swager schema generation fail in case when Get endpoint has param with Extension Attributes (reported by @swnsma) has been fixed in #24117 by @swnsma in 2.3-develop branch
   Related commits:
     1. 166a1e0
  • Loading branch information
magento-engcom-team authored Aug 21, 2019
2 parents deef245 + 8e10c1a commit 89e28aa
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 deletions.
15 changes: 10 additions & 5 deletions app/code/Magento/CatalogSearch/Model/Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ public function __construct(
/**
* Add advanced search filters to product collection
*
* @param array $values
* @return $this
* @param array $values
* @return $this
* @throws LocalizedException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
Expand All @@ -197,6 +197,11 @@ public function addFilters($values)
if (!isset($values[$attribute->getAttributeCode()])) {
continue;
}
if ($attribute->getFrontendInput() == 'text' || $attribute->getFrontendInput() == 'textarea') {
if (!trim($values[$attribute->getAttributeCode()])) {
continue;
}
}
$value = $values[$attribute->getAttributeCode()];
$preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);
if (false === $preparedSearchValue) {
Expand Down Expand Up @@ -343,9 +348,9 @@ protected function addSearchCriteria($attribute, $value)
*
* @todo: Move this code to block
*
* @param EntityAttribute $attribute
* @param mixed $value
* @return string|bool
* @param EntityAttribute $attribute
* @param mixed $value
* @return string|bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
Expand Down
13 changes: 13 additions & 0 deletions app/code/Magento/Reports/Test/Mftf/Page/LowStockReportPage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="LowStockReportPage" url="reports/report_product/lowstock/" area="admin" module="Reports">
<section name="LowStockReportMainSection"/>
<section name="LowStockProductGridSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="LowStockProductGridSection">
<element name="productSku" type="input" selector="//tr[1]/td[@data-column='sku']"/>
<element name="productName" type="input" selector="//tr[1]/td[@data-column='name']"/>
<element name="productQty" type="input" selector="//tr[1]/td[@data-column='qty']"/>
</section>
</sections>
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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="LowStockReportFilterSection">
<element name="productSku" type="input" selector="#gridLowstock_filter_sku"/>
<element name="productName" type="input" selector="#gridLowstock_filter_name"/>
<element name="qtyFrom" type="input" selector="#gridLowstock_filter_qty_from"/>
<element name="qtyTo" type="input" selector="#gridLowstock_filter_qty_to"/>
<element name="searchButton" type="button" selector="//button/span[text()='Search']"/>
<element name="resetButton" type="button" selector="//button/span[text()='Reset Filter']"/>
</section>
</sections>
3 changes: 2 additions & 1 deletion app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ protected function getQueryParamNames($name, $type, $description, $prefix = '')
*/
private function handleComplex($name, $type, $prefix, $isArray)
{
$parameters = $this->typeProcessor->getTypeData($type)['parameters'];
$typeData = $this->typeProcessor->getTypeData($type);
$parameters = $typeData['parameters'] ?? [];
$queryNames = [];
foreach ($parameters as $subParameterName => $subParameterInfo) {
$subParameterType = $subParameterInfo['type'];
Expand Down
2 changes: 1 addition & 1 deletion lib/web/css/source/lib/_icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
display: inline-block;

& when not (@_icon-image = false) {
._lib-icon-text-hide(@_icon-font-text-hide);
._lib-icon-text-hide(@_icon-image-text-hide);
}

&:after {
Expand Down

0 comments on commit 89e28aa

Please sign in to comment.