Skip to content

#1456 - Removed SelectModifierInterface and added CollectionProcessor #1473

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

Merged

Conversation

gabrieldagama
Copy link
Contributor

Description (*)

Removed SelectModifierInterface and added CollectionProcessor to the MediaGalleryUi DataProvider.

Fixed Issues (if relevant)

  1. Fixes Update media gallery data provider to utilize collection processor and migrate current filters/joins #1456: Update media gallery data provider to utilize collection processor and migrate current filters/joins

Manual testing scenarios (*)

  1. Go to Content -> Media Gallery
  2. Test filters, pagination and sorting.

@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.

Thanks for the PR @gabrieldagama , please see my review comments

@@ -33,11 +33,11 @@
</argument>
</arguments>
</type>
<type name="Magento\MediaGalleryUi\Model\SelectModifierComposite">
<virtualType name="Magento\MediaGalleryUi\Model\Api\SearchCriteria\CollectionProcessor\JoinProcessor" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor\JoinProcessor">
Copy link
Member

Choose a reason for hiding this comment

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

This virtual type is already declared in MediaGalleryUi module, so I think there is no need to specify the type

Suggested change
<virtualType name="Magento\MediaGalleryUi\Model\Api\SearchCriteria\CollectionProcessor\JoinProcessor" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor\JoinProcessor">
<virtualType name="Magento\MediaGalleryUi\Model\Api\SearchCriteria\CollectionProcessor\JoinProcessor">

@@ -73,7 +83,6 @@ public function getData(): array
try {
/** @var SearchResult $searchResult */
$searchResult = $this->getSearchResult();
$this->selectModifier->apply($searchResult->getSelect(), $this->getSearchCriteria());

return $this->searchResultToOutput($searchResult);
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary variable can be eliminated

Suggested change
return $this->searchResultToOutput($searchResult);
return $this->searchResultToOutput($this->getSearchResult());

'keywords_table.keyword_id = asset_keywords_table.id',
['asset_id']
),
->joinInner(
Copy link
Member

Choose a reason for hiding this comment

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

let's keep the consistent formatting in this method (let's move ) to the next line)

@gabrieldagama
Copy link
Contributor Author

@magento run all tests

@sivaschenko
Copy link
Member

@magento run all tests

@chalov-anton
Copy link
Contributor

✔️ QA Passed

Rechecked the:

  • filters
  • sorting
  • pagination

@ghost
Copy link

ghost commented Jun 17, 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update media gallery data provider to utilize collection processor and migrate current filters/joins
3 participants