Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Browse files Browse the repository at this point in the history
Accepted Community Pull Requests:
 - #29576: Add suport of reading PNG JPEG Exif metadata (by @Nazar65)
 - #29429: Fix ui-select options placeholders for url-filter-applier (by @Nazar65)
 - #29400: #1703: The deleted tags are not removed from Tags drop-down until the web page is refreshed (by @yolouiese)
 - #29433: Reorganize Media Gallery stores configuration UI (by @konarshankar07)
 - #29494: #1748: Some category grid columns are empty (by @joweecaquicla)
 - #29461: #1727: Introduce internal class wrapping SplFileInfo (by @joweecaquicla)
 - #29491: #1712: Remove DataObject usage from OpenDialogUrl provider (by @joweecaquicla)
 - #29458: magento/web-api-test-recursive-array-comparison (by @bricht)
 - #29511: #29496 :- UI : Time field element in admin (by @konarshankar07)
 - #29483: fix fatal error when exception was thrown (by @rafal-kos)
 - #27478: improve exception handling in Layout render (by @fsw)
 - #29413: Fix #24060 - Terms and Conditions label doesn't fit longer texts (by @Bartlomiejsz)
 - #29452: Fix date timestamp typo ( Created and Modified date are different for newly saved Image Preview) (by @Nazar65)
 - #29410: Changed misunderstanding title (by @angelo983)
 - #29435: #1711: Use product model instead of data object for catalog image helper init (by @jmonteros422)


Fixed GitHub Issues:
 - #1449: Duplicated attributes in sidebar when installing with sample data (reported by @markoshust) has been fixed in #29576 by @Nazar65 in 2.4-develop branch
   Related commits:
     1. a74d422
     2. 9b8c81c
     3. 5c7c959
     4. 4ef4c6c
     5. 4a7fbd7
     6. 5e07290
     7. 0830d38
     8. c29e740
     9. bed58c5
     10. 58fbad4
     11. 9a74037
     12. 583b013

 - #1694: Remove / Edit Item in minicart does not work if span css is changed (reported by @Zaylril) has been fixed in #29429 by @Nazar65 in 2.4-develop branch
   Related commits:
     1. 4ebe9d6

 - #1755: why i disable all  caches and enable xdebug  that  cause   magento very slow? (reported by @LifeAsBook) has been fixed in #29429 by @Nazar65 in 2.4-develop branch
   Related commits:
     1. 4ebe9d6

 - #1703: when multiple productInterface implement which to use  (reported by @LifeAsBook) has been fixed in #29400 by @yolouiese in 2.4-develop branch
   Related commits:
     1. b2b45e6
     2. c716884
     3. 9a2f265
     4. 8d9d0a5
     5. 512942e
     6. 7e34bc9
     7. 0f9189e
     8. c4055cc
     9. 3b350fd
     10. bf77de0
     11. 5f1d43a

 - #1738: Where the relevant information about the template <!--ko--> (reported by @LifeAsBook) has been fixed in #29433 by @konarshankar07 in 2.4-develop branch
   Related commits:
     1. 3633542
     2. 651bd69
     3. 8b592ee
     4. 3fc2303
     5. e76cb95
     6. 1fe9c22
     7. de6d2a7

 - #29498: [Issue] magento/web-api-test-recursive-array-comparison (reported by @m2-assistant[bot]) has been fixed in #29458 by @bricht in 2.4-develop branch
   Related commits:
     1. 9cf55e5
     2. 289af76

 - #29496: UI : Time field element in admin (reported by @sankalpshekhar) has been fixed in #29511 by @konarshankar07 in 2.4-develop branch
   Related commits:
     1. 23b5a24
     2. 3723b61

 - #29525: [Issue] fix fatal error when exception was thrown (reported by @m2-assistant[bot]) has been fixed in #29483 by @rafal-kos in 2.4-develop branch
   Related commits:
     1. 8b8e496

 - #29606: [Issue] improve exception handling in Layout render (reported by @m2-assistant[bot]) has been fixed in #27478 by @fsw in 2.4-develop branch
   Related commits:
     1. 9565c44
     2. ab74f29
     3. c30dd60

 - #24060: Terms and Conditions label doesn't fit longer texts (reported by @DanieliMi) has been fixed in #29413 by @Bartlomiejsz in 2.4-develop branch
   Related commits:
     1. 5a0680c

 - #29416: [Issue] Changed misunderstanding title (reported by @m2-assistant[bot]) has been fixed in #29410 by @angelo983 in 2.4-develop branch
   Related commits:
     1. 209018c
     2. afdcc93
     3. e2b6d33

 - #1711: Clear static content when enabling new module from CLI (reported by @markoshust) has been fixed in #29435 by @jmonteros422 in 2.4-develop branch
   Related commits:
     1. 11d0a35
     2. 25133c5
     3. c72447f
     4. 73d032f
     5. 36427dc
  • Loading branch information
