From d9bdbd8e18852bdeec2cc571b830f39e4249d946 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Mon, 18 May 2026 00:06:02 -0400 Subject: [PATCH] feat(portal): reusable list-search JS + fp_portal_list_controls macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the shared infrastructure for real-time multi-keyword search on portal list pages: - static/src/js/fp_portal_list_search.js — vanilla-JS IIFE that wires every input.o_fp_list_search to the container at the selector in its data-fp-target. On every keystroke, walks the container's direct children and toggles display: none based on whether each row's textContent contains all whitespace-tokenised keywords. Also wires .o_fp_sort_select dropdowns on every page EXCEPT Account Summary (scoped by .o_fp_account_summary closest-ancestor check) so the existing fp_portal_account_summary.js handler isn't doubled up. - views/fp_portal_macros.xml — new t-call macro fusion_plating_portal.fp_portal_list_controls that renders the filter pills + search input + sort dropdown strip in one block. Callers pass filters, sorts, active_filter, active_sort, search, url, extra_qs, target, result_total, clipped via t-set. - __manifest__.py — registers the new JS in web.assets_frontend (after fp_portal_account_summary.js). Version bumps 19.0.4.0.0 -> 19.0.4.1.0. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../fusion_plating_portal/__manifest__.py | 3 +- .../static/src/js/fp_portal_list_search.js | 92 +++++++++++++++++++ .../views/fp_portal_macros.xml | 55 +++++++++++ 3 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 fusion_plating/fusion_plating_portal/static/src/js/fp_portal_list_search.js diff --git a/fusion_plating/fusion_plating_portal/__manifest__.py b/fusion_plating/fusion_plating_portal/__manifest__.py index 95972936..f36cbc15 100644 --- a/fusion_plating/fusion_plating_portal/__manifest__.py +++ b/fusion_plating/fusion_plating_portal/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating — Customer Portal', - 'version': '19.0.4.0.0', + 'version': '19.0.4.1.0', 'category': 'Manufacturing/Plating', 'summary': 'Customer-facing portal for plating shops: online RFQ, job status, ' 'CoC downloads, invoice access.', @@ -84,6 +84,7 @@ Copyright (c) 2026 Nexa Systems Inc. All rights reserved. 'fusion_plating_portal/static/src/js/fp_rfq_form.js', 'fusion_plating_portal/static/src/js/fp_portal_sidebar.js', # NEW — Task 5 'fusion_plating_portal/static/src/js/fp_portal_account_summary.js', # NEW — Task 10 fix + 'fusion_plating_portal/static/src/js/fp_portal_list_search.js', # list search + sort ], }, 'demo': [ diff --git a/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_list_search.js b/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_list_search.js new file mode 100644 index 00000000..87c66eee --- /dev/null +++ b/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_list_search.js @@ -0,0 +1,92 @@ +/** + * Fusion Plating — portal list search + filter UI helper. + * + * Provides client-side, real-time multi-keyword filtering for any portal + * list page that opts in via the markup contract below. Pure vanilla JS, + * no framework, no debounce (client-side filter is <1ms even on 500 rows). + * + * Markup contract: + * - One + * - One container matching with attribute data-fp-filterable + * whose direct children are the filterable rows (e.g. in a tbody, + * or
children of #fp_jobs_list). + * - Optional: updates with N visible + * of M total when a filter is active. Empty (no text) when search is empty. + * + * Each row's textContent is matched against the user's keywords using a + * lowercase AND across whitespace-split tokens. Extra non-visible search + * terms can be added per row as . + * + * Sort dropdown: any