Skip to content

Commit 1fcb11a

Browse files
author
Gabriel Galvao da Gama
committed
Added UI filter to media gallery
1 parent 15aa96f commit 1fcb11a

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MediaContentUi\Ui\Component\Listing\Filters\Options;
9+
10+
use Magento\Framework\Data\OptionSourceInterface;
11+
12+
/**
13+
* Status filter options
14+
*/
15+
class Status implements OptionSourceInterface
16+
{
17+
/**
18+
* @inheritdoc
19+
*/
20+
public function toOptionArray(): array
21+
{
22+
return [
23+
['value' => '1', 'label' => __('Enabled')],
24+
['value' => '0', 'label' => __('Disabled')]
25+
];
26+
}
27+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
10+
<listingToolbar name="listing_top">
11+
<filters name="listing_filters">
12+
<filterSelect name="content_status" provider="${ $.parentName }" sortOrder="10">
13+
<settings>
14+
<options class="Magento\MediaContentUi\Ui\Component\Listing\Filters\Options\Status"/>
15+
<label translate="true">Content Status</label>
16+
<caption>All</caption>
17+
<dataScope>content_status</dataScope>
18+
</settings>
19+
</filterSelect>
20+
</filters>
21+
</listingToolbar>
22+
</listing>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
10+
<listingToolbar name="listing_top">
11+
<filters name="listing_filters">
12+
<filterSelect name="content_status" provider="${ $.parentName }" sortOrder="10">
13+
<settings>
14+
<options class="Magento\MediaContentUi\Ui\Component\Listing\Filters\Options\Status"/>
15+
<label translate="true">Content Status</label>
16+
<caption>All</caption>
17+
<dataScope>content_status</dataScope>
18+
</settings>
19+
</filterSelect>
20+
</filters>
21+
</listingToolbar>
22+
</listing>

0 commit comments

Comments
 (0)