Skip to content

feat(EasyAdmin): Search in the choose media modal#128

Open
loic425 wants to merge 1 commit into
jolicode:mainfrom
loic425:feat/search-in-choose-media-modal
Open

feat(EasyAdmin): Search in the choose media modal#128
loic425 wants to merge 1 commit into
jolicode:mainfrom
loic425:feat/search-in-choose-media-modal

Conversation

@loic425
Copy link
Copy Markdown
Contributor

@loic425 loic425 commented May 21, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.search and media.search_label translations (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 thread src/Bridge/EasyAdmin/assets/js/components/mediaSelector.js Outdated
Comment thread src/Bridge/EasyAdmin/assets/js/components/mediaSelector.js Outdated
Comment thread src/Bridge/EasyAdmin/templates/list.html.twig Outdated
Comment thread src/Bridge/EasyAdmin/src/Controller/MediaAdminController.php Outdated
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;

@loic425 loic425 force-pushed the feat/search-in-choose-media-modal branch from 486daed to 8ec6f3f Compare May 28, 2026 15:21
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.

2 participants