magento-engcom-team authored Aug 19, 2020
2 parents bdde24b + 1adcc4a commit 18da36b
Show file tree
Hide file tree
Showing 66 changed files with 1,329 additions and 266 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/Checkout/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ Summary,Summary
"We'll send your order confirmation here.","We'll send your order confirmation here."
Payment,Payment
"Not yet calculated","Not yet calculated"
"We received your order!","We received your order!"
"The order was not successful!","The order was not successful!"
"Thank you for your purchase!","Thank you for your purchase!"
"Password", "Password"
"Something went wrong while saving the page. Please refresh the page and try again.","Something went wrong while saving the page. Please refresh the page and try again."
"Item in Cart","Item in Cart"
"Items in Cart","Items in Cart"
"Close","Close"
"Show Cross-sell Items in the Shopping Cart","Show Cross-sell Items in the Shopping Cart"
"You added %1 to your <a href=""%2"">shopping cart</a>.","You added %1 to your <a href=""%2"">shopping cart</a>."
"You added %1 to your <a href=""%2"">shopping cart</a>.","You added %1 to your <a href=""%2"">shopping cart</a>."
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<referenceBlock name="page.main.title">
<action method="setPageTitle">
<argument translate="true" name="title" xsi:type="string">We received your order!</argument>
<argument translate="true" name="title" xsi:type="string">The order was not successful!</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
<description>Assert category grid page basic columns values for default category</description>
</annotations>

<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.image('1','image')}}" stepKey="assertImageColumn"/>
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.path('1')}}" stepKey="assertPathColumn"/>
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.name('1', 'Default Category')}}" stepKey="assertNameColumn"/>
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.displayMode('1', 'PRODUCTS')}}" stepKey="assertDisplayModeColumn"/>
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.products('1', '0')}}" stepKey="assertProductsColumn"/>
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.inMenu('1', 'Yes')}}" stepKey="assertInMenuColumn"/>
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.enabled('1', 'Yes')}}" stepKey="assertEnabledColumn"/>
</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="AssertAdminMediaGalleryAssetFilterPlaceHolderActionGroup">
<annotations>
<description>Assert asset filter placeholder value</description>
</annotations>
<arguments>
<argument name="filterPlaceholder" type="string"/>
</arguments>

<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.activeFilterPlaceholder(filterPlaceholder)}}" stepKey="assertFilterPLaceHolder" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminMediaGalleryCatalogUiCategoryGridSection">
<element name="activeFilterPlaceholder" type="text" selector="//div[@class='admin__current-filters-list-wrap']//li//span[contains(text(), '{{filterPlaceholder}}')]" parameterized="true"/>
<element name="image" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Image')]/preceding-sibling::th) +1]//img[contains(@src, '{{imageName}}')]" parameterized="true"/>
<element name="path" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Path')]/preceding-sibling::th)]" parameterized="true"/>
<element name="name" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Name')]/preceding-sibling::th) +1 ]//*[text()='{{categoryName}}']" parameterized="true"/>
<element name="displayMode" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Display Mode')]/preceding-sibling::th) +1 ]//*[text()='{{productsText}}']" parameterized="true"/>
<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"/>
<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"/>
<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"/>
<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"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,20 @@
<actionGroup ref="AdminMediaGalleryAssertImageInGridActionGroup" stepKey="assertImageInGrid">
<argument name="title" value="ImageMetadata.title"/>
</actionGroup>

