Skip to content

Commit e4de07c

Browse files
committed
Merge branch 'asi-bugfix-241-2' of github.com:magento-engcom/magento2ce into asi-bugfix-241-2
2 parents 9775a1d + a63ba82 commit e4de07c

File tree

62 files changed

+1145
-1183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1145
-1183
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminPageIs404ActionGroup">
12+
<annotations>
13+
<description>Validates that the '404 Error' message is present in the current Admin Page Header.</description>
14+
</annotations>
15+
16+
<see userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="see404PageHeading"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridUrlFilterApplierTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
3232
</after>
3333

34-
<amOnPage url="{{AdminProductIndexPage.url}}?filters[name]=$createSimpleProduct.name$" stepKey="navigateToProductGridWithFilters"/>
34+
<amOnPage url="{{AdminProductIndexPage.url}}?filters[sku]=$createSimpleProduct.sku$" stepKey="navigateToProductGridWithFilters"/>
3535
<waitForPageLoad stepKey="waitForProductGrid"/>
3636
<see selector="{{AdminProductGridSection.productGridNameProduct($createSimpleProduct.name$)}}" userInput="$createSimpleProduct.name$" stepKey="seeProduct"/>
3737
<waitForElementVisible selector="{{AdminProductGridFilterSection.enabledFilters}}" stepKey="waitForEnabledFilters"/>
3838
<seeElement selector="{{AdminProductGridFilterSection.enabledFilters}}" stepKey="seeEnabledFilters"/>
39-
<see selector="{{AdminProductGridFilterSection.enabledFilters}}" userInput="Name: $createSimpleProduct.name$" stepKey="seeProductNameFilter"/>
39+
<see selector="{{AdminProductGridFilterSection.enabledFilters}}" userInput="SKU: $createSimpleProduct.sku$" stepKey="seeProductNameFilter"/>
4040
</test>
4141
</tests>

app/code/Magento/Catalog/view/adminhtml/web/js/components/product-ui-select.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
/**
7+
* @deprecated see Magento/Ui/view/base/web/js/grid/filters/elements/ui-select.js
8+
*/
69
define([
710
'Magento_Ui/js/form/element/ui-select',
811
'jquery',

app/code/Magento/MediaGallery/etc/db_schema.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
99
<table name="media_gallery_asset" resource="default" engine="innodb" comment="Media Gallery Asset">
1010
<column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
11-
<column xsi:type="varchar" name="path" length="255" nullable="true" comment="Path"/>
11+
<column xsi:type="text" name="path" nullable="true" comment="Path"/>
1212
<column xsi:type="varchar" name="title" length="255" nullable="true" comment="Title"/>
1313
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
1414
<column xsi:type="varchar" name="source" length="255" nullable="true" comment="Source"/>
@@ -25,9 +25,6 @@
2525
<index referenceId="MEDIA_GALLERY_ID" indexType="btree">
2626
<column name="id"/>
2727
</index>
28-
<constraint xsi:type="unique" referenceId="MEDIA_GALLERY_ID_PATH_TITLE_CONTENT_TYPE_WIDTH_HEIGHT">
29-
<column name="path"/>
30-
</constraint>
3128
<index referenceId="MEDIA_GALLERY_ASSET_TITLE" indexType="fulltext">
3229
<column name="title"/>
3330
</index>

app/code/Magento/MediaGallery/etc/db_schema_whitelist.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"MEDIA_GALLERY_ASSET_TITLE": true
2121
},
2222
"constraint": {
23-
"MEDIA_GALLERY_ID_PATH_TITLE_CONTENT_TYPE_WIDTH_HEIGHT": true,
2423
"PRIMARY": true,
2524
"MEDIA_GALLERY_ASSET_PATH": true
2625
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\MediaGalleryCatalogUi\Controller\Adminhtml\Product;
10+
11+
use Magento\Framework\Controller\ResultInterface;
12+
use Magento\Backend\App\Action\Context;
13+
use Magento\Catalog\Api\ProductRepositoryInterface;
14+
use Magento\Framework\Controller\Result\JsonFactory;
15+
use Magento\Framework\App\Action\HttpGetActionInterface;
16+
use Magento\Backend\App\Action;
17+
18+
/**
19+
* Returns selected product by product id. for ui-select filter
20+
*/
21+
class GetSelected extends Action implements HttpGetActionInterface
22+
{
23+
/**
24+
* @see _isAllowed()
25+
*/
26+
const ADMIN_RESOURCE = 'Magento_Catalog::products';
27+
28+
/**
29+
* @var JsonFactory
30+
*/
31+
private $resultJsonFactory;
32+
33+
/**
34+
* @var ProductRepositoryInterface
35+
*/
36+
private $productRepository;
37+
38+
/**
39+
* GetSelected constructor.
40+
*
41+
* @param JsonFactory $jsonFactory
42+
* @param ProductRepositoryInterface $productRepository
43+
* @param Context $context
44+
*/
45+
public function __construct(
46+
JsonFactory $jsonFactory,
47+
ProductRepositoryInterface $productRepository,
48+
Context $context
49+
) {
50+
$this->resultJsonFactory = $jsonFactory;
51+
$this->productRepository = $productRepository;
52+
parent::__construct($context);
53+
}
54+
55+
/**
56+
* Return selected products options
57+
*
58+
* @return ResultInterface
59+
*/
60+
public function execute() : ResultInterface
61+
{
62+
$productIds = $this->getRequest()->getParam('ids');
63+
$options = [];
64+
65+
if (!is_array($productIds)) {
66+
return $this->resultJsonFactory->create()->setData('parameter ids must be type of array');
67+
}
68+
foreach ($productIds as $id) {
69+
try {
70+
$product = $this->productRepository->getById($id);
71+
$options[] = [
72+
'value' => $product->getId(),
73+
'label' => $product->getName(),
74+
'is_active' => $product->getSatus(),
75+
'path' => $product->getSku()
76+
];
77+
} catch (\Exception $e) {
78+
continue;
79+
}
80+
}
81+
82+
return $this->resultJsonFactory->create()->setData($options);
83+
}
84+
}

app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/ActionGroup/AdminEditCategoryInGridPageActionGroup.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
<annotations>
1212
<description>Clicks the Edit action from the Media Gallery Category Grid</description>
1313
</annotations>
14-
<click selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.edit('2', 'Edit')}}" stepKey="clickOnCategoryRow"/>
14+
15+
<arguments>
16+
<argument name="categoryName" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.edit(categoryName, 'Edit')}}" stepKey="clickOnCategoryRow"/>
1520
<waitForPageLoad time="30" stepKey="waitForCategoryDetailsPageLoad"/>
1621
</actionGroup>
1722
</actionGroups>

