diff --git a/src/lib/ae_core/ae_comp__hosted_files_upload.svelte b/src/lib/ae_core/ae_comp__hosted_files_upload.svelte index 2d936458..752b4cc0 100644 --- a/src/lib/ae_core/ae_comp__hosted_files_upload.svelte +++ b/src/lib/ae_core/ae_comp__hosted_files_upload.svelte @@ -286,7 +286,7 @@ async function handle_input_upload_files(input_upload_files, task_id) { - {#if $ae_sess.files.processed_file_list.length > 0} + {#if $ae_sess.files.processed_file_list?.length > 0} Viewing: - {$lq__archive_content_obj?.name} + {$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id} diff --git a/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_content_obj_li.svelte b/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_content_obj_li.svelte index e6e785e6..bc0710bb 100644 --- a/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_content_obj_li.svelte +++ b/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_content_obj_li.svelte @@ -123,7 +123,7 @@ onMount(() => { --> {/if} - {#if $ae_loc.trusted_access} + {#if $ae_loc.trusted_access && $ae_loc.edit_mode} { diff --git a/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_view.svelte b/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_view.svelte index b1157ffa..9cf6159b 100644 --- a/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_view.svelte +++ b/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_view.svelte @@ -70,7 +70,7 @@ onMount(() => { {/if} - {#if $ae_loc.trusted_access} + {#if $ae_loc.trusted_access && $ae_loc.edit_mode} -import { createEventDispatcher, onMount } from 'svelte'; -import { fade } from 'svelte/transition'; +import { onDestroy, onMount } from 'svelte'; +import { browser } from '$app/environment'; // import { ae, Element_modal_v3 } from 'aether_npm_lib'; import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores'; @@ -8,6 +8,8 @@ import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores'; // export let archive_content_id = null; +export let lq__archive_content_obj: any; + let file_icons:any = {} file_icons['ac3'] = 'file-audio'; file_icons['aac'] = 'file-audio'; @@ -35,17 +37,36 @@ file_icons['xls'] = 'file-excel'; file_icons['xlsx'] = 'file-excel'; file_icons['zip'] = 'file-archive'; -onMount(() => { +$: if (browser && $lq__archive_content_obj?.archive_content_id) { console.log('** Component Mounted: ** Media Player - Archive Content Obj'); + + const url = new URL(location); + url.searchParams.set('archive_content_id', $lq__archive_content_obj?.archive_content_id); + // url.searchParams.set('archive_content_id', $idaa_slct?.archive_content_id); + history.pushState({}, '', url); +} + +onDestroy(() => { + console.log('** Component Destroyed: ** View - Archive Content Obj'); + + const url = new URL(location); + url.searchParams.delete('archive_content_id'); + history.pushState({}, '', url); }); // Reminder: Styling is being done with Tailwind CSS, not Bootstrap. - + - {#if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-audio'} + {#if !$idaa_slct.archive_content_obj.hosted_file_id} + + + No Hosted File Linked + + + {:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-audio'} -import { onMount } from 'svelte'; -import { fade } from 'svelte/transition'; -import { Modal } from 'flowbite-svelte'; +import { onDestroy } from 'svelte'; +import { browser } from '$app/environment'; // *** Import Aether core variables and functions import { ae_util } from '$lib/ae_utils/ae_utils'; @@ -15,7 +14,6 @@ export let lq__post_obj: any; export let lq__post_comment_obj_li: any; export let lq__post_comment_obj: any; -// import Edit_post_comment_obj from './10_edit__post_comment_obj.svelte'; if ($idaa_slct.post_id) { console.log(`Post ID selected: ${$idaa_slct.post_id}`); @@ -24,51 +22,63 @@ if ($idaa_slct.post_id) { $idaa_trigger = 'load__post_obj'; } -onMount(() => { +$: if (browser && $lq__post_obj?.post_id) { console.log('** Component Mounted: ** View - Post Obj'); + + const url = new URL(location); + url.searchParams.set('post_id', $lq__post_obj?.post_id); + history.pushState({}, '', url); +} + +onDestroy(() => { + console.log('** Component Destroyed: ** View - Post Obj'); + + const url = new URL(location); + url.searchParams.delete('post_id'); + history.pushState({}, '', url); }); -function handle_post_comment_obj_created(event) { - console.log('*** handle_post_comment_obj_created() ***'); - console.log(event.detail); +// function handle_post_comment_obj_created(event) { +// console.log('*** handle_post_comment_obj_created() ***'); +// console.log(event.detail); - $idaa_slct.post_comment_id = null; - $idaa_slct.post_comment_obj = {}; +// $idaa_slct.post_comment_id = null; +// $idaa_slct.post_comment_obj = {}; - $idaa_trigger = 'load__post_obj_li'; - $idaa_trigger = 'load__post_obj'; - $idaa_trigger = 'load__post_comment_obj_li'; +// $idaa_trigger = 'load__post_obj_li'; +// $idaa_trigger = 'load__post_obj'; +// $idaa_trigger = 'load__post_comment_obj_li'; - // $idaa_sess.bb.show_post_list = false; - // $idaa_sess.bb.show_edit__post_id = false; - // $idaa_sess.bb.show_view__post_id = true; - $idaa_sess.bb.show_edit__post_comment = false; -} -function handle_post_comment_obj_updated(event) { - console.log('*** handle_post_comment_obj_updated() ***'); - console.log(event.detail); +// // $idaa_sess.bb.show_post_list = false; +// // $idaa_sess.bb.show_edit__post_id = false; +// // $idaa_sess.bb.show_view__post_id = true; +// $idaa_sess.bb.show_edit__post_comment = false; +// } +// function handle_post_comment_obj_updated(event) { +// console.log('*** handle_post_comment_obj_updated() ***'); +// console.log(event.detail); - $idaa_trigger = 'load__post_obj'; - $idaa_trigger = 'load__post_comment_obj_li'; +// $idaa_trigger = 'load__post_obj'; +// $idaa_trigger = 'load__post_comment_obj_li'; - // $idaa_sess.bb.show_post_list = false; - // $idaa_sess.bb.show_edit__post_id = false; - // $idaa_sess.bb.show_view__post_id = true; - $idaa_sess.bb.show_edit__post_comment = false; -} -function handle_post_comment_obj_deleted(event) { - console.log('*** handle_post_comment_obj_deleted() ***'); - console.log(event.detail); +// // $idaa_sess.bb.show_post_list = false; +// // $idaa_sess.bb.show_edit__post_id = false; +// // $idaa_sess.bb.show_view__post_id = true; +// $idaa_sess.bb.show_edit__post_comment = false; +// } +// function handle_post_comment_obj_deleted(event) { +// console.log('*** handle_post_comment_obj_deleted() ***'); +// console.log(event.detail); - $idaa_trigger = 'load__post_obj_li'; - $idaa_trigger = 'load__post_obj'; - $idaa_trigger = 'load__post_comment_obj_li'; +// $idaa_trigger = 'load__post_obj_li'; +// $idaa_trigger = 'load__post_obj'; +// $idaa_trigger = 'load__post_comment_obj_li'; - // $idaa_sess.bb.show_post_list = false; - // $idaa_sess.bb.show_edit__post_id = false; - // $idaa_sess.bb.show_view__post_id = true; - $idaa_sess.bb.show_edit__post_comment = false; -} +// // $idaa_sess.bb.show_post_list = false; +// // $idaa_sess.bb.show_edit__post_id = false; +// // $idaa_sess.bb.show_view__post_id = true; +// $idaa_sess.bb.show_edit__post_comment = false; +// } @@ -134,6 +144,7 @@ function handle_post_comment_obj_deleted(event) { {($idaa_slct.post_obj.post_comment_count == 1 ? `${$idaa_slct.post_obj.post_comment_count} comment` : `${$idaa_slct.post_obj.post_comment_count} comments` )} {/if} + {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid} { if (confirm('Are you sure you want to add a new comment?')) { @@ -145,8 +156,9 @@ function handle_post_comment_obj_deleted(event) { > New Comment + {/if} - {#if $ae_loc.trusted_access || $idaa_slct.post_obj.external_person_id === $idaa_loc.novi_uuid} + {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_slct.post_obj.external_person_id === $idaa_loc.novi_uuid} { // $idaa_slct.post_id = $idaa_slct.post_obj.post_id_random; @@ -172,8 +184,6 @@ function handle_post_comment_obj_deleted(event) { {/if} - - {#if $lq__post_comment_obj_li?.length} {#each $lq__post_comment_obj_li as post_comment_obj, index} @@ -213,7 +223,7 @@ function handle_post_comment_obj_deleted(event) { - {#if $ae_loc.trusted_access || post_comment_obj.external_person_id === $idaa_loc.novi_uuid} + {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || post_comment_obj.external_person_id === $idaa_loc.novi_uuid} { $idaa_slct.post_comment_id = post_comment_obj.post_comment_id; diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_li.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_li.svelte index 79e98585..cce250b6 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_li.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_li.svelte @@ -68,7 +68,7 @@ onMount(() => { {/if} - {#if $ae_loc.trusted_access || idaa_post_obj.external_person_id === $idaa_loc.novi_uuid} + {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || idaa_post_obj.external_person_id === $idaa_loc.novi_uuid} { $idaa_slct.post_id = idaa_post_obj.post_id; diff --git a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_view.svelte b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_view.svelte index 0d2bed5b..7b0117c3 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_view.svelte +++ b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_view.svelte @@ -1,5 +1,6 @@