Wrapping up for the day. Trying to get LQ to work with searching and bulkGet.
This commit is contained in:
@@ -22,6 +22,7 @@ export let link_to_type: string;
|
|||||||
export let link_to_id: string;
|
export let link_to_id: string;
|
||||||
export let allow_basic: boolean = false;
|
export let allow_basic: boolean = false;
|
||||||
export let allow_moderator: boolean = false;
|
export let allow_moderator: boolean = false;
|
||||||
|
export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||||
|
|
||||||
export let show_convert_btn: null|boolean = null;
|
export let show_convert_btn: null|boolean = null;
|
||||||
|
|
||||||
@@ -55,8 +56,6 @@ onMount(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<section class="svelte_component event_file_uploaded_manage {container_class_li}">
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
@@ -66,15 +65,22 @@ onMount(() => {
|
|||||||
$slct_trigger = 'load__event_file_obj_li';
|
$slct_trigger = 'load__event_file_obj_li';
|
||||||
ae_tmp.show__file_li = true;
|
ae_tmp.show__file_li = true;
|
||||||
}}
|
}}
|
||||||
class="btn btn-sm variant-soft-secondary hover:variant-ghost-warning float-right transition hover:transition-all"
|
class="btn btn-sm p-1 m-1 variant-soft-secondary hover:variant-ghost-warning float-right transition hover:transition-all"
|
||||||
|
class:hidden={display_mode != 'default' && !$ae_loc.administrator_access}
|
||||||
|
title="Refresh the list of files"
|
||||||
>
|
>
|
||||||
<span class="fas fa-sync-alt mx-1"></span>
|
<span class="fas fa-sync-alt mx-1"></span>
|
||||||
Refresh Files
|
Files
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<section class="svelte_component event_file_uploaded_manage {container_class_li}"
|
||||||
|
class:text-sm={display_mode != 'default'}
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
<h3
|
<h3
|
||||||
class="h6"
|
class="h6"
|
||||||
class:hidden={!$lq__event_file_obj_li?.length}
|
class:hidden={!$lq__event_file_obj_li?.length || display_mode != 'default'}
|
||||||
>
|
>
|
||||||
Manage Files:
|
Manage Files:
|
||||||
<span class="font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
<span class="font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
||||||
@@ -88,20 +94,27 @@ onMount(() => {
|
|||||||
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
|
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
|
||||||
<div class="overflow-scroll w-full">
|
<div class="overflow-scroll w-full">
|
||||||
<table class="table-auto w-full">
|
<table class="table-auto w-full">
|
||||||
|
|
||||||
|
{#if display_mode === 'default'}
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center">Download File</th>
|
<th class="text-center">Download File</th>
|
||||||
|
{#if display_mode === 'default'}
|
||||||
<th
|
<th
|
||||||
class="text-center"
|
class="text-center"
|
||||||
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
||||||
>Options</th>
|
>Options</th>
|
||||||
|
{/if}
|
||||||
|
{#if display_mode === 'default'}
|
||||||
<th
|
<th
|
||||||
class="text-center"
|
class="text-center"
|
||||||
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
||||||
>Status</th>
|
>Status</th>
|
||||||
|
{/if}
|
||||||
<th class="text-center">Meta</th>
|
<th class="text-center">Meta</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
@@ -160,6 +173,8 @@ onMount(() => {
|
|||||||
</button>
|
</button>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
{#if display_mode === 'default'}
|
||||||
<td
|
<td
|
||||||
class="event_file__options"
|
class="event_file__options"
|
||||||
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
||||||
@@ -204,6 +219,9 @@ onMount(() => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if display_mode === 'default'}
|
||||||
<td
|
<td
|
||||||
class="event_file__status"
|
class="event_file__status"
|
||||||
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
||||||
@@ -277,12 +295,19 @@ onMount(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<td class="event_file_info file_meta text-gray-500">
|
<td class="event_file_info file_meta text-gray-500">
|
||||||
<div class="flex flex-col text-xs lg:text-sm">
|
<div
|
||||||
|
class="flex flex-col gap:1 text-sm"
|
||||||
|
class:text-xs={display_mode != 'default'}
|
||||||
|
>
|
||||||
<!-- {event_file_obj.hosted_file_content_type} -->
|
<!-- {event_file_obj.hosted_file_content_type} -->
|
||||||
|
|
||||||
<span class="w-full flex flex-col lg:flex-row justify-between">
|
<span class="w-full flex flex-col lg:flex-row justify-between">
|
||||||
<span>
|
<span
|
||||||
|
class:hidden={display_mode != 'default'}
|
||||||
|
>
|
||||||
Type:
|
Type:
|
||||||
<strong>{event_file_obj.extension} <span class="fas fa-{ae_util.file_extension_icon(event_file_obj.extension)}"></span>
|
<strong>{event_file_obj.extension} <span class="fas fa-{ae_util.file_extension_icon(event_file_obj.extension)}"></span>
|
||||||
</strong>
|
</strong>
|
||||||
@@ -297,33 +322,58 @@ onMount(() => {
|
|||||||
{/if} -->
|
{/if} -->
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
Size:
|
<span
|
||||||
|
class:hidden={display_mode != 'default'}
|
||||||
|
>
|
||||||
|
Size:
|
||||||
|
</span>
|
||||||
<strong>{ae_util.format_bytes(event_file_obj.file_size)}</strong>
|
<strong>{ae_util.format_bytes(event_file_obj.file_size)}</strong>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="w-full flex flex-col lg:flex-row justify-between">
|
<span class="w-full flex flex-col lg:flex-row justify-between">
|
||||||
<span title="SHA 256: {event_file_obj.hash_sha256}">
|
<span title="SHA 256: {event_file_obj.hash_sha256}">
|
||||||
Hash: <strong>{event_file_obj.hash_sha256.slice(0, 10)}…</strong>
|
<span
|
||||||
|
class:hidden={display_mode != 'default'}
|
||||||
|
>
|
||||||
|
Hash:
|
||||||
|
</span>
|
||||||
|
<strong
|
||||||
|
class:font-normal={display_mode != 'default'}
|
||||||
|
>{event_file_obj.hash_sha256.slice(0, 10)}…</strong>
|
||||||
</span>
|
</span>
|
||||||
<span class:hidden={!$ae_loc.administrator_access}>
|
<span
|
||||||
ID:
|
class:hidden={!$ae_loc.administrator_access || display_mode != 'default'}>
|
||||||
|
<span
|
||||||
|
class:hidden={display_mode != 'default'}
|
||||||
|
>
|
||||||
|
ID:
|
||||||
|
</span>
|
||||||
<strong>{event_file_obj.hosted_file_id_random}</strong>
|
<strong>{event_file_obj.hosted_file_id_random}</strong>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<!-- <span class="fas fa-cloud-upload-alt mx-1"></span> -->
|
{#if display_mode == 'default'}
|
||||||
<!-- Uploaded: -->
|
<!-- <span class="fas fa-cloud-upload-alt mx-1"></span> -->
|
||||||
<!-- <span class="fas fa-calendar-day mx-1"></span> -->
|
<!-- Uploaded: -->
|
||||||
<span class="fas fa-clock mx-1"></span>
|
<!-- <span class="fas fa-calendar-day mx-1"></span> -->
|
||||||
<strong>
|
<span class="fas fa-clock mx-1"></span>
|
||||||
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'dddd')}
|
<strong>
|
||||||
</strong>
|
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'dddd')}
|
||||||
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'date_iso')}
|
</strong>
|
||||||
at
|
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'date_iso')}
|
||||||
<strong>{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'time_short_no_leading')}</strong>
|
at
|
||||||
<!-- {event_file_obj.updated_on} -->
|
<strong>{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'time_short_no_leading')}</strong>
|
||||||
|
<!-- {event_file_obj.updated_on} -->
|
||||||
|
{:else}
|
||||||
|
<!-- <span class="fas fa-calendar-day mx-1"></span> -->
|
||||||
|
<strong>
|
||||||
|
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'date_short')}
|
||||||
|
<!-- at -->
|
||||||
|
<strong>{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'time_short_no_leading')}</strong>
|
||||||
|
</strong>
|
||||||
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -337,7 +387,10 @@ onMount(() => {
|
|||||||
|
|
||||||
{:else}
|
{:else}
|
||||||
|
|
||||||
<p class="text-center text-muted">
|
<p
|
||||||
|
class="text-center text-muted"
|
||||||
|
class:hidden={display_mode != 'default'}
|
||||||
|
>
|
||||||
No files uploaded yet.
|
No files uploaded yet.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ export let link_to_id: string;
|
|||||||
export let allow_basic: boolean = false;
|
export let allow_basic: boolean = false;
|
||||||
export let allow_moderator: boolean = false;
|
export let allow_moderator: boolean = false;
|
||||||
|
|
||||||
|
export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
// This more or less overrides the default access control. Some elements may have their own access control.
|
// This more or less overrides the default access control. Some elements may have their own access control.
|
||||||
if ($ae_loc.administrator_access) {
|
if ($ae_loc.administrator_access) {
|
||||||
@@ -94,6 +96,29 @@ onMount(() => {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
on:click={() => {
|
||||||
|
console.log('*** Refresh button clicked ***');
|
||||||
|
ae_tmp.show__file_li = false;
|
||||||
|
console.log(`$lq__event_presenter_obj_li:`, $lq__event_presenter_obj_li);
|
||||||
|
// $slct_trigger = 'load__event_presenter_obj_li';
|
||||||
|
|
||||||
|
// if (link_to_type == 'event_presentation') {
|
||||||
|
events_func.handle_load_ae_obj_li__event_presenter({
|
||||||
|
api_cfg: $ae_api,
|
||||||
|
event_presentation_id: link_to_id,
|
||||||
|
log_lvl: 1,
|
||||||
|
});
|
||||||
|
// }
|
||||||
|
}}
|
||||||
|
class="btn btn-sm p-1 m-1 variant-soft-secondary hover:variant-ghost-warning float-right transition hover:transition-all"
|
||||||
|
class:hidden={display_mode != 'default' && !$ae_loc.administrator_access}
|
||||||
|
title="Refresh the list of presenters"
|
||||||
|
>
|
||||||
|
<span class="fas fa-sync-alt mx-1"></span>
|
||||||
|
Presenters
|
||||||
|
</button>
|
||||||
|
|
||||||
<section class="ae_comp event_presenter_obj_li {container_class_li}">
|
<section class="ae_comp event_presenter_obj_li {container_class_li}">
|
||||||
|
|
||||||
@@ -126,7 +151,8 @@ onMount(() => {
|
|||||||
$events_sess.pres_mgmt.show_content__presenter_start = event_presenter_obj.event_presenter_id_random;
|
$events_sess.pres_mgmt.show_content__presenter_start = event_presenter_obj.event_presenter_id_random;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary font-bold min-w-64"
|
class="btn variant-ghost-primary hover:variant-filled-primary font-bold min-w-64 my-0.5"
|
||||||
|
class:btn-sm={display_mode != 'default'}
|
||||||
title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.email}"
|
title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.email}"
|
||||||
>
|
>
|
||||||
<span class="fas fa-user mx-1"></span>
|
<span class="fas fa-user mx-1"></span>
|
||||||
@@ -136,7 +162,6 @@ onMount(() => {
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{#if $ae_loc.trusted_access || !$events_loc.auth__person?.id }
|
{#if $ae_loc.trusted_access || !$events_loc.auth__person?.id }
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -169,7 +194,8 @@ onMount(() => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary"
|
class="btn variant-ghost-primary hover:variant-filled-primary my-0.5"
|
||||||
|
class:btn-sm={display_mode != 'default'}
|
||||||
title="Email the access link to the presenter"
|
title="Email the access link to the presenter"
|
||||||
>
|
>
|
||||||
<span class="fas fa-envelope mx-1"></span>
|
<span class="fas fa-envelope mx-1"></span>
|
||||||
@@ -195,7 +221,8 @@ onMount(() => {
|
|||||||
$events_sess.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
$events_sess.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class="btn btn-md variant-ghost-success hover:variant-filled-success"
|
class="btn variant-ghost-success hover:variant-filled-success my-0.5"
|
||||||
|
class:btn-sm={display_mode != 'default'}
|
||||||
title="Agreed to terms and conditions"
|
title="Agreed to terms and conditions"
|
||||||
>
|
>
|
||||||
<span class="fas fa-check text-green-500 px-1" title="Agreed to terms and conditions"></span>
|
<span class="fas fa-check text-green-500 px-1" title="Agreed to terms and conditions"></span>
|
||||||
@@ -218,7 +245,8 @@ onMount(() => {
|
|||||||
$events_sess.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
$events_sess.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class="btn btn-md variant-ghost-warning hover:variant-filled-warning"
|
class="btn variant-ghost-warning hover:variant-filled-warning my-0.5"
|
||||||
|
class:btn-sm={display_mode != 'default'}
|
||||||
title="View terms and conditions"
|
title="View terms and conditions"
|
||||||
>
|
>
|
||||||
<span class="fas fa-times bg-red-500 text-white px-1 mx-1" title="Not agreed to terms and conditions"></span>
|
<span class="fas fa-times bg-red-500 text-white px-1 mx-1" title="Not agreed to terms and conditions"></span>
|
||||||
@@ -322,7 +350,9 @@ onMount(() => {
|
|||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
{:else}
|
{:else}
|
||||||
<p>No presenters available to show for this presentation at this time</p>
|
<p
|
||||||
|
class:hidden={display_mode != 'default'}
|
||||||
|
>No presenters available to show for this presentation at this time</p>
|
||||||
<!-- {$lq__event_presenter_obj_li?.length} -->
|
<!-- {$lq__event_presenter_obj_li?.length} -->
|
||||||
<!-- {$events_slct.event_presentation_id} -->
|
<!-- {$events_slct.event_presentation_id} -->
|
||||||
<!-- {$lq__event_presentation_obj} -->
|
<!-- {$lq__event_presentation_obj} -->
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import { ae_util } from '$lib/ae_utils';
|
|||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||||
import Element_data_store from '$lib/element_data_store.svelte';
|
import Element_data_store from '$lib/element_data_store.svelte';
|
||||||
|
import Comp_event_presenter_obj_li from '../../ae_comp__event_presenter_obj_li.svelte';
|
||||||
|
import Element_manage_event_file_li from '$lib/element_manage_event_file_li.svelte';
|
||||||
|
|
||||||
import { liveQuery } from "dexie";
|
import { liveQuery } from "dexie";
|
||||||
import { core_func } from '$lib/ae_core_functions';
|
import { core_func } from '$lib/ae_core_functions';
|
||||||
@@ -52,6 +54,58 @@ let event_obj = liveQuery(
|
|||||||
|
|
||||||
let event_obj_v2 = db_events.events.get($events_slct.event_id);
|
let event_obj_v2 = db_events.events.get($events_slct.event_id);
|
||||||
|
|
||||||
|
// let lq__event_session_obj_li = liveQuery(
|
||||||
|
// () => db_events.sessions
|
||||||
|
// .where('event_id')
|
||||||
|
// .equals($events_slct.event_id)
|
||||||
|
// .toArray()
|
||||||
|
// );
|
||||||
|
|
||||||
|
let event_session_id_random_li: string[] = ['VSBH-19-41-50'];
|
||||||
|
// let event_session_id_random_li: string[] = ['VSBH-19-41-51'];
|
||||||
|
// let event_session_id_random_li: string[] = [];
|
||||||
|
// event_session_id_random_li = [];
|
||||||
|
|
||||||
|
// let lq_kv__event_session_obj_li = liveQuery(
|
||||||
|
// () => db_events.sessions
|
||||||
|
// // .bulkGet(event_session_id_random_li)
|
||||||
|
// .where('event_session_id_random')
|
||||||
|
// .anyOf(event_session_id_random_li)
|
||||||
|
// // .toArray() ?? ['No sessions found.']
|
||||||
|
// .sortBy('start_datetime')
|
||||||
|
// );
|
||||||
|
|
||||||
|
let lq_kv__event_session_obj_li = liveQuery(
|
||||||
|
() => db_events.sessions
|
||||||
|
.bulkGet(event_session_id_random_li)
|
||||||
|
.then(results => {
|
||||||
|
console.log(`LQ Results:`, results);
|
||||||
|
// If the results are an array
|
||||||
|
if (results.length == 1) {
|
||||||
|
// If the first item is undefined we need to do something.
|
||||||
|
if (results[0] == undefined) {
|
||||||
|
console.log('Something went wrong! No sessions found?');
|
||||||
|
return [];
|
||||||
|
// return [{ id: '' }];
|
||||||
|
// return 'NOTHING???';
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
}else if (results.length > 1) {
|
||||||
|
return results;
|
||||||
|
} else {
|
||||||
|
return ['No sessions found.'];
|
||||||
|
}
|
||||||
|
// return results;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(`LQ Error: ${error}`);
|
||||||
|
return ['No sessions found.'];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
console.log(`LQ Finally:`, $lq_kv__event_session_obj_li);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
let load_obj_li_results: Promise<any>|key_val;
|
let load_obj_li_results: Promise<any>|key_val;
|
||||||
let search_submit_results: Promise<any>|key_val;
|
let search_submit_results: Promise<any>|key_val;
|
||||||
@@ -134,6 +188,9 @@ function handle_search__event_session(search_str: string) {
|
|||||||
ft_search_str_new = `${search_str}`;
|
ft_search_str_new = `${search_str}`;
|
||||||
// ft_search_str_new = `"${search_str}"`;
|
// ft_search_str_new = `"${search_str}"`;
|
||||||
} else if (search_method == 'lk') {
|
} else if (search_method == 'lk') {
|
||||||
|
if (search_str == null) {
|
||||||
|
search_str = '';
|
||||||
|
}
|
||||||
// Add a wildcard to the search string to make it a like match.
|
// Add a wildcard to the search string to make it a like match.
|
||||||
lk_search_str_new = search_str.trim().replace(',', ' ').replace(';', ' ').replaceAll(' ', '%').replaceAll(' ', '%');
|
lk_search_str_new = search_str.trim().replace(',', ' ').replace(';', ' ').replaceAll(' ', '%').replaceAll(' ', '%');
|
||||||
lk_search_str_new = `%${lk_search_str_new}%`;
|
lk_search_str_new = `%${lk_search_str_new}%`;
|
||||||
@@ -186,6 +243,10 @@ function handle_search__event_session(search_str: string) {
|
|||||||
$events_slct.event_session_obj_li = search_results;
|
$events_slct.event_session_obj_li = search_results;
|
||||||
console.log(search_results);
|
console.log(search_results);
|
||||||
$events_sess.status_qry__search = 'done';
|
$events_sess.status_qry__search = 'done';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
console.log('Search done.');
|
||||||
|
console.log(`test1: ${$lq_kv__event_session_obj_li}`);
|
||||||
});
|
});
|
||||||
}, 250);
|
}, 250);
|
||||||
} else {
|
} else {
|
||||||
@@ -211,9 +272,26 @@ function handle_search__event_session(search_str: string) {
|
|||||||
$events_slct.event_session_obj_li = search_results;
|
$events_slct.event_session_obj_li = search_results;
|
||||||
console.log(search_results);
|
console.log(search_results);
|
||||||
$events_sess.status_qry__search = 'done';
|
$events_sess.status_qry__search = 'done';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
console.log('Search done.');
|
||||||
|
console.log(`test2: ${$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.
|
||||||
|
for (let i = 0; i < $events_slct.event_session_obj_li.length; i++) {
|
||||||
|
event_session_id_random_li.push($events_slct.event_session_obj_li[i].event_session_id_random);
|
||||||
|
}
|
||||||
|
// event_session_id_random_li = $events_slct.event_session_obj_li.map(session_obj => session_obj.event_session_id_random);
|
||||||
|
console.log(`event_session_id_random_li:`, event_session_id_random_li);
|
||||||
|
console.log(`test3: ${$lq_kv__event_session_obj_li}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// } // end if search string is valid
|
// } // end if search string is valid
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,6 +299,37 @@ function handle_search__event_session(search_str: string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{#if event_session_id_random_li}
|
||||||
|
ID count:{event_session_id_random_li.length}
|
||||||
|
<!-- This needs to be in here so it works correctly with the liveQuery. -->
|
||||||
|
{#if $lq_kv__event_session_obj_li?.length}
|
||||||
|
Sess li: {$lq_kv__event_session_obj_li?.length}
|
||||||
|
<!-- {$lq_kv__event_session_obj_li?.map(session_obj => session_obj?.event_session_id_random)} -->
|
||||||
|
{:else}
|
||||||
|
<!-- No sess -->
|
||||||
|
x: {$lq_kv__event_session_obj_li}
|
||||||
|
{/if}
|
||||||
|
{:else}
|
||||||
|
No IDs found
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<!-- {#await $lq_kv__event_session_obj_li}
|
||||||
|
{:then result}
|
||||||
|
{#if result}
|
||||||
|
Sess li: {result.length}
|
||||||
|
{:else}
|
||||||
|
No sess
|
||||||
|
{/if}
|
||||||
|
{/await} -->
|
||||||
|
{#if $lq_kv__event_session_obj_li?.length}
|
||||||
|
Sess li: {$lq_kv__event_session_obj_li?.length}
|
||||||
|
<!-- {$lq_kv__event_session_obj_li?.map(session_obj => session_obj?.event_session_id_random)} -->
|
||||||
|
{:else}
|
||||||
|
<!-- No sess -->
|
||||||
|
x: {$lq_kv__event_session_obj_li}
|
||||||
|
{/if}
|
||||||
|
|
||||||
<section
|
<section
|
||||||
class="ae_events_pres_mgmt_event md:container h-full mx-auto flex flex-col items-center space-y-2 pt-0 pb-8"
|
class="ae_events_pres_mgmt_event md:container h-full mx-auto flex flex-col items-center space-y-2 pt-0 pb-8"
|
||||||
>
|
>
|
||||||
@@ -375,7 +484,7 @@ function handle_search__event_session(search_str: string) {
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
{#if $events_slct.event_session_obj_li.length}
|
{#if $events_slct.event_session_obj_li.length}
|
||||||
<span class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-500"
|
<span class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
||||||
title="Count {$events_slct.event_session_obj_li.length ?? 'None'}"
|
title="Count {$events_slct.event_session_obj_li.length ?? 'None'}"
|
||||||
>
|
>
|
||||||
<span class="fas fa-list-ol mx-4"></span>
|
<span class="fas fa-list-ol mx-4"></span>
|
||||||
@@ -416,6 +525,28 @@ function handle_search__event_session(search_str: string) {
|
|||||||
<!-- Nothing -->
|
<!-- Nothing -->
|
||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{#if $ae_loc.administrator_access}
|
||||||
|
<Comp_event_presenter_obj_li
|
||||||
|
link_to_type={'event_session'}
|
||||||
|
link_to_id={session_obj.event_session_id_random}
|
||||||
|
display_mode={'minimal'}
|
||||||
|
>
|
||||||
|
</Comp_event_presenter_obj_li>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
{#if $ae_loc.administrator_access}
|
||||||
|
<Element_manage_event_file_li
|
||||||
|
link_to_type={'event_session'}
|
||||||
|
link_to_id={session_obj.event_session_id_random}
|
||||||
|
allow_basic={$events_loc.auth__kv.session[$events_slct.event_session_id] || $events_loc.auth__kv.presenter[$events_slct.event_presenter_id]}
|
||||||
|
allow_moderator={$events_loc.auth__kv.session[$events_slct.event_session_id]}
|
||||||
|
container_class_li={''}
|
||||||
|
display_mode={'minimal'}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span style="break-inside: avoid;">
|
<span style="break-inside: avoid;">
|
||||||
|
|||||||
@@ -1396,17 +1396,7 @@ $: if ($slct_trigger == 'load__event_presenter_obj_li') {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Show presenters for this presentation -->
|
<!-- Show presenters for this presentation -->
|
||||||
<!-- {#await event_presentation_obj.event_presentation_id_random}
|
{#if event_presentation_obj.event_presentation_id_random}
|
||||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
|
||||||
{:then result}
|
|
||||||
<Comp_event_presenter_obj_li
|
|
||||||
link_to_type={'event_presentation'}
|
|
||||||
link_to_id={result}
|
|
||||||
>
|
|
||||||
</Comp_event_presenter_obj_li>
|
|
||||||
{/await} -->
|
|
||||||
|
|
||||||
{#if event_presentation_obj.event_presentation_id_random}
|
|
||||||
<Comp_event_presenter_obj_li
|
<Comp_event_presenter_obj_li
|
||||||
link_to_type={'event_presentation'}
|
link_to_type={'event_presentation'}
|
||||||
link_to_id={event_presentation_obj.event_presentation_id_random}
|
link_to_id={event_presentation_obj.event_presentation_id_random}
|
||||||
|
|||||||
Reference in New Issue
Block a user