fix: pres_mgmt session search now includes presenter and presentation names
Previously, searching by presenter name in pres_mgmt returned no results
because event_presenter_li_qry_str / event_presentation_li_qry_str were
never requested or stored.
Changes:
- ae_types.ts: add event_presentation_li_qry_str + event_presenter_li_qry_str
to ae_EventSession interface
- db_events.ts: same two fields added to Session Dexie interface
- ae_events__event_session.ts:
* add ft_presentation_search_qry_str param
* auto-upgrade view to 'alt' when either ft_presenter or ft_presentation
search is used (backend requires v_event_session_w_file_count for these)
* add both fields to properties_to_save so they persist to Dexie cache
- +page.svelte (pres_mgmt):
* pass ft_presenter_search_qry_str + ft_presentation_search_qry_str in API call
* local IDB fast path now checks both new fields
* client-side filter guard also checks both new fields
This commit is contained in:
@@ -666,6 +666,7 @@ export async function search__event_session({
|
|||||||
event_id,
|
event_id,
|
||||||
fulltext_search_qry_str = '',
|
fulltext_search_qry_str = '',
|
||||||
ft_presenter_search_qry_str = '',
|
ft_presenter_search_qry_str = '',
|
||||||
|
ft_presentation_search_qry_str = '',
|
||||||
like_search_qry_str = '',
|
like_search_qry_str = '',
|
||||||
like_presentation_search_qry_str = '',
|
like_presentation_search_qry_str = '',
|
||||||
like_presenter_search_qry_str = '',
|
like_presenter_search_qry_str = '',
|
||||||
@@ -688,6 +689,7 @@ export async function search__event_session({
|
|||||||
event_id: string;
|
event_id: string;
|
||||||
fulltext_search_qry_str?: string;
|
fulltext_search_qry_str?: string;
|
||||||
ft_presenter_search_qry_str?: string | null;
|
ft_presenter_search_qry_str?: string | null;
|
||||||
|
ft_presentation_search_qry_str?: string | null;
|
||||||
like_search_qry_str?: string;
|
like_search_qry_str?: string;
|
||||||
like_presentation_search_qry_str?: string;
|
like_presentation_search_qry_str?: string;
|
||||||
like_presenter_search_qry_str?: string;
|
like_presenter_search_qry_str?: string;
|
||||||
@@ -710,15 +712,26 @@ export async function search__event_session({
|
|||||||
q: '',
|
q: '',
|
||||||
and: [{ field: 'event_id', op: 'eq', value: event_id }]
|
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 = {};
|
const ft: any = {};
|
||||||
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2)
|
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2)
|
||||||
ft['default_qry_str'] = fulltext_search_qry_str;
|
ft['default_qry_str'] = fulltext_search_qry_str;
|
||||||
if (
|
if (
|
||||||
ft_presenter_search_qry_str &&
|
ft_presenter_search_qry_str &&
|
||||||
ft_presenter_search_qry_str.length > 2
|
ft_presenter_search_qry_str.length > 2
|
||||||
)
|
) {
|
||||||
ft['event_presenter_li_qry_str'] = ft_presenter_search_qry_str;
|
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 (Object.keys(ft).length) search_query.params = { ft_qry: ft };
|
||||||
}
|
}
|
||||||
if (enabled === 'enabled')
|
if (enabled === 'enabled')
|
||||||
@@ -878,7 +891,9 @@ export const properties_to_save = [
|
|||||||
'event_name',
|
'event_name',
|
||||||
'event_location_code',
|
'event_location_code',
|
||||||
'event_location_name',
|
'event_location_name',
|
||||||
'event_presentation_li'
|
'event_presentation_li',
|
||||||
|
'event_presentation_li_qry_str',
|
||||||
|
'event_presenter_li_qry_str'
|
||||||
];
|
];
|
||||||
|
|
||||||
async function _process_generic_props<T extends Record<string, any>>({
|
async function _process_generic_props<T extends Record<string, any>>({
|
||||||
|
|||||||
@@ -809,6 +809,9 @@ export interface Session {
|
|||||||
// A key value list of the presentations
|
// A key value list of the presentations
|
||||||
event_presentation_kv?: null | key_val;
|
event_presentation_kv?: null | key_val;
|
||||||
event_presentation_li?: null | [any];
|
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
|
// A key value list of the files
|
||||||
event_file_kv?: null | key_val;
|
event_file_kv?: null | key_val;
|
||||||
event_file_li?: null | [any];
|
event_file_li?: null | [any];
|
||||||
|
|||||||
@@ -631,6 +631,9 @@ export interface ae_EventSession extends ae_BaseObj {
|
|||||||
event_file_li?: ae_EventFile[] | null;
|
event_file_li?: ae_EventFile[] | null;
|
||||||
event_presentation_kv?: any;
|
event_presentation_kv?: any;
|
||||||
event_file_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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -250,12 +250,20 @@ async function handle_search_refresh(params: any) {
|
|||||||
const qry_string = (
|
const qry_string = (
|
||||||
session.default_qry_str ?? ''
|
session.default_qry_str ?? ''
|
||||||
).toLowerCase();
|
).toLowerCase();
|
||||||
|
const presenter_qry = (
|
||||||
|
session.event_presenter_li_qry_str ?? ''
|
||||||
|
).toLowerCase();
|
||||||
|
const presentation_qry = (
|
||||||
|
session.event_presentation_li_qry_str ?? ''
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
const match =
|
const match =
|
||||||
name.includes(qry_str) ||
|
name.includes(qry_str) ||
|
||||||
code.includes(qry_str) ||
|
code.includes(qry_str) ||
|
||||||
description.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;
|
if (!match) return false;
|
||||||
}
|
}
|
||||||
@@ -298,6 +306,8 @@ async function handle_search_refresh(params: any) {
|
|||||||
event_id: event_id,
|
event_id: event_id,
|
||||||
fulltext_search_qry_str: qry_str || null,
|
fulltext_search_qry_str: qry_str || null,
|
||||||
like_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,
|
location_name: location_name || null,
|
||||||
enabled: pres_mgmt_loc.current.qry_enabled ?? 'enabled',
|
enabled: pres_mgmt_loc.current.qry_enabled ?? 'enabled',
|
||||||
hidden: pres_mgmt_loc.current.qry_hidden ?? 'not_hidden',
|
hidden: pres_mgmt_loc.current.qry_hidden ?? 'not_hidden',
|
||||||
@@ -326,11 +336,19 @@ async function handle_search_refresh(params: any) {
|
|||||||
const qry_string = (
|
const qry_string = (
|
||||||
session.default_qry_str ?? ''
|
session.default_qry_str ?? ''
|
||||||
).toLowerCase();
|
).toLowerCase();
|
||||||
|
const presenter_qry = (
|
||||||
|
session.event_presenter_li_qry_str ?? ''
|
||||||
|
).toLowerCase();
|
||||||
|
const presentation_qry = (
|
||||||
|
session.event_presentation_li_qry_str ?? ''
|
||||||
|
).toLowerCase();
|
||||||
const match =
|
const match =
|
||||||
name.includes(qry_str) ||
|
name.includes(qry_str) ||
|
||||||
code.includes(qry_str) ||
|
code.includes(qry_str) ||
|
||||||
description.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;
|
if (!match) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user