Suppliers Search & Display Modes
Suppliers has two user-facing ways to find suppliers:
- a type-ahead search dropdown (focus on a single supplier)
- an explicit “show all suppliers” toggle (browse the paginated list)
These are designed to avoid rendering a large table by default.
Search dropdown behavior
Component: SuppliersSearchPanel
- The input hints
min 2 chars. - Results render in an overlay dropdown only when:
- there are results, and
- no supplier is currently selected
(
selectedSupplieris null)
Selecting a supplier from the dropdown: - sets
selectedSearchResult - sets selectedId
(enables edit/delete buttons) - resets pagination to page 0 -
updates searchQuery to the supplier name
Clearing the selection: - clears
selectedSearchResult - clears
selectedId - clears searchQuery
Display mode selection (what the table shows)
SuppliersBoard computes table rows using:
hasSelectedFromSearch = selectedSearchResult !== null
Then:
- If
hasSelectedFromSearch:displayRowsis[selectedSearchResult]displayRowCountis1
- Else if
showAllSuppliers:displayRowsisdata.suppliersdisplayRowCountisdata.total
- Else:
- the table is hidden and an empty placeholder is shown
This design keeps the default page lightweight (no automatic paginated fetch needed to show the table).
Interaction between search and “show all”
Search selection takes precedence: once a supplier is
selected from search, the board shows the single-row mode
regardless of showAllSuppliers.