Lots of work related to the IDAA Recovery Meetings. Better pulling in off lookup list data.
This commit is contained in:
@@ -28,15 +28,8 @@ import Comp__event_obj_id_view from './ae_idaa_comp__event_obj_id_view.svelte';
|
||||
|
||||
let event_id_random_li: Array<string>;
|
||||
|
||||
// $: lq__event_obj_li = liveQuery(async () => {
|
||||
// let results = await db_events.events
|
||||
// .where('account_id')
|
||||
// .equals($slct.account_id)
|
||||
// .sortBy('name');
|
||||
|
||||
// return results;
|
||||
// });
|
||||
|
||||
// Functions and Logic
|
||||
$: lq__event_obj = liveQuery(async () => {
|
||||
let results = await db_events.events
|
||||
.get($idaa_slct.event_id);
|
||||
@@ -45,12 +38,7 @@ $: lq__event_obj = liveQuery(async () => {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Functions and Logic
|
||||
$: lq_new__event_obj_li = liveQuery(async () => {
|
||||
console.log('Trying... HERE!!! BEGIN');
|
||||
|
||||
let link_to_type: string = 'account';
|
||||
let link_to_id: string = $slct.account_id;
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
@@ -74,25 +62,8 @@ $: lq_new__event_obj_li = liveQuery(async () => {
|
||||
console.log('Trying... Nothing to load');
|
||||
return null;
|
||||
}
|
||||
console.log('Trying... HERE!!! END');
|
||||
});
|
||||
|
||||
// $: lq_bulk__event_obj_li = liveQuery(async () => {
|
||||
// console.log('Trying... HERE!!! BULK BEGIN');
|
||||
|
||||
// if (event_id_random_li.length) {
|
||||
// console.log(`Trying bulkGet:`, event_id_random_li);
|
||||
// let results = await db_events.events
|
||||
// .bulkGet(event_id_random_li);
|
||||
|
||||
// return results;
|
||||
// } else {
|
||||
// console.log('Trying... Nothing to load');
|
||||
// return null;
|
||||
// }
|
||||
// console.log('Trying... HERE!!! BULK END');
|
||||
// });
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -134,10 +105,38 @@ $: lq_new__event_obj_li = liveQuery(async () => {
|
||||
title="{$lq__event_obj?.name} - {$lq__event_obj?.id}"
|
||||
bind:open={$idaa_sess.recovery_meetings.show__modal_edit}
|
||||
autoclose={false}
|
||||
placement="top-center"
|
||||
size="xl"
|
||||
class="bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
|
||||
class="top-center bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
|
||||
>
|
||||
|
||||
<svelte:fragment slot="header">
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-lg font-semibold">
|
||||
{#if $ae_loc.trusted_access || $lq__event_obj?.external_person_id === $ae_loc.novi_uuid || $lq__event_obj?.contact_li_json[0]?.email === $ae_loc.novi_email}
|
||||
<!-- <div class="ae_options"> -->
|
||||
<button
|
||||
on:click={() => {
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('event_id', $lq__event_obj?.event_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
$idaa_sess.recovery_meetings.show__modal_view = true;
|
||||
$idaa_sess.recovery_meetings.show__modal_edit = false;
|
||||
}}
|
||||
class="btn btn-sm variant-ghost-warning hover:variant-filled-warning transition"
|
||||
title={`Edit meeting: ${$lq__event_obj?.name}`}
|
||||
>
|
||||
<span class="fas fa-eye m-1"></span> View
|
||||
</button>
|
||||
<!-- </div> -->
|
||||
{/if}
|
||||
|
||||
Edit Meeting: {$lq__event_obj?.name}</h3>
|
||||
</div>
|
||||
|
||||
</svelte:fragment>
|
||||
|
||||
<Comp__event_obj_id_edit
|
||||
lq__event_obj={lq__event_obj}
|
||||
/>
|
||||
@@ -161,15 +160,42 @@ $: lq_new__event_obj_li = liveQuery(async () => {
|
||||
|
||||
</Modal>
|
||||
|
||||
<!-- Main modal -->
|
||||
<!-- Modal: Event (Recovery Meeting) view ID -->
|
||||
<Modal
|
||||
title="{$lq__event_obj?.name} - {$lq__event_obj?.id}"
|
||||
bind:open={$idaa_sess.recovery_meetings.show__modal_view}
|
||||
autoclose={false}
|
||||
size="xl"
|
||||
outsideclose={true}
|
||||
placement="top-center"
|
||||
size="lg"
|
||||
class="bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
|
||||
>
|
||||
|
||||
<svelte:fragment slot="header">
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-lg font-semibold">
|
||||
{#if $ae_loc.trusted_access || $lq__event_obj?.external_person_id === $ae_loc.novi_uuid || $lq__event_obj?.contact_li_json[0].email === $ae_loc.novi_email}
|
||||
<button
|
||||
on:click={() => {
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('event_id', $lq__event_obj?.event_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
$idaa_sess.recovery_meetings.show__modal_view = false;
|
||||
$idaa_sess.recovery_meetings.show__modal_edit = true;
|
||||
}}
|
||||
class="btn btn-sm variant-ghost-warning hover:variant-filled-warning transition"
|
||||
title={`View meeting: ${$lq__event_obj?.name}`}
|
||||
>
|
||||
<span class="fas fa-edit m-1"></span> Edit
|
||||
</button>
|
||||
{/if}
|
||||
{$lq__event_obj?.name}
|
||||
</h3>
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
|
||||
<Comp__event_obj_id_view
|
||||
lq__event_obj={lq__event_obj}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user