fix(locations): auto-load locations on page open; fix session query and POC visibility

- Add +page.ts to trigger load_ae_obj_li__event_location on page load (locations
  were never fetched without a manual trigger)
- Fix ae_comp__event_session_obj_li_wrapper: query used event_location_id_random
  (deprecated index) instead of event_location_id, causing empty session lists
  under each location
- Wire hide__session_poc to pres_mgmt_loc.current.show__session_li_poc_field so
  the Options toggle actually takes effect in the per-location session list
- Also set hide__session_location=true since location is implicit in that context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-19 11:54:22 -04:00
parent a42b49dd50
commit 721facf7ba
4 changed files with 33 additions and 6 deletions

View File

@@ -5,8 +5,9 @@
## 🔴 BGH Conference — April 21 (Must Fix Before Event) ## 🔴 BGH Conference — April 21 (Must Fix Before Event)
- [ ] **[Locations] Event Locations list does not auto-load** — list must be loaded automatically on - [x] **[Locations] Event Locations list does not auto-load** — added `+page.ts` to trigger
page open; currently requires manual trigger. Also needs general cleanup of the Locations list UI. `load_ae_obj_li__event_location` on page load. Also fixed session query using stale
`event_location_id_random` index (should be `event_location_id`). (2026-04-19)
- [ ] **[Files] Warn/error on `.ppt` upload** — if a presenter tries to upload a `.ppt` file (legacy - [ ] **[Files] Warn/error on `.ppt` upload** — if a presenter tries to upload a `.ppt` file (legacy
PowerPoint format), show a clear warning or block the upload with an error message instructing them PowerPoint format), show a clear warning or block the upload with an error message instructing them
@@ -19,9 +20,10 @@
the build and deployment process; verify the latest version is installed and functional on the the build and deployment process; verify the latest version is installed and functional on the
onsite Mac laptops before April 21. onsite Mac laptops before April 21.
- [ ] **[Pres Mgmt] POC column shown in "Sessions at this Location"** — the POC (Point of Contact) - [x] **[Pres Mgmt] POC column shown in "Sessions at this Location"** — wired
column is appearing in the Sessions at this Location view when it should be hidden. Identify the `hide__session_poc={!pres_mgmt_loc.current.show__session_li_poc_field}` in
condition controlling visibility and suppress it in this context. `ae_comp__event_location_obj_li.svelte`; also set `hide__session_location={true}` since
location is implicit in that context. (2026-04-19)
--- ---

View File

@@ -0,0 +1,23 @@
/** @type {import('./$types').PageLoad} */
import { browser } from '$app/environment';
import { events_func } from '$lib/ae_events/ae_events_functions';
export async function load({ parent }) {
const parent_data = await parent();
const account_id = parent_data.account_id;
const ae_acct = parent_data[account_id];
const event_id = ae_acct.slct.event_id;
if (browser && event_id) {
events_func.load_ae_obj_li__event_location({
api_cfg: ae_acct.api,
for_obj_type: 'event',
for_obj_id: event_id,
hidden: 'all'
});
}
return parent_data;
}

View File

@@ -386,6 +386,8 @@ if (!pres_mgmt_loc.current.location_kv) {
link_to_type={'event_location'} link_to_type={'event_location'}
link_to_id={event_location_obj?.event_location_id} link_to_id={event_location_obj?.event_location_id}
event_session_id_random_li={[]} event_session_id_random_li={[]}
hide__session_location={true}
hide__session_poc={!pres_mgmt_loc.current.show__session_li_poc_field}
{log_lvl}></Comp_event_session_obj_li> {log_lvl}></Comp_event_session_obj_li>
{/if} {/if}
{:else if pres_mgmt_loc.current.show_content__location_devices_sessions == 'devices'} {:else if pres_mgmt_loc.current.show_content__location_devices_sessions == 'devices'}

View File

@@ -41,7 +41,7 @@ let lq__event_session_obj_li = $derived.by(() => {
return liveQuery(async () => { return liveQuery(async () => {
if (link_to_type && link_to_id) { if (link_to_type && link_to_id) {
const results = await db_events.session const results = await db_events.session
.where(`${link_to_type}_id_random`) .where(`${link_to_type}_id`)
.equals(link_to_id) .equals(link_to_id)
.sortBy('start_datetime'); .sortBy('start_datetime');
return results; return results;