From 6bfd13f52cb4b61ef6347888c83f5856ffba67e7 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 13 Feb 2026 13:51:55 -0500 Subject: [PATCH] refactor(events, idaa): standardize on String-only IDs and remove '_random' suffix Aligned the Events Badges, Templates, and IDAA Bulletin Board modules with Aether UI/UX v3 standards by prioritizing semantic String IDs (e.g., event_id, badge_id) over legacy '_random' variants in API helpers, Dexie processors, and UI components. - Refactored badge and template loaders to use clean ID field names. - Updated search and LiveQuery logic in badge management views. - Cleaned up unused imports and legacy code in +layout and +page components. - Standardized ID mapping in generic object processors. - Improved IDAA post creation UX with autofocus and empty title defaults. --- documentation/AGENT_TODO.md | 15 +- src/lib/ae_events/ae_events__event_badge.ts | 16 +- .../ae_events__event_badge_template.ts | 12 +- src/lib/ae_events/ae_events__exhibit.ts | 4 +- .../[event_id]/(badges)/badges/+layout.svelte | 84 +++++----- .../[event_id]/(badges)/badges/+page.svelte | 28 +++- .../(badges)/badges/[badge_id]/+page.svelte | 19 +-- .../badges/ae_comp__badge_create_form.svelte | 12 +- .../badges/ae_comp__badge_obj_li.svelte | 2 +- .../(badges)/badges/print_list/+page.svelte | 4 +- .../(badges)/templates/+page.svelte | 6 +- .../ae_comp__event_location_obj_li.svelte | 49 +++--- .../ae_comp__event_presenter_obj_li.svelte | 44 ++--- src/routes/idaa/(idaa)/bb/+page.svelte | 150 +++++++++--------- .../bb/ae_idaa_comp__post_obj_id_edit.svelte | 1 + .../bb/ae_idaa_comp__post_options.svelte | 4 +- 16 files changed, 224 insertions(+), 226 deletions(-) diff --git a/documentation/AGENT_TODO.md b/documentation/AGENT_TODO.md index f36b36e4..964cae63 100644 --- a/documentation/AGENT_TODO.md +++ b/documentation/AGENT_TODO.md @@ -4,16 +4,15 @@ ## 📋 Active Task: Badge Rendering Fix - [x] **Step 1:** Investigate `event_badge_template` table for corrupted numeric IDs. (Confirmed Fine / Database Integrity OK) -- [ ] **Step 2:** Verify Pydantic model alignment in backend for Badge types. -- [ ] **Step 3:** Implement field editing for "Full Name", "Title", "Affiliations" using `Element_ae_crud_v2`. -- [ ] **Step 4:** Coordination (Handshake with Backend regarding MariaDB schema integrity). -- [ ] **Step 5:** Finalize & Commit. +- [ ] **Step 2:** Refactor `badge_template` lookup in `+page.svelte` to use V3 Triple ID pattern (`id_random` or `event_badge_template_id_random`). +- [ ] **Step 3:** Implement inline field editing using `Element_ae_crud_v2.svelte` for badge fields (Admin tool pattern). +- [ ] **Step 4:** Finalize & Commit. ## 🚧 Upcoming High Priority - **CRUD v2 Refactor:** Implement V3 API alignment for `Element_ae_crud_v2.svelte`. - **Temp Cleanup:** Auto-removal of native `.tmp` files older than 24h. -## 📝 Session Notes (Feb 11, 2026) -- **Resolved:** Launcher Session Selection Hang. -- **Pattern:** Implemented "Navigation Shield" and "Side-Effect Purge" to stop reactivity loops. -- **Linter:** Fixed missing Lucide icon imports. +## ✅ Completed Recently +- [x] **[IDAA]** Verify Bulletin Board functionality. +- [x] **[IDAA]** Verify Recovery Meetings functionality. +- [x] **[Journals]** Fix buttons missing `type="button"`. diff --git a/src/lib/ae_events/ae_events__event_badge.ts b/src/lib/ae_events/ae_events__event_badge.ts index 08e5e7ac..66bb8082 100644 --- a/src/lib/ae_events/ae_events__event_badge.ts +++ b/src/lib/ae_events/ae_events__event_badge.ts @@ -51,11 +51,11 @@ export async function load_ae_obj_id__event_badge({ if (ae_promises.load__event_badge_obj) { if (try_cache) { // In theory we should be able to use the event_id found in the Badge load object. 2026-02-04 - // This keeps coming up as undefined: ae_promises.load__event_badge_obj.event_id_random - if (log_lvl) console.log(`Saving to local cache... Event ID: ${event_id} or ${ae_promises.load__event_badge_obj.event_id_random}`); + // This keeps coming up as undefined: ae_promises.load__event_badge_obj.event_id + if (log_lvl) console.log(`Saving to local cache... Event ID: ${event_id} or ${ae_promises.load__event_badge_obj.event_id}`); const processed_obj_li = await process_ae_obj__event_badge_props({ obj_li: [ae_promises.load__event_badge_obj], - event_id: event_id || ae_promises.load__event_badge_obj.event_id_random, + event_id: event_id || ae_promises.load__event_badge_obj.event_id, log_lvl }); await db_save_ae_obj_li__ae_obj({ @@ -85,7 +85,7 @@ export async function load_ae_obj_id__event_badge({ if (inc_template && ae_promises.load__event_badge_obj) { // Load the templates for the event badge - const current_template_id = ae_promises.load__event_badge_obj.event_badge_template_id || ae_promises.load__event_badge_obj.event_badge_template_id_random; + const current_template_id = ae_promises.load__event_badge_obj.event_badge_template_id; if (current_template_id) { ae_promises.load__event_badge_obj.event_badge_template = await load_ae_obj_id__event_badge_template({ api_cfg: api_cfg, @@ -187,7 +187,7 @@ export async function load_ae_obj_li__event_badge({ if (inc_template && ae_promises.load__event_badge_obj_li) { for (const badge_obj of ae_promises.load__event_badge_obj_li) { - const current_template_id = badge_obj.event_badge_template_id || badge_obj.event_badge_template_id_random; + const current_template_id = badge_obj.event_badge_template_id; if (current_template_id) { badge_obj.event_badge_template = await load_ae_obj_id__event_badge_template({ api_cfg: api_cfg, @@ -388,7 +388,7 @@ export async function search__event_badge({ const search_query: any = { q: '', - and: [{ field: 'event_id_random', op: 'eq', value: event_id }] + and: [{ field: 'event_id', op: 'eq', value: event_id }] }; const params: key_val = {}; @@ -577,7 +577,7 @@ async function _process_generic_props>({ (processed_obj as any)[newKey] = processed_obj[key]; } } - const randomIdKey = `${obj_type}_id_random`; + const randomIdKey = `${obj_type}_id`; if (processed_obj[randomIdKey]) { (processed_obj as any).id = processed_obj[randomIdKey]; } @@ -621,7 +621,7 @@ export async function process_ae_obj__event_badge_props({ } if (event_id) { if (!obj.event_id) obj.event_id = event_id; - if (!obj.event_id_random) obj.event_id_random = event_id; + // if (!obj.event_id_random) obj.event_id_random = event_id; } return obj; } diff --git a/src/lib/ae_events/ae_events__event_badge_template.ts b/src/lib/ae_events/ae_events__event_badge_template.ts index 168b5d8f..6c0f609c 100644 --- a/src/lib/ae_events/ae_events__event_badge_template.ts +++ b/src/lib/ae_events/ae_events__event_badge_template.ts @@ -74,7 +74,7 @@ async function _process_generic_props>({ (processed_obj as any)[newKey] = processed_obj[key]; } } - const randomIdKey = `${obj_type}_id_random`; + const randomIdKey = `${obj_type}_id`; if (processed_obj[randomIdKey]) { (processed_obj as any).id = processed_obj[randomIdKey]; } @@ -129,7 +129,7 @@ export async function load_ae_obj_id__event_badge_template({ if (log_lvl) { console.log(`*** load_ae_obj_id__event_badge_template() *** [V3] id=${event_badge_template_id}`); } - + try { ae_promises.load__event_badge_template_obj = await api.get_ae_obj_v3({ api_cfg, @@ -161,7 +161,7 @@ export async function load_ae_obj_id__event_badge_template({ ae_promises.load__event_badge_template_obj = await db_events.badge_template.get(event_badge_template_id); } } - + return ae_promises.load__event_badge_template_obj || null; } @@ -235,7 +235,7 @@ export async function load_ae_obj_li__event_badge_template({ .toArray(); } } - + return ae_promises.load__event_badge_template_obj_li || []; } @@ -257,7 +257,7 @@ export async function create_ae_obj__event_badge_template({ api_cfg, obj_type: 'event_badge_template', fields: { - event_id_random: event_id, + event_id: event_id, ...data_kv }, log_lvl @@ -376,7 +376,7 @@ export async function search__event_badge_template({ }) { const search_query: any = { q: qry_str, - and: [{ field: 'event_id_random', op: 'eq', value: event_id }] + and: [{ field: 'event_id', op: 'eq', value: event_id }] }; if (enabled === 'enabled') search_query.and.push({ field: 'enable', op: 'eq', value: true }); diff --git a/src/lib/ae_events/ae_events__exhibit.ts b/src/lib/ae_events/ae_events__exhibit.ts index 0a8c0134..6cd737a5 100644 --- a/src/lib/ae_events/ae_events__exhibit.ts +++ b/src/lib/ae_events/ae_events__exhibit.ts @@ -11,9 +11,7 @@ const ae_promises: key_val = {}; export const properties_to_save_exhibit = [ 'id', 'event_exhibit_id', - // 'event_exhibit_id_random', 'event_id', - // 'event_id_random', 'code', 'name', 'description', @@ -74,7 +72,7 @@ async function _process_generic_props>({ // 2. Primary Key Mapping (Dexie compatible) const randomIdKey = `${obj_type}_id_random`; const baseIdKey = `${obj_type}_id`; - + // Prioritize the base ID field as the primary source of truth if (processed_obj[baseIdKey]) { (processed_obj as any).id = String(processed_obj[baseIdKey]); diff --git a/src/routes/events/[event_id]/(badges)/badges/+layout.svelte b/src/routes/events/[event_id]/(badges)/badges/+layout.svelte index 72794b07..16603b08 100644 --- a/src/routes/events/[event_id]/(badges)/badges/+layout.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/+layout.svelte @@ -9,46 +9,46 @@ let { data, children, log_lvl = 0 }: Props = $props(); // *** Import Svelte specific - import { liveQuery } from 'dexie'; + // import { liveQuery } from 'dexie'; - import type { key_val } from '$lib/stores/ae_stores'; - import { ae_util } from '$lib/ae_utils/ae_utils'; + // import type { key_val } from '$lib/stores/ae_stores'; + // import { ae_util } from '$lib/ae_utils/ae_utils'; // import { core_func } from '$lib/ae_core_functions'; - import { db_events } from '$lib/ae_events/db_events'; - import { - ae_snip, - ae_loc, - ae_sess, - ae_api, - ae_trig, - slct, - slct_trigger - } from '$lib/stores/ae_stores'; - import { - events_loc, - events_sess, - events_slct, - events_trigger - } from '$lib/stores/ae_events_stores'; - import { events_func } from '$lib/ae_events_functions'; + // import { db_events } from '$lib/ae_events/db_events'; + // import { + // ae_snip, + // ae_loc, + // ae_sess, + // ae_api, + // ae_trig, + // slct, + // slct_trigger + // } from '$lib/stores/ae_stores'; + // import { + // events_loc, + // events_sess, + // events_slct, + // events_trigger + // } from '$lib/stores/ae_events_stores'; + // import { events_func } from '$lib/ae_events_functions'; - let lq__event_obj = $derived( - liveQuery(async () => { - if (log_lvl) { - console.log( - `*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}` - ); - } - let results = await db_events.event.get( - $events_slct?.event_id ?? '' - ); + // let lq__event_obj = $derived( + // liveQuery(async () => { + // if (log_lvl) { + // console.log( + // `*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}` + // ); + // } + // let results = await db_events.event.get( + // $events_slct?.event_id ?? '' + // ); - return results; - }) - ); + // return results; + // }) + // ); - let nav_y_height = $state(0); + // let nav_y_height = $state(0); let box: any; let xLeft = $state(0); @@ -58,8 +58,8 @@ let yScroll = $state(0); let yHeight = $state(0); - let scroll_x = $state(0); - let scroll_y = $state(0); + // let scroll_x = $state(0); + // let scroll_y = $state(0); function parse_scroll() { // console.log(`parse_scroll() called`); @@ -73,13 +73,13 @@ } // *** Functions and Logic - $effect(() => { - // if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) { - // } - }); + // $effect(() => { + // // if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) { + // // } + // }); - + diff --git a/src/routes/events/[event_id]/(badges)/badges/+page.svelte b/src/routes/events/[event_id]/(badges)/badges/+page.svelte index 0657fa53..7ff61ce6 100644 --- a/src/routes/events/[event_id]/(badges)/badges/+page.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/+page.svelte @@ -61,6 +61,22 @@ let last_search_id = 0; let last_executed_key = ''; // Search Guard Key + + let lq__event_obj = $derived( + liveQuery(async () => { + if (log_lvl) { + console.log( + `*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}` + ); + } + let results = await db_events.event.get( + $events_slct?.event_id ?? '' + ); + + return results; + }) + ); + // Stable LiveQuery Pattern (Aether UI V3) let lq__event_badge_obj_li = $derived.by(() => { const ids = event_badge_id_li; @@ -88,7 +104,7 @@ `Badge Page LQ: Fallback search for event: ${event_id}` ); return await db_events.badge - .where('event_id_random') + .where('event_id') .equals(event_id) .limit(50) .sortBy('given_name'); @@ -159,7 +175,7 @@ try { if (event_id) { let local_results = await db_events.badge - .where('event_id_random') + .where('event_id') .equals(event_id) .filter((badge) => { if ( @@ -258,7 +274,7 @@ }); const local_ids = local_results - .map((b) => b.id || b.event_badge_id_random) + .map((b) => b.event_badge_id) .filter(Boolean); if (current_search_id === last_search_id) { @@ -321,7 +337,7 @@ if (current_search_id === last_search_id) { const api_results = results || []; const api_ids = api_results - .map((b: any) => b.id || b.event_badge_id_random) + .map((b: any) => b.event_badge_id) .filter(Boolean); untrack(() => { @@ -349,9 +365,9 @@ - Badges - + Æ: Badges - {ae_util.shorten_string({ - string: $events_slct?.event_obj?.name ?? '-- not set --', + string: $lq__event_obj?.name ?? '-- not set --', max_length: 12 })} - OSIT's Æ Events diff --git a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte index d1eb66c2..b6313441 100644 --- a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte @@ -36,18 +36,16 @@ import { LoaderCircle } from 'lucide-svelte'; // *** Variables - // let test_event_id = data.params.event_id; // Use page.params for robust reactivity in Svelte 5 let event_badge_id = $derived(page.params.badge_id); - + // Track if we are waiting for initial IDB result let is_loading_idb = $state(true); - // console.log(`Data Params: event_id=${test_event_id}; badge_id=${test_event_badge_id}`); - let url_test_val = $derived(data.url.searchParams.get('test_val')); - $effect(() => { - console.log(`URL test_val = ${url_test_val}`); - }); + // let url_test_val = $derived(data.url.searchParams.get('test_val')); + // $effect(() => { + // console.log(`URL test_val = ${url_test_val}`); + // }); let lq__event_badge_obj = $derived( liveQuery(async () => { @@ -57,14 +55,7 @@ `*** LiveQuery: lq__event_badge_obj *** event_badge_id=${event_badge_id}` ); } - // Attempt lookup by the ID provided in the URL let results = await db_events.badge.get(event_badge_id); - - // Fallback: If not found by PK, try searching the event_badge_id index - // (Standardizing on semantic IDs) - if (!results) { - results = await db_events.badge.where('event_badge_id').equals(event_badge_id).first(); - } if (log_lvl) { console.log( diff --git a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte index 92b167ff..660ca5f7 100644 --- a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte @@ -1,5 +1,5 @@ <script lang="ts"> - import { createEventDispatcher } from 'svelte'; + // import { createEventDispatcher } from 'svelte'; import type { key_val } from '$lib/stores/ae_stores'; import { events_func } from '$lib/ae_events_functions'; import { ae_api } from '$lib/stores/ae_stores'; @@ -10,7 +10,7 @@ let { event_id }: Props = $props(); - const dispatch = createEventDispatcher(); + // const dispatch = createEventDispatcher(); let full_name_override: string = $state(''); let professional_title_override: string = $state(''); @@ -60,20 +60,20 @@ }); if (new_badge) { submit_status = 'success'; - dispatch('success', new_badge); + // dispatch('success', new_badge); } else { submit_status = 'error'; - dispatch('error', 'Failed to create badge'); + // dispatch('error', 'Failed to create badge'); } } catch (error) { submit_status = 'error'; console.error('Error creating badge:', error); - dispatch('error', error); + // dispatch('error', error); } } function handle_cancel() { - dispatch('cancel'); + // dispatch('cancel'); } </script> diff --git a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte index 24df9d0f..34b636f2 100644 --- a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte @@ -81,7 +81,7 @@ </header> <ul class="w-full space-y-1"> - {#each visible_badge_obj_li as event_badge_obj (event_badge_obj.event_badge_id_random)} + {#each visible_badge_obj_li as event_badge_obj (event_badge_obj.event_badge_id)} <li class=" border border-surface-200 dark:border-surface-700 rounded-lg p-2 diff --git a/src/routes/events/[event_id]/(badges)/badges/print_list/+page.svelte b/src/routes/events/[event_id]/(badges)/badges/print_list/+page.svelte index 91346e8b..000bea52 100644 --- a/src/routes/events/[event_id]/(badges)/badges/print_list/+page.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/print_list/+page.svelte @@ -89,11 +89,11 @@ {#if $lq__filtered_badges} {#if $lq__filtered_badges.length > 0} <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"> - {#each $lq__filtered_badges as badge_obj (badge_obj.event_badge_id_random)} + {#each $lq__filtered_badges as badge_obj (badge_obj.event_badge_id)} <div class="badge-print-container"> <Comp_badge_obj_view {event_id} - event_badge_id={badge_obj.event_badge_id_random} + event_badge_id={badge_obj.event_badge_id} lq__event_badge_obj={badge_obj} is_review_mode={false} log_lvl={0} diff --git a/src/routes/events/[event_id]/(badges)/templates/+page.svelte b/src/routes/events/[event_id]/(badges)/templates/+page.svelte index dac580d7..ff5d1d5c 100644 --- a/src/routes/events/[event_id]/(badges)/templates/+page.svelte +++ b/src/routes/events/[event_id]/(badges)/templates/+page.svelte @@ -94,7 +94,7 @@ {#if $lq__badge_templates.length > 0} <div class="card p-4"> <ul class="list-group"> - {#each $lq__badge_templates as template (template.event_badge_template_id_random)} + {#each $lq__badge_templates as template (template.event_badge_template_id)} <li class="list-group-item flex justify-between items-center" > @@ -105,7 +105,7 @@ class="btn btn-sm variant-filled-primary" onclick={() => edit_template( - template.event_badge_template_id_random + template.event_badge_template_id )} > <span class="fas fa-edit"></span> Edit @@ -115,7 +115,7 @@ class="btn btn-sm variant-filled-error ml-2" onclick={() => delete_template( - template.event_badge_template_id_random + template.event_badge_template_id )} > <span class="fas fa-trash"></span> Delete diff --git a/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte b/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte index 3b3b6709..7e9388f7 100644 --- a/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte +++ b/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte @@ -81,7 +81,7 @@ } let location_data = { - event_id_random: $events_slct.event_id, + event_id: $events_slct.event_id, name: 'TEMP Location Name', enable: true }; @@ -261,7 +261,7 @@ <!-- <Element_ae_crud api_cfg={$ae_api} object_type={'event_location'} - object_id={event_location_obj?.event_location_id_random} + object_id={event_location_obj?.event_location_id} field_name={'description'} field_type={'textarea'} field_value={event_location_obj?.description} @@ -276,7 +276,7 @@ on:ae_crud_updated={e => { console.log(`ae_crud_updated:`, e.detail); - events_func.load_ae_obj_id__event_location({api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id_random, log_lvl: 1}); + events_func.load_ae_obj_id__event_location({api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id, log_lvl: 1}); }} > <strong class="text-sm"> @@ -287,21 +287,21 @@ <button type="button" onclick={() => { console.log('Show/Hide Description'); - if ($events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random) { + if ($events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id) { $events_sess.pres_mgmt.show_content__location_description = null; // Was testing with LiveQuery $events_slct.event_location_id = null; } else { - $events_sess.pres_mgmt.show_content__location_description = event_location_obj.event_location_id_random; + $events_sess.pres_mgmt.show_content__location_description = event_location_obj.event_location_id; // Was testing with LiveQuery - $events_slct.event_location_id = event_location_obj.event_location_id_random; + $events_slct.event_location_id = event_location_obj.event_location_id; } }} class="btn btn-sm preset-tonal-surface hover:preset-filled-surface-500 text-xs" > - {#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random} + {#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id} <span class="fas fa-eye-slash mx-1"></span> <span>Hide Description</span> {:else} @@ -312,7 +312,7 @@ <pre class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md" - class:hidden={$events_sess.pres_mgmt.show_content__location_description !== event_location_obj.event_location_id_random} + class:hidden={$events_sess.pres_mgmt.show_content__location_description !== event_location_obj.event_location_id} >{event_location_obj.description}</pre> {:else} @@ -323,7 +323,7 @@ <Element_ae_crud_v2 api_cfg={$ae_api} object_type={'event_location'} - object_id={event_location_obj?.event_location_id_random} + object_id={event_location_obj?.event_location_id} object_reload={true} field_name={'description'} field_type={'textarea'} @@ -350,7 +350,7 @@ if ( $events_sess.pres_mgmt .show_content__location_description == - event_location_obj.event_location_id_random + event_location_obj.event_location_id ) { $events_sess.pres_mgmt.show_content__location_description = null; @@ -360,16 +360,16 @@ null; } else { $events_sess.pres_mgmt.show_content__location_description = - event_location_obj.event_location_id_random; + event_location_obj.event_location_id; // Was testing with LiveQuery $events_slct.event_location_id = - event_location_obj.event_location_id_random; + event_location_obj.event_location_id; } }} class="btn btn-sm preset-tonal-surface hover:preset-filled-surface-500 text-xs" > - {#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random} + {#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id} <span class="fas fa-eye-slash mx-1" ></span> <span>Hide Description</span> @@ -384,7 +384,7 @@ class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md" class:hidden={$events_sess.pres_mgmt .show_content__location_description !== - event_location_obj.event_location_id_random}>{event_location_obj.description}</pre> + event_location_obj.event_location_id}>{event_location_obj.description}</pre> {:else} {@html ae_snip.html__not_set} {/if} @@ -393,20 +393,20 @@ {#if !$events_loc.pres_mgmt.show_content__location_devices_sessions || $events_loc.pres_mgmt.show_content__location_devices_sessions == 'default' || $events_loc.pres_mgmt.show_content__location_devices_sessions == 'sessions'} <!-- Show sessions for this location --> - {#if event_location_obj?.event_location_id_random} + {#if event_location_obj?.event_location_id} <Comp_event_session_obj_li link_to_type={'event_location'} - link_to_id={event_location_obj?.event_location_id_random} + link_to_id={event_location_obj?.event_location_id} event_session_id_random_li={[]} {log_lvl} ></Comp_event_session_obj_li> {/if} {:else if $events_loc.pres_mgmt.show_content__location_devices_sessions == 'devices'} <!-- Show devices for this location --> - {#if event_location_obj?.event_location_id_random} + {#if event_location_obj?.event_location_id} <Comp_event_device_obj_li link_to_type={'event_location'} - link_to_id={event_location_obj?.event_location_id_random} + link_to_id={event_location_obj?.event_location_id} event_device_id_random_li={[]} auto_refresh={$events_loc.pres_mgmt .refresh_interval ?? 90000} @@ -416,20 +416,13 @@ {/if} <!-- Show files for this location --> - <!-- <Element_manage_event_file_li_wrap - link_to_type={'event_location'} - link_to_id={event_location_obj?.event_location_id_random} - allow_basic={$events_loc.trusted_access} - allow_moderator={$events_loc.trusted_access} - container_class_li={''} - /> --> </div> </li> {/each} </ul> {:else} - <!-- <p class:hidden={display_mode != 'default'}> - No locations available to show at this time - </p> --> + <!-- <p> + No locations available to show at this time + </p> --> {/if} </section> diff --git a/src/routes/events/[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li.svelte b/src/routes/events/[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li.svelte index 1a43a019..94af7524 100644 --- a/src/routes/events/[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li.svelte +++ b/src/routes/events/[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li.svelte @@ -133,7 +133,7 @@ <ul class="space-y-1 px-4 m-2 bg-gray-100 rounded-md"> {#each $lq__event_presenter_obj_li as event_presenter_obj} <!-- This is a hack. I can not get the LiveQuery to work with specific presentation IDs. It only works with the session ID. I need to figure out how to get the presenters for the specific presentation. --> - <!-- {#if event_presenter_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random} --> + <!-- {#if event_presenter_obj.event_presentation_id == event_presentation_obj.event_presentation_id} --> <li class:dim={event_presenter_obj?.hide} class:dim_warning={!event_presenter_obj?.enable} @@ -150,7 +150,7 @@ font-bold min-w-64 max-w-96 my-0.5 overflow-hidden " - title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.person_primary_email}" + title="Person ID: {event_presenter_obj.person_id}; Email: {event_presenter_obj.person_primary_email}" > {#if event_presenter_obj?.given_name && event_presenter_obj?.given_name != 'Group'} <span @@ -228,18 +228,18 @@ '-- not set --', base_url: $ae_loc.url_origin, person_id: - event_presenter_obj?.person_id_random, + event_presenter_obj?.person_id, person_passcode: event_presenter_obj.person_passcode ?? '-- not set --', event_id: - event_presenter_obj.event_id_random, + event_presenter_obj.event_id, event_session_id: - event_presenter_obj.event_session_id_random, + event_presenter_obj.event_session_id, event_presentation_id: - event_presenter_obj.event_presentation_id_random, + event_presenter_obj.event_presentation_id, event_presenter_id: - event_presenter_obj.event_presenter_id_random, + event_presenter_obj.event_presenter_id, session_name: event_presenter_obj?.event_session_name ?? '-- not set --', @@ -259,26 +259,26 @@ {#if $events_loc.pres_mgmt?.require__presenter_agree} {#if event_presenter_obj?.agree} - <!-- {#if $ae_loc.trusted_access || $events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id_random]} --> + <!-- {#if $ae_loc.trusted_access || $events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id]} --> <button type="button" disabled={!$ae_loc.trusted_access && !$events_loc.auth__kv.presenter[ event_presenter_obj - .event_presenter_id_random + .event_presenter_id ]} onclick={() => { console.log('View terms and conditions'); $events_slct.event_presentation_id = - event_presenter_obj.event_presentation_id_random; + event_presenter_obj.event_presentation_id; // $events_slct.event_presentation_obj = $lq__event_presentation_obj; $events_slct.event_presenter_id = - event_presenter_obj.event_presenter_id_random; + event_presenter_obj.event_presenter_id; // $events_slct.event_presenter_obj = event_presenter_obj; $events_sess.pres_mgmt.show_modal__presenter_agree = - event_presenter_obj.event_presenter_id_random; + event_presenter_obj.event_presenter_id; }} class="btn preset-tonal-success hover:preset-filled-success-500 my-0.5" class:btn-sm={display_mode != 'default'} @@ -296,21 +296,21 @@ disabled={!$ae_loc.trusted_access && !$events_loc.auth__kv.presenter[ event_presenter_obj - .event_presenter_id_random + .event_presenter_id ]} onclick={() => { console.log('View terms and conditions'); $events_slct.event_presentation_id = - event_presenter_obj.event_presentation_id_random; + event_presenter_obj.event_presentation_id; // $events_slct.event_presentation_obj = $lq__event_presentation_obj; $events_slct.event_presenter_id = - event_presenter_obj.event_presenter_id_random; + event_presenter_obj.event_presenter_id; // $events_slct.event_presenter_obj = event_presenter_obj; $events_sess.pres_mgmt.show_modal__presenter_agree = - event_presenter_obj.event_presenter_id_random; + event_presenter_obj.event_presenter_id; }} class="btn preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 my-0.5" class:btn-sm={display_mode != 'default'} @@ -326,7 +326,7 @@ {/if} <div class="float-right space-2 flex flex-row items-center"> - {#if $ae_loc.administrator_access && !event_presenter_obj.person_id_random} + {#if $ae_loc.administrator_access && !event_presenter_obj.person_id} <button type="button" onclick={async () => { @@ -340,8 +340,8 @@ } let person_data = { - account_id_random: $slct.account_id, - // user_id_random: user_obj.user_id_random, + account_id: $slct.account_id, + // user_id: user_obj.user_id, given_name: 'New', family_name: 'Presenter', primary_email: @@ -373,10 +373,10 @@ { api_cfg: $ae_api, event_presenter_id: - event_presenter_obj.event_presenter_id_random, + event_presenter_obj.event_presenter_id, data_kv: { - person_id_random: - new_person_obj.person_id_random + person_id: + new_person_obj.person_id }, log_lvl: log_lvl } diff --git a/src/routes/idaa/(idaa)/bb/+page.svelte b/src/routes/idaa/(idaa)/bb/+page.svelte index a28569d4..a1470375 100644 --- a/src/routes/idaa/(idaa)/bb/+page.svelte +++ b/src/routes/idaa/(idaa)/bb/+page.svelte @@ -10,11 +10,11 @@ // *** Import Svelte specific import { page } from '$app/state'; import { browser } from '$app/environment'; - import { untrack } from 'svelte'; + // import { untrack } from 'svelte'; // import { goto, invalidate, pushState, replaceState } from '$app/navigation'; // *** Import other supporting libraries - import { Modal } from 'flowbite-svelte'; + // import { Modal } from 'flowbite-svelte'; import { liveQuery } from 'dexie'; // *** Import Aether specific variables and functions @@ -83,33 +83,33 @@ }); }); - let lq__post_obj = $derived.by(() => { - const post_id = $idaa_slct.post_id ?? ''; - return liveQuery(async () => { - if (!post_id) return null; - return await db_posts.post.get(post_id); - }); - }); + // let lq__post_obj = $derived.by(() => { + // const post_id = $idaa_slct.post_id ?? ''; + // return liveQuery(async () => { + // if (!post_id) return null; + // return await db_posts.post.get(post_id); + // }); + // }); - let lq__post_comment_obj_li = $derived.by(() => { - const post_id = $idaa_slct.post_id ?? ''; - return liveQuery(async () => { - if (!post_id) return []; - return await db_posts.comment - .where('post_id') - .equals(post_id) - .reverse() - .sortBy('updated_on'); - }); - }); + // let lq__post_comment_obj_li = $derived.by(() => { + // const post_id = $idaa_slct.post_id ?? ''; + // return liveQuery(async () => { + // if (!post_id) return []; + // return await db_posts.comment + // .where('post_id') + // .equals(post_id) + // .reverse() + // .sortBy('updated_on'); + // }); + // }); - let lq__post_comment_obj = $derived.by(() => { - const comment_id = $idaa_slct.post_comment_id ?? ''; - return liveQuery(async () => { - if (!comment_id) return null; - return await db_posts.comment.get(comment_id); - }); - }); + // let lq__post_comment_obj = $derived.by(() => { + // const comment_id = $idaa_slct.post_comment_id ?? ''; + // return liveQuery(async () => { + // if (!comment_id) return null; + // return await db_posts.comment.get(comment_id); + // }); + // }); // Handle Single Post Load Trigger $effect(() => { @@ -188,57 +188,57 @@ // ); } - function add_activity_log({ - action = 'idaa_bb_page', - action_with = 'none' - }: { - action?: string; - action_with?: string; - }) { - let last_cache_refresh_iso = new Date($ae_loc?.last_cache_refresh); + // function add_activity_log({ + // action = 'idaa_bb_page', + // action_with = 'none' + // }: { + // action?: string; + // action_with?: string; + // }) { + // let last_cache_refresh_iso = new Date($ae_loc?.last_cache_refresh); - let activity_description = ` - ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? 'no-email'} - allow=${$ae_loc?.allow_access} - last_cache_refresh=${last_cache_refresh_iso.toLocaleString()} - data_route=${data?.route.toString() ?? 'unknown'} - `; + // let activity_description = ` + // ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? 'no-email'} + // allow=${$ae_loc?.allow_access} + // last_cache_refresh=${last_cache_refresh_iso.toLocaleString()} + // data_route=${data?.route.toString() ?? 'unknown'} + // `; - let data_kv = { - external_client_id: data?.route.id, - name: `IDAA: ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? ''}`, - description: activity_description ?? null, - object_type: 'post', // archive, post, event - // object_id: data?.params?.event_id ?? null, - // object_id: ae_acct.slct.archive_id, // data?.params?.archive_id ?? null, - url_root: data?.url.origin, - // url_full_path: data?.url.href, - url_full_path: data?.url.pathname, - url_params: data?.url.searchParams.toString(), - action: action, - action_with: action_with ?? 'none', - meta_json: { - allow_access: $ae_loc?.allow_access, - last_cache_refresh: $ae_loc?.last_cache_refresh, - last_cache_refresh_iso: last_cache_refresh_iso.toISOString(), - last_cache_refresh_locale: last_cache_refresh_iso.toLocaleString(), - access_level: $ae_loc?.access_level, - iframe: $ae_loc?.iframe - // site_access_key: $ae_loc?.site_access_key, - // site_domain_access_key: $ae_loc?.site_domain_access_key, - // site_domain: $ae_loc?.site_domain, - // extra_data: extra_data ?? '', - // log_lvl: log_lvl, - } - }; + // let data_kv = { + // external_client_id: data?.route.id, + // name: `IDAA: ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? ''}`, + // description: activity_description ?? null, + // object_type: 'post', // archive, post, event + // // object_id: data?.params?.event_id ?? null, + // // object_id: ae_acct.slct.archive_id, // data?.params?.archive_id ?? null, + // url_root: data?.url.origin, + // // url_full_path: data?.url.href, + // url_full_path: data?.url.pathname, + // url_params: data?.url.searchParams.toString(), + // action: action, + // action_with: action_with ?? 'none', + // meta_json: { + // allow_access: $ae_loc?.allow_access, + // last_cache_refresh: $ae_loc?.last_cache_refresh, + // last_cache_refresh_iso: last_cache_refresh_iso.toISOString(), + // last_cache_refresh_locale: last_cache_refresh_iso.toLocaleString(), + // access_level: $ae_loc?.access_level, + // iframe: $ae_loc?.iframe + // // site_access_key: $ae_loc?.site_access_key, + // // site_domain_access_key: $ae_loc?.site_domain_access_key, + // // site_domain: $ae_loc?.site_domain, + // // extra_data: extra_data ?? '', + // // log_lvl: log_lvl, + // } + // }; - core_func.create_ae_obj__activity_log({ - api_cfg: $ae_api, - account_id: $ae_loc.account_id, - data_kv: data_kv, - log_lvl: log_lvl - }); - } + // core_func.create_ae_obj__activity_log({ + // api_cfg: $ae_api, + // account_id: $ae_loc.account_id, + // data_kv: data_kv, + // log_lvl: log_lvl + // }); + // } </script> <svelte:head> diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte index f8967260..72d01041 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte @@ -473,6 +473,7 @@ Copy and paste link: <a href="${link_base_url}?post_id=${$idaa_slct.post_id}">${ Title of BB post: </span> <input + autofocus type="text" id="title" name="title" diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte index f1bb1687..8e15a39c 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte @@ -38,7 +38,7 @@ // let search_submit_results: any = null; - if (log_lvl) console.log('** Component Loaded: ** Post Options'); + // if (log_lvl) console.log('** Component Loaded: ** Post Options'); </script> <!-- preset-filled-surface-500 --> @@ -180,7 +180,7 @@ let data_kv = { external_person_id: $idaa_loc.novi_uuid, - title: 'Change NEW Post Title', + title: '', full_name: $idaa_loc.novi_full_name, email: $idaa_loc.novi_email, enable: true