<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">dotdigitalgroup_rules_grid.rules_report_grid_data_source</item>
        </item>
    </argument>
    <settings>
        <buttons>
            <button name="add">
                <url path="*/*/new"/>
                <class>primary</class>
                <label translate="true">Add New Rule</label>
                <aclResource>Dotdigitalgroup_Email::exclusion_rules</aclResource>
            </button>
        </buttons>
        <spinner>dotdigitalgroup_rules_columns</spinner>
        <deps>
            <dep>dotdigitalgroup_rules_grid.rules_report_grid_data_source</dep>
        </deps>
    </settings>
    <dataSource name="rules_report_grid_data_source" component="Magento_Ui/js/grid/provider">
        <settings>
            <storageConfig>
                <param name="indexField" xsi:type="string">id</param>
            </storageConfig>
            <updateUrl path="mui/index/render"/>
        </settings>
        <aclResource>Dotdigitalgroup_Email::exclusion_rules</aclResource>
        <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="rules_report_grid_data_source">
            <settings>
                <requestFieldName>id</requestFieldName>
                <primaryFieldName>id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>
    <listingToolbar name="listing_top">
        <bookmark name="bookmarks"/>
        <columnsControls name="columns_controls"/>
        <filters name="listing_filters"/>
        <exportButton name="export_button"/>
        <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
            <action name="delete">
                <settings>
                    <url path="*/*/massDelete"/>
                    <type>delete</type>
                    <label translate="true">Delete</label>
                    <confirm>
                        <title translate="true">Delete items</title>
                        <message translate="true">Are you sure?</message>
                    </confirm>
                </settings>
            </action>
        </massaction>
        <paging name="listing_paging"/>
    </listingToolbar>
    <columns name="dotdigitalgroup_rules_columns">
        <!--The list of columns-->
        <selectionsColumn name="ids" sortOrder="0">
            <settings>
                <indexField>id</indexField>
            </settings>
        </selectionsColumn>
        <column name="id" sortOrder="10">
            <settings>
                <filter>text</filter>
                <label translate="true">Id</label>
            </settings>
        </column>
        <column name="name" sortOrder="20">
            <settings>
                <filter>text</filter>
                <label translate="true">Rule Name</label>
            </settings>
        </column>
        <column name="type" component="Magento_Ui/js/grid/columns/select" sortOrder="30">
            <settings>
                <options class="Dotdigitalgroup\Email\Model\Adminhtml\Source\Rules\ConditionType"/>
                <filter>select</filter>
                <dataType>select</dataType>
                <label translate="true">Rule Type</label>
            </settings>
        </column>
        <column name="status" component="Magento_Ui/js/grid/columns/select" sortOrder="40">
            <settings>
                <options class="Dotdigitalgroup\Email\Model\Adminhtml\Source\Rules\Status"/>
                <filter>select</filter>
                <dataType>select</dataType>
                <label translate="true">Rule Status</label>
            </settings>
        </column>
        <column name="website_ids" component="Magento_Ui/js/grid/columns/select" sortOrder="50">
            <settings>
                <options class="Magento\Store\Model\ResourceModel\Website\Collection"/>
                <filter>select</filter>
                <dataType>select</dataType>
                <label translate="true">Website</label>
            </settings>
        </column>
        <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="60">
            <settings>
                <filter>dateRange</filter>
                <label translate="true">Created At</label>
            </settings>
        </column>
        <column name="updated_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="70">
            <settings>
                <filter>dateRange</filter>
                <label translate="true">Updated At</label>
            </settings>
        </column>
        <actionsColumn name="actions" class="Dotdigitalgroup\Email\Block\Adminhtml\Rules\Listing\Actions" sortOrder="80">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="editUrlPath" xsi:type="string">dotdigitalgroup_email/rules/edit</item>
                </item>
            </argument>
            <settings>
                <indexField>id</indexField>
            </settings>
        </actionsColumn>
    </columns>
</listing>
