feat(EasyAdmin): Search in the choose media modal#128
Open
loic425 wants to merge 1 commit into
Open
Conversation
This was referenced May 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a search capability to the EasyAdmin “choose media” modal by introducing a search UI, wiring a search query parameter through the EasyAdmin media listing endpoint, and updating the modal JS to fetch filtered results.
Changes:
- Add
action.searchandmedia.search_labeltranslations (EN/FR). - Render a search form in the EasyAdmin media list template when used in the “choose” modal and pass the current search value from the controller.
- Implement server-side filtering/recursive listing when
?search=...is provided, and update the JS modal loader to include the search query in AJAX navigation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Bridge/EasyAdmin/translations/JoliMediaEasyAdminBundle.fr.yaml | Adds French labels for the search UI. |
| src/Bridge/EasyAdmin/translations/JoliMediaEasyAdminBundle.en.yaml | Adds English labels for the search UI. |
| src/Bridge/EasyAdmin/templates/list.html.twig | Adds the search form to the choose-modal listing view. |
| src/Bridge/EasyAdmin/src/Controller/MediaAdminController.php | Reads search query param and applies recursive filtering for directories/medias. |
| src/Bridge/EasyAdmin/assets/js/components/mediaSelector.js | Adds modal search handling and URL manipulation for AJAX navigation. |
| src/Bridge/EasyAdmin/public/manifest.json | Updates built asset reference to new JS filename. |
| src/Bridge/EasyAdmin/public/entrypoints.json | Updates built asset reference to new JS filename. |
| src/Bridge/EasyAdmin/public/joli-media-easy-admin.51f41996.js | Updated compiled JS bundle containing the new modal search logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
321
to
325
| $paginatedMedias = $this->getOriginalStorage()->listMediasPaginated( | ||
| $currentKey, | ||
| recursive: false, | ||
| recursive: $hasSearch, | ||
| page: $request->query->getInt('page', 1), | ||
| perPage: $this->config->getPaginationSize(), |
Comment on lines
+273
to
+275
| $searchValue = $request->query->getString('search', ''); | ||
| $hasSearch = '' !== $searchValue; | ||
|
|
486daed to
8ec6f3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.