Standardize Event DB/Types and fix critical UI type mismatches across Badges, Journals, and Locations modules

This commit is contained in:
Scott Idem
2026-02-04 17:57:42 -05:00
parent 2e804ae01b
commit db34da66dc
15 changed files with 251 additions and 137 deletions

View File

@@ -253,14 +253,53 @@ export async function update_ae_obj__event_presenter({
// Updated 2026-01-21 to Restore Full Aether Search Logic
export async function search__event_presenter({
api_cfg, event_id, fulltext_search_qry_str = '', like_search_qry_str = '', agree = null, biography = null, enabled = 'enabled', hidden = 'not_hidden', view = 'default', limit = 25, offset = 0, order_by_li = [{ sort: 'ASC' }, { given_name: 'ASC' }, { family_name: 'ASC' }], try_cache = true, log_lvl = 0
api_cfg,
event_id,
fulltext_search_qry_str = '',
ft_presenter_search_qry_str = null,
like_search_qry_str = '',
like_presentation_search_qry_str = '',
like_presenter_search_qry_str = '',
agree = null,
biography = null,
enabled = 'enabled',
hidden = 'not_hidden',
view = 'default',
limit = 25,
offset = 0,
order_by_li = [{ sort: 'ASC' }, { given_name: 'ASC' }, { family_name: 'ASC' }],
try_cache = true,
log_lvl = 0
}: {
api_cfg: any; event_id: string; fulltext_search_qry_str?: string; like_search_qry_str?: string; agree?: null | boolean; biography?: null | boolean; enabled?: 'enabled' | 'all' | 'not_enabled'; hidden?: 'hidden' | 'all' | 'not_hidden'; view?: string; limit?: number; offset?: number; order_by_li?: any; try_cache?: boolean; log_lvl?: number;
api_cfg: any;
event_id: string;
fulltext_search_qry_str?: string;
ft_presenter_search_qry_str?: string | null;
like_search_qry_str?: string;
like_presentation_search_qry_str?: string;
like_presenter_search_qry_str?: string;
agree?: null | boolean;
biography?: null | boolean;
enabled?: 'enabled' | 'all' | 'not_enabled';
hidden?: 'hidden' | 'all' | 'not_hidden';
view?: string;
limit?: number;
offset?: number;
order_by_li?: any;
try_cache?: boolean;
log_lvl?: number;
}): Promise<ae_EventPresenter[]> {
const search_query: any = { q: '', and: [{ field: 'event_id', op: 'eq', value: event_id }] };
const params: key_val = {};
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) params['ft_qry'] = { 'default_qry_str': fulltext_search_qry_str };
if (like_search_qry_str) params['lk_qry'] = { 'default_qry_str': like_search_qry_str };
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2)
params['ft_qry'] = { default_qry_str: fulltext_search_qry_str };
if (ft_presenter_search_qry_str && ft_presenter_search_qry_str.length > 2)
params['ft_qry'] = { ...params['ft_qry'], event_presenter_li_qry_str: ft_presenter_search_qry_str };
if (like_search_qry_str) params['lk_qry'] = { default_qry_str: like_search_qry_str };
if (like_presentation_search_qry_str)
params['lk_qry'] = { ...params['lk_qry'], event_presentation_li_qry_str: like_presentation_search_qry_str };
if (like_presenter_search_qry_str)
params['lk_qry'] = { ...params['lk_qry'], event_presenter_li_qry_str: like_presenter_search_qry_str };
if (agree !== null) search_query.and.push({ field: 'agree', op: 'eq', value: agree ? 1 : 0 });
if (biography === true) search_query.and.push({ field: 'biography', op: 'ne', value: '' });
if (enabled === 'enabled') search_query.and.push({ field: 'enable', op: 'eq', value: 1 });
@@ -279,6 +318,54 @@ export async function search__event_presenter({
return [];
}
export const qry__event_presenter = search__event_presenter;
export async function email_sign_in__event_presenter({
api_cfg,
to_email,
to_name,
base_url,
person_id,
person_passcode,
event_id,
event_session_id,
event_presentation_id,
event_presenter_id,
session_name,
presentation_name
}: {
api_cfg: any;
to_email?: string | null;
to_name?: string | null;
base_url?: string | null;
person_id?: string | null;
person_passcode?: string | null;
event_id?: string | null;
event_session_id?: string | null;
event_presentation_id?: string | null;
event_presenter_id?: string | null;
session_name?: string | null;
presentation_name?: string | null;
}) {
if (!to_email || !person_id || !person_passcode || !event_id || !event_presenter_id) {
console.error('Missing required parameters for email_sign_in__event_presenter');
return null;
}
const subject = `Pres Mgmt Hub Sign In Link for Presenter: ${to_name ?? 'Presenter'}`;
const sign_in_url = encodeURI(
`${base_url}/events/${event_id}/presenter/${event_presenter_id}?person_id=${person_id}&person_pass=${person_passcode}`
);
const body_html = `<div>${to_name},<p>Your sign-in link for ${presentation_name ?? 'Presentation'} (Session: ${session_name ?? 'Session'}): <a href="${sign_in_url}">${sign_in_url}</a></p></div>`;
return await api.send_email({
api_cfg,
from_email: 'noreply+presmgmt@oneskyit.com',
from_name: 'Aether Pres Mgmt',
to_email,
subject,
body_html
});
}
export const properties_to_save = [
'id', 'event_presenter_id', 'event_presenter_id_random', 'external_id', 'code', 'event_id', 'event_session_id', 'event_presentation_id', 'event_person_id', 'person_id', 'person_profile_id', 'person_id_random', 'person_profile_id_random', 'pronouns', 'informal_name', 'title_names', 'given_name', 'middle_name', 'family_name', 'designations', 'professional_title', 'full_name', 'affiliations', 'email', 'biography', 'agree', 'comments', 'passcode', 'hide_event_launcher', 'data_json', 'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on', 'tmp_sort_1', 'tmp_sort_2', 'file_count', 'event_session_code', 'event_session_name', 'event_session_start_datetime', 'event_presentation_code', 'event_presentation_name', 'event_presentation_start_datetime', 'person_external_id', 'person_external_sys_id', 'person_given_name', 'person_family_name', 'person_full_name', 'person_professional_title', 'person_affiliations', 'person_primary_email', 'person_passcode'
];

View File

@@ -5,7 +5,13 @@ import type { key_val } from '$lib/stores/ae_stores';
// li = list
// kv = key value list
// Updated 2024-10-16
/**
* Event - A core Aether event
* Related Files:
* - src/lib/ae_events/ae_events__event.ts (API)
* - src/routes/events/[event_id]/+page.svelte (View)
* - src/routes/events/[event_id]/settings/+page.svelte (Admin Settings)
*/
export interface Event {
id: string;
// id_random: string;
@@ -47,13 +53,13 @@ export interface Event {
mod_pres_mgmt_json?: null | key_val;
cfg_json?: null | key_val;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -169,13 +175,13 @@ export interface Badge {
alert?: null | boolean;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -246,13 +252,13 @@ export interface Badge_template {
layout?: null | string;
style_filename?: null | string;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -310,13 +316,13 @@ export interface Device {
meta_json?: null | string;
other_json?: null | string;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -353,14 +359,14 @@ export interface Exhibit {
license_li_json: null | string;
cfg_json: string;
enable: null | boolean;
hide: null | boolean;
priority: null | boolean;
sort: null | number;
group: null | string;
notes: null | string;
created_on: Date;
updated_on: null | Date;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
// tmp_sort_1?: null|string;
@@ -410,14 +416,14 @@ export interface Exhibit_tracking {
event_badge_country: null | string;
enable: null | boolean;
hide: null | boolean;
priority: null | boolean;
sort: null | number;
group: null | string;
notes: null | string;
created_on: Date;
updated_on: null | Date;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
// tmp_sort_1?: null|string;
@@ -458,13 +464,13 @@ export interface File {
lu_event_file_purpose_name: string;
file_purpose: string;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -523,13 +529,13 @@ export interface Location {
data_json?: null | string;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -585,13 +591,13 @@ export interface Presentation {
hide_event_launcher?: null | boolean;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -660,13 +666,13 @@ export interface Presenter {
data_json?: null | string;
enable: null | boolean;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on?: Date;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
@@ -704,7 +710,13 @@ export interface Registration {
// Nothing here yet
}
// Updated 2024-06-19
/**
* Session - An event session
* Related Files:
* - src/lib/ae_events/ae_events__event_session.ts (API)
* - src/routes/events/[event_id]/(pres_mgmt)/session/[session_id]/+page.svelte (View)
* - src/routes/events/[event_id]/(launcher)/menu_session_list.svelte (Launcher)
*/
export interface Session {
id: string;
// id_random: string;
@@ -749,14 +761,14 @@ export interface Session {
// colloquium - Specialists present on related topics with questions
// symposium - A discussion, less formal
enable: null | boolean;
hide: null | boolean;
priority: null | boolean;
sort: null | number;
group: null | string;
notes: null | string;
created_on: Date;
updated_on: null | Date;
enable?: null | boolean;
hide?: null | boolean;
priority?: null | boolean;
sort?: null | number;
group?: null | string;
notes?: null | string;
created_on?: Date | null;
updated_on?: null | Date;
// Generated fields for sorting locally only
tmp_sort_1?: null | string;

View File

@@ -204,7 +204,7 @@ function create_video_element({
// This function will take a long string (sentences or paragraphs) of text and return an estimated number of words.
function count_words(text: string) {
if (!text || text.length < 1) {
return false;
return 0;
}
const count = text.trim().split(/\s+/).length;

View File

@@ -50,7 +50,7 @@
console.log('** Element Mounted: ** Element Input File');
});
async function process_file_list(file_list) {
async function process_file_list(file_list: FileList | null) {
console.log('*** process_file_list() ***');
file_list_status = 'processing';

View File

@@ -441,14 +441,14 @@
!$ae_loc.trusted_access}
value={event_file_obj.file_purpose}
onchange={(e) => {
// ae_tmp[event_file_obj.event_file_id].file_purpose = e.target.value;
// ae_tmp[event_file_obj.event_file_id].file_purpose = (e.target as HTMLInputElement).value;
console.log(
`Selected file_purpose: ${e.target.value}`
`Selected file_purpose: ${(e.target as HTMLInputElement).value}`
);
let event_file_data = {
event_file_id: event_file_obj.event_file_id,
file_purpose: e.target.value
file_purpose: (e.target as HTMLInputElement).value
};
events_func

View File

@@ -14,27 +14,31 @@ export interface ae_BaseObj {
short_name?: string;
description?: string | null;
enable: boolean | null;
hide: boolean | null;
enable?: boolean | null;
hide?: boolean | null;
archive?: boolean;
archive_on?: string | Date;
priority: boolean | null;
sort: number | null;
group?: string;
notes?: string;
priority?: boolean | null;
sort?: number | null;
group?: string | null;
notes?: string | null;
created_on: string | Date;
updated_on: string | Date;
created_on?: string | Date | null;
updated_on?: string | Date | null;
// Standard frontend computed sort fields
tmp_sort_1?: string;
tmp_sort_2?: string;
tmp_sort_3?: string;
tmp_sort_1?: string | null;
tmp_sort_2?: string | null;
tmp_sort_3?: string | null;
}
/**
* Account - Core client account
* Related Files:
* - src/lib/ae_core/ae_core_functions.ts (API)
* - src/routes/core/accounts/[account_id]/+page.svelte (View)
* - src/routes/core/accounts/ae_comp__account_search.svelte (Search)
*/
export interface ae_Account extends ae_BaseObj {
account_id: string;
@@ -270,6 +274,10 @@ export interface ae_Person extends ae_BaseObj {
/**
* User - A login entity with permissions
* Related Files:
* - src/lib/ae_core/ae_core_functions.ts (API)
* - src/routes/core/users/[user_id]/+page.svelte (View)
* - src/routes/core/users/ae_comp__user_search.svelte (Search)
*/
export interface ae_User extends ae_BaseObj {
user_id: string;
@@ -464,36 +472,36 @@ export interface ae_EventBadge extends ae_BaseObj {
event_id_random: string;
person_id: string;
person_id_random: string;
event_person_id?: string;
event_person_id_random?: string;
event_person_id?: string | null;
event_person_id_random?: string | null;
event_badge_template_id?: string;
event_badge_template_id_random?: string;
event_badge_template_id?: string | null;
event_badge_template_id_random?: string | null;
badge_type_code?: string;
badge_type?: string;
badge_type_code?: string | null;
badge_type?: string | null;
member_type_code?: string;
member_status?: string;
member_type_code?: string | null;
member_status?: string | null;
pronouns?: string;
given_name?: string;
middle_name?: string;
family_name?: string;
full_name?: string;
affiliations?: string;
pronouns?: string | null;
given_name?: string | null;
middle_name?: string | null;
family_name?: string | null;
full_name?: string | null;
affiliations?: string | null;
professional_title?: string;
email?: string;
city?: string;
state_province?: string;
country?: string;
professional_title?: string | null;
email?: string | null;
city?: string | null;
state_province?: string | null;
country?: string | null;
print_count?: number;
print_first_datetime?: string | Date;
print_last_datetime?: string | Date;
print_count?: number | null;
print_first_datetime?: string | Date | null;
print_last_datetime?: string | Date | null;
ticket_list?: any[];
ticket_list?: any[] | null;
data_json?: any;
}
@@ -506,20 +514,20 @@ export interface ae_EventBadgeTemplate extends ae_BaseObj {
event_id: string;
event_id_random: string;
logo_path?: string;
header_path?: string;
header_row_1?: string;
header_row_2?: string;
logo_path?: string | null;
header_path?: string | null;
header_row_1?: string | null;
header_row_2?: string | null;
footer_path?: string;
footer_title?: string;
footer_path?: string | null;
footer_title?: string | null;
badge_type_list?: any;
ticket_list?: any;
layout?: string;
style_href?: string;
passcode?: string;
layout?: string | null;
style_href?: string | null;
passcode?: string | null;
}
/**
@@ -531,14 +539,14 @@ export interface ae_EventLocation extends ae_BaseObj {
event_id: string;
event_id_random: string;
location_type?: string;
location_type_code?: string;
location_type?: string | null;
location_type_code?: string | null;
internal_use?: boolean;
record_audio?: boolean;
record_video?: boolean;
internal_use?: boolean | null;
record_audio?: boolean | null;
record_video?: boolean | null;
passcode?: string;
passcode?: string | null;
data_json?: any;
}
@@ -627,22 +635,22 @@ export interface ae_EventPresenter extends ae_BaseObj {
event_presenter_id_random: string;
event_id: string;
event_id_random: string;
person_id: string;
person_id_random: string;
person_id?: string | null;
person_id_random?: string | null;
pronouns?: string;
pronouns?: string | null;
informal_name?: string | null;
title_names?: string | null;
given_name?: string;
middle_name?: string;
family_name?: string;
full_name?: string;
affiliations?: string;
email?: string;
middle_name?: string | null;
family_name?: string | null;
designations?: string | null;
professional_title?: string;
tagline?: string;
biography?: string;
professional_title?: string | null;
tagline?: string | null;
biography?: string | null;
agree?: boolean;
agree?: boolean | null;
data_json?: any;
}
@@ -831,16 +839,20 @@ export interface ae_EventFile extends ae_BaseObj {
event_id: string;
event_id_random: string;
hosted_file_id_random?: string;
for_type?: string;
for_id_random?: string;
hosted_file_id: string;
hosted_file_id_random: string;
for_type?: string | null;
for_id_random?: string | null;
filename?: string;
filename_no_ext?: string;
extension?: string;
file_purpose?: string;
approve?: boolean;
open_in_os?: string | null;
file_purpose?: string | null;
approve?: boolean | null;
}
/**