Skip to content

Commit

Permalink
Display the "status" column in the subscription grid as select instea…
Browse files Browse the repository at this point in the history
…d of text (#17)
  • Loading branch information
avstudnitz authored Jan 10, 2024
1 parent a6c8fc4 commit 1fa940a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Model/Source/Status.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);

namespace MageOS\AsyncEvents\Model\Source;

use Magento\Framework\Data\OptionSourceInterface;

class Status implements OptionSourceInterface
{
public function toOptionArray()
{
return [
['value' => 0, 'label' => __('Disabled')],
['value' => 1, 'label' => __('Enabled')],
];
}
}
12 changes: 12 additions & 0 deletions view/adminhtml/ui_component/async_events_events_listing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@
<label translate="true">Status</label>
</settings>
</column>
<column name="status" component="Magento_Ui/js/grid/columns/select">
<settings>
<options class="MageOS\AsyncEvents\Model\Source\Status"/>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Status</label>
</settings>
</column>

<column name="subscribed_at" class="Magento\Ui\Component\Listing\Columns\Date"
component="Magento_Ui/js/grid/columns/date">
<settings>
Expand Down

0 comments on commit 1fa940a

Please sign in to comment.