fix(events): Correct data fetching for session child objects
This commit fixes a bug where presentations, presenters, and files related to a session were not being displayed. The issues were caused by incorrect property names ( suffix) and improper use of Svelte 5 features after a recent refactoring.
This commit is contained in:
@@ -52,7 +52,7 @@ let lq__event_file_obj_li = $derived(liveQuery(async () => {
|
|||||||
let results = await db_events.file
|
let results = await db_events.file
|
||||||
.where(dq__where_val)
|
.where(dq__where_val)
|
||||||
.equals(dq__where_eq_val)
|
.equals(dq__where_eq_val)
|
||||||
.and(file => file.for_id_random == dq__where_for_id_eq_val)
|
.and(file => file.for_id == dq__where_for_id_eq_val)
|
||||||
.reverse()
|
.reverse()
|
||||||
.sortBy('created_on')
|
.sortBy('created_on')
|
||||||
// .toArray()
|
// .toArray()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if (log_lvl) {
|
|||||||
// let ae_tmp: key_val = {};
|
// let ae_tmp: key_val = {};
|
||||||
// let ae_triggers: key_val = {};
|
// let ae_triggers: key_val = {};
|
||||||
|
|
||||||
let dq__where_type_id_val: string = `${link_to_type}_id_random`;
|
let dq__where_type_id_val: string = `${link_to_type}_id`;
|
||||||
let dq__where_eq_id_val: string = link_to_id;
|
let dq__where_eq_id_val: string = link_to_id;
|
||||||
|
|
||||||
// *** Functions and Logic
|
// *** Functions and Logic
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if (log_lvl) {
|
|||||||
|
|
||||||
let event_presenter_id_random_li: Array<string> = $state([]);
|
let event_presenter_id_random_li: Array<string> = $state([]);
|
||||||
|
|
||||||
let dq__where_type_id_val: string = `${link_to_type}_id_random`;
|
let dq__where_type_id_val: string = `${link_to_type}_id`;
|
||||||
let dq__where_eq_id_val: string = link_to_id ?? '';
|
let dq__where_eq_id_val: string = link_to_id ?? '';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -960,17 +960,13 @@ let clipboard_success = $state(false);
|
|||||||
class="w-full"
|
class="w-full"
|
||||||
>
|
>
|
||||||
|
|
||||||
{#await lq__event_presentation_obj_li}
|
{#if $lq__event_presentation_obj_li && $lq__event_presentation_obj_li?.length > 0}
|
||||||
Loading....
|
|
||||||
{:then event_presentation_obj_li}
|
|
||||||
{#if event_presentation_obj_li && event_presentation_obj_li?.length > 0}
|
|
||||||
<Comp_event_presentation_obj_li
|
<Comp_event_presentation_obj_li
|
||||||
lq__event_presentation_obj_li={event_presentation_obj_li}
|
lq__event_presentation_obj_li={lq__event_presentation_obj_li}
|
||||||
log_lvl={log_lvl}
|
log_lvl={log_lvl}
|
||||||
>
|
>
|
||||||
</Comp_event_presentation_obj_li>
|
</Comp_event_presentation_obj_li>
|
||||||
{/if}
|
{/if}
|
||||||
{/await}
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,6 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
}
|
}
|
||||||
|
|
||||||
let presentation_data = {
|
let presentation_data = {
|
||||||
event_id_random: $events_slct.event_id,
|
|
||||||
event_session_id_random: $events_slct.event_session_id,
|
|
||||||
name: 'TEMP Presentation Name',
|
name: 'TEMP Presentation Name',
|
||||||
code: 'new_presentation',
|
code: 'new_presentation',
|
||||||
enable: true,
|
enable: true,
|
||||||
@@ -110,7 +108,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- {#if !$lq__event_presentation_obj_li?.length}
|
<!-- {#if !lq__event_presentation_obj_li?.length}
|
||||||
<span class="text-sm text-gray-500">
|
<span class="text-sm text-gray-500">
|
||||||
<span class="fas fa-exclamation-triangle mx-1"></span>
|
<span class="fas fa-exclamation-triangle mx-1"></span>
|
||||||
No presentations available to show at this time
|
No presentations available to show at this time
|
||||||
@@ -140,9 +138,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
}
|
}
|
||||||
|
|
||||||
let presenter_data = {
|
let presenter_data = {
|
||||||
event_id_random: $events_slct.event_id,
|
event_presentation_id: event_presentation_obj?.event_presentation_id,
|
||||||
event_session_id_random: $events_slct.event_session_id,
|
|
||||||
event_presentation_id_random: event_presentation_obj?.event_presentation_id_random,
|
|
||||||
given_name: 'New',
|
given_name: 'New',
|
||||||
family_name: 'Presenter',
|
family_name: 'Presenter',
|
||||||
email: 'test+newpres@oneskyit.com',
|
email: 'test+newpres@oneskyit.com',
|
||||||
@@ -154,7 +150,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
event_id: $events_slct.event_id,
|
event_id: $events_slct.event_id,
|
||||||
event_session_id: $events_slct.event_session_id,
|
event_session_id: $events_slct.event_session_id,
|
||||||
event_presentation_id: event_presentation_obj.event_presentation_id_random,
|
event_presentation_id: event_presentation_obj.event_presentation_id,
|
||||||
data_kv: presenter_data,
|
data_kv: presenter_data,
|
||||||
log_lvl: 1,
|
log_lvl: 1,
|
||||||
})
|
})
|
||||||
@@ -184,7 +180,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
<Element_ae_crud
|
<Element_ae_crud
|
||||||
api_cfg={$ae_api}
|
api_cfg={$ae_api}
|
||||||
object_type={'event_presentation'}
|
object_type={'event_presentation'}
|
||||||
object_id={event_presentation_obj?.event_presentation_id_random}
|
object_id={event_presentation_obj?.event_presentation_id}
|
||||||
field_name={'name'}
|
field_name={'name'}
|
||||||
field_type={'text'}
|
field_type={'text'}
|
||||||
field_value={event_presentation_obj?.name}
|
field_value={event_presentation_obj?.name}
|
||||||
@@ -199,13 +195,13 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
console.log(`ae_crud_updated:`, e.detail);
|
console.log(`ae_crud_updated:`, e.detail);
|
||||||
|
|
||||||
events_func.load_ae_obj_id__event_presentation({
|
events_func.load_ae_obj_id__event_presentation({
|
||||||
api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id_random, log_lvl: 1
|
api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id, log_lvl: 1
|
||||||
})
|
})
|
||||||
.then(function (load_results) {
|
.then(function (load_results) {
|
||||||
})
|
})
|
||||||
.then(function (load_results) {
|
.then(function (load_results) {
|
||||||
// $events_trigger = 'load__event_presentation_obj_id';
|
// $events_trigger = 'load__event_presentation_obj_id';
|
||||||
// $events_trig_kv['event_presentation_id'] = event_presentation_obj.event_presentation_id_random;
|
// $events_trig_kv['event_presentation_id'] = event_presentation_obj.event_presentation_id;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -219,7 +215,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
<Element_ae_crud
|
<Element_ae_crud
|
||||||
api_cfg={$ae_api}
|
api_cfg={$ae_api}
|
||||||
object_type={'event_presentation'}
|
object_type={'event_presentation'}
|
||||||
object_id={event_presentation_obj?.event_presentation_id_random}
|
object_id={event_presentation_obj?.event_presentation_id}
|
||||||
field_name={'code'}
|
field_name={'code'}
|
||||||
field_type={'text'}
|
field_type={'text'}
|
||||||
field_value={event_presentation_obj?.code}
|
field_value={event_presentation_obj?.code}
|
||||||
@@ -234,13 +230,13 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
console.log(`ae_crud_updated:`, e.detail);
|
console.log(`ae_crud_updated:`, e.detail);
|
||||||
|
|
||||||
events_func.load_ae_obj_id__event_presentation({
|
events_func.load_ae_obj_id__event_presentation({
|
||||||
api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id_random, log_lvl: 1
|
api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id, log_lvl: 1
|
||||||
})
|
})
|
||||||
.then(function (load_results) {
|
.then(function (load_results) {
|
||||||
})
|
})
|
||||||
.then(function (load_results) {
|
.then(function (load_results) {
|
||||||
// $events_trigger = 'load__event_presentation_obj_id';
|
// $events_trigger = 'load__event_presentation_obj_id';
|
||||||
// $events_trig_kv['event_presentation_id'] = event_presentation_obj.event_presentation_id_random;
|
// $events_trig_kv['event_presentation_id'] = event_presentation_obj.event_presentation_id;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -354,7 +350,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
<Element_ae_crud
|
<Element_ae_crud
|
||||||
api_cfg={$ae_api}
|
api_cfg={$ae_api}
|
||||||
object_type={'event_presentation'}
|
object_type={'event_presentation'}
|
||||||
object_id={event_presentation_obj?.event_presentation_id_random}
|
object_id={event_presentation_obj?.event_presentation_id}
|
||||||
field_name={'description'}
|
field_name={'description'}
|
||||||
field_type={'textarea'}
|
field_type={'textarea'}
|
||||||
field_value={event_presentation_obj?.description}
|
field_value={event_presentation_obj?.description}
|
||||||
@@ -369,7 +365,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
on:ae_crud_updated={e => {
|
on:ae_crud_updated={e => {
|
||||||
console.log(`ae_crud_updated:`, e.detail);
|
console.log(`ae_crud_updated:`, e.detail);
|
||||||
|
|
||||||
events_func.load_ae_obj_id__event_presentation({api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id_random, log_lvl: 1});
|
events_func.load_ae_obj_id__event_presentation({api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id, log_lvl: 1});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span class="text-sm text-semibold text-success-800-400">
|
<span class="text-sm text-semibold text-success-800-400">
|
||||||
@@ -381,21 +377,21 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
console.log('Show/Hide Description');
|
console.log('Show/Hide Description');
|
||||||
if ($events_sess.pres_mgmt.show_content__presentation_description == event_presentation_obj.event_presentation_id_random) {
|
if ($events_sess.pres_mgmt.show_content__presentation_description == event_presentation_obj.event_presentation_id) {
|
||||||
$events_sess.pres_mgmt.show_content__presentation_description = null;
|
$events_sess.pres_mgmt.show_content__presentation_description = null;
|
||||||
|
|
||||||
// Was testing with LiveQuery
|
// Was testing with LiveQuery
|
||||||
$events_slct.event_presentation_id = null;
|
$events_slct.event_presentation_id = null;
|
||||||
} else {
|
} else {
|
||||||
$events_sess.pres_mgmt.show_content__presentation_description = event_presentation_obj.event_presentation_id_random;
|
$events_sess.pres_mgmt.show_content__presentation_description = event_presentation_obj.event_presentation_id;
|
||||||
|
|
||||||
// Was testing with LiveQuery
|
// Was testing with LiveQuery
|
||||||
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
class="btn btn-sm preset-tonal-surface hover:preset-filled-surface-500 text-xs"
|
class="btn btn-sm preset-tonal-surface hover:preset-filled-surface-500 text-xs"
|
||||||
>
|
>
|
||||||
{#if $events_sess.pres_mgmt.show_content__presentation_description == event_presentation_obj.event_presentation_id_random}
|
{#if $events_sess.pres_mgmt.show_content__presentation_description == event_presentation_obj.event_presentation_id}
|
||||||
<span class="fas fa-eye-slash mx-1"></span>
|
<span class="fas fa-eye-slash mx-1"></span>
|
||||||
<span>Hide Description</span>
|
<span>Hide Description</span>
|
||||||
{:else}
|
{:else}
|
||||||
@@ -406,7 +402,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
|
|
||||||
<pre
|
<pre
|
||||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||||
class:hidden={$events_sess.pres_mgmt.show_content__presentation_description !== event_presentation_obj.event_presentation_id_random}
|
class:hidden={$events_sess.pres_mgmt.show_content__presentation_description !== event_presentation_obj.event_presentation_id}
|
||||||
>{event_presentation_obj.description}</pre>
|
>{event_presentation_obj.description}</pre>
|
||||||
|
|
||||||
{:else}
|
{:else}
|
||||||
@@ -424,12 +420,12 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Show presenters for this presentation -->
|
<!-- Show presenters for this presentation -->
|
||||||
{#if event_presentation_obj?.event_presentation_id_random}
|
{#if event_presentation_obj?.event_presentation_id}
|
||||||
<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}
|
||||||
event_presenter_id_random_li={[]}
|
event_presenter_id_random_li={[]}
|
||||||
log_lvl={log_lvl}
|
log_lvl={2}
|
||||||
>
|
>
|
||||||
</Comp_event_presenter_obj_li>
|
</Comp_event_presenter_obj_li>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -438,7 +434,7 @@ import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_even
|
|||||||
<!-- Show files for this presentation -->
|
<!-- Show files for this presentation -->
|
||||||
<Element_manage_event_file_li_wrap
|
<Element_manage_event_file_li_wrap
|
||||||
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}
|
||||||
allow_basic={$events_loc.auth__kv.session[$events_slct.event_session_id] || $events_loc.auth__kv.presenter[$events_slct.event_presenter_id]}
|
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]}
|
allow_moderator={$events_loc.auth__kv.session[$events_slct.event_session_id]}
|
||||||
container_class_li={''}
|
container_class_li={''}
|
||||||
|
|||||||
Reference in New Issue
Block a user