Work on style updates. Able to create new meetings again.

This commit is contained in:
Scott Idem
2025-06-27 17:36:00 -04:00
parent e87fae34f8
commit 4c0b1d4c50
7 changed files with 172 additions and 251 deletions

View File

@@ -68,6 +68,7 @@ let idaa_local_data_struct: key_val = {
},
recovery_meetings: {
edit_kv: {},
qry__enabled: 'enabled', // all, disabled, enabled
qry__hidden: 'not_hidden', // all, hidden, not_hidden
qry__limit: 150,

View File

@@ -34,14 +34,14 @@ import Comp__event_obj_id_edit from './ae_idaa_comp__event_obj_id_edit.svelte';
import Comp__event_obj_id_view from './ae_idaa_comp__event_obj_id_view.svelte';
let event_id = page.url.searchParams.get('event_id') ?? null;
if (!event_id) {
$idaa_slct.event_id = null;
} else {
console.log(`ae Recovery Meetings - [event_id] +page.ts: event_id = `, event_id);
$idaa_slct.event_id = event_id;
$idaa_trig.event_id = event_id;
}
// let event_id = page.url.searchParams.get('event_id') ?? null;
// if (!event_id) {
// $idaa_slct.event_id = null;
// } else {
// console.log(`ae Recovery Meetings - [event_id] +page.ts: event_id = `, event_id);
// $idaa_slct.event_id = event_id;
// $idaa_trig.event_id = event_id;
// }
let event_id_random_li: Array<string> = $state();
@@ -100,12 +100,12 @@ let lq_new__event_obj_li = $derived(liveQuery(async () => {
}
}));
let lq__event_obj = $derived(liveQuery(async () => {
let results = await db_events.events
.get($idaa_slct.event_id ?? '');
// let lq__event_obj = $derived(liveQuery(async () => {
// let results = await db_events.events
// .get($idaa_slct.event_id ?? '');
return results;
}));
// return results;
// }));
// This (event_li trigger for IDAA) is not currently being used.
@@ -436,8 +436,7 @@ function add_activity_log(
<svelte:head>
<title>
IDAA Recovery Meetings:
{$lq__event_obj?.name ? ae_util.shorten_string({ string: $lq__event_obj?.name, max_length: 20, begin_length: 10, end_length: 4 }) : ''}
IDAA Recovery Meetings
- Novi - {$ae_loc?.title}
</title>
</svelte:head>
@@ -478,184 +477,3 @@ function add_activity_log(
<!-- </div> -->
<!-- Modal: Event (Recovery Meeting) edit ID -->
<!-- title="{$lq__event_obj?.name} - {$lq__event_obj?.id}" -->
<Modal
bind:open={$idaa_sess.recovery_meetings.show__modal_edit__event_id}
autoclose={false}
placement="top-center"
size="xl"
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"
>
{#snippet 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 === $idaa_loc.novi_uuid || $lq__event_obj?.contact_li_json[0]?.email === $idaa_loc.novi_email}
<!-- <div class="ae_options"> -->
<button
onclick={() => {
// 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_edit = false;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = false;
$idaa_sess.recovery_meetings.show__modal_view = true;
$idaa_sess.recovery_meetings.show__modal_view__event_id = $lq__event_obj?.event_id;
add_activity_log(
{
action: 'idaa_meetings_page',
action_with: 'cancel_edit',
}
);
}}
class="novi_btn btn btn-sm btn-warning preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
title={`View meeting: ${$lq__event_obj?.name}`}
>
<span class="fas fa-times m-1"></span> Cancel Edit
</button>
<!-- </div> -->
{/if}
<span class="fas fa-calendar-day m-1"></span>
{$lq__event_obj?.name ?? 'New Recovery Meeting'}
</h3>
</div>
{/snippet}
<Comp__event_obj_id_edit
lq__event_obj={lq__event_obj}
/>
{#snippet footer()}
<div class="text-center w-full">
<button
type="button"
onclick={() => {
console.log('Close modal');
$idaa_sess.recovery_meetings.show__modal_edit = false;
add_activity_log(
{
action: 'idaa_meetings_page',
action_with: 'close_modal',
}
);
}}
class="novi_btn btn btn-warning btn-sm preset-tonal-warning hover:preset-tonal-warning border border-warning-500"
>
<span class="fas fa-times mx-1"></span>
Close
</button>
</div>
{/snippet}
</Modal>
<!-- Modal: Event (Recovery Meeting) view ID -->
<!-- title="{$lq__event_obj?.name} - {$lq__event_obj?.id}" -->
<Modal
bind:open={$idaa_sess.recovery_meetings.show__modal_view__event_id}
autoclose={false}
outsideclose={true}
placement="top-center"
size="lg"
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"
>
{#snippet header()}
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-lg font-semibold text-center">
{#if $ae_loc.trusted_access || $lq__event_obj?.external_person_id === $idaa_loc.novi_uuid || $lq__event_obj?.contact_li_json[0].email === $idaa_loc.novi_email}
<button
onclick={() => {
// 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_view__event_id = false;
$idaa_sess.recovery_meetings.show__modal_edit = true;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = $lq__event_obj?.event_id;
add_activity_log(
{
action: 'idaa_meetings_page',
action_with: 'edit',
}
);
}}
class="novi_btn btn btn-warning btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
title={`Edit meeting: ${$lq__event_obj?.name}`}
>
<span class="fas fa-edit m-1"></span> Edit
</button>
{/if}
<span class="">
<span class="fas fa-calendar-day m-1"></span>
{$lq__event_obj?.name ?? '-- not set --'}
</span>
</h3>
{#if $lq__event_obj?.status == 'unknown'}
<span class="badge badge-warning preset-tonal-error" title="This meeting has not been confirmed by IDAA Central Office. Please reach out to the chair for current meeting list info. Meeting attendees can reach out to info@idaa.org if they know this is information is accurate and this meeting is still taking place.">
<span class="fas fa-exclamation-triangle m-1"></span>
Not Confirmed by IDAA
<!-- Unknown Status -->
<span class="fas fa-exclamation-triangle m-1"></span>
</span>
{/if}
</div>
<button
type="button"
class="novi_btn btn btn-sm btn-secondary absolute top-2 right-2"
onclick={() => {
$idaa_sess.recovery_meetings.show__modal_view = false;
$idaa_sess.recovery_meetings.show__modal_view__event_id = false;
$idaa_sess.recovery_meetings.show__modal_edit = false;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = false;
$idaa_slct.event_id = null;
$idaa_slct.event_obj = null;
let message = {'event_id': $idaa_slct.event_id ?? null};
window.parent.postMessage(message, "*");
}}
>
<span class="fas fa-times"></span>
Close
</button>
{/snippet}
<Comp__event_obj_id_view
lq__event_obj={lq__event_obj}
/>
{#snippet footer()}
<button
type="button"
class="btn btn-sm btn-secondary"
onclick={() => {
$idaa_sess.recovery_meetings.show__modal_view = false;
$idaa_sess.recovery_meetings.show__modal_view__event_id = false;
$idaa_sess.recovery_meetings.show__modal_edit = false;
$idaa_sess.recovery_meetings.show__inline_edit__event_obj = false;
$idaa_slct.event_id = null;
$idaa_slct.event_obj = null;
let message = {'event_id': $idaa_slct.event_id ?? null};
window.parent.postMessage(message, "*");
}}
>
<span class="fas fa-times"></span>
Close
</button>
{/snippet}
</Modal>

View File

@@ -50,6 +50,11 @@ if (browser) {
let message = {'event_id': $idaa_slct?.event_id ?? null};
window.parent.postMessage(message, "*");
if ($ae_loc?.iframe) {
console.log('In iframe, sending message to parent window to scroll to top as well');
window.parent.postMessage({'scroll_to': 0}, "*"); // This should be in pixels
}
}
</script>
@@ -62,22 +67,64 @@ if (browser) {
</title>
</svelte:head>
<h2
class="
ae_title event__title
text-2xl font-bold
flex flex-row gap-2 items-center justify-between
w-full
<header class="ae_header flex flex-row flex-wrap gap-2 items-center justify-evenly w-full">
<h2
class="
ae_title event__title
h3
text-2xl font-bold
flex flex-row gap-2 items-center justify-center
min-w-1/2
max-w-full
"
>
<!-- <span class="ae_icon fas fa-calendar-alt"></span> -->
<span class="ae_icon fas fa-calendar-day"></span>
{$lq__event_obj?.name ? $lq__event_obj?.name : 'Recovery Meeting'}
</h2>
<div
class="
flex flex-row gap-2 items-center justify-evenly
min-w-1/4
max-w-full
"
>
<!-- <span class="ae_icon fas fa-calendar-alt"></span> -->
<span class="ae_icon fas fa-calendar-day"></span>
{$lq__event_obj?.name ? $lq__event_obj?.name : 'Recovery Meeting'}
</h2>
{#if $lq__event_obj?.status == 'unknown'}
<span class="badge badge-warning preset-tonal-error" title="This meeting has not been confirmed by IDAA Central Office. Please reach out to the chair for current meeting list info. Meeting attendees can reach out to info@idaa.org if they know this is information is accurate and this meeting is still taking place.">
<span class="fas fa-exclamation-triangle m-1"></span>
Not Confirmed by IDAA
<!-- Unknown Status -->
<span class="fas fa-exclamation-triangle m-1"></span>
</span>
{/if}
<span class="float-right flex flex-row flex-wrap gap-1 items-center justify-end">
<span class="badge badge-info preset-tonal-tertiary">
{#if $lq__event_obj?.physical && $lq__event_obj?.virtual}
<span class="fas fa-home m-1"></span> F2F and <span class="fas fa-laptop m-1"></span> Virtual
{:else if $lq__event_obj?.physical}
<span class="fas fa-home m-1"></span> F2F
{:else if $lq__event_obj?.virtual}
<span class="fas fa-laptop m-1"></span> Virtual
{/if}
</span>
{#if $lq__event_obj?.type}
<span class="badge badge-info preset-tonal-secondary"><span class="fas fa-user-md m-1"></span> {$lq__event_obj?.type}</span>
{/if}
{#if $ae_loc.trusted_access && $lq__event_obj?.hide}
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Hidden</span>
{/if}
{#if $ae_loc.administrator_access && !$lq__event_obj?.enable}
<span class="badge badge-warning preset-tonal-warning"><span class="fas fa-exclamation-triangle m-1"></span> Not enabled</span>
{/if}
</span>
</div>
</header>
<div
class="
flex flex-row gap-2 items-center justify-between
flex flex-row gap-2 items-center justify-evenly
w-full
p-1 pb-2 mb-2
border-b border-b-surface-300-700

View File

@@ -120,44 +120,59 @@ function add_activity_log(
class:text-warning-900={!idaa_event_obj?.enable}
>
<header class="ae_header flex flex-row gap-2 items-center justify-between w-full">
<h3 class="event__name h3">
<span class="fas fa-calendar-day m-1"></span>
{idaa_event_obj?.name}
<header class="ae_header flex flex-row flex-wrap gap-2 items-center justify-between w-full">
<h3
class="
event__name
h3
text-2xl font-bold
flex flex-row gap-2 items-center justify-between
w-full
"
>
<span class="fas fa-calendar-day"></span>
{idaa_event_obj?.name ?? 'Recovery Meeting'}
</h3>
{#if idaa_event_obj?.status == 'unknown'}
<span class="badge badge-warning preset-tonal-error" title="This meeting has not been confirmed by IDAA Central Office. Please reach out to the chair for current meeting list info. Meeting attendees can reach out to info@idaa.org if they know this is information is accurate and this meeting is still taking place.">
<span class="fas fa-exclamation-triangle m-1"></span>
Not Confirmed by IDAA
<!-- Unknown Status -->
<span class="fas fa-exclamation-triangle m-1"></span>
</span>
{/if}
<div
class="
flex flex-row gap-2 items-center justify-between
w-full
"
>
{#if idaa_event_obj?.status == 'unknown'}
<span class="badge badge-warning preset-tonal-error" title="This meeting has not been confirmed by IDAA Central Office. Please reach out to the chair for current meeting list info. Meeting attendees can reach out to info@idaa.org if they know this is information is accurate and this meeting is still taking place.">
<span class="fas fa-exclamation-triangle m-1"></span>
Not Confirmed by IDAA
<!-- Unknown Status -->
<span class="fas fa-exclamation-triangle m-1"></span>
</span>
{/if}
<span class="flex flex-row flex-wrap gap-1 items-center justify-center">
<span class="badge badge-info preset-tonal-tertiary">
{#if idaa_event_obj?.physical && idaa_event_obj?.virtual}
<span class="fas fa-home m-1"></span> F2F and <span class="fas fa-laptop m-1"></span> Virtual
{:else if idaa_event_obj?.physical}
<span class="fas fa-home m-1"></span> F2F
{:else if idaa_event_obj?.virtual}
<span class="fas fa-laptop m-1"></span> Virtual
<span class="float-right flex flex-row flex-wrap gap-1 items-center justify-end">
<span class="badge badge-info preset-tonal-tertiary">
{#if idaa_event_obj?.physical && idaa_event_obj?.virtual}
<span class="fas fa-home m-1"></span> F2F and <span class="fas fa-laptop m-1"></span> Virtual
{:else if idaa_event_obj?.physical}
<span class="fas fa-home m-1"></span> F2F
{:else if idaa_event_obj?.virtual}
<span class="fas fa-laptop m-1"></span> Virtual
{/if}
</span>
{#if idaa_event_obj?.type}
<span class="badge badge-info preset-tonal-secondary"><span class="fas fa-user-md m-1"></span> {idaa_event_obj?.type}</span>
{/if}
{#if $ae_loc.trusted_access && idaa_event_obj?.hide}
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Hidden</span>
{/if}
{#if $ae_loc.administrator_access && !idaa_event_obj?.enable}
<span class="badge badge-warning preset-tonal-warning"><span class="fas fa-exclamation-triangle m-1"></span> Not enabled</span>
{/if}
</span>
{#if idaa_event_obj?.type}
<span class="badge badge-info preset-tonal-secondary"><span class="fas fa-user-md m-1"></span> {idaa_event_obj?.type}</span>
{/if}
{#if $ae_loc.trusted_access && idaa_event_obj?.hide}
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Hidden</span>
{/if}
{#if $ae_loc.administrator_access && !idaa_event_obj?.enable}
<span class="badge badge-warning preset-tonal-warning"><span class="fas fa-exclamation-triangle m-1"></span> Not enabled</span>
{/if}
</span>
</div>
</header>
<div class="ae_options flex flex-row gap-2 items-center justify-center">
<div class="ae_options flex flex-row flex-wrap gap-2 items-center justify-center">
<a
href="/idaa/recovery_meetings/{idaa_event_obj?.event_id}"
class="novi_btn btn btn-secondary btn-md preset-tonal-primary border border-primary-500 hover:preset-filled-primary-500 transition"
@@ -165,7 +180,7 @@ function add_activity_log(
>
<span class="fas fa-envelope-open m-1"></span>
<!-- <span class="fas fa-info-circle"></span> -->
Info
View Details
</a>
<button
type="button"
@@ -210,7 +225,7 @@ function add_activity_log(
}
}}
class="novi_btn btn btn-secondary btn-md preset-tonal-primary border border-primary-500 hover:preset-filled-primary-500 transition"
class="novi_btn btn btn-secondary btn-md preset-tonal-primary border border-primary-500 hover:preset-filled-primary-500 transition hidden"
title={`Open to see details: ${idaa_event_obj?.name}`}
>
<span class="fas fa-envelope-open m-1"></span>
@@ -239,7 +254,7 @@ function add_activity_log(
$idaa_sess.recovery_meetings.show__modal_edit = true;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = idaa_event_obj?.event_id;
}}
class="novi_btn btn btn-tertiary btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
class="novi_btn btn btn-tertiary btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition hidden"
title={`Edit meeting: ${idaa_event_obj?.name}`}
>
<span class="fas fa-edit m-1"></span>

View File

@@ -1,5 +1,6 @@
<script lang="ts">
// *** Import Svelte core
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
// *** Import Aether core variables and functions
@@ -8,7 +9,7 @@ import { ae_util } from '$lib/ae_utils/ae_utils';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { core_func } from '$lib/ae_core/ae_core_functions';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig, idaa_prom } from '$lib/ae_idaa_stores';
// import { events_func } from '$lib/ae_events_functions';
import { events_func } from '$lib/ae_events_functions';
export let log_lvl: number = 0;
// export let event_id_random_li: Array<string>;
@@ -506,17 +507,54 @@ if ($idaa_loc.recovery_meetings.qry__fulltext_str && $idaa_loc.recovery_meetings
$idaa_slct.event_id = null;
$idaa_slct.event_obj = {};
const url = new URL(location);
url.searchParams.delete('event_id');
history.pushState({}, '', url);
// const url = new URL(location);
// url.searchParams.delete('event_id');
// history.pushState({}, '', url);
// $idaa_loc.recovery_meetings.show_main__options = false;
// $idaa_loc.recovery_meetings.show_list__event_obj_li = false;
// $idaa_loc.recovery_meetings.show_view__event_obj = false;
// $idaa_loc.recovery_meetings.show_edit__event_obj = true;
$idaa_sess.recovery_meetings.show__modal_view = false;
$idaa_sess.recovery_meetings.show__modal_edit = true;
// $idaa_sess.recovery_meetings.show__modal_view = false;
// $idaa_sess.recovery_meetings.show__modal_edit = true;
// Get the users current timezone
// let timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// let timezone = $ae_loc.timezone || 'UTC'; // Fallback to UTC if timezone is not set
let data_kv = {
name: 'NEW Recovery Meeting',
// timezone: timezone,
};
if (log_lvl) {
console.log('Creating new event (recovery meeting) with data_kv:', data_kv);
}
events_func.create_ae_obj__event({
api_cfg: $ae_api,
account_id: $ae_loc.account_id,
data_kv: data_kv,
log_lvl: log_lvl
}).then((results) => {
if (log_lvl) {
console.log('New event (recovery meeting) created:', results);
}
$idaa_slct.event_id = results?.event_id_random;
$idaa_loc.recovery_meetings.edit_kv[$idaa_slct.event_id] = 'current';
}).catch((error) => {
console.error('Error updating event (recovery meeting):', error);
alert('Failed to update event (recovery meeting).');
}).finally(() => {
if ($idaa_slct.event_id) {
goto(`/idaa/recovery_meetings/${$idaa_slct.event_id}`);
} else {
alert('Failed to create new event (recovery meeting).');
}
});
}}
class="novi_btn btn btn-sm btn-tertiary preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition text-xs"
disabled={!$ae_loc.authenticated_access}

View File

@@ -278,7 +278,7 @@ $effect(() => {
<!-- <svelte:window onscroll={handle_on_scroll} /> -->
<!-- <svelte:window bind:scrollY={scroll_y} /> -->
<!-- h-full max-h-full -->
<div
id="ae_idaa"
bind:clientHeight={$ae_loc.iframe_height}
@@ -287,7 +287,7 @@ $effect(() => {
class:iframe={$ae_loc?.iframe}
class="
ae_idaa
h-full max-h-full max-w-6xl overflow-auto
h-full max-h-fit max-w-6xl overflow-auto
flex flex-col gap-1
m-auto
"

View File

@@ -53,7 +53,9 @@ fetch(novi_api_get_customer_endpoint, requestOptions)
if (idaa_ae_slct_event_id) {
// console.log(`Loading AE Archive ID: ${idaa_ae_slct_event_id}`);
idaa_ae_iframe_element.src = `${idaa_ae_api_root_url}?uuid=${novi_customer_uid}&email=${novi_current_user_obj.Email}&full_name=${novi_current_user_obj.Name}&event_id=${idaa_ae_slct_event_id}&iframe=true&key=${idaa_osit_site_key}`;
// idaa_ae_iframe_element.src = `${idaa_ae_api_root_url}?uuid=${novi_customer_uid}&email=${novi_current_user_obj.Email}&full_name=${novi_current_user_obj.Name}&event_id=${idaa_ae_slct_event_id}&iframe=true&key=${idaa_osit_site_key}`;
idaa_ae_iframe_element.src = `${idaa_ae_api_root_url}/${idaa_ae_slct_event_id}?uuid=${novi_customer_uid}&email=${novi_current_user_obj.Email}&full_name=${novi_current_user_obj.Name}&iframe=true&key=${idaa_osit_site_key}`;
} else {
idaa_ae_iframe_element.src = `${idaa_ae_api_root_url}?uuid=${novi_customer_uid}&email=${novi_current_user_obj.Email}&full_name=${novi_current_user_obj.Name}&iframe=true&key=${idaa_osit_site_key}`;
@@ -135,7 +137,7 @@ window.addEventListener('message', function(event) {
<!-- IDAA Aether Apps for Novi - Recovery Meetings (events) iframe -->
<p><iframe width="100%" height="750" id="ae_idaa_recovery_meetings_iframe" src="" style="min-height: 600px; max-height: 100%;" class="ae_idaa_iframe"></iframe></p>
<p><iframe width="100%" height="750" id="ae_idaa_recovery_meetings_iframe" src="" style="min-height: 600px; height: min-content; max-height: 2048px;" class="ae_idaa_iframe"></iframe></p>