Skip to content

Commit 10006e0

Browse files
committed
Move Source filter to MediaGalleryUi module
1 parent d76acc2 commit 10006e0

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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\MediaGalleryUi\Ui\Component\Listing\Columns\Source;
9+
10+
use Magento\Framework\Data\OptionSourceInterface;
11+
12+
/**
13+
* Image source filter options
14+
*/
15+
class Options implements OptionSourceInterface
16+
{
17+
/**
18+
* @inheritdoc
19+
*/
20+
public function toOptionArray(): array
21+
{
22+
return [
23+
[
24+
'value' => 'Local',
25+
'label' => __('Uploaded Locally'),
26+
],
27+
];
28+
}
29+
}

app/code/Magento/MediaGalleryUi/view/adminhtml/ui_component/media_gallery_listing.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@
122122
<dataScope>entity_type</dataScope>
123123
</settings>
124124
</filterSelect>
125+
<filterSelect name="source" provider="${ $.parentName }" sortOrder="60">
126+
<settings>
127+
<caption translate="true">All</caption>
128+
<options class="Magento\MediaGalleryUi\Ui\Component\Listing\Columns\Source\Options"/>
129+
<label translate="true">Source</label>
130+
<dataScope>source</dataScope>
131+
</settings>
132+
</filterSelect>
125133
<filterSelect name="content_status" provider="${ $.parentName }" sortOrder="220">
126134
<settings>
127135
<options class="Magento\MediaGalleryUi\Ui\Component\Listing\Filters\Options\Status"/>

app/code/Magento/MediaGalleryUi/view/adminhtml/ui_component/standalone_media_gallery_listing.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@
109109
<dataScope>entity_type</dataScope>
110110
</settings>
111111
</filterSelect>
112+
<filterSelect name="source" provider="${ $.parentName }" sortOrder="60">
113+
<settings>
114+
<caption translate="true">All</caption>
115+
<options class="Magento\MediaGalleryUi\Ui\Component\Listing\Columns\Source\Options"/>
116+
<label translate="true">Source</label>
117+
<dataScope>source</dataScope>
118+
</settings>
119+
</filterSelect>
112120
<filterSelect name="content_status" provider="${ $.parentName }" sortOrder="220">
113121
<settings>
114122
<options class="Magento\MediaGalleryUi\Ui\Component\Listing\Filters\Options\Status"/>

0 commit comments

Comments
 (0)