<wait time="10" stepKey="waitForBookmarkToSaveView"/>
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForGridReloaded"/>
<actionGroup ref="AdminAssertMediaGalleryFilterPlaceholderActionGroup" stepKey="assertFilterApplied">
<argument name="filterPlaceholder" value="$$product.name$$"/>
</actionGroup>

<actionGroup ref="AdminEnhancedMediaGalleryEnableMassActionModeActionGroup" stepKey="enableMassActionToDeleteImages"/>
<actionGroup ref="AdminEnhancedMediaGallerySelectImageForMassActionActionGroup" stepKey="selectFirstImageToDelete">
<argument name="imageName" value="{{ImageMetadata.title}}"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryClickDeleteImagesButtonActionGroup" stepKey="clikDeleteSelectedButton"/>
<actionGroup ref="AdminEnhancedMediaGalleryConfirmDeleteImagesActionGroup" stepKey="deleteImages"/>

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<actionGroup ref="AdminEnhancedMediaGalleryClickEntityUsedInActionGroup" stepKey="clickUsedInCategories">
<argument name="entityName" value="Categories"/>
</actionGroup>
<actionGroup ref="AssertAdminMediaGalleryAssetFilterPlaceHolderActionGroup" stepKey="assertFilterApplied">
<argument name="filterPlaceholder" value="{{UpdatedImageDetails.title}}"/>
</actionGroup>
<actionGroup ref="AdminMediaGalleryAssertCategoryNameInCategoryGridActionGroup" stepKey="assertCategoryInGrid">
<argument name="categoryName" value="$$category.name$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns;

use Magento\Ui\Component\Listing\Columns\Column;

