fix: add input search field on show pages list page#858
fix: add input search field on show pages list page#858
Conversation
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
📝 WalkthroughWalkthroughA search input field has been added to the show pages list interface, enabling users to filter results by a search term while maintaining existing pagination and filter parameters. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/pages/sponsors/show-pages-list-page/index.js (1)
119-124: Consider preserving search context after save.After a page is saved,
getShowPages()is called without parameters, which resets the search term. If users search, edit a page, and save, they'll lose their search filter. Consider passing the current search state:♻️ Suggested improvement
const handleSaveShowPage = (entity) => { saveShowPage(entity).then(() => { setOpenPopup(null); - getShowPages(); + getShowPages(term, currentPage, perPage, order, orderDir, hideArchived); }); };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/sponsors/show-pages-list-page/index.js` around lines 119 - 124, handleSaveShowPage currently calls saveShowPage(entity) and then getShowPages() which clears the user's active search; preserve the current search/filter by passing the existing search state into getShowPages after saving. Modify handleSaveShowPage to read the current searchTerm (or filters/pagination state used by getShowPages) and call getShowPages(searchTermOrFilters) instead of bare getShowPages(), keeping the setOpenPopup(null) behavior and ensuring getShowPages accepts and applies the passed search context (update getShowPages signature if needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/pages/sponsors/show-pages-list-page/index.js`:
- Around line 119-124: handleSaveShowPage currently calls saveShowPage(entity)
and then getShowPages() which clears the user's active search; preserve the
current search/filter by passing the existing search state into getShowPages
after saving. Modify handleSaveShowPage to read the current searchTerm (or
filters/pagination state used by getShowPages) and call
getShowPages(searchTermOrFilters) instead of bare getShowPages(), keeping the
setOpenPopup(null) behavior and ensuring getShowPages accepts and applies the
passed search context (update getShowPages signature if needed).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9d81b39e-b715-4abd-a697-5ee6e7bb0c18
📒 Files selected for processing (1)
src/pages/sponsors/show-pages-list-page/index.js
ref: https://app.clickup.com/t/86b96pbpc
Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com
Summary by CodeRabbit
Release Notes