<?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">filoblu_indexer_listing.filoblu_indexer_listing_data_source</item>
            <item name="deps" xsi:type="string">filoblu_indexer_listing.filoblu_indexer_listing_data_source</item>
        </item>
        <item name="spinner" xsi:type="string">spinner_columns</item>
        <item name="buttons" xsi:type="array">
            <item name="connectors" xsi:type="string">FiloBlu\Refilo\Block\Adminhtml\Indexer\ConnectorsButton</item>
        </item>
    </argument>
    <dataSource name="filoblu_indexer_listing_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">FiloBlu\Refilo\Ui\Component\Indexer\Listing\DataProvider</argument>
            <argument name="name" xsi:type="string">filoblu_indexer_listing_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">id</argument>
            <argument name="requestFieldName" xsi:type="string">id</argument>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
                    <item name="update_url" xsi:type="url" path="mui/index/render"/>
                    <item name="storageConfig" xsi:type="array">
                        <item name="indexField" xsi:type="string">id</item>
                    </item>
                </item>
            </argument>
        </argument>
    </dataSource>
    <listingToolbar name="listing_top">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sticky" xsi:type="boolean">true</item>
            </item>
        </argument>
    </listingToolbar>
    <massaction name="listing_massaction" class="FiloBlu\Refilo\Ui\Component\Indexer\Listing\MassAction">
        <action name="enable">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">enable</item>
                    <item name="label" xsi:type="string" translate="true">Enable</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massStatus">
                        <param name="status">enable</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Enable</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to enable selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="disable">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">disable</item>
                    <item name="label" xsi:type="string" translate="true">Disable</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massStatus">
                        <param name="status">disable</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Disable</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to disable selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="allow_delete">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">allow_delete</item>
                    <item name="label" xsi:type="string" translate="true">Allow to delete</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massAllowDelete">
                        <param name="allow_delete">1</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Allow to delete</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to allow delete selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="disallow_delete">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">disallow_delete</item>
                    <item name="label" xsi:type="string" translate="true">Disallow to delete</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massAllowDelete">
                        <param name="allow_delete">0</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Disallow to delete</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to disallow delete selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="delete_order_before">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">delete_order_before</item>
                    <item name="label" xsi:type="string" translate="true">Delete before reindex</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massDeleteOrder">
                        <param name="delete_order">0</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Delete before reindex</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to disallow delete selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="delete_order_after">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">delete_order_after</item>
                    <item name="label" xsi:type="string" translate="true">Delete after reindex</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massDeleteOrder">
                        <param name="delete_order">1</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Delete after reindex</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to disallow delete selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="enable_memory_optimization">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">enable_memory_optimization</item>
                    <item name="label" xsi:type="string" translate="true">Enable Memory Optimization</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massEnableMemoryOptimization">
                        <param name="enable_memory_optimization">1</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Enable Memory Optimization</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to enable memory optimization for selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
        <action name="disable_memory_optimization">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">disable_memory_optimization</item>
                    <item name="label" xsi:type="string" translate="true">Disable Memory Optimization</item>
                    <item name="url" xsi:type="url" path="filoblu_refilo/indexer/massEnableMemoryOptimization">
                        <param name="enable_memory_optimization">0</param>
                    </item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Disable Memory Optimization</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to disable memory optimization for selected items?</item>
                    </item>
                </item>
            </argument>
        </action>
    </massaction>
    <columns name="spinner_columns">
        <selectionsColumn name="ids">
            <settings>
                <indexField>id</indexField>
            </settings>
        </selectionsColumn>
        <column name="id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">ID</item>
                </item>
            </argument>
        </column>
        <column name="indexer_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Indexer</item>
                </item>
            </argument>
        </column>
        <column name="enabled">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="label" xsi:type="string" translate="true">Enabled</item>
                </item>
            </argument>
        </column>
        <column name="allow_delete">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="label" xsi:type="string" translate="true">Allow delete</item>
                </item>
            </argument>
        </column>
        <column name="delete_order">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">FiloBlu\Refilo\Data\Remote\IndexerDeleteOrderOptions</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="label" xsi:type="string" translate="true">Delete order</item>
                </item>
            </argument>
        </column>
        <column name="index_name">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Remote Index</item>
                </item>
            </argument>
        </column>
        <column name="connector_configuration">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">FiloBlu\Refilo\Data\Remote\ConnectorConfigurationOptions</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="label" xsi:type="string" translate="true">Connector</item>
                </item>
            </argument>
        </column>
        <column name="enabled_memory_optimization">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="label" xsi:type="string" translate="true">Memory Usage Optimization</item>
                </item>
            </argument>
        </column>
        <actionsColumn name="actions" class="FiloBlu\Refilo\Ui\Component\Indexer\Listing\Column\Actions">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="resizeEnabled" xsi:type="boolean">false</item>
                    <item name="resizeDefaultWidth" xsi:type="string">107</item>
                    <item name="indexField" xsi:type="string">id</item>
                </item>
            </argument>
        </actionsColumn>
    </columns>
</listing>