Skip to content

Commit c77d812

Browse files
author
Gabriel Galvao da Gama
committed
Implemented suggestions and fixed tests
1 parent 96e6752 commit c77d812

File tree

8 files changed

+22
-8
lines changed

8 files changed

+22
-8
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridUrlFilterApplierTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<createData entity="simpleProductWithShortNameAndSku" stepKey="createSimpleProduct"/>
2424
</before>
2525
<after>
26+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
2627
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
2728
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
2829
</after>
@@ -31,6 +32,5 @@
3132
<see selector="{{AdminProductGridSection.productGridNameProduct($$createSimpleProduct.name$$)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeProduct"/>
3233
<seeElement selector="{{AdminProductGridFilterSection.enabledFilters}}" stepKey="seeEnabledFilters"/>
3334
<see selector="{{AdminProductGridFilterSection.enabledFilters}}" userInput="Name: $$createSimpleProduct.name$$" stepKey="seeProductNameFilter"/>
34-
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
3535
</test>
3636
</tests>

app/code/Magento/Catalog/view/adminhtml/templates/product/grid/url_filter_applier.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<script type="text/x-magento-init">
1010
{
1111
"*": {
12-
"Magento_Ui/js/grid/url-filter-applier": {}
12+
"Magento_Ui/js/grid/url-filter-applier": {
13+
"listingNamespace": "product_listing"
14+
}
1315
}
1416
}
1517
</script>

app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<createData entity="Sales25offBlock" stepKey="createBlock"/>
2424
</before>
2525
<after>
26+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
2627
<deleteData createDataKey="createBlock" stepKey="deletePage"/>
2728
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
2829
</after>
@@ -31,6 +32,5 @@
3132
<see selector="{{BlockPageActionsSection.blockGridRowByTitle($$createBlock.title$$)}}" userInput="$$createBlock.title$$" stepKey="seeBlock"/>
3233
<seeElement selector="{{BlockPageActionsSection.activeFilterDiv}}" stepKey="seeEnabledFilters"/>
3334
<see selector="{{BlockPageActionsSection.activeFilterDiv}}" userInput="Title: $$createBlock.title$$" stepKey="seeBlockTitleFilter"/>
34-
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
3535
</test>
3636
</tests>

app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageGridUrlFilterApplierTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<createData entity="_defaultCmsPage" stepKey="createPage"/>
2424
</before>
2525
<after>
26+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
2627
<deleteData createDataKey="createPage" stepKey="deletePage"/>
2728
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
2829
</after>
@@ -31,6 +32,5 @@
3132
<see selector="{{CmsPagesPageActionsSection.pagesGridRowByTitle($$createPage.title$$)}}" userInput="$$createPage.title$$" stepKey="seePage"/>
3233
<seeElement selector="{{CmsPagesPageActionsSection.activeFilter}}" stepKey="seeEnabledFilters"/>
3334
<see selector="{{CmsPagesPageActionsSection.activeFilter}}" userInput="Title: $$createPage.title$$" stepKey="seePageTitleFilter"/>
34-
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
3535
</test>
3636
</tests>

app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
<body>
1010
<referenceContainer name="content">
1111
<uiComponent name="cms_block_listing"/>
12-
<block class="Magento\Backend\Block\Template" template="Magento_Cms::url_filter_applier.phtml" name="block_list_url_filter_applier" />
12+
<block class="Magento\Backend\Block\Template" template="Magento_Cms::url_filter_applier.phtml" name="block_list_url_filter_applier">
13+
<arguments>
14+
<argument name="listing_namespace" xsi:type="string">cms_block_listing</argument>
15+
</arguments>
16+
</block>
1317
</referenceContainer>
1418
<referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way -->
1519
</body>

app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
<body>
1111
<referenceContainer name="content">
1212
<uiComponent name="cms_page_listing"/>
13-
<block class="Magento\Backend\Block\Template" template="Magento_Cms::url_filter_applier.phtml" name="page_list_url_filter_applier" />
13+
<block class="Magento\Backend\Block\Template" template="Magento_Cms::url_filter_applier.phtml" name="page_list_url_filter_applier">
14+
<arguments>
15+
<argument name="listing_namespace" xsi:type="string">cms_page_listing</argument>
16+
</arguments>
17+
</block>
1418
</referenceContainer>
1519
</body>
1620
</page>

app/code/Magento/Cms/view/adminhtml/templates/url_filter_applier.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<script type="text/x-magento-init">
1010
{
1111
"*": {
12-
"Magento_Ui/js/grid/url-filter-applier": {}
12+
"Magento_Ui/js/grid/url-filter-applier": {
13+
"listingNamespace": "<?php echo $block->getListingNamespace() ?>"
14+
}
1315
}
1416
}
1517
</script>

app/code/Magento/Ui/view/base/web/js/grid/url-filter-applier.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ define([
1111

1212
return Component.extend({
1313
defaults: {
14-
filterProvider: 'componentType = filters',
14+
listingNamespace: null,
15+
filterProvider: 'componentType = filters, ns = ${ $.listingNamespace }',
1516
filterKey: 'filters',
1617
searchString: location.search,
1718
modules: {
@@ -44,6 +45,7 @@ define([
4445

4546
return;
4647
}
48+
4749
if (Object.keys(urlFilter).length) {
4850
this.filterComponent().setData(urlFilter, false);
4951
this.filterComponent().apply();

0 commit comments

Comments
 (0)