From 9bf2373a82ddb1b6e545a54136362f37902547b0 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 29 Jan 2026 12:21:47 -0500 Subject: [PATCH] Slowly updating things to Data Store v3. Also doing some safe code clean up. Mainly removing commented out code. --- src/routes/events/+layout.svelte | 7 ++- .../location/[event_location_id]/+page.svelte | 9 --- .../location_page_menu.svelte | 2 +- .../(pres_mgmt)/locations/+page.svelte | 2 +- src/routes/hosted_files/+layout.svelte | 4 +- .../(idaa)/archives/[archive_id]/+page.svelte | 13 ----- .../(idaa)/recovery_meetings/+page.svelte | 16 ++--- src/routes/idaa/+layout.svelte | 25 +------- src/routes/journals/+layout.svelte | 2 +- .../entry/[journal_entry_id]/+page.svelte | 58 +------------------ 10 files changed, 19 insertions(+), 119 deletions(-) diff --git a/src/routes/events/+layout.svelte b/src/routes/events/+layout.svelte index 862f92e5..0ccd5994 100644 --- a/src/routes/events/+layout.svelte +++ b/src/routes/events/+layout.svelte @@ -13,7 +13,7 @@ // *** Import Aether specific variables and functions import type { key_val } from '$lib/stores/ae_stores'; import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores'; - import Element_data_store from '$lib/elements/element_data_store_v2.svelte'; + import Element_data_store from '$lib/elements/element_data_store_v3.svelte'; import { events_loc, events_sess, @@ -223,7 +223,10 @@ Æ Events {#if !$ae_sess?.disable_sys_header} - + {/if} 0) { $idaa_sess.recovery_meetings.qry__status = 'done'; @@ -174,7 +174,7 @@ if (current_search_id === last_search_id) { const api_results = results || []; const api_ids = api_results.map((e: any) => e.id || e.event_id_random).filter(Boolean); - + // If API returns 0 but local search found broad results, protect the UI if (api_ids.length === 0 && local_ids.length > 0 && !remote_first && !qry_str) { if (log_lvl) console.warn(`[Search #${current_search_id}] Revalidation returned 0. Preserving cache.`); diff --git a/src/routes/idaa/+layout.svelte b/src/routes/idaa/+layout.svelte index 5d8a8b8f..18d8a304 100644 --- a/src/routes/idaa/+layout.svelte +++ b/src/routes/idaa/+layout.svelte @@ -20,14 +20,7 @@ } from '$lib/stores/ae_stores'; import { core_func } from '$lib/ae_core/ae_core_functions'; import { idaa_loc, idaa_sess, idaa_slct } from '$lib/stores/ae_idaa_stores'; - import Element_data_store from '$lib/elements/element_data_store_v2.svelte'; - - // const modalRegistry: Record = { - // // Set a unique modal ID, then pass the component reference - // // modalComponentEditSponsorshipObj: { ref: ModalComponentEditSponsorshipObj }, - // // modalComponentTwo: { ref: ModalComponentTwo }, - // // ... - // }; + import Element_data_store from '$lib/elements/element_data_store_v3.svelte'; interface Props { /** @type {import('./$types').LayoutData} */ @@ -37,13 +30,6 @@ let { data, children }: Props = $props(); - // if (browser) { - // add_activity_log({ - // action: 'idaa_root_layout', - // action_with: 'browser' - // }); - // } - function add_activity_log({ action = 'idaa_root_layout', action_with = 'none' @@ -179,15 +165,6 @@ // }); }); - // if (browser) { - // $idaa_loc.novi_uuid = data.params.uuid; - // $idaa_loc.novi_email = decodeURIComponent(data.params.email); - // $idaa_loc.novi_full_name = decodeURIComponent(data.params.full_name); - // // $idaa_loc.novi_admin_li = novi_admin_li; - // // $idaa_loc.novi_trusted_li = novi_trusted_li; - // console.log(`$idaa_loc.novi_uuid:`, $idaa_loc.novi_uuid); - // } - let iframe = data.url.searchParams.get('iframe'); if (browser && iframe == 'true') { console.log('Use iframe layout!'); diff --git a/src/routes/journals/+layout.svelte b/src/routes/journals/+layout.svelte index 40a7048a..4205e24a 100644 --- a/src/routes/journals/+layout.svelte +++ b/src/routes/journals/+layout.svelte @@ -16,7 +16,7 @@ journals_slct, journals_trig } from '$lib/ae_journals/ae_journals_stores'; - import Element_data_store from '$lib/elements/element_data_store_v2.svelte'; + import Element_data_store from '$lib/elements/element_data_store_v3.svelte'; import Help_tech from '$lib/app_components/e_app_help_tech.svelte'; // *** Setup Svelte properties diff --git a/src/routes/journals/[journal_id]/entry/[journal_entry_id]/+page.svelte b/src/routes/journals/[journal_id]/entry/[journal_entry_id]/+page.svelte index c88141c4..6f396f9f 100644 --- a/src/routes/journals/[journal_id]/entry/[journal_entry_id]/+page.svelte +++ b/src/routes/journals/[journal_id]/entry/[journal_entry_id]/+page.svelte @@ -30,12 +30,9 @@ journals_prom, journals_trig } from '$lib/ae_journals/ae_journals_stores'; - // import { journals_func } from '$lib/ae_journals/ae_journals_functions'; - // import Journal_entry_obj_id_edit from './ae_journals_comp__journal_entry_obj_id_edit.svelte'; import Journal_entry_view from './../../../ae_comp__journal_entry_obj_id_view.svelte'; - // import Journal_page_menu from './session_page_menu.svelte'; - // import Element_data_store from '$lib/element_data_store_v2.svelte'; + // import Element_data_store from '$lib/elements/element_data_store_v3.svelte'; import AeCompModalJournalExport from '../../../ae_comp__modal_journal_export.svelte'; interface Props { @@ -183,59 +180,6 @@ } }); - // $effect(() => { - // if (browser && $lq__journal_entry_obj?.journal_entry_id) { - - // // $journals_loc.entry_view_history_li = [...new Set($journals_loc.entry_view_history_li)] - - // let tmp_history_li = [ - // ...new Set($journals_loc?.entry_view_history_li ?? []) - // ]; - - // // Limit to last 15 entries - // if (tmp_history_li.length > 15) { - // tmp_history_li = tmp_history_li.slice(tmp_history_li.length - 15); - // } - - // // let chk_history_li = tmp_history_li?.filter(item => item.id === $lq__journal_entry_obj?.journal_entry_id); - - // // if (chk_history_li?.length) { - // // // Already in history, do not add again - // // console.log(`Entry ID = ${$lq__journal_entry_obj?.journal_entry_id} already in history, not adding again.`, tmp_history_li); - - // // // if (tmp_history_li !== $journals_loc.entry_view_history_li) { - // // if (JSON.stringify(tmp_history_li) !== JSON.stringify($journals_loc.entry_view_history_li)) { - // // $journals_loc.entry_view_history_li = tmp_history_li; - - // // console.log(`$journals_loc.entry_view_history_li = `, $journals_loc.entry_view_history_li); - // // } - - // // return; - // // } - - // tmp_history_li.push({ - // id: $lq__journal_entry_obj?.journal_entry_id ?? 'NONE', - // name: $lq__journal_entry_obj?.name ?? ae_util.iso_datetime_formatter($lq__journal_entry_obj?.created_on, 'datetime_iso_12_no_seconds'), - // url: `/journals/${$lq__journal_entry_obj?.journal_id ?? 'NONE'}/entry/${$lq__journal_entry_obj?.journal_entry_id ?? 'NONE'}`, - // }); - - // // Remove duplicates and keep most recent - // tmp_history_li = [...new Set(tmp_history_li.map(item => JSON.stringify(item)))].map(item => JSON.parse(item)); - - // // Limit to last 15 entries - // if (tmp_history_li.length > 15) { - // tmp_history_li = tmp_history_li.slice(tmp_history_li.length - 15); - // } - - // if (JSON.stringify(tmp_history_li) !== JSON.stringify($journals_loc?.entry_view_history_li)) { - // $journals_loc.entry_view_history_li = tmp_history_li; - - // console.log(`$journals_loc.entry_view_history_li = `, $journals_loc?.entry_view_history_li); - // } - - // console.log(`$journals_loc.entry_view_history_li = `, $journals_loc?.entry_view_history_li); - // } - // }); $effect(() => { if (browser && $lq__journal_entry_obj?.journal_entry_id) {