Starting real work on the IDAA BB (posts). Can at least view them and their comments now.

This commit is contained in:
Scott Idem
2024-11-05 12:37:46 -05:00
parent 4d2a78f80f
commit ac7016bb3e
19 changed files with 679 additions and 655 deletions

View File

@@ -85,8 +85,6 @@ $: lq_new__event_obj_li = liveQuery(async () => {
<!-- <h1>Recovery Meetings {$lq_new__event_obj_li?.length}</h1> -->
<!-- Search results: {$lq_bulk__event_obj_li?.length}? -->
{#if $lq_new__event_obj_li && $lq_new__event_obj_li?.length }
<Comp__event_obj_li
lq__event_obj_li={lq_new__event_obj_li}
@@ -113,7 +111,7 @@ $: lq_new__event_obj_li = liveQuery(async () => {
<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}
{#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
on:click={() => {
@@ -175,7 +173,7 @@ $: lq_new__event_obj_li = liveQuery(async () => {
<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}
{#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
on:click={() => {
// const url = new URL(location);

View File

@@ -24,20 +24,20 @@ import View_event_obj from './ae_idaa_comp__event_obj_id_view.svelte';
// *** Export/Exposed variables and functions for component
// export let account_id: string = $page['page_for']['account_id'];
export let account_id: string = $ae_app.account_id;
export let event_id: string = $ae_app.events.event_id;
export let event_id: string = $idaa_loc.recovery_meetings.event_id;
export let novi_uuid: string = $ae_app.novi_uuid;
export let novi_email: string = $ae_app.novi_email;
export let novi_full_name: string = $ae_app.novi_full_name;
export let novi_admin_li: string = $ae_app.novi_admin_li;
export let novi_trusted_li: string = $ae_app.novi_trusted_li;
export let novi_uuid: string = $idaa_loc.novi_uuid;
export let novi_email: string = $idaa_loc.novi_email;
export let novi_full_name: string = $idaa_loc.novi_full_name;
export let novi_admin_li: string = $idaa_loc.novi_admin_li;
export let novi_trusted_li: string = $idaa_loc.novi_trusted_li;
// *** Set initial variables
$ae_app.novi_uuid = novi_uuid;
$ae_app.novi_email = decodeURIComponent(novi_email);
$ae_app.novi_full_name = decodeURIComponent(novi_full_name);
$ae_app.novi_admin_li = novi_admin_li;
$ae_app.novi_trusted_li = novi_trusted_li;
$idaa_loc.novi_uuid = novi_uuid;
$idaa_loc.novi_email = decodeURIComponent(novi_email);
$idaa_loc.novi_full_name = decodeURIComponent(novi_full_name);
$idaa_loc.novi_admin_li = novi_admin_li;
$idaa_loc.novi_trusted_li = novi_trusted_li;
$ae_app.current_timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
if (!$ae_app.lu_country_subdivision_list) {
@@ -50,41 +50,41 @@ if (!$ae_app.lu_timezone_list) {
$ae_app.lu_timezone_list = [];
}
$ae_app.events.show_main__options = true; // Section for: search area, buttons for filtering events, create new event (Meeting).
$ae_app.events.show_list__event_obj_li = true;
$ae_app.events.fulltext_search_qry_str = '';
$ae_app.events.qry_virtual = false;
$ae_app.events.qry_physical = false;
$ae_app.events.qry_type = '';
$idaa_loc.recovery_meetings.show_main__options = true; // Section for: search area, buttons for filtering events, create new event (Meeting).
$idaa_loc.recovery_meetings.show_list__event_obj_li = true;
$idaa_loc.recovery_meetings.fulltext_search_qry_str = '';
$idaa_loc.recovery_meetings.qry_virtual = false;
$idaa_loc.recovery_meetings.qry_physical = false;
$idaa_loc.recovery_meetings.qry_type = '';
// NOTE: Check if the novi_uuid is in the novi_admin_li list
if ($ae_app.novi_uuid && $ae_app.novi_admin_li) {
if ($ae_app.novi_admin_li.includes($ae_app.novi_uuid)) {
$ae_app.access_type = 'administrator';
$ae_app.administrator_access = true;
$ae_app.trusted_access = true;
if ($idaa_loc.novi_uuid && $idaa_loc.novi_admin_li) {
if ($idaa_loc.novi_admin_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'administrator';
$ae_loc.administrator_access = true;
$ae_loc.trusted_access = true;
}
}
// NOTE: Check if the novi_uuid is in the novi_trusted_li list
if ($ae_app.novi_uuid && $ae_app.novi_trusted_li) {
if ($ae_app.novi_trusted_li.includes($ae_app.novi_uuid)) {
$ae_app.access_type = 'trusted';
$ae_app.trusted_access = true;
if ($idaa_loc.novi_uuid && $idaa_loc.novi_trusted_li) {
if ($idaa_loc.novi_trusted_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'trusted';
$ae_loc.trusted_access = true;
}
}
if ($ae_app.administrator_access) {
$ae_app.events.enabled = 'enabled';
$ae_app.events.hidden = 'not_hidden';
$ae_app.events.limit = 150;
} else if ($ae_app.trusted_access) {
$ae_app.events.enabled = 'enabled';
$ae_app.events.hidden = 'not_hidden';
$ae_app.events.limit = 75;
if ($ae_loc.administrator_access) {
$idaa_loc.recovery_meetings.enabled = 'enabled';
$idaa_loc.recovery_meetings.hidden = 'not_hidden';
$idaa_loc.recovery_meetings.limit = 150;
} else if ($ae_loc.trusted_access) {
$idaa_loc.recovery_meetings.enabled = 'enabled';
$idaa_loc.recovery_meetings.hidden = 'not_hidden';
$idaa_loc.recovery_meetings.limit = 75;
} else {
$ae_app.events.enabled = 'enabled';
$ae_app.events.hidden = 'not_hidden';
$ae_app.events.limit = 25;
$idaa_loc.recovery_meetings.enabled = 'enabled';
$idaa_loc.recovery_meetings.hidden = 'not_hidden';
$idaa_loc.recovery_meetings.limit = 25;
}
let idaa_event_obj_li_get_promise;
@@ -114,10 +114,10 @@ if (event_id) {
// let message = {'event_id': $slct.event_id};
// window.parent.postMessage(message, "*");
$ae_app.events.show_main__options = true;
$ae_app.events.show_list__event_obj_li = true;
$ae_app.events.show_view__event_obj = true;
$ae_app.events.show_edit__event_obj = false;
$idaa_loc.recovery_meetings.show_main__options = true;
$idaa_loc.recovery_meetings.show_list__event_obj_li = true;
$idaa_loc.recovery_meetings.show_view__event_obj = true;
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
}
if (!$ae_app.client_content) {
@@ -164,8 +164,8 @@ $: if ($ae_app.iframe_height && $ae_app.iframe_height_modal_body) {
$: if ($slct_trigger == 'load__event_obj_li' && $slct.account_id) {
if ($ae_app.events.qry_status == 'loading') {
console.log('*** $ae_app.events.qry_status == loading ***');
if ($idaa_loc.recovery_meetings.qry_status == 'loading') {
console.log('*** $idaa_loc.recovery_meetings.qry_status == loading ***');
setTimeout(() => {
console.log("Delayed for X second.");
@@ -173,7 +173,7 @@ $: if ($slct_trigger == 'load__event_obj_li' && $slct.account_id) {
handle_load_idaa_event_obj_li({account_id: $slct.account_id, try_cache: false});
}, 250);
} else {
console.log('*** $ae_app.events.qry_status != loading ***');
console.log('*** $idaa_loc.recovery_meetings.qry_status != loading ***');
$slct_trigger = null;
handle_load_idaa_event_obj_li({account_id: $slct.account_id, try_cache: false});
}
@@ -181,19 +181,19 @@ $: if ($slct_trigger == 'load__event_obj_li' && $slct.account_id) {
async function handle_load_idaa_event_obj_li({account_id, try_cache=true}) {
console.log('*** handle_load_idaa_event_obj_li() ***');
console.log($ae_app.events);
console.log($idaa_loc.recovery_meetings);
// The fulltext search should be lower case
// let fulltext_search_qry_str = $ae_app.events.fulltext_search_qry_str.toLowerCase();
let fulltext_search_qry_str = $ae_app.events.fulltext_search_qry_str;
let qry_virtual = $ae_app.events.qry_virtual;
let qry_physical = $ae_app.events.qry_physical;
let qry_type = $ae_app.events.qry_type;
// let fulltext_search_qry_str = $idaa_loc.recovery_meetings.fulltext_search_qry_str.toLowerCase();
let fulltext_search_qry_str = $idaa_loc.recovery_meetings.fulltext_search_qry_str;
let qry_virtual = $idaa_loc.recovery_meetings.qry_virtual;
let qry_physical = $idaa_loc.recovery_meetings.qry_physical;
let qry_type = $idaa_loc.recovery_meetings.qry_type;
let enabled = $ae_app.events.enabled;
let hidden = $ae_app.events.hidden;
let limit = $ae_app.events.limit;
let offset = $ae_app.events.offset;
let enabled = $idaa_loc.recovery_meetings.enabled;
let hidden = $idaa_loc.recovery_meetings.hidden;
let limit = $idaa_loc.recovery_meetings.limit;
let offset = $idaa_loc.recovery_meetings.offset;
let params = {};
@@ -220,7 +220,7 @@ async function handle_load_idaa_event_obj_li({account_id, try_cache=true}) {
// if (JSON.stringify(params_json) == JSON.stringify({})) {
// params_json = null;
// }
$ae_app.events.qry_status = 'loading';
$idaa_loc.recovery_meetings.qry_status = 'loading';
idaa_event_obj_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
api_cfg: $ae_app.ae_api,
obj_type: 'event', // Event in this case is a recovery meeting.
@@ -251,7 +251,7 @@ async function handle_load_idaa_event_obj_li({account_id, try_cache=true}) {
console.log('No results returned or failed.', error);
})
.finally(function () {
$ae_app.events.qry_status = 'done';
$idaa_loc.recovery_meetings.qry_status = 'done';
});
return idaa_event_obj_li_get_promise;
@@ -274,19 +274,19 @@ $: if ($slct_trigger == 'load__event_obj' && $slct.event_id) {
// let message = {'event_id': $slct.event_id};
// window.parent.postMessage(message, "*");
// $ae_app.events.show_main__options = false;
// $ae_app.events.show_list__event_obj_li = false;
// $ae_app.events.show_view__event_obj = true;
// $ae_app.events.show_edit__event_obj = false;
// $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 = true;
// $idaa_loc.recovery_meetings.show_edit__event_obj = false;
}
async function handle_load_event_id_obj({event_id, try_cache=false}) {
console.log('*** handle_load_event_id_obj() ***');
// let enabled = $ae_app.events.enabled;
// let hidden = $ae_app.events.hidden;
// let limit = $ae_app.events.limit;
// let offset = $ae_app.events.offset;
// let enabled = $idaa_loc.recovery_meetings.enabled;
// let hidden = $idaa_loc.recovery_meetings.hidden;
// let limit = $idaa_loc.recovery_meetings.limit;
// let offset = $idaa_loc.recovery_meetings.offset;
let params = {};
@@ -339,10 +339,10 @@ function handle_created_event_obj(event) {
// $slct_trigger = 'load__event_obj';
$slct_trigger = 'load__event_obj_li';
$ae_app.events.show_main__options = false;
$ae_app.events.show_list__event_obj_li = false;
$ae_app.events.show_view__event_obj = true;
$ae_app.events.show_edit__event_obj = false;
$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 = true;
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
}
function handle_updated_event_obj(event) {
@@ -352,10 +352,10 @@ function handle_updated_event_obj(event) {
// $slct_trigger = 'load__event_obj';
$slct_trigger = 'load__event_obj_li';
$ae_app.events.show_main__options = false;
$ae_app.events.show_list__event_obj_li = false;
$ae_app.events.show_view__event_obj = true;
$ae_app.events.show_edit__event_obj = false;
$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 = true;
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
}
function handle_deleted_event_obj(event) {
@@ -371,10 +371,10 @@ function handle_deleted_event_obj(event) {
$slct_trigger = 'load__event_obj_li';
$ae_app.events.show_main__options = true;
$ae_app.events.show_list__event_obj_li = true;
$ae_app.events.show_view__event_obj = false;
$ae_app.events.show_edit__event_obj = false;
$idaa_loc.recovery_meetings.show_main__options = true;
$idaa_loc.recovery_meetings.show_list__event_obj_li = true;
$idaa_loc.recovery_meetings.show_view__event_obj = false;
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
}
@@ -420,9 +420,9 @@ function handle_oninput_fulltext_search_qry_str(event) {
// fulltext_search_qry_str = event.target.value;
// if ($ae_app.events.fulltext_search_qry_str.length > 2) {
// if ($idaa_loc.recovery_meetings.fulltext_search_qry_str.length > 2) {
// } else {
// $ae_app.events.fulltext_search_qry_str = '';
// $idaa_loc.recovery_meetings.fulltext_search_qry_str = '';
// }
$slct_trigger = 'load__event_obj_li';
}
@@ -432,7 +432,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
let get_item_result = window.localStorage.getItem(code);
if (get_item_result) {
$ae_app.events.ds[code] = get_item_result;
$idaa_loc.recovery_meetings.ds[code] = get_item_result;
} else {
console.log('Get local storage item miss.');
}
@@ -448,14 +448,14 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
if (data_type == 'text') {
// console.log(get_data_store_result.text);
$ae_app.events.ds[code] = get_data_store_result.text;
$idaa_loc.recovery_meetings.ds[code] = get_data_store_result.text;
} else if (data_type == 'json') {
// console.log(get_data_store_result.json);
$ae_app.events.ds[code] = get_data_store_result.json;
$idaa_loc.recovery_meetings.ds[code] = get_data_store_result.json;
}
// console.log(`Code: ${$ae_app.events.ds[code]}`);
// console.log(`Code:`, $ae_app.events.ds[code]);
// console.log(`Code: ${$idaa_loc.recovery_meetings.ds[code]}`);
// console.log(`Code:`, $idaa_loc.recovery_meetings.ds[code]);
}
})
.catch(function (error) {
@@ -476,16 +476,16 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
<section class="ae_section ae_meta">
<p>
Novi: {$ae_app.novi_full_name}
Novi: {$idaa_loc.novi_full_name}
<span class="details">
(
{$ae_app.novi_email}
{#if $ae_app.administrator_access}
{$idaa_loc.novi_email}
{#if $ae_loc.administrator_access}
<span class="access_type administrator_access">Administrator</span>
{:else if $ae_app.trusted_access}
{:else if $ae_loc.trusted_access}
<span class="access_type trusted_access">Trusted</span>
{/if}
<span class="novi_uuid">UUID: {$ae_app.novi_uuid}</span>
<span class="novi_uuid">UUID: {$idaa_loc.novi_uuid}</span>
)
</span>
</p>
@@ -500,12 +500,12 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
<p>If you are interested in Starting a Meeting, IDAA has developed a guide. <a href="https://static.oneskyit.com/c/IDAA/files/IDAA_-_How_to_Start_A_Meeting_Guide.pdf" class="ae_btn btn_md btn_outline_info"><span class="fas fa-file-pdf"></span> Open IDAA's How to Start an IDAA Recovery Meeting PDF</a> for additional information.</p>
</div> -->
{#if $ae_app.events.show_main__options}
{#if $idaa_loc.recovery_meetings.show_main__options}
<section class="ae_section ae_options ae_column event_obj__options">
<div class="filters_and_search">
<div class="ae_info recovery_meetings_info note">
{@html $ae_app.events.ds.recovery_meetings_info}
{@html $idaa_loc.recovery_meetings.ds.recovery_meetings_info}
</div>
<!-- <div class="note">Note: The state/province filter only includes states and provinces that are set for at least one meeting. Many virtual/online meetings do not have a state/province set. Some in-person meetings also do not have a state/province set. Please ask one of the meeting contacts to update this information if it is missing.</div> -->
@@ -516,7 +516,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
placeholder="Search (day of week, location, time, chair, etc.)"
name="fulltext_search_qry_str"
on:keyup={handle_oninput_fulltext_search_qry_str}
bind:value={$ae_app.events.fulltext_search_qry_str}
bind:value={$idaa_loc.recovery_meetings.fulltext_search_qry_str}
>
</div> -->
<div class="ae_group">
@@ -525,7 +525,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
placeholder="Search (day of week, location, chair, etc.)"
id="meeting_fulltext_search_qry_str"
name="fulltext_search_qry_str"
bind:value={$ae_app.events.fulltext_search_qry_str}
bind:value={$idaa_loc.recovery_meetings.fulltext_search_qry_str}
style="width: 50%;"
class="bs-input"
>
@@ -543,7 +543,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
<input
name="qry_virtual"
type="checkbox"
bind:checked={$ae_app.events.qry_virtual}
bind:checked={$idaa_loc.recovery_meetings.qry_virtual}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
>
</label>
@@ -551,7 +551,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
<input
name="qry_physical"
type="checkbox"
bind:checked={$ae_app.events.qry_physical}
bind:checked={$idaa_loc.recovery_meetings.qry_physical}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
>
</label>
@@ -566,7 +566,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
name="qry_type"
type="radio"
value=""
bind:group={$ae_app.events.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry_type}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
title="Show all meeting types"
>
@@ -576,7 +576,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
name="qry_type"
type="radio"
value="IDAA"
bind:group={$ae_app.events.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry_type}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
title="Open to IDAA members only"
>
@@ -586,7 +586,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
name="qry_type"
type="radio"
value="Caduceus"
bind:group={$ae_app.events.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry_type}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
title="Open to all healthcare workers including those who do not qualify for IDAA"
>
@@ -596,18 +596,18 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
name="qry_type"
type="radio"
value="Family Recovery"
bind:group={$ae_app.events.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry_type}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
title="Open to spouses, parents, and children of medical professionals who have substance use disorder."
>
</label>
<!-- {#if $ae_app.administrator_access}
<!-- {#if $ae_loc.administrator_access}
<label>Al-Anon (old)
<input
name="qry_type"
type="radio"
value="Al-Anon"
bind:group={$ae_app.events.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry_type}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
>
</label>
@@ -616,7 +616,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
name="qry_type"
type="radio"
value="Other"
bind:group={$ae_app.events.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry_type}
on:change={() => {$slct_trigger = 'load__event_obj_li';}}
>
</label>
@@ -634,21 +634,21 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
<div class="ae_group ae_row">
{#if $ae_app.trusted_access && $ae_app.events.hidden == 'not_hidden'}
{#if $ae_loc.trusted_access && $idaa_loc.recovery_meetings.hidden == 'not_hidden'}
<button
on:click={() => {
$ae_app.events.hidden = 'all';
$ae_app.events.limit = 150;
$idaa_loc.recovery_meetings.hidden = 'all';
$idaa_loc.recovery_meetings.limit = 150;
$slct_trigger = 'load__event_obj_li';
}}
class="btn_show_bb_post ae_btn btn btn-info"
>
<span class="fas fa-eye"></span> Show Hidden Events
</button>
{:else if $ae_app.trusted_access && $ae_app.events.hidden == 'all'}
{:else if $ae_loc.trusted_access && $idaa_loc.recovery_meetings.hidden == 'all'}
<button
on:click={() => {
$ae_app.events.hidden = 'not_hidden';
$idaa_loc.recovery_meetings.hidden = 'not_hidden';
$slct_trigger = 'load__event_obj_li';
}}
class="btn_hide_bb_post ae_btn btn btn-info"
@@ -657,22 +657,22 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
</button>
{/if}
{#if $ae_app.administrator_access && $ae_app.events.enabled == 'enabled'}
{#if $ae_loc.administrator_access && $idaa_loc.recovery_meetings.enabled == 'enabled'}
<button
on:click={() => {
$ae_app.events.hidden = 'all';
$ae_app.events.enabled = 'all';
$ae_app.events.limit = 500;
$idaa_loc.recovery_meetings.hidden = 'all';
$idaa_loc.recovery_meetings.enabled = 'all';
$idaa_loc.recovery_meetings.limit = 500;
$slct_trigger = 'load__event_obj_li';
}}
class="btn_show_bb_post ae_btn btn btn-warning"
>
<span class="fas fa-eye"></span> Show Disabled Events
</button>
{:else if $ae_app.administrator_access && $ae_app.events.enabled == 'all'}
{:else if $ae_loc.administrator_access && $idaa_loc.recovery_meetings.enabled == 'all'}
<button
on:click={() => {
$ae_app.events.enabled = 'enabled';
$idaa_loc.recovery_meetings.enabled = 'enabled';
$slct_trigger = 'load__event_obj_li';
}}
class="btn_hide_bb_post ae_btn btn btn-warning"
@@ -690,10 +690,10 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
url.searchParams.delete('event_id');
history.pushState({}, '', url);
$ae_app.events.show_main__options = false;
$ae_app.events.show_list__event_obj_li = false;
$ae_app.events.show_view__event_obj = false;
$ae_app.events.show_edit__event_obj = true;
$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;
}}
class="btn_new_recovery_meeting ae_btn btn btn-secondary"
>
@@ -707,22 +707,22 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
{/if}
{#if $ae_app.events.show_list__event_obj_li}
{#if $idaa_loc.recovery_meetings.show_list__event_obj_li}
<List_event_obj />
{/if}
{#if $ae_app.events.show_edit__event_obj}
{#if $idaa_loc.recovery_meetings.show_edit__event_obj}
<!-- <section class="ae_edit event_obj event_id idaa_event_id_edit"> -->
<Element_modal_v3
show = { true }
modal_cover_body = { false }
report_client_dimensions = { true }
on:close={ () => {
$ae_app.events.show_main__options = true;
$ae_app.events.show_list__event_obj_li = true;
$ae_app.events.show_edit__event_obj = false;
$ae_app.events.show_view__event_obj = false;
$idaa_loc.recovery_meetings.show_main__options = true;
$idaa_loc.recovery_meetings.show_list__event_obj_li = true;
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
$idaa_loc.recovery_meetings.show_view__event_obj = false;
const url = new URL(location);
url.searchParams.delete('event_id');
@@ -754,7 +754,7 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
{/if}
{#if $ae_app.events.show_view__event_obj && $slct.event_obj}
{#if $idaa_loc.recovery_meetings.show_view__event_obj && $slct.event_obj}
<!-- <section class="ae_view event_obj event_id idaa_event_id_view"> -->
<Element_modal_v3
show = { true }
@@ -764,10 +764,10 @@ async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
$slct.event_id = null;
$slct.event_obj = {};
$ae_app.events.show_main__options = true;
$ae_app.events.show_list__event_obj_li = true;
$ae_app.events.show_view__event_obj = false;
$ae_app.events.show_edit__event_obj = false;
$idaa_loc.recovery_meetings.show_main__options = true;
$idaa_loc.recovery_meetings.show_list__event_obj_li = true;
$idaa_loc.recovery_meetings.show_view__event_obj = false;
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
const url = new URL(location);
url.searchParams.delete('event_id');

View File

@@ -310,7 +310,7 @@ async function handle_submit_form(event: any) {
event_do['timezone'] = event_meeting_fd.timezone;
event_do['recurring'] = !!event_meeting_fd.recurring;
event_do['recurring'] = true; // Assume always true 2024-10 !!event_meeting_fd.recurring;
event_do['recurring_pattern'] = event_meeting_fd.recurring_pattern;
// NOTE: !! converts to boolean based on truthiness

View File

@@ -7,7 +7,6 @@ import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
export let lq__event_obj: any;
export let container_class_li = [];
const dispatch = createEventDispatcher();
@@ -40,7 +39,7 @@ onMount(() => {
</script>
<section class={`svelte_component ae_section ae_view event_obj view__event_obj ${container_class_li.join(' ')}`}>
<section class="svelte_component ae_section ae_view event_obj view__event_obj space-y-2">
<div class="p-2 bg-white shadow-md rounded-lg">
<div class="meeting_description description mb-4">
@@ -163,7 +162,7 @@ onMount(() => {
<div class="p-2 bg-white shadow-md rounded-lg meeting_when">
<div class="meeting_recurring"
class:ae_d_none={!$lq__event_obj?.recurring}
class:hidden={!$lq__event_obj?.recurring}
>
<div class="meeting_recurring_text">
<span class="ae_label">
@@ -348,14 +347,14 @@ onMount(() => {
justify-content: space-between;
} */
.event_obj .ae_meta .ae_group {
/* .event_obj .ae_meta .ae_group {
flex-direction: row;
}
} */
.event_obj .ae_meta .ae_options {
/* .event_obj .ae_meta .ae_options {
flex-direction: row;
justify-content: space-between;
}
} */
/* a {
color: #82B6E1;

View File

@@ -10,15 +10,13 @@ import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
export let lq__event_obj_li: any;
export let container_class_li = [];
onMount(() => {
console.log('** Component Mounted: ** List - Recovery Meeting (Event) Obj');
});
</script>
<section class="svelte_component ae_section ae_list event_obj_li list__event_obj recovery_meeting_list {container_class_li.join(' ')}">
<section class="svelte_component ae_section ae_list event_obj_li list__event_obj recovery_meeting_list">
<!-- <h1>Recovery Meetings {$lq__event_obj_li?.length}</h1> -->
{#if $lq__event_obj_li && $lq__event_obj_li.length}
@@ -40,18 +38,15 @@ onMount(() => {
{#each $lq__event_obj_li as idaa_event_obj, index}
<div
id={`idaa_recovery_meeting_id__${idaa_event_obj?.event_id_random}`}
class="container recovery_meeting ae_object event_obj border border-1 rounded p-2 mb-2"
class:meeting_physical={idaa_event_obj?.physical}
class:meeting_virtual={idaa_event_obj?.virtual}
class="container recovery_meeting event_obj border border-1 rounded p-2 mb-2"
class:dim={idaa_event_obj?.hide}
class:bg-warning-100={!idaa_event_obj?.enable}
>
<header class="ae_header event__header">
<header class="ae_header">
<h3
class="flex flex-row gap-2 items-center">
<span class="event__name">{idaa_event_obj?.name}</span>
<span class="event__name h3">{idaa_event_obj?.name}</span>
<span class="badge badge-info variant-glass-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
@@ -73,21 +68,21 @@ onMount(() => {
</h3>
</header>
<div class="ae_options event_obj__options">
<div class="ae_options flex flex-row gap-2 items-center justify-center">
<button
on:click={() => {
$idaa_slct.event_id = idaa_event_obj?.event_id_random;
$idaa_slct.event_id = idaa_event_obj?.event_id;
$idaa_slct.event_obj = idaa_event_obj;
$slct_trigger = 'load__event_obj';
// $slct_trigger = 'load__event_obj';
// // handle_load_event_id_obj({event_id: $idaa_slct.event_id, try_cache: false});
// const url = new URL(location);
// url.searchParams.set('event_id', idaa_event_obj?.event_id_random);
// history.pushState({}, '', url);
const url = new URL(location);
url.searchParams.set('event_id', idaa_event_obj?.event_id);
history.pushState({}, '', url);
// let message = {'event_id': idaa_event_obj?.event_id_random};
// window.parent.postMessage(message, "*");
let message = {'event_id': idaa_event_obj?.event_id};
window.parent.postMessage(message, "*");
// $idaa_sess.recovery_meetings.show_main__options = true;
// $idaa_sess.recovery_meetings.show_list__event_obj_li = true;
@@ -103,15 +98,15 @@ onMount(() => {
</button>
<!-- This checks if the currently logged in Novi user has a matching UUID or email address. -->
{#if $ae_loc.trusted_access || idaa_event_obj?.external_person_id === $ae_loc.novi_uuid || idaa_event_obj?.contact_li_json[0].email === $ae_loc.novi_email}
{#if $ae_loc.trusted_access || idaa_event_obj?.external_person_id === $idaa_loc.novi_uuid || idaa_event_obj?.contact_li_json[0].email === $idaa_loc.novi_email}
<button
on:click={() => {
$idaa_slct.event_id = idaa_event_obj?.event_id_random;
$idaa_slct.event_id = idaa_event_obj?.event_id;
$idaa_slct.event_obj = idaa_event_obj;
$slct_trigger = 'load__event_obj';
// $slct_trigger = 'load__event_obj';
// const url = new URL(location);
// url.searchParams.set('event_id', idaa_event_obj?.event_id_random);
// url.searchParams.set('event_id', idaa_event_obj?.event_id);
// history.pushState({}, '', url);
// $idaa_sess.recovery_meetings.show_main__options = true;
@@ -125,16 +120,6 @@ onMount(() => {
<span class="fas fa-edit m-1"></span>
Edit Meeting
</button>
<!-- <button
on:click={() => {
// Copy URL to clipboard
// Is there a URL anymore?
// const copy_text = document.getElementById(`meeting_edit_url_${idaa_event_obj?.event_id_random}`);
}}
class="ae_btn btn_sm btn_outline_info meeting_edit_help"
>
<span class="fas fa-link m-1"></span> URL
</button> -->
{/if}
</div>
@@ -322,8 +307,8 @@ onMount(() => {
}
.ae_header h3 {
font-size: 1.2em;
margin: 0;
/* font-size: 1.2em; */
/* margin: 0; */
/* padding: 0; */
}
@@ -336,8 +321,8 @@ onMount(() => {
flex-direction: row;
}
.event_obj .ae_meta .ae_options {
/* .event_obj .ae_meta .ae_options {
flex-direction: row;
justify-content: space-between;
}
} */
</style>