-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Merge Pull Request #29494 from joweecaquicla/magento2:1748-some-category-grid-columns-are-empty - Merged commits: 1. 7ae8c6e 2. ded3e1e
- Loading branch information
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
app/code/Magento/MediaGalleryCatalogUi/Ui/Component/Listing/Columns/InMenu.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/code/Magento/MediaGalleryCatalogUi/Ui/Component/Listing/Columns/IsActive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters