Skip to content

fix: update uicore, replace and implement mui search input from uicore#867

Open
tomrndom wants to merge 3 commits intomasterfrom
fix/mui-search-input-uicore
Open

fix: update uicore, replace and implement mui search input from uicore#867
tomrndom wants to merge 3 commits intomasterfrom
fix/mui-search-input-uicore

Conversation

@tomrndom
Copy link
Copy Markdown

@tomrndom tomrndom commented Apr 9, 2026

ref: https://app.clickup.com/t/86b84rhkb

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • Chores

    • Updated React to v17 and the foundation UI library to v5.0.3.
  • Refactor

    • Replaced many local search inputs with a shared, standardized search component.
    • Search behavior simplified: searches are triggered directly from the standardized input (more consistent and immediate across the app).

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

Replaces a local SearchInput with openstack-uicore-foundation/lib/components/mui/search-input across the codebase, deletes the local src/components/mui/search-input.js, updates react/react-dom and openstack-uicore-foundation versions in package.json, and adjusts multiple pages to accept search term values directly instead of Enter-key event handling.

Changes

Cohort / File(s) Summary
Dependency Version Updates
package.json
Bump openstack-uicore-foundation to 5.0.3, react to ^17.0.0, and react-dom to ^17.0.0.
Deleted Local Component
src/components/mui/search-input.js
Removed the local SearchInput implementation (internal state, Enter-key submit, clear action).
Import Path Replacements
src/components/select-page-template-dialog/index.js, src/pages/.../page-templates/page-template-list-page.js, src/pages/.../sponsor-form-add-item-from-inventory-popup.js, src/pages/.../select-templates-dialog.js, src/pages/.../sponsor-forms-list-page/index.js, src/pages/.../cart-view.js, src/pages/.../select-form-dialog/index.js, src/pages/.../manage-items/*.js, src/pages/.../sponsor-forms-tab/index.js, src/pages/.../sponsor-pages-tab/index.js, src/pages/.../sponsor-purchases-tab/index.js, src/pages/.../sponsor-users-list-page/index.js, src/pages/.../sponsor-users-list-per-sponsor/index.js
Switched imports from the local components/mui/search-input to openstack-uicore-foundation/lib/components/mui/search-input without changing usage signatures.
Search UI Replacement & Handler Refactor
src/pages/sponsors-global/form-templates/add-form-template-item-popup.js, src/pages/sponsors-global/form-templates/form-template-from-duplicate-popup.js, src/pages/sponsors-global/form-templates/form-template-list-page.js, src/pages/sponsors-global/inventory/inventory-list-page.js, src/pages/sponsors/sponsor-list-page.js, src/pages/sponsors/sponsor-page/tabs/sponsor-badge-scans/index.js, src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js, src/pages/sponsors/sponsor-page/tabs/sponsor-pages-tab/components/add-sponsor-page-template-popup/index.js
Replaced TextField-based search and local searchTerm state/debouncing/Enter-key handlers with the external SearchInput. Search callbacks now receive the term value directly and call existing fetch functions.
Test Mock Path Update
src/pages/.../select-form-dialog/__tests__/select-form-dialog.test.js
Updated Jest mock target to openstack-uicore-foundation/lib/components/mui/search-input (mock behavior unchanged).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐰 I hopped from local code to shared delight,
I swapped the inputs and updated React tonight,
One file retired, imports now in line,
Searches now pass terms, neat and fine,
🍃✨ — a rabbit's tiny byte of rhyme.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: updating uicore dependencies and replacing the local SearchInput component with the one from uicore.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mui-search-input-uicore

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
package.json (1)

100-111: Sync the React typings with the runtime versions.

react and react-dom are bumped to 17.x here, but @types/react (line 50) and @types/react-dom (line 150) remain pinned to 16.x. For react@17 runtime, the type definitions should use @17.x to keep the type surface aligned with the shipped runtime. Either update both type packages to match the runtime version or remove them if they are no longer consumed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 100 - 111, The package.json lists react and
react-dom at ^17.0.0 but the type packages `@types/react` and `@types/react-dom` are
still at 16.x; update the type packages to match React 17 (e.g., set
`@types/react` and `@types/react-dom` to ^17.0.0) or remove them if types are not
consumed, and then run your package manager to reinstall; look for the
`@types/react` and `@types/react-dom` entries to update.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/select-page-template-dialog/index.js`:
- Line 20: The import path for SearchInput is invalid in
openstack-uicore-foundation@5.0.3; replace the external import with a supported
component or a local implementation: either import the package's public search
component (e.g., FreeTextSearch from the library's inputs export) and update all
uses of SearchInput in this file to the new component name, or create a local
SearchInput component and import it from a relative path (e.g., ./SearchInput)
and ensure the component API matches how this file uses SearchInput. Target the
import statement and all references to SearchInput in this module (the import
line and usages in SelectPageTemplateDialog) when applying the fix.

In `@src/pages/sponsors-global/form-templates/add-form-template-item-popup.js`:
- Around line 68-70: The search handler handleOnSearch currently calls
getInventoryItems(searchTerm, currentPage, perPage, order, orderDir) which can
return empty results if the user is on a later page; change the flow to reset
pagination to page 1 when a new search term is applied by setting the current
page state to 1 and calling getInventoryItems with page=1 (i.e., use 1 instead
of currentPage) so the search always starts from the first page; update any
related state setter (e.g., setCurrentPage) and ensure getInventoryItems uses
the provided page argument.

In `@src/pages/sponsors-global/form-templates/form-template-list-page.js`:
- Around line 105-113: handleSearch currently calls getFormTemplates with the
existing currentPage which can leave the user on a later page and hide new
search results; update handleSearch to pass DEFAULT_CURRENT_PAGE instead of
currentPage so new searches always start at the first page (modify the call in
handleSearch to use DEFAULT_CURRENT_PAGE, keeping other args: perPage, order,
orderDir, hideArchived).

In
`@src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js`:
- Around line 101-110: The search handler handleOnSearch should reset pagination
before fetching results to avoid requesting a non-existent page; update
handleOnSearch to set the current page to 1 (e.g., call setCurrentPage(1) or
pass 1 as the page arg) and then call getSponsorForms(searchTerm, 1, perPage,
order, orderDir, false, sponsorshipTypeIds) so new searches always start from
the first page.

---

Nitpick comments:
In `@package.json`:
- Around line 100-111: The package.json lists react and react-dom at ^17.0.0 but
the type packages `@types/react` and `@types/react-dom` are still at 16.x; update
the type packages to match React 17 (e.g., set `@types/react` and `@types/react-dom`
to ^17.0.0) or remove them if types are not consumed, and then run your package
manager to reinstall; look for the `@types/react` and `@types/react-dom` entries to
update.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d9398ba-c9bc-4d37-9ab5-b5c4ed62af81

📥 Commits

Reviewing files that changed from the base of the PR and between 033cf84 and 0693fb9.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (24)
  • package.json
  • src/components/mui/search-input.js
  • src/components/select-page-template-dialog/index.js
  • src/pages/sponsors-global/form-templates/add-form-template-item-popup.js
  • src/pages/sponsors-global/form-templates/form-template-from-duplicate-popup.js
  • src/pages/sponsors-global/form-templates/form-template-list-page.js
  • src/pages/sponsors-global/inventory/inventory-list-page.js
  • src/pages/sponsors-global/page-templates/page-template-list-page.js
  • src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-add-item-from-inventory-popup.js
  • src/pages/sponsors/sponsor-forms-list-page/components/global-template/select-templates-dialog.js
  • src/pages/sponsors/sponsor-forms-list-page/index.js
  • src/pages/sponsors/sponsor-list-page.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-badge-scans/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/cart-view.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/select-form-dialog/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/manage-items/sponsor-form-item-from-inventory.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/manage-items/sponsor-forms-manage-items.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-pages-tab/components/add-sponsor-page-template-popup/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-pages-tab/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-purchases-tab/index.js
  • src/pages/sponsors/sponsor-users-list-page/index.js
  • src/pages/sponsors/sponsor-users-list-per-sponsor/index.js
💤 Files with no reviewable changes (1)
  • src/components/mui/search-input.js

} from "@mui/material";
import CloseIcon from "@mui/icons-material/Close";
import SearchInput from "../mui/search-input";
import SearchInput from "openstack-uicore-foundation/lib/components/mui/search-input";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

python - <<'PY'
import io
import json
import tarfile
import urllib.parse
import urllib.request

name = "openstack-uicore-foundation"
version = "5.0.3"
encoded = urllib.parse.quote(name, safe="")
meta_url = f"https://registry.npmjs.org/{encoded}/{version}"

with urllib.request.urlopen(meta_url) as resp:
    meta = json.load(resp)

print("main:", meta.get("main"))
print("module:", meta.get("module"))
print("exports:", json.dumps(meta.get("exports"), indent=2, sort_keys=True))

with urllib.request.urlopen(meta["dist"]["tarball"]) as resp:
    blob = resp.read()

with tarfile.open(fileobj=io.BytesIO(blob), mode="r:gz") as tar:
    names = sorted(
        n for n in tar.getnames()
        if "search-input" in n.lower()
    )

print("\nPublished search-input paths:")
for name in names:
    print(name)

targets = {
    "package/lib/components/mui/search-input.js",
    "package/lib/components/mui/search-input/index.js",
}
print("\nTarget path published:", any(n in targets for n in names))
PY

Repository: fntechgit/summit-admin

Length of output: 2648


🌐 Web query:

openstack-uicore-foundation 5.0.3 SearchInput component public API documentation

💡 Result:

I couldn’t find any exported/public React component named SearchInput in openstack-uicore-foundation (including around the lib/components/inputs and lib/components listings I inspected). (app.unpkg.com)

What does exist in the public build is a search-related component named FreeTextSearch:

  • Built file: lib/components/free-text-search.js (app.unpkg.com)
  • You can browse other input components here: lib/components/inputs/ (app.unpkg.com)

Also, version 5.0.3 is present on UNPKG as a selectable/latest version for this package, so if you specifically need 5.0.3, you can switch the UNPKG version selector to 5.0.3 and then open the same paths (e.g., lib/components/free-text-search.js) to see the exact public API for that version. (app.unpkg.com)

Citations:


🏁 Script executed:

# Search for SearchInput imports across the codebase to understand the pattern
rg "SearchInput" --type js --type ts -B 2 -A 2 | head -100

Repository: fntechgit/summit-admin

Length of output: 9342


🏁 Script executed:

# Check package.json for the dependency
rg "openstack-uicore-foundation" --type json

Repository: fntechgit/summit-admin

Length of output: 122


🏁 Script executed:

# Search for local SearchInput components
fd -t f "search-input" src/components/

Repository: fntechgit/summit-admin

Length of output: 48


🏁 Script executed:

# Check if src/components/mui/search-input exists
ls -la src/components/mui/search-input* 2>/dev/null || echo "Not found in local structure"

Repository: fntechgit/summit-admin

Length of output: 94


🏁 Script executed:

# Search for all local SearchInput definitions or exports
ast-grep --pattern 'export.*SearchInput'

Repository: fntechgit/summit-admin

Length of output: 48


🏁 Script executed:

# Check package-lock.json or yarn.lock to see actual installed structure
ls -la | grep -E "package-lock|yarn.lock"

Repository: fntechgit/summit-admin

Length of output: 128


🏁 Script executed:

# Search git history for when SearchInput imports were added
git log --oneline --all -S "openstack-uicore-foundation/lib/components/mui/search-input" | head -20

Repository: fntechgit/summit-admin

Length of output: 152


🏁 Script executed:

# Check if maybe there's a dist or build output with this file
find . -path ./node_modules -prune -o -type f -name "*search-input*" -print 2>/dev/null | head -20

Repository: fntechgit/summit-admin

Length of output: 48


🏁 Script executed:

# Extract openstack-uicore-foundation entry from yarn.lock
rg -A 10 '"openstack-uicore-foundation@' yarn.lock | head -50

Repository: fntechgit/summit-admin

Length of output: 48


🏁 Script executed:

# Also check if there's a .d.ts or types definition that might export SearchInput
fd -t f "\.(d\.ts|ts)$" | xargs rg -l "SearchInput" 2>/dev/null | head -10

Repository: fntechgit/summit-admin

Length of output: 772


This import path does not exist in openstack-uicore-foundation@5.0.3.

Line 20 imports from openstack-uicore-foundation/lib/components/mui/search-input, but web search of the published v5.0.3 package shows no SearchInput component in the lib/components/mui/ directory. The package provides other components (e.g., FreeTextSearch, input components in lib/components/inputs/), but this specific path is not a documented or supported export. No local fallback component exists either. Either switch to a confirmed public export from the package, or if a SearchInput component is needed, create or import it from a local source.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/select-page-template-dialog/index.js` at line 20, The import
path for SearchInput is invalid in openstack-uicore-foundation@5.0.3; replace
the external import with a supported component or a local implementation: either
import the package's public search component (e.g., FreeTextSearch from the
library's inputs export) and update all uses of SearchInput in this file to the
new component name, or create a local SearchInput component and import it from a
relative path (e.g., ./SearchInput) and ensure the component API matches how
this file uses SearchInput. Target the import statement and all references to
SearchInput in this module (the import line and usages in
SelectPageTemplateDialog) when applying the fix.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js (1)

104-113: Keep page-size argument consistent in search fetch.

Line [108] uses perPage, while initial load/sort/pagination in this component all use FIVE_PER_PAGE. Using the same constant here avoids inconsistent result sizes from shared state leakage.

Suggested change
   const handleOnSearch = (searchTerm) => {
     getSponsorForms(
       searchTerm,
       DEFAULT_CURRENT_PAGE,
-      perPage,
+      FIVE_PER_PAGE,
       order,
       orderDir,
       false,
       sponsorshipTypeIds
     );
   };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js`
around lines 104 - 113, The search handler handleOnSearch currently calls
getSponsorForms with the variable perPage causing inconsistent page sizes;
change the page-size argument to the shared constant FIVE_PER_PAGE (i.e., call
getSponsorForms(searchTerm, DEFAULT_CURRENT_PAGE, FIVE_PER_PAGE, order,
orderDir, false, sponsorshipTypeIds)) so it matches initial load/sort/pagination
and avoid perPage/state leakage; also scan other calls to getSponsorForms in
this component to ensure they uniformly use FIVE_PER_PAGE.
🤖 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/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js`:
- Around line 104-113: The search handler handleOnSearch currently calls
getSponsorForms with the variable perPage causing inconsistent page sizes;
change the page-size argument to the shared constant FIVE_PER_PAGE (i.e., call
getSponsorForms(searchTerm, DEFAULT_CURRENT_PAGE, FIVE_PER_PAGE, order,
orderDir, false, sponsorshipTypeIds)) so it matches initial load/sort/pagination
and avoid perPage/state leakage; also scan other calls to getSponsorForms in
this component to ensure they uniformly use FIVE_PER_PAGE.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 565aa9ae-9bbe-4a37-b8c5-ba87c96fb342

📥 Commits

Reviewing files that changed from the base of the PR and between e88bf38 and 55325b0.

📒 Files selected for processing (3)
  • src/pages/sponsors-global/form-templates/add-form-template-item-popup.js
  • src/pages/sponsors-global/form-templates/form-template-list-page.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/components/add-sponsor-form-template-popup/index.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/sponsors-global/form-templates/form-template-list-page.js
  • src/pages/sponsors-global/form-templates/add-form-template-item-popup.js

@tomrndom tomrndom requested a review from smarcet April 9, 2026 13:12
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.

1 participant