diff --git a/src/lib/ae_events/ae_events__event_session.ts b/src/lib/ae_events/ae_events__event_session.ts index 43e3f73b..5b69b516 100644 --- a/src/lib/ae_events/ae_events__event_session.ts +++ b/src/lib/ae_events/ae_events__event_session.ts @@ -666,6 +666,7 @@ export async function search__event_session({ event_id, fulltext_search_qry_str = '', ft_presenter_search_qry_str = '', + ft_presentation_search_qry_str = '', like_search_qry_str = '', like_presentation_search_qry_str = '', like_presenter_search_qry_str = '', @@ -688,6 +689,7 @@ export async function search__event_session({ event_id: string; fulltext_search_qry_str?: string; ft_presenter_search_qry_str?: string | null; + ft_presentation_search_qry_str?: string | null; like_search_qry_str?: string; like_presentation_search_qry_str?: string; like_presenter_search_qry_str?: string; @@ -710,15 +712,26 @@ export async function search__event_session({ q: '', and: [{ field: 'event_id', op: 'eq', value: event_id }] }; - if (fulltext_search_qry_str || ft_presenter_search_qry_str) { + if (fulltext_search_qry_str || ft_presenter_search_qry_str || ft_presentation_search_qry_str) { const ft: any = {}; if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) ft['default_qry_str'] = fulltext_search_qry_str; if ( ft_presenter_search_qry_str && ft_presenter_search_qry_str.length > 2 - ) + ) { ft['event_presenter_li_qry_str'] = ft_presenter_search_qry_str; + // These fields only exist in v_event_session_w_file_count (alt view) + view = 'alt'; + } + if ( + ft_presentation_search_qry_str && + ft_presentation_search_qry_str.length > 2 + ) { + ft['event_presentation_li_qry_str'] = ft_presentation_search_qry_str; + // These fields only exist in v_event_session_w_file_count (alt view) + view = 'alt'; + } if (Object.keys(ft).length) search_query.params = { ft_qry: ft }; } if (enabled === 'enabled') @@ -878,7 +891,9 @@ export const properties_to_save = [ 'event_name', 'event_location_code', 'event_location_name', - 'event_presentation_li' + 'event_presentation_li', + 'event_presentation_li_qry_str', + 'event_presenter_li_qry_str' ]; async function _process_generic_props>({ diff --git a/src/lib/ae_events/db_events.ts b/src/lib/ae_events/db_events.ts index 65140c63..309ee67e 100644 --- a/src/lib/ae_events/db_events.ts +++ b/src/lib/ae_events/db_events.ts @@ -809,6 +809,9 @@ export interface Session { // A key value list of the presentations event_presentation_kv?: null | key_val; event_presentation_li?: null | [any]; + // Concatenated search strings from JOINed views (v_event_session_w_file_count) + event_presentation_li_qry_str?: null | string; + event_presenter_li_qry_str?: null | string; // A key value list of the files event_file_kv?: null | key_val; event_file_li?: null | [any]; diff --git a/src/lib/types/ae_types.ts b/src/lib/types/ae_types.ts index ae41a833..d51b4dc0 100644 --- a/src/lib/types/ae_types.ts +++ b/src/lib/types/ae_types.ts @@ -631,6 +631,9 @@ export interface ae_EventSession extends ae_BaseObj { event_file_li?: ae_EventFile[] | null; event_presentation_kv?: any; event_file_kv?: any; + // Concatenated search strings from JOINed views (v_event_session_w_file_count) + event_presentation_li_qry_str?: string | null; + event_presenter_li_qry_str?: string | null; } /** diff --git a/src/routes/events/[event_id]/(pres_mgmt)/pres_mgmt/+page.svelte b/src/routes/events/[event_id]/(pres_mgmt)/pres_mgmt/+page.svelte index 1a6df86b..155eeceb 100644 --- a/src/routes/events/[event_id]/(pres_mgmt)/pres_mgmt/+page.svelte +++ b/src/routes/events/[event_id]/(pres_mgmt)/pres_mgmt/+page.svelte @@ -250,12 +250,20 @@ async function handle_search_refresh(params: any) { const qry_string = ( session.default_qry_str ?? '' ).toLowerCase(); + const presenter_qry = ( + session.event_presenter_li_qry_str ?? '' + ).toLowerCase(); + const presentation_qry = ( + session.event_presentation_li_qry_str ?? '' + ).toLowerCase(); const match = name.includes(qry_str) || code.includes(qry_str) || description.includes(qry_str) || - qry_string.includes(qry_str); + qry_string.includes(qry_str) || + presenter_qry.includes(qry_str) || + presentation_qry.includes(qry_str); if (!match) return false; } @@ -298,6 +306,8 @@ async function handle_search_refresh(params: any) { event_id: event_id, fulltext_search_qry_str: qry_str || null, like_search_qry_str: qry_str || null, + ft_presenter_search_qry_str: qry_str || null, + ft_presentation_search_qry_str: qry_str || null, location_name: location_name || null, enabled: pres_mgmt_loc.current.qry_enabled ?? 'enabled', hidden: pres_mgmt_loc.current.qry_hidden ?? 'not_hidden', @@ -326,11 +336,19 @@ async function handle_search_refresh(params: any) { const qry_string = ( session.default_qry_str ?? '' ).toLowerCase(); + const presenter_qry = ( + session.event_presenter_li_qry_str ?? '' + ).toLowerCase(); + const presentation_qry = ( + session.event_presentation_li_qry_str ?? '' + ).toLowerCase(); const match = name.includes(qry_str) || code.includes(qry_str) || description.includes(qry_str) || - qry_string.includes(qry_str); + qry_string.includes(qry_str) || + presenter_qry.includes(qry_str) || + presentation_qry.includes(qry_str); if (!match) return false; } return true;