Skip to content
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

Add fulltext/keyword search field for product admin grid #10089

Merged
merged 10 commits into from
Jul 20, 2017
Merged

Add fulltext/keyword search field for product admin grid #10089

merged 10 commits into from
Jul 20, 2017

Conversation

josefbehr
Copy link
Contributor

@josefbehr josefbehr commented Jun 28, 2017

Description

This adds a keyword search field (like on sales_order_grid) to catalog_product_grid (product_listing)

Manual testing scenarios

  1. Log into the backend
  2. Go to Catalog -> Products
  3. Notice the key word search field
  4. Enter arbitrary search terms occurring in product attributes
  5. Apply and filter grid to only show matching products

Fixes issues

  1. Quick Search feature in Admin is not working properly when choosing in Products #5785

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 on Travis CI are green)

@okorshenko okorshenko self-assigned this Jun 28, 2017
@okorshenko okorshenko added this to the June 2017 milestone Jun 28, 2017
variable $field is not needed, so warnings can be ignored
@okorshenko okorshenko modified the milestones: June 2017, July 2017 Jul 2, 2017
Copy link
Contributor

@maghamed maghamed left a comment

Choose a reason for hiding this comment

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

Grid Search is not a responsibility of CatalogSearch module, as CatalogSearch is responsible just for Front-End search.
Grid Search is the responsibility of Catalog module, so fix should be placed there

Thus, you can change directly product_listing.xml

@josefbehr
Copy link
Contributor Author

@maghamed
Can do, but what about the dependency on the Collection from CatalogSearch

@maghamed
Copy link
Contributor

maghamed commented Jul 6, 2017

@josefbehr I looked through the CatalogSearch code and found that there is already code responsible for Backend search

Magento\CatalogSearch\Model\Search\Catalog

so, let's leave your fix in CatalogSearch, because you right, for now, we have the dependency on this Collection

*
* @var SearchCollection
*/
protected $searchCollection;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use private instead of protected

/**
* {@inheritdoc}
*
* @SuppressWarnings("unused")
Copy link
Contributor

Choose a reason for hiding this comment

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

please change to UnusedFormalParam

@maghamed
Copy link
Contributor

maghamed commented Jul 7, 2017

BTW, could you please test that general Admin Search works correctly.
For now, in the upper right corner, we have a search box. When Admin starts typing there a search phrase - dropdown box appears which provides an ability to search in "Products", "Customers", "Orders", "Pages".

screen shot 2017-07-07 at 07 46 31

Search in Products doesn't work because for now there is no Search on Product grid.
Let's check that searching from the Admin Search will make a correct redirect to the Product grid with applying Search phrase as a filter.

screen shot 2017-07-07 at 07 47 15

@maghamed maghamed self-assigned this Jul 7, 2017
@josefbehr
Copy link
Contributor Author

@maghamed
Admin Search does (still) not appear to be working for Products. But neither does it so for Orders. What would I have to change to make it workable?

@maghamed
Copy link
Contributor

maghamed commented Jul 10, 2017

hey @josefbehr. For me search for Orders works as expected
http://b2b.dev.magento.com/builds/20170616035016/backend/sales/order/index/?search=Katia

I thought that Search for Products will work after your changes. If not, need to double check that.

All that global search does is redirects on Order/Customer/Page/Product grid with ?search GET parameter and whether Grid supports search - it applies the filter.

@ishakhsuvarov ishakhsuvarov dismissed maghamed’s stale review July 20, 2017 10:22

Fixes applied according to review

 - Declared introduced dependency on the module Ui
@Ctucker9233
Copy link

@magento-team Can this be backported to 2.2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants