Implement exhibitor search constraints and sync telemetry

- Restricted public exhibitor search to Priority (paid) items only.
- Enforced 3-character search minimum for non-trusted users on landing page.
- Implemented real-time sync telemetry (last refresh and countdown) in Manage tab.
- Added auto-refresh logic with configurable intervals.
This commit is contained in:
Scott Idem
2026-02-08 19:46:53 -05:00
parent b3114c619a
commit 16acae03d0
5 changed files with 67 additions and 5 deletions

View File

@@ -85,17 +85,26 @@
const current_search_id = ++last_search_id;
const event_id = params.event_id;
const remote_first = params.remote_first;
const qry_str = params.str;
if (!event_id) return;
// --- Search Constraint: Min 3 characters for non-trusted users ---
if (!$ae_loc.trusted_access && qry_str.length < 3) {
if (log_lvl) console.log('🛑 [Trace] Search string too short for public user.');
untrack(() => {
exhibit_id_li = [];
$events_sess.leads.submit_status__search = 'idle';
});
return;
}
if (log_lvl) console.log(`🔎 [Trace] Exhibit Search #${current_search_id}: START (remote=${remote_first}, event=${event_id}, str=${params.str})`);
untrack(() => {
$events_sess.leads.submit_status__search = 'searching';
});
const qry_str = params.str;
// 1. FAST PATH: Local IDB Search
if (!remote_first) {
try {
@@ -103,6 +112,9 @@
.where('event_id')
.equals(event_id)
.filter((exhibit) => {
// Priority Filter for Public
if (!$ae_loc.manager_access && !exhibit.priority) return false;
if (qry_str) {
const name = (exhibit.name ?? '').toLowerCase();
const code = (exhibit.code ?? '').toLowerCase();
@@ -111,6 +123,9 @@
!code.includes(qry_str)
)
return false;
} else if (!$ae_loc.trusted_access) {
// Don't show default results to public if no search string
return false;
}
return true;
})
@@ -178,6 +193,7 @@
api_cfg: $ae_api,
event_id: event_id,
fulltext_search_qry_str: qry_str || null,
priority: $ae_loc.manager_access ? 'all' : 'priority',
order_by_li,
limit: 100
});