Skip to content

Implemented UrlFilterApplier component #28932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gabrieldagama
Copy link
Contributor

@gabrieldagama gabrieldagama commented Jun 30, 2020

Description (*)

Implemented a new component to apply filters on a grid via GET URL parameter. Added the component to the product, cms_page, and cms_block grids.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Add ability to set the filters on UI grid via GET parameters of request adobe-stock-integration#1501

Manual testing scenarios (*)

  1. Open one of the grids mentioned above
  2. Add the filters parameter to the URL, example for product: ?filters[name]=product123
  3. The grid should be loaded with a name active filter with value = product123

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jun 30, 2020

Hi @gabrieldagama. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

@gabrieldagama
Copy link
Contributor Author

@magento run all tests

@gabrieldagama gabrieldagama marked this pull request as draft June 30, 2020 15:48
@gabrieldagama gabrieldagama changed the title Implemented UrlFilterApplier component [WIP] Implemented UrlFilterApplier component Jun 30, 2020
@gabrieldagama gabrieldagama marked this pull request as ready for review July 1, 2020 16:25
@gabrieldagama gabrieldagama changed the title [WIP] Implemented UrlFilterApplier component Implemented UrlFilterApplier component Jul 1, 2020
@gabrieldagama
Copy link
Contributor Author

@magento run all tests

@gabrieldagama
Copy link
Contributor Author

@magento run all tests

@gabrieldagama
Copy link
Contributor Author

@magento run all tests

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution @gabrieldagama ! Thanks for the double test coverage! Please take a look at my comments

<title value="Verify that filter is applied on product grid when filters parameter is set on url"/>
<description value="Accessing product grid url with filters parameter"/>
<severity value="MAJOR"/>
<testCaseId value="to-be-added"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case id needs to be added

<see selector="{{AdminProductGridSection.productGridNameProduct($$createSimpleProduct.name$$)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeProduct"/>
<seeElement selector="{{AdminProductGridFilterSection.enabledFilters}}" stepKey="seeEnabledFilters"/>
<see selector="{{AdminProductGridFilterSection.enabledFilters}}" userInput="Name: $$createSimpleProduct.name$$" stepKey="seeProductNameFilter"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this action group to after section

<title value="Verify that filter is applied on block grid when filters parameter is set on url"/>
<description value="Accessing block grid url with filters parameter"/>
<severity value="MAJOR"/>
<testCaseId value="to-be-added"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case need to be added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @chalov-anton can you provide the test cases for this issue?

<see selector="{{CmsPagesPageActionsSection.pagesGridRowByTitle($$createPage.title$$)}}" userInput="$$createPage.title$$" stepKey="seePage"/>
<seeElement selector="{{CmsPagesPageActionsSection.activeFilter}}" stepKey="seeEnabledFilters"/>
<see selector="{{CmsPagesPageActionsSection.activeFilter}}" userInput="Title: $$createPage.title$$" stepKey="seePageTitleFilter"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this action group to after section


return Component.extend({
defaults: {
filterProvider: 'componentType = filters',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how this component is behaving on a page with multiple grids?
I.e. media gallery + adobe stock

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will have a look on this, probably will have to introduce a parameter to handle the component namespace.

<title value="Verify that filter is applied on page grid when filters parameter is set on url"/>
<description value="Accessing page grid url with filters parameter"/>
<severity value="MAJOR"/>
<testCaseId value="to-be-added"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case needs to be added

@gabrieldagama
Copy link
Contributor Author

@magento run all tests

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-7778 has been created to process this Pull Request
✳️ @sivaschenko, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@chalov-anton chalov-anton self-assigned this Jul 3, 2020
@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

Manual scenario on Cucumber Studio - https://studio.cucumber.io/projects/131313/test-plan/folders/1320712/scenarios/4931106

@engcom-Bravo engcom-Bravo added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Jul 3, 2020
@engcom-Charlie engcom-Charlie self-assigned this Jul 3, 2020
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie engcom-Charlie added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jul 6, 2020
@sivaschenko sivaschenko added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Jul 6, 2020
@lenaorobei lenaorobei added this to the 2.4.1 milestone Jul 6, 2020
@@ -9,6 +9,7 @@
<body>
<referenceContainer name="content">
<uiComponent name="cms_block_listing"/>
<block class="Magento\Backend\Block\Template" template="Magento_Cms::url_filter_applier.phtml" />
Copy link
Contributor

@konarshankar07 konarshankar07 Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add Urlfilter component in ui_component instead of creating a new block. Please check the similar implementation
https://github.com/magento/adobe-stock-integration/blob/f8f7257d30bf54646536491ad5366ae082c13570/AdobeStockImageAdminUi/view/adminhtml/ui_component/adobe_stock_images_listing.xml#L55-L70
Let me know your thoughts
Thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@konarshankar07 I think both approaches are fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sivaschenko ... Yes, you are right but my concerns is the namespace are hard coded in the url_filter_applier.phtml file which can be easily exported using ui_component.

@m2-assistant
Copy link

m2-assistant bot commented Jul 16, 2020

Hi @gabrieldagama, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Catalog Component: Cms Component: Ui Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add ability to set the filters on UI grid via GET parameters of request
8 participants