app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Section/AdminMediaGalleryCatalogUiCategoryGridSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<element name="products" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Products')]/preceding-sibling::th) +1 ]//*[text()='{{productsQty}}']" parameterized="true"/>
1818
<element name="inMenu" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'In Menu')]/preceding-sibling::th) +1 ]//*[text()='{{inMenuValue}}']" parameterized="true"/>
1919
<element name="enabled" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Enabled')]/preceding-sibling::th) +1 ]//*[text()='{{enabledValue}}']" parameterized="true"/>
20-
<element name="edit" type="button" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Action')]/preceding-sibling::th) +1 ]//*[text()='{{edit}}']" parameterized="true"/>
20+
<element name="edit" type="button" selector="//tr[td//text()[contains(., '{{categoryName}}')]]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Action')]/preceding-sibling::th) +1 ]//*[text()='{{actionButton}}']" parameterized="true"/>
2121
</section>
2222
</sections>

app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiEditCategoryGridPageTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
<deleteData createDataKey="category" stepKey="deleteCategory"/>
2727
</after>
2828
<actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openCategoryPage"/>
29-
<actionGroup ref="AdminEditCategoryInGridPageActionGroup" stepKey="editCategoryItem"/>
29+
<actionGroup ref="AdminEditCategoryInGridPageActionGroup" stepKey="editCategoryItem">
30+
<argument name="categoryName" value="$$category.name$$"/>
31+
</actionGroup>
3032
<actionGroup ref="AdminAssertCategoryPageTitleActionGroup" stepKey="assertCategoryByName"/>
3133
</test>
3234
</tests>

app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,16 @@
6060
<actionGroup ref="AdminMediaGalleryAssertCategoryNameInCategoryGridActionGroup" stepKey="assertCategoryInGrid">
6161
<argument name="categoryName" value="$$category.name$$"/>
6262
</actionGroup>
63+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/>
64+
<actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openCategoryPageToVerifyIfFilterCanBeApplied"/>
65+
<actionGroup ref="AdminEnhancedMediaGalleryCategoryGridExpandFilterActionGroup" stepKey="expandFilters"/>
66+
<actionGroup ref="AdminEnhancedMediaGallerySelectUsedInFilterActionGroup" stepKey="setAssetFilter">
67+
<argument name="filterName" value="Asset"/>
68+
<argument name="optionName" value="{{UpdatedImageDetails.title}}"/>
69+
</actionGroup>
70+
<actionGroup ref="AdminEnhancedMediaGalleryCategoryGridApplyFiltersActionGroup" stepKey="applyFilters"/>
71+
<actionGroup ref="AssertAdminMediaGalleryAssetFilterPlaceHolderActionGroup" stepKey="assertFilterAppliedAfterUrlFilterApplier">
72+
<argument name="filterPlaceholder" value="{{UpdatedImageDetails.title}}"/>
73+
</actionGroup>
6374
</test>
6475
</tests>

0 commit comments

Comments
 (0)