fix(badges): update badge type list and fix filter-only search
Update badge type codes for Axonius 2026 (replaces ISHLT 2024 list). Added TODO to drive this from event templates in the future. Fix printed status and badge type filters not working without a text query. The min_chars guard was blocking all filter-only searches, causing "Printed" and "Not Printed" to always return empty results. Now bypasses min_chars when any non-default filter is active (printed status, type code, or affiliations), since selecting a filter is explicit user intent regardless of the text query. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -218,7 +218,10 @@ async function handle_search_refresh(params: any) {
|
||||
const min_chars = params.min_chars;
|
||||
|
||||
// Defense-in-depth: enforce min_chars even if the search component lets one through.
|
||||
if (qry_str.length < min_chars) {
|
||||
// Exception: if the user has set a non-default filter (printed status, type, affiliations),
|
||||
// that is an explicit intent — run the search even without a text query.
|
||||
const has_active_filters = printed_status !== 'all' || !!type_code || !!aff_str;
|
||||
if (qry_str.length < min_chars && !has_active_filters) {
|
||||
untrack(() => {
|
||||
event_badge_id_li = [];
|
||||
$events_sess.badges.search_status = 'done';
|
||||
|
||||
@@ -32,21 +32,17 @@ import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// })
|
||||
// );
|
||||
|
||||
// ISHLT 2024 badge type codes
|
||||
// Axonius 2026 badge type codes
|
||||
// TODO: drive this from the event's badge templates so it's event-agnostic
|
||||
let badge_type_code_li = [
|
||||
{ code: 'current_member', name: 'Member' },
|
||||
{ code: 'inactive_member', name: 'Non-Member' },
|
||||
{ code: 'current_member_trainee', name: 'Trainee Member' },
|
||||
{ code: 'inactive_member_trainee', name: 'Trainee Non-Member' },
|
||||
{ code: 'ex_all', name: 'Exhibitor All Access' },
|
||||
{ code: 'ex_booth', name: 'Exhibitor Booth Staff' },
|
||||
{ code: 'hftx', name: 'HFTX Master Academy' },
|
||||
{ code: 'mcs', name: 'MCS Master Academy' },
|
||||
{ code: 'pediatric', name: 'Pediatric' },
|
||||
{ code: 'guest', name: 'Guest' },
|
||||
{ code: 'attendee', name: 'In-Person Attendee' },
|
||||
{ code: 'sponsor', name: 'Adapt26 Sponsor' },
|
||||
{ code: 'test', name: 'Test' },
|
||||
{ code: 'staff', name: 'Staff' },
|
||||
{ code: 'guest', name: 'Guest' },
|
||||
{ code: 'volunteer', name: 'Volunteer' },
|
||||
{ code: 'test', name: 'Test' }
|
||||
{ code: 'member', name: 'Member' },
|
||||
{ code: 'nonmember', name: 'Non-Member' },
|
||||
];
|
||||
|
||||
// Resolve the minimum characters required for the current user's access tier.
|
||||
|
||||
Reference in New Issue
Block a user