Progress on more low level updates to the Events module loading process.
This commit is contained in:
@@ -5,6 +5,8 @@ import { db_save_ae_obj_li__ae_obj } from "$lib/ae_core/core__idb_dexie";
|
||||
import { db_events } from "$lib/ae_events/db_events";
|
||||
|
||||
import { load_ae_obj_li__event_device } from './ae_events__event_device';
|
||||
import { load_ae_obj_li__event_location } from './ae_events__event_location';
|
||||
import { load_ae_obj_li__event_session } from './ae_events__event_session';
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
|
||||
@@ -96,23 +98,79 @@ export async function load_ae_obj_id__event(
|
||||
}
|
||||
|
||||
if (inc_device_li) {
|
||||
// Load the devices for the
|
||||
// Load the devices for the event
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the device list for the now`);
|
||||
console.log(`Need to load the device list for the event now`);
|
||||
}
|
||||
let load_event_device_obj_li = load_ae_obj_li__event_device({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'all', qry__limit: 50},
|
||||
params: {qry__enabled: 'enabled', qry__limit: 49},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
}).then((event_device_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_device_obj_li = `, event_device_obj_li);
|
||||
}
|
||||
return event_device_obj_li;
|
||||
});
|
||||
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_device_obj_li = `, load_event_device_obj_li);
|
||||
}
|
||||
ae_promises.load__event_obj.event_device_li = load_event_device_obj_li;
|
||||
ae_promises.load__event_obj.event_device_obj_li = load_event_device_obj_li;
|
||||
}
|
||||
|
||||
if (inc_location_li) {
|
||||
// Load the locations for the event
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the location list for the event now`);
|
||||
}
|
||||
let load_event_location_obj_li = load_ae_obj_li__event_location({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'enabled', qry__limit: 19},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
}).then((event_location_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_location_obj_li = `, event_location_obj_li);
|
||||
}
|
||||
return event_location_obj_li;
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
||||
}
|
||||
ae_promises.load__event_obj.event_location_obj_li = load_event_location_obj_li;
|
||||
}
|
||||
|
||||
if (inc_session_li) {
|
||||
// Load the sessions for the events
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the session list for the event now`);
|
||||
}
|
||||
let load_event_session_obj_li = load_ae_obj_li__event_session({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'enabled', qry__limit: 249},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
}).then((event_session_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_session_obj_li = `, event_session_obj_li);
|
||||
}
|
||||
return event_session_obj_li;
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
||||
}
|
||||
ae_promises.load__event_obj.event_session_obj_li = load_event_session_obj_li;
|
||||
}
|
||||
|
||||
return ae_promises.load__event_obj;
|
||||
@@ -127,6 +185,7 @@ export async function load_ae_obj_li__event(
|
||||
for_obj_id,
|
||||
qry_conference = true,
|
||||
qry_str = null,
|
||||
inc_device_li = false,
|
||||
inc_file_li = false,
|
||||
inc_location_li = false,
|
||||
inc_presentation_li = false,
|
||||
@@ -147,6 +206,7 @@ export async function load_ae_obj_li__event(
|
||||
for_obj_id: string,
|
||||
qry_conference?: null|boolean,
|
||||
qry_str?: null|string,
|
||||
inc_device_li?: boolean,
|
||||
inc_file_li?: boolean,
|
||||
inc_location_li?: boolean,
|
||||
inc_presentation_li?: boolean,
|
||||
@@ -233,7 +293,7 @@ export async function load_ae_obj_li__event(
|
||||
if (log_lvl) {
|
||||
console.log('Saving to DB...');
|
||||
}
|
||||
db_save_ae_obj_li__ae_obj({
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'events',
|
||||
obj_li: processed_obj_li,
|
||||
@@ -257,6 +317,117 @@ export async function load_ae_obj_li__event(
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_obj_li:', ae_promises.load__event_obj_li);
|
||||
}
|
||||
|
||||
if (inc_device_li) {
|
||||
// Load the devices for the events
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the device list for each event now`);
|
||||
}
|
||||
for (let i = 0; i < ae_promises.load__event_obj_li.length; i++) {
|
||||
let event_obj = ae_promises.load__event_obj_li[i];
|
||||
let event_id = event_obj.event_id_random;
|
||||
|
||||
let load_event_device_obj_li = load_ae_obj_li__event_device({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'enabled', qry__limit: 49},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then((event_device_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_device_obj_li = `, event_device_obj_li);
|
||||
}
|
||||
|
||||
return event_device_obj_li;
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_device_obj_li = `, load_event_device_obj_li);
|
||||
}
|
||||
|
||||
if (load_event_device_obj_li) {
|
||||
ae_promises.load__event_obj_li[i].event_device_obj_li = load_event_device_obj_li;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_location_li) {
|
||||
// Load the locations for the events
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the location list for each event now`);
|
||||
}
|
||||
for (let i = 0; i < ae_promises.load__event_obj_li.length; i++) {
|
||||
let event_obj = ae_promises.load__event_obj_li[i];
|
||||
let event_id = event_obj.event_id_random;
|
||||
|
||||
let load_event_location_obj_li = load_ae_obj_li__event_location({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'enabled', qry__limit: 19},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then((event_location_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_location_obj_li = `, event_location_obj_li);
|
||||
}
|
||||
|
||||
return event_location_obj_li;
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
||||
}
|
||||
|
||||
if (load_event_location_obj_li) {
|
||||
ae_promises.load__event_obj_li[i].event_location_obj_li = load_event_location_obj_li;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_session_li) {
|
||||
// Load the sessions for the events
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the session list for each event now`);
|
||||
}
|
||||
for (let i = 0; i < ae_promises.load__event_obj_li.length; i++) {
|
||||
let event_obj = ae_promises.load__event_obj_li[i];
|
||||
let event_id = event_obj.event_id_random;
|
||||
|
||||
let load_event_session_obj_li = load_ae_obj_li__event_session({
|
||||
api_cfg: api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
order_by_li: order_by_li,
|
||||
params: params,
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then((event_session_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_session_obj_li = `, event_session_obj_li);
|
||||
}
|
||||
|
||||
return event_session_obj_li;
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
||||
}
|
||||
|
||||
if (load_event_session_obj_li) {
|
||||
ae_promises.load__event_obj_li[i].event_session_obj_li = load_event_session_obj_li;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ae_promises.load__event_obj_li;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').LayoutProps} */
|
||||
let log_lvl: number = 0;
|
||||
|
||||
|
||||
// Imports
|
||||
// *** Import Svelte specific
|
||||
import { browser } from '$app/environment';
|
||||
// *** Import other supporting libraries
|
||||
@@ -18,6 +18,7 @@ const modalRegistry: Record<string, ModalComponent> = {
|
||||
// ...
|
||||
};
|
||||
|
||||
// *** Import Aether specific variables and functions
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { ae_loc, ae_sess, ae_api, slct } from '$lib/ae_stores';
|
||||
@@ -42,10 +43,12 @@ $events_loc.qry__offset = 0;
|
||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||
$slct.account_id = data.account_id;
|
||||
console.log(`$slct.account_id = `, $slct.account_id);
|
||||
if (log_lvl) {
|
||||
console.log(`$slct.account_id = `, $slct.account_id);
|
||||
}
|
||||
let ae_acct = data[$slct.account_id];
|
||||
// console.log(`ae_acct = `, ae_acct);
|
||||
|
||||
|
||||
$events_slct.event_id = ae_acct.slct.event_id;
|
||||
// $events_slct.event_obj = ae_acct.slct.event_obj;
|
||||
$events_slct.event_obj_li = ae_acct.slct.event_obj_li;
|
||||
|
||||
@@ -2,49 +2,49 @@
|
||||
console.log(`ae_events_pres_mgmt +layout.ts start`);
|
||||
|
||||
// Imports
|
||||
import { browser } from '$app/environment';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
// import { browser } from '$app/environment';
|
||||
// import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
|
||||
export async function load({ parent }) {
|
||||
let log_lvl: number = 0;
|
||||
|
||||
let data = await parent();
|
||||
// console.log(`ae_events_pres_mgmt +layout.ts data:`, data);
|
||||
let parent_data = await parent();
|
||||
// console.log(`ae_events_pres_mgmt +layout.ts parent_data:`, parent_data);
|
||||
|
||||
let account_id = data.account_id;
|
||||
let account_id = parent_data.account_id;
|
||||
if (!account_id) {
|
||||
console.log(`events_pres_mgmt +layout.ts: The account_id was not found in the data!!!`);
|
||||
console.log(`events_pres_mgmt +layout.ts: The account_id was not found in the parent_data!!!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let ae_acct = data[account_id];
|
||||
let ae_acct = parent_data[account_id];
|
||||
if (log_lvl) {
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
}
|
||||
|
||||
let event_id = ae_acct.slct.event_id; // From root +layout.ts
|
||||
// let event_id = ae_acct.slct.event_id; // From root +layout.ts
|
||||
// if (!event_id) {
|
||||
// console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the data!!!`);
|
||||
// console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the parent_data!!!`);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (browser) {
|
||||
if (log_lvl) {
|
||||
console.log(`ae_events_pres_mgmt +layout.ts data:`, data);
|
||||
}
|
||||
// if (browser) {
|
||||
// if (log_lvl) {
|
||||
// console.log(`ae_events_pres_mgmt +layout.ts parent_data:`, parent_data);
|
||||
// }
|
||||
|
||||
// Should we limit these to event.conference = true?
|
||||
let load_event_obj_li = events_func.load_ae_obj_li__event({
|
||||
api_cfg: ae_acct.api,
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
params: {qry__enabled: 'enabled', qry__limit: 25},
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
}
|
||||
// // Should we limit these to event.conference = true?
|
||||
// let load_event_obj_li = events_func.load_ae_obj_li__event({
|
||||
// api_cfg: ae_acct.api,
|
||||
// for_obj_type: 'account',
|
||||
// for_obj_id: account_id,
|
||||
// params: {qry__enabled: 'enabled', qry__limit: 25},
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
// }
|
||||
|
||||
// let load_event_obj = events_func.load_ae_obj_id__event({
|
||||
// api_cfg: ae_acct.api,
|
||||
@@ -60,12 +60,12 @@ export async function load({ parent }) {
|
||||
// // manage: {name: 'Manage', href: '/events_pres_mgmt/manage', access: 'administrator', disable: true, hide: true},
|
||||
// locations: {name: 'Locations', href: `/events/${event_id}/locations`, access: false, disable: false, hide: false},
|
||||
// };
|
||||
// data.submenu = submenu
|
||||
// parent_data.submenu = submenu
|
||||
|
||||
// WARNING: Precaution against shared data between sites and sessions.
|
||||
data[account_id] = ae_acct;
|
||||
// WARNING: Precaution against shared parent_data between sites and sessions.
|
||||
parent_data[account_id] = ae_acct;
|
||||
|
||||
return data;
|
||||
return parent_data;
|
||||
}
|
||||
|
||||
// export const prerender = false;
|
||||
|
||||
@@ -1,22 +1,65 @@
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { browser } from '$app/environment';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
export async function load({ parent }) {
|
||||
let log_lvl: number = 0;
|
||||
|
||||
let data = await parent();
|
||||
let parent_data = await parent();
|
||||
|
||||
// let account_id = data.account_id;
|
||||
// if (!account_id) {
|
||||
// console.log(`events_pres_mgmt +page.ts: The account_id was not found in the data!!!`);
|
||||
// error(500, {
|
||||
// message: 'Not found'
|
||||
// });
|
||||
// }
|
||||
let account_id = parent_data.account_id;
|
||||
|
||||
// let ae_acct = data[account_id];
|
||||
let ae_acct = parent_data[account_id];
|
||||
|
||||
let event_id = ae_acct.slct.event_id; // From root +layout.ts
|
||||
if (!event_id) {
|
||||
if (log_lvl) {
|
||||
console.log(`INFO: events +layout.ts: The event_id was not found in the parent_data.`);
|
||||
}
|
||||
// return false;
|
||||
}
|
||||
|
||||
if (browser) {
|
||||
if (event_id) {
|
||||
// let ae_params = {};
|
||||
|
||||
let load_event_obj_li = await events_func.load_ae_obj_id__event({
|
||||
api_cfg: ae_acct.api,
|
||||
event_id: event_id,
|
||||
hidden: 'all', // 'not_hidden' to load only visible entries
|
||||
// params: ae_params,
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
}
|
||||
|
||||
let load_event_obj_li = await events_func.load_ae_obj_li__event({
|
||||
api_cfg: ae_acct.api,
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
inc_session_li: true,
|
||||
hidden: 'all', // 'not_hidden'
|
||||
enabled: 'enabled',
|
||||
// order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
limit: 25,
|
||||
// params: ae_params,
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
|
||||
|
||||
}
|
||||
|
||||
parent_data[account_id] = ae_acct;
|
||||
|
||||
return parent_data;
|
||||
|
||||
|
||||
// let ae_acct = parent_data[account_id];
|
||||
|
||||
// Should we limit these to event.conference = true?
|
||||
// let load_event_obj_li = await events_func.load_ae_obj_li__event({
|
||||
@@ -28,7 +71,7 @@ export async function load({ parent }) {
|
||||
// });
|
||||
// ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
|
||||
// data[account_id] = ae_acct;
|
||||
// parent_data[account_id] = ae_acct;
|
||||
|
||||
return data;
|
||||
// return parent_data;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function load({ params, parent }) { // route
|
||||
if (!event_id) {
|
||||
console.log(`ae Events - [event_id] +page.ts: The event_id was not found in the params.event_id!!!`);
|
||||
error(404, {
|
||||
message: 'Event ID not found'
|
||||
message: 'Events Pres Mgmt - Event ID not found'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,37 +41,42 @@ export async function load({ params, parent }) { // route
|
||||
// ae_acct.slct.event_obj = await load_event_obj;
|
||||
|
||||
if (browser) {
|
||||
let load_event_obj = events_func.load_ae_obj_id__event({
|
||||
let load_event_obj = await events_func.load_ae_obj_id__event({
|
||||
api_cfg: ae_acct.api,
|
||||
event_id: event_id,
|
||||
inc_device_li: true,
|
||||
inc_location_li: true,
|
||||
inc_session_li: true,
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
console.log(`load_event_obj = `, load_event_obj);
|
||||
ae_acct.slct.event_obj = load_event_obj;
|
||||
ae_acct.slct.event_device_obj_li = load_event_obj.event_device_obj_li;
|
||||
ae_acct.slct.event_location_obj_li = load_event_obj.event_location_obj_li;
|
||||
ae_acct.slct.event_session_obj_li = load_event_obj.event_session_obj_li;
|
||||
|
||||
let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({
|
||||
api_cfg: ae_acct.api,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
||||
ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
|
||||
// let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({
|
||||
// api_cfg: ae_acct.api,
|
||||
// for_obj_type: 'event',
|
||||
// for_obj_id: event_id,
|
||||
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
||||
// ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
|
||||
|
||||
let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({
|
||||
api_cfg: ae_acct.api,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
||||
ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
||||
// let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({
|
||||
// api_cfg: ae_acct.api,
|
||||
// for_obj_type: 'event',
|
||||
// for_obj_id: event_id,
|
||||
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
||||
// ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
||||
}
|
||||
|
||||
// WARNING: Precaution against shared data between sites and sessions.
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').PageData} */
|
||||
export let data: any;
|
||||
let log_lvl: number = 0;
|
||||
// console.log(`ae_events_pres_mgmt event [event_id] +page.svelte data:`, data);
|
||||
|
||||
// *** Import Svelte specific
|
||||
import { browser } from '$app/environment';
|
||||
// import { goto, invalidate, pushState, replaceState } from '$app/navigation';
|
||||
|
||||
@@ -11,6 +10,7 @@ import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
import Comp_event_session_obj_li from '../ae_comp__event_session_obj_li.svelte';
|
||||
import Comp_event_session_obj_li_wrapper from '../ae_comp__event_session_obj_li_wrapper.svelte';
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
@@ -23,6 +23,11 @@ import Comp_event_files_upload from '../ae_comp__event_files_upload.svelte';
|
||||
import Element_manage_event_file_li_wrap from '$lib/element_manage_event_file_li_direct.svelte';
|
||||
import Event_page_menu from './event_page_menu.svelte';
|
||||
|
||||
interface Props {
|
||||
data: any;
|
||||
}
|
||||
|
||||
let { data }: Props = $props();
|
||||
|
||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||
// $slct.account_id = data.account_id;
|
||||
@@ -37,52 +42,74 @@ if (log_lvl) {
|
||||
console.log(`event_id layout B: ${ae_acct.slct.event_id}`);
|
||||
console.log(`event_id layout C: ${$events_slct.event_id}`);
|
||||
}
|
||||
$: event_id = data.params.event_id;
|
||||
let event_id = data.params.event_id;
|
||||
$events_slct.event_id = ae_acct.slct.event_id;
|
||||
// $events_slct.event_device_id = null;
|
||||
// $events_slct.event_location_id = null;
|
||||
// $events_slct.event_session_id = null;
|
||||
|
||||
|
||||
$: lq__event_obj = liveQuery(async () => {
|
||||
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.events
|
||||
.get($events_slct.event_id)
|
||||
.get($events_slct?.event_id ?? '');
|
||||
|
||||
return results;
|
||||
});
|
||||
}));
|
||||
|
||||
// JSON formatted configuration options for an event, and specifically for the presentation management module.
|
||||
$: if ($lq__event_obj?.mod_pres_mgmt_json) {
|
||||
// if (log_lvl) {
|
||||
// console.log(`*** Event Pres Mgmt JSON *** pres_mgmt_cfg_local`, $events_loc.pres_mgmt);
|
||||
// }
|
||||
// $events_loc.pres_mgmt =
|
||||
events_func.sync_config__event_pres_mgmt({
|
||||
pres_mgmt_cfg_remote: $lq__event_obj.mod_pres_mgmt_json,
|
||||
pres_mgmt_cfg_local: $events_loc.pres_mgmt,
|
||||
log_lvl: log_lvl,
|
||||
});
|
||||
}
|
||||
$effect(() => {
|
||||
if ($lq__event_obj?.mod_pres_mgmt_json) {
|
||||
// if (log_lvl) {
|
||||
// console.log(`*** Event Pres Mgmt JSON *** pres_mgmt_cfg_local`, $events_loc.pres_mgmt);
|
||||
// }
|
||||
// $events_loc.pres_mgmt =
|
||||
events_func.sync_config__event_pres_mgmt({
|
||||
pres_mgmt_cfg_remote: $lq__event_obj.mod_pres_mgmt_json,
|
||||
pres_mgmt_cfg_local: $events_loc.pres_mgmt,
|
||||
log_lvl: log_lvl,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let event_session_id_random_li: Array<string> = [];
|
||||
let event_session_id_random_li: Array<string> = $state([]);
|
||||
|
||||
// OMG THIS WORKS!!! 2024-09-17
|
||||
// Using the $: seems to have fixed it along with the async await?
|
||||
$: lq__event_session_obj_li = liveQuery(async () => {
|
||||
let results = await db_events.sessions
|
||||
.bulkGet(event_session_id_random_li);
|
||||
let lq__event_session_obj_li = $derived(liveQuery(async () => {
|
||||
// console.log(`*** LiveQuery: lq__event_session_obj_li *** event_session_id_random_li`, $state.snapshot(event_session_id_random_li));
|
||||
// if (!event_session_id_random_li) {
|
||||
// // return [];
|
||||
// return;
|
||||
// }
|
||||
if (event_session_id_random_li.length) {
|
||||
console.log(`*** LiveQuery: lq__event_session_obj_li *** time to bulkGet`, $state.snapshot(event_session_id_random_li));
|
||||
let results = await db_events.sessions
|
||||
.bulkGet(event_session_id_random_li);
|
||||
|
||||
return results;
|
||||
});
|
||||
return results;
|
||||
} else {
|
||||
let results = await db_events.sessions
|
||||
.where('event_id')
|
||||
.equals($events_slct?.event_id ?? '') // null or undefined does not reset things like '' does
|
||||
.reverse()
|
||||
.sortBy('name');
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
|
||||
$: lq__event_location_obj_li = liveQuery(async () => {
|
||||
let lq__event_location_obj_li = $derived(liveQuery(async () => {
|
||||
let results = await db_events.locations
|
||||
.where('event_id_random')
|
||||
.equals($events_slct.event_id)
|
||||
.sortBy('name')
|
||||
;
|
||||
return results;
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
// let load_obj_li_results: Promise<any>|key_val;
|
||||
@@ -108,31 +135,57 @@ if (browser) {
|
||||
|
||||
|
||||
// Updated 2024-06-12 late
|
||||
$: if ($events_trigger == 'load__event_session_obj_li' && $events_slct.event_id) {
|
||||
console.log(`load__event_session_obj_li() $events_slct.event_id=${$events_slct.event_id}`);
|
||||
$effect(() => {
|
||||
if ($events_trigger == 'load__event_session_obj_li' && $events_slct.event_id) {
|
||||
console.log(`load__event_session_obj_li() $events_slct.event_id=${$events_slct.event_id}`);
|
||||
|
||||
$events_trigger = null;
|
||||
$events_trigger = null;
|
||||
|
||||
if ($events_loc.pres_mgmt.save_search_text) {
|
||||
if (log_lvl) {
|
||||
console.log(`*** Save search text *** ${$events_loc.pres_mgmt.save_search_text}`);
|
||||
if ($events_loc.pres_mgmt.save_search_text) {
|
||||
if (log_lvl) {
|
||||
console.log(`*** Save search text *** ${$events_loc.pres_mgmt.save_search_text}`);
|
||||
}
|
||||
$events_loc.pres_mgmt.saved_search__session = $events_sess.pres_mgmt.fulltext_search_qry_str;
|
||||
$events_loc.pres_mgmt.saved_search__session_location_name = $events_sess.pres_mgmt.location_name_qry_str;
|
||||
}
|
||||
|
||||
if ( $events_sess.pres_mgmt.fulltext_search_qry_str?.length > 2 ) {
|
||||
console.log('*** Search string is valid ***');
|
||||
process_search_string($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||
} else if ( $ae_loc.authenticated_access ) {
|
||||
console.log('*** Administrator Access or Trusted Access ***');
|
||||
process_search_string($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||
} else {
|
||||
console.log('*** Check permissions and or search string. Not allowed or too short. ***');
|
||||
$events_slct.event_session_obj_li = [];
|
||||
event_session_id_random_li = [];
|
||||
}
|
||||
$events_loc.pres_mgmt.saved_search__session = $events_sess.pres_mgmt.fulltext_search_qry_str;
|
||||
$events_loc.pres_mgmt.saved_search__session_location_name = $events_sess.pres_mgmt.location_name_qry_str;
|
||||
}
|
||||
|
||||
if ( $events_sess.pres_mgmt.fulltext_search_qry_str?.length > 2 ) {
|
||||
console.log('*** Search string is valid ***');
|
||||
process_search_string($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||
} else if ( $ae_loc.authenticated_access ) {
|
||||
console.log('*** Administrator Access or Trusted Access ***');
|
||||
process_search_string($events_sess.pres_mgmt.fulltext_search_qry_str);
|
||||
} else {
|
||||
console.log('*** Check permissions and or search string. Not allowed or too short. ***');
|
||||
$events_slct.event_session_obj_li = [];
|
||||
event_session_id_random_li = [];
|
||||
// if ($events_sess.pres_mgmt.status_qry__search == 'done' && $events_slct?.event_session_obj_li) {
|
||||
if ($events_trigger == 'search_done') {
|
||||
$events_trigger = null;
|
||||
$events_sess.pres_mgmt.status_qry__search = null;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('TEST SEARCH - Search done. Pulling out the event_session_id_randoms...');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// We need to loop through the array of objects and get the event_session_id_random from each object a new list of event_session_id_randoms. Then we can use this list to get the full objects from the database.
|
||||
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
|
||||
if ($events_slct.event_session_obj_li && $events_slct.event_session_obj_li.length) {
|
||||
event_session_id_random_li = [];
|
||||
console.log(`TEST SEARCH - Get ids:`, $events_slct.event_session_obj_li);
|
||||
for (let i = 0; i < $events_slct.event_session_obj_li.length; i++) {
|
||||
tmp_li.push($events_slct.event_session_obj_li[i].event_session_id_random);
|
||||
}
|
||||
}
|
||||
event_session_id_random_li = tmp_li;
|
||||
console.log(`TEST search: event_session_id_random_li`, $state.snapshot(event_session_id_random_li));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function process_search_string(search_str: string) {
|
||||
@@ -236,7 +289,7 @@ async function handle_search__event_session(
|
||||
search_delay += 50+random_delay;
|
||||
}
|
||||
|
||||
log_lvl = 1;
|
||||
log_lvl = 2;
|
||||
|
||||
let count = 0;
|
||||
let request_loop = setInterval(() => {
|
||||
@@ -257,7 +310,9 @@ async function handle_search__event_session(
|
||||
} else {
|
||||
console.log('*** TEST SEARCH - $events_sess.pres_mgmt.status_qry__search != loading ***');
|
||||
|
||||
$events_trigger = 'loading_search_results';
|
||||
$events_sess.pres_mgmt.status_qry__search = 'loading';
|
||||
event_session_id_random_li = [];
|
||||
|
||||
search_submit_results = events_func.search__event_session({
|
||||
api_cfg: $ae_api,
|
||||
@@ -276,26 +331,27 @@ async function handle_search__event_session(
|
||||
})
|
||||
.then(function (search_results) {
|
||||
// Processing the results from the search.
|
||||
$events_trigger = 'process_search_results';
|
||||
$events_sess.pres_mgmt.status_qry__search = 'processing';
|
||||
$events_slct.event_session_obj_li = search_results;
|
||||
console.log(search_results);
|
||||
// $events_sess.pres_mgmt.status_qry__search = 'done';
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('TEST SEARCH - Search done. Pulling out the event_session_id_randoms.');
|
||||
}
|
||||
// if (log_lvl) {
|
||||
// console.log('TEST SEARCH - Search done. Pulling out the event_session_id_randoms...');
|
||||
// }
|
||||
// console.log(`TEST search: ${$lq_kv__event_session_obj_li}`);
|
||||
|
||||
// event_session_id_random_li = [];
|
||||
|
||||
// We need to loop through the array of objects and get the event_session_id_random from each object a new list of event_session_id_randoms. Then we can use this list to get the full objects from the database.
|
||||
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
|
||||
if (search_results && search_results.length) {
|
||||
for (let i = 0; i < search_results.length; i++) {
|
||||
tmp_li.push($events_slct.event_session_obj_li[i].event_session_id_random);
|
||||
}
|
||||
}
|
||||
event_session_id_random_li = tmp_li;
|
||||
// // We need to loop through the array of objects and get the event_session_id_random from each object a new list of event_session_id_randoms. Then we can use this list to get the full objects from the database.
|
||||
// let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
|
||||
// if (search_results && search_results.length) {
|
||||
// for (let i = 0; i < search_results.length; i++) {
|
||||
// tmp_li.push($events_slct.event_session_obj_li[i].event_session_id_random);
|
||||
// }
|
||||
// }
|
||||
// event_session_id_random_li = tmp_li;
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -303,12 +359,13 @@ async function handle_search__event_session(
|
||||
// event_session_id_random_li = $events_slct.event_session_obj_li.map(session_obj => session_obj.event_session_id_random);
|
||||
|
||||
// Finally done with the search.
|
||||
$events_trigger = 'search_done';
|
||||
$events_sess.pres_mgmt.status_qry__search = 'done';
|
||||
|
||||
if (log_lvl > 1) {
|
||||
console.log(`TEST SEARCH - event_session_id_random_li:`, event_session_id_random_li);
|
||||
// console.log(`TEST SEARCH - search live query: ${$lq_kv__event_session_obj_li}`);
|
||||
}
|
||||
// if (log_lvl > 1) {
|
||||
// console.log(`TEST SEARCH - event_session_id_random_li:`, event_session_id_random_li);
|
||||
// // console.log(`TEST SEARCH - search live query: ${$lq_kv__event_session_obj_li}`);
|
||||
// }
|
||||
|
||||
});
|
||||
clearInterval(request_loop);
|
||||
@@ -372,7 +429,7 @@ max-w-max -->
|
||||
<!-- Button to toggle between the regular event view and managing event files -->
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
if ($events_loc.pres_mgmt.show_content__event_view == 'manage_files') {
|
||||
$events_loc.pres_mgmt.show_content__event_view = null;
|
||||
} else {
|
||||
@@ -426,7 +483,7 @@ max-w-max -->
|
||||
<div class="variant-ghost-success my-2 p-2 rounded-md flex flex-row items-center">
|
||||
|
||||
<form
|
||||
on:submit|preventDefault={() => {
|
||||
onsubmit={() => {
|
||||
$events_trigger = 'load__event_session_obj_li';
|
||||
}}
|
||||
autocomplete="off"
|
||||
@@ -439,13 +496,14 @@ max-w-max -->
|
||||
type="button"
|
||||
class="btn btn-sm variant-ghost-warning hover:variant-filled-warning transition-all mx-1"
|
||||
class:hidden={!$ae_loc.authenticated_access}
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
$events_sess.pres_mgmt.location_name_qry_str = '';
|
||||
$events_loc.pres_mgmt.show_content__session_search_room_name = !$events_loc.pres_mgmt.show_content__session_search_room_name;
|
||||
}}
|
||||
title="Search by location name"
|
||||
>
|
||||
<span class="fas fa-search-location"></span>
|
||||
<span class="hidden">Search on location</span>
|
||||
</button>
|
||||
|
||||
<select
|
||||
@@ -454,7 +512,7 @@ max-w-max -->
|
||||
bind:value={$events_sess.pres_mgmt.location_name_qry_str}
|
||||
class="input text-xs font-bold font-mono min-w-fit w-min max-w-40 transition-all mx-1"
|
||||
class:hidden={!$ae_loc.authenticated_access || !$events_loc.pres_mgmt.show_content__session_search_room_name}
|
||||
on:change={() => {
|
||||
onchange={() => {
|
||||
$events_trigger = 'load__event_session_obj_li';
|
||||
}}
|
||||
>
|
||||
@@ -469,7 +527,7 @@ max-w-max -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-ghost-warning hover:variant-filled-warning transition-all mx-1"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
$events_sess.pres_mgmt.fulltext_search_qry_str = '';
|
||||
$events_trigger = 'load__event_session_obj_li';
|
||||
}}
|
||||
@@ -488,7 +546,7 @@ max-w-max -->
|
||||
id="session_fulltext_search_qry_str"
|
||||
bind:value={$events_sess.pres_mgmt.fulltext_search_qry_str}
|
||||
class="input text-1xl hover:text-2xl font-bold font-mono w-80 transition-all mx-1"
|
||||
on:keyup={() => {
|
||||
onkeyup={() => {
|
||||
if ($events_sess.pres_mgmt?.fulltext_search_qry_str && $events_sess.pres_mgmt.fulltext_search_qry_str.length >= 3) {
|
||||
$events_trigger = 'load__event_session_obj_li';
|
||||
}
|
||||
@@ -500,7 +558,7 @@ max-w-max -->
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-lg variant-ghost-success hover:variant-filled-success text-2xl font-bold w-48 transition-all mx-1"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
|
||||
}}
|
||||
title="Search for a session"
|
||||
@@ -518,42 +576,54 @@ max-w-max -->
|
||||
</div>
|
||||
|
||||
|
||||
{#if $lq__event_session_obj_li && $lq__event_session_obj_li?.length > 0 && event_session_id_random_li && event_session_id_random_li?.length > 0}
|
||||
<!-- {#if $lq__event_session_obj_li && $lq__event_session_obj_li?.length > 0 && event_session_id_random_li && event_session_id_random_li?.length > 0} -->
|
||||
<!-- {#if event_session_id_random_li && $lq__event_session_obj_li && $lq__event_session_obj_li?.length} -->
|
||||
{#if event_session_id_random_li}
|
||||
|
||||
<!-- <Comp_event_session_obj_li
|
||||
lq__event_session_obj_li={lq__event_session_obj_li}
|
||||
hide__session_location={$events_loc.pres_mgmt.hide__session_location}
|
||||
hide__session_poc={$events_loc.pres_mgmt.hide__session_poc || $events_loc.pres_mgmt.hide__session_li_poc_field}
|
||||
show__launcher_link={$ae_loc.administrator_access && $events_loc.pres_mgmt.show__launcher_link}
|
||||
show__launcher_link_legacy={$ae_loc.trusted_access && $events_loc.pres_mgmt.show__launcher_link_legacy}
|
||||
show__location_link={$events_loc.pres_mgmt.show__location_link}
|
||||
log_lvl={log_lvl}
|
||||
/> -->
|
||||
|
||||
<!-- link_to_type={'event'} -->
|
||||
<!-- link_to_id={$lq__event_obj?.event_id_random} -->
|
||||
|
||||
<Comp_event_session_obj_li_wrapper
|
||||
event_session_id_random_li={event_session_id_random_li}
|
||||
log_lvl={2}
|
||||
/>
|
||||
|
||||
<Comp_event_session_obj_li
|
||||
lq__event_session_obj_li={lq__event_session_obj_li}
|
||||
hide__session_location={$events_loc.pres_mgmt.hide__session_location}
|
||||
hide__session_poc={$events_loc.pres_mgmt.hide__session_poc || $events_loc.pres_mgmt.hide__session_li_poc_field}
|
||||
show__launcher_link={$ae_loc.administrator_access && $events_loc.pres_mgmt.show__launcher_link}
|
||||
show__launcher_link_legacy={$ae_loc.trusted_access && $events_loc.pres_mgmt.show__launcher_link_legacy}
|
||||
show__location_link={$events_loc.pres_mgmt.show__location_link}
|
||||
log_lvl={log_lvl}
|
||||
/>
|
||||
<!-- </div> -->
|
||||
{:else}
|
||||
<section class="text-center text-2xl bg-yellow-100 p-4 rounded-md lg:max-w-lg space-y-2">
|
||||
<div>
|
||||
<span class="fas fa-exclamation-triangle text-2xl text-yellow-500"></span>
|
||||
<strong>No results to show</strong>
|
||||
<span class="fas fa-exclamation-triangle text-2xl text-yellow-500"></span>
|
||||
<br>
|
||||
<div class="text-lg">
|
||||
Please use the search above to find your session.
|
||||
|
||||
<section class="text-center text-2xl bg-yellow-100 p-4 rounded-md lg:max-w-lg space-y-2">
|
||||
<div>
|
||||
<span class="fas fa-exclamation-triangle text-2xl text-yellow-500"></span>
|
||||
<strong>No results to show</strong>
|
||||
<span class="fas fa-exclamation-triangle text-2xl text-yellow-500"></span>
|
||||
<br>
|
||||
<div class="text-lg">
|
||||
Please use the search above to find your session.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<strong>Search by:</strong>
|
||||
<ul
|
||||
class="list-disc list-inside text-lg text-left"
|
||||
>
|
||||
<li>Session name</li>
|
||||
<li>Session description</li>
|
||||
<li>Presentation name</li>
|
||||
<li>Presenter names</li>
|
||||
<li>Presenter ID (member ID)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<div>
|
||||
<strong>Search by:</strong>
|
||||
<ul
|
||||
class="list-disc list-inside text-lg text-left"
|
||||
>
|
||||
<li>Session name</li>
|
||||
<li>Session description</li>
|
||||
<li>Presentation name</li>
|
||||
<li>Presenter names</li>
|
||||
<li>Presenter ID (member ID)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
// Imports
|
||||
|
||||
// *** Import Svelte specific
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
@@ -8,28 +9,46 @@ import Comp_event_presenter_obj_li from '../events/[event_id]/presenter/ae_comp_
|
||||
import Element_manage_event_file_li from '$lib/element_manage_event_file_li_direct.svelte';
|
||||
|
||||
// import { liveQuery } from "dexie";
|
||||
|
||||
// *** Import Aether specific variables and functions
|
||||
import { core_func } from '$lib/ae_core/ae_core_functions';
|
||||
// import { db_events } from "$lib/db_events";
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
// Exports
|
||||
export let log_lvl: number = 0;
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
|
||||
export let link_to_type: null|string;
|
||||
export let link_to_id: null|string;
|
||||
export let lq__event_session_obj_li: any;
|
||||
interface Props {
|
||||
// Exports
|
||||
log_lvl?: number;
|
||||
container_class_li?: string|Array<string>;
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
link_to_type: null|string;
|
||||
link_to_id: null|string;
|
||||
lq__event_session_obj_li: any;
|
||||
hide__session_location?: boolean;
|
||||
hide__session_poc?: boolean;
|
||||
show__launcher_link?: boolean;
|
||||
show__launcher_link_legacy?: boolean;
|
||||
show__location_link?: boolean;
|
||||
show__session_files?: boolean;
|
||||
show__session_presentations?: boolean;
|
||||
}
|
||||
|
||||
export let hide__session_location: boolean = false;
|
||||
export let hide__session_poc: boolean = false;
|
||||
export let show__launcher_link: boolean = false;
|
||||
export let show__launcher_link_legacy: boolean = false;
|
||||
export let show__location_link: boolean = false;
|
||||
export let show__session_files: boolean = false;
|
||||
export let show__session_presentations: boolean = false;
|
||||
let {
|
||||
log_lvl = 0,
|
||||
container_class_li = [],
|
||||
link_to_type,
|
||||
link_to_id,
|
||||
lq__event_session_obj_li,
|
||||
hide__session_location = false,
|
||||
hide__session_poc = false,
|
||||
show__launcher_link = false,
|
||||
show__launcher_link_legacy = false,
|
||||
show__location_link = false,
|
||||
show__session_files = false,
|
||||
show__session_presentations = false
|
||||
}: Props = $props();
|
||||
// export let allow_basic: boolean = false;
|
||||
// export let allow_moderator: boolean = false;
|
||||
|
||||
@@ -39,8 +58,8 @@ if (log_lvl) {
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_triggers: key_val = {};
|
||||
let ae_tmp: key_val = $state({});
|
||||
let ae_triggers: key_val = $state({});
|
||||
|
||||
// Functions and Logic
|
||||
</script>
|
||||
@@ -60,7 +79,7 @@ let ae_triggers: key_val = {};
|
||||
>
|
||||
|
||||
|
||||
{#if $lq__event_session_obj_li?.length}
|
||||
{#if $lq__event_session_obj_li && $lq__event_session_obj_li?.length}
|
||||
<!-- {#if $events_slct.event_session_obj_li?.length == event_session_id_random_li?.length && event_session_id_random_li.length == $lq__event_session_obj_li?.length} -->
|
||||
<!-- {#if $events_slct?.event_session_obj_li && $events_slct.event_session_obj_li.length > 0} -->
|
||||
|
||||
@@ -105,7 +124,7 @@ let ae_triggers: key_val = {};
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- {#each $events_slct?.event_session_obj_li as session_obj} -->
|
||||
{#each $lq__event_session_obj_li as session_obj}
|
||||
{#each $lq__event_session_obj_li as session_obj, index}
|
||||
<tr
|
||||
class:dim={session_obj?.hide}
|
||||
>
|
||||
@@ -327,7 +346,7 @@ let ae_triggers: key_val = {};
|
||||
<button
|
||||
type="button"
|
||||
disabled={ae_tmp[$events_slct.event_session_id].poc_person_id == $events_slct?.event_session_obj?.poc_person_id_random}
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
console.log('Save the POC person for the session.');
|
||||
|
||||
let person_id = ae_tmp[$events_slct.event_session_id].poc_person_id;
|
||||
@@ -348,7 +367,7 @@ let ae_triggers: key_val = {};
|
||||
{#if ae_tmp[$events_slct.event_session_id] && ae_tmp[$events_slct.event_session_id].show__edit_poc_person}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
console.log('Cancel the POC person for the session.');
|
||||
|
||||
ae_tmp[$events_slct.event_session_id].poc_person_id = null;
|
||||
@@ -365,7 +384,7 @@ let ae_triggers: key_val = {};
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
console.log('Edit the POC person for the session.');
|
||||
|
||||
let params = {
|
||||
|
||||
@@ -14,7 +14,10 @@ export let link_to_id: string;
|
||||
export let log_lvl: number = 0;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
console.log(`TEST event_session: link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
if (log_lvl > 1) {
|
||||
console.log(`TEST event_session: event_session_id_random_li: ${event_session_id_random_li}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
|
||||
@@ -4,7 +4,7 @@ let log_lvl: number = 0;
|
||||
|
||||
// *** Import Svelte specific
|
||||
import { browser } from '$app/environment';
|
||||
import { goto } from '$app/navigation';
|
||||
// import { goto } from '$app/navigation';
|
||||
|
||||
// *** Import other supporting libraries
|
||||
// import * as icons from '@lucide/svelte';
|
||||
|
||||
Reference in New Issue
Block a user