/**
* Class InMenu column for Category grid
*/
class InMenu extends Column
{
/**
* Prepare data source.
*
* @param array $dataSource
* @return array
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
$fieldName = $this->getData('name');
foreach ($dataSource['data']['items'] as & $item) {
if (isset($item[$fieldName]) && $item[$fieldName] == 1) {
$item[$fieldName] = 'Yes';
} else {
$item[$fieldName] = 'No';
}
}
}

return $dataSource;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns;

use Magento\Ui\Component\Listing\Columns\Column;

/**
* Class IsActive column for Category grid
*/
class IsActive extends Column
{
/**
* Prepare data source.
*
* @param array $dataSource
* @return array
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
$fieldName = $this->getData('name');
foreach ($dataSource['data']['items'] as & $item) {
if (isset($item[$fieldName]) && $item[$fieldName] == 1) {
$item[$fieldName] = 'Yes';
} else {
$item[$fieldName] = 'No';
}
}
}

return $dataSource;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/
namespace Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns;

use Magento\Catalog\Helper\Image;
use Magento\Framework\DataObject;
use Magento\Catalog\Model\Category\Image;
use Magento\Catalog\Model\CategoryRepository;
use Magento\Framework\View\Asset\Repository as AssetRepository;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Store\Model\Store;
Expand All @@ -27,48 +28,87 @@ class Thumbnail extends Column
/**
* @var Image
*/
private $imageHelper;
private $categoryImage;

/**
* @var CategoryRepository
*/
private $categoryRepository;

/**
* @var AssetRepository
*/
private $assetRepository;

/**
* @var string[]
*/
private $defaultPlaceholder;

/**
* Thumbnail constructor.
* @param ContextInterface $context
* @param UiComponentFactory $uiComponentFactory
* @param StoreManagerInterface $storeManager
* @param Image $image
* @param Image $categoryImage
* @param CategoryRepository $categoryRepository
* @param AssetRepository $assetRepository
* @param array $defaultPlaceholder
* @param array $components
* @param array $data
*/
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
StoreManagerInterface $storeManager,
Image $image,
Image $categoryImage,
CategoryRepository $categoryRepository,
AssetRepository $assetRepository,
array $defaultPlaceholder = [],
array $components = [],
array $data = []
) {
parent::__construct($context, $uiComponentFactory, $components, $data);
$this->imageHelper = $image;
$this->storeManager = $storeManager;
$this->categoryImage = $categoryImage;
$this->categoryRepository = $categoryRepository;
$this->assetRepository = $assetRepository;
$this->defaultPlaceholder = $defaultPlaceholder;
}

/**
* Prepare Data Source
*
* @param array $dataSource
* @return array
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
$fieldName = $this->getData('name');
foreach ($dataSource['data']['items'] as & $item) {
if (isset($item[$fieldName])) {
$item[$fieldName . '_src'] = $this->getUrl($item[$fieldName]);
} else {
$category = new DataObject($item);
$imageHelper = $this->imageHelper->init($category, 'product_listing_thumbnail');
$item[$fieldName . '_src'] = $imageHelper->getUrl();
if (!isset($dataSource['data']['items'])) {
return $dataSource;
}

$fieldName = $this->getData('name');
foreach ($dataSource['data']['items'] as & $item) {
if (isset($item[$fieldName])) {
$item[$fieldName . '_src'] = $this->getUrl($item[$fieldName]);
continue;
}

if (isset($item['entity_id'])) {
$src = $this->categoryImage->getUrl(
$this->categoryRepository->get($item['entity_id'])
);

if (!empty($src)) {
$item[$fieldName . '_src'] = $src;
continue;
}
}

$item[$fieldName . '_src'] = $this->assetRepository->getUrl($this->defaultPlaceholder['image']);
}

return $dataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,54 +80,36 @@ public function prepare()
{
$options = [];
$productIds = [];
$bookmarks = $this->bookmarkManagement->loadByNamespace($this->context->getNameSpace())->getItems();
foreach ($bookmarks as $bookmark) {
if ($bookmark->getIdentifier() === 'current') {
$applied = $bookmark->getConfig()['current']['filters']['applied'];
if (isset($applied[$this->getName()])) {
$productIds = $applied[$this->getName()];
}
}
$bookmark = $this->bookmarkManagement->getByIdentifierNamespace(
'current',
$this->context->getNameSpace()
);
if ($bookmark === null) {
parent::prepare();
return;
}

foreach ($productIds as $id) {
$product = $this->productRepository->getById($id);
$options[] = [
'value' => $id,
'label' => $product->getName(),
'is_active' => $product->getStatus(),
'path' => $product->getSku(),
'optgroup' => false
$applied = $bookmark->getConfig()['current']['filters']['applied'];

];
if (isset($applied[$this->getName()])) {
$productIds = $applied[$this->getName()];
}

$this->wrappedComponent = $this->uiComponentFactory->create(
$this->getName(),
parent::COMPONENT,
[
'context' => $this->getContext(),
'options' => $options
]
);

$this->wrappedComponent->prepare();
$productsFilterJsConfig = array_replace_recursive(
$this->getJsConfig($this->wrappedComponent),
$this->getJsConfig($this)
);
$this->setData('js_config', $productsFilterJsConfig);

$this->setData(
'config',
array_replace_recursive(
(array)$this->wrappedComponent->getData('config'),
(array)$this->getData('config')
)
);

$this->applyFilter();

foreach ($productIds as $id) {
try {
$product = $this->productRepository->getById($id);
$options[] = [
'value' => $id,
'label' => $product->getName(),
'is_active' => $product->getStatus(),
'path' => $product->getSku(),
'optgroup' => false
];
} catch (\Exception $e) {
continue;
}
}
$this->optionsProvider = $options;
parent::prepare();
}
}
7 changes: 7 additions & 0 deletions app/code/Magento/MediaGalleryCatalogUi/etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@
</argument>
</arguments>
</type>
<type name="Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns\Thumbnail">
<arguments>
<argument name="defaultPlaceholder" xsi:type="array">
<item name="image" xsi:type="string">Magento_MediaGalleryCatalogUi::images/category/placeholder/image.jpg</item>
</argument>
</arguments>
</type>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@
<label translate="true">Products</label>
</settings>
</column>
<column name="include_in_menu" component="Magento_Ui/js/grid/columns/select">
<column name="include_in_menu" class="Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns\InMenu">
<settings>
<label translate="true">In Menu</label>
</settings>
</column>
<column name="is_active" component="Magento_Ui/js/grid/columns/select" >
<column name="is_active" class="Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns\IsActive">
<settings>
<label translate="true">Enabled</label>
</settings>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 18da36b

Please sign in to comment.