Standardize Exhibit Leads module: Rich text support and naming alignment

- Integrated TipTap rich text editor for Booth Descriptions and Exhibitor Notes.
- Implemented strip_html utility for clean search/preview of rich text fields.
- Renamed exhibit loading functions to follow load_ae_obj_id__event_exhibit* pattern.
- Hardened property processors with 'undefined' string guards and automatic reload triggers.
- Resolved type mismatches and naming inconsistencies across the Leads module.
- Verified zero-error state via svelte-check.
This commit is contained in:
Scott Idem
2026-02-09 15:30:00 -05:00
parent e7895cee07
commit fe4380f819
15 changed files with 91 additions and 35 deletions

View File

@@ -89,6 +89,11 @@ async function _process_generic_props<T extends Record<string, any>>({
const updated = processed_obj.updated_on ?? processed_obj.created_on;
const name = processed_obj.name ?? '';
// Guard: Prevent literal "undefined" string from showing in description
if ((processed_obj as any).description === 'undefined') {
(processed_obj as any).description = '';
}
(processed_obj as any).tmp_sort_1 = `${group}_${priority}_${sort}_${updated}`;
(processed_obj as any).tmp_sort_2 = `${group}_${priority}_${sort}_${name}_${updated}`;
@@ -119,7 +124,7 @@ export async function process_ae_obj__exhibit_props({
/**
* Load Single Exhibit (SWR Pattern)
*/
export async function load_ae_obj_id__exhibit({
export async function load_ae_obj_id__event_exhibit({
api_cfg,
exhibit_id,
view = 'default',
@@ -134,7 +139,7 @@ export async function load_ae_obj_id__exhibit({
}): Promise<ae_EventExhibit | null> {
const start_time = performance.now();
if (log_lvl) {
console.log(`🔎 [Trace] load_ae_obj_id__exhibit: START (id=${exhibit_id}, try_cache=${try_cache})`);
console.log(`🔎 [Trace] load_ae_obj_id__event_exhibit: START (id=${exhibit_id}, try_cache=${try_cache})`);
}
// 1. FAST PATH: Return cached data immediately
@@ -192,7 +197,7 @@ async function _refresh_exhibit_id_background({ api_cfg, exhibit_id, view, try_c
/**
* Load Collection of Exhibits (SWR Pattern)
*/
export async function load_ae_obj_li__exhibit({
export async function load_ae_obj_li__event_exhibit({
api_cfg,
event_id,
enabled = 'enabled',
@@ -222,7 +227,7 @@ export async function load_ae_obj_li__exhibit({
}): Promise<ae_EventExhibit[]> {
const start_time = performance.now();
if (log_lvl) {
console.log(`🔎 [Trace] load_ae_obj_li__exhibit: START (event=${event_id}, try_cache=${try_cache})`);
console.log(`🔎 [Trace] load_ae_obj_li__event_exhibit: START (event=${event_id}, try_cache=${try_cache})`);
}
if (try_cache) {

View File

@@ -101,6 +101,11 @@ async function _process_generic_props<T extends Record<string, any>>({
const updated = processed_obj.updated_on ?? processed_obj.created_on;
const name = processed_obj.event_badge_full_name ?? '';
// Guard: Prevent literal "undefined" string from showing in notes
if ((processed_obj as any).exhibitor_notes === 'undefined') {
(processed_obj as any).exhibitor_notes = '';
}
(processed_obj as any).tmp_sort_1 = `${group}_${priority}_${sort}_${updated}`;
(processed_obj as any).tmp_sort_2 = `${group}_${priority}_${sort}_${name}_${updated}`;
@@ -131,7 +136,7 @@ export async function process_ae_obj__exhibit_tracking_props({
/**
* Load Single Lead (SWR Pattern)
*/
export async function load_ae_obj_id__exhibit_tracking({
export async function load_ae_obj_id__event_exhibit_tracking({
api_cfg,
exhibit_tracking_id,
view = 'default',
@@ -146,7 +151,7 @@ export async function load_ae_obj_id__exhibit_tracking({
}): Promise<ae_EventExhibitTracking | null> {
const start_time = performance.now();
if (log_lvl) {
console.log(`🔎 [Trace] load_ae_obj_id__exhibit_tracking: START (id=${exhibit_tracking_id}, try_cache=${try_cache})`);
console.log(`🔎 [Trace] load_ae_obj_id__event_exhibit_tracking: START (id=${exhibit_tracking_id}, try_cache=${try_cache})`);
}
// 1. FAST PATH: Return cached data immediately
@@ -204,7 +209,7 @@ async function _refresh_tracking_id_background({ api_cfg, exhibit_tracking_id, v
/**
* Load Collection of Leads (SWR Pattern)
*/
export async function load_ae_obj_li__exhibit_tracking({
export async function load_ae_obj_li__event_exhibit_tracking({
api_cfg,
exhibit_id,
enabled = 'enabled',
@@ -233,7 +238,7 @@ export async function load_ae_obj_li__exhibit_tracking({
}): Promise<ae_EventExhibitTracking[]> {
const start_time = performance.now();
if (log_lvl) {
console.log(`🔎 [Trace] load_ae_obj_li__exhibit_tracking: START (exhibit=${exhibit_id}, try_cache=${try_cache})`);
console.log(`🔎 [Trace] load_ae_obj_li__event_exhibit_tracking: START (exhibit=${exhibit_id}, try_cache=${try_cache})`);
}
if (try_cache) {