diff --git a/src/routes/idaa/(idaa)/bb/[post_id]/+page.svelte b/src/routes/idaa/(idaa)/bb/[post_id]/+page.svelte index c6a0ed47..0cec5b01 100644 --- a/src/routes/idaa/(idaa)/bb/[post_id]/+page.svelte +++ b/src/routes/idaa/(idaa)/bb/[post_id]/+page.svelte @@ -10,6 +10,7 @@ let log_lvl: number = 0; // *** Import Svelte specific import { onMount, onDestroy, untrack } from 'svelte'; +import { goto } from '$app/navigation'; // *** Import other supporting libraries import { liveQuery } from 'dexie'; @@ -90,6 +91,27 @@ let lq__post_comment_obj = $derived.by(() => { }); }); +function clear_bb_edit_state() { + $idaa_sess.bb.edit__post_obj = false; + $idaa_loc.bb.edit__post_obj = false; + $idaa_sess.bb.show__inline_edit__post_obj = false; + $idaa_loc.bb.show__inline_edit__post_obj = false; + $idaa_sess.bb.show__inline_edit__post_comment_id = false; + $idaa_loc.bb.show__inline_edit__post_comment_id = false; + $idaa_sess.bb.obj_changed = false; +} + +function handle_back_to_posts_list() { + if ($idaa_sess.bb.obj_changed) { + if (!confirm('You have unsaved changes. Are you sure you want to cancel?')) { + return; + } + } + + clear_bb_edit_state(); + void goto('/idaa/bb'); +} + onMount(() => { console.log('Browser environment detected.'); @@ -186,8 +208,9 @@ onDestroy(() => { justify-evenly gap-2 border-b p-1 pb-2 "> - Back to Posts List - + {#if $idaa_sess.bb.edit__post_obj} diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte index 22d1c50b..59120fc2 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte @@ -584,22 +584,28 @@ Copy and paste link: ${ - - + + Linked with Novi ID {#if !$ae_loc.trusted_access} - + + + + {post_comment_form.external_person_id || + '-- not set --'} + + value={post_comment_form.external_person_id ?? ''} /> {:else} Primary link using the Novi API UUID. This must be @@ -617,16 +623,19 @@ Copy and paste link: ${ readonly={false} class="input form-control w-96" /> {/if} - + - - + + Name {#if !$ae_loc.trusted_access} {:else} ${ title="Field is unlocked"> {/if} - - + {#if !$ae_loc.trusted_access} + + + {post_comment_form.full_name || '-- not set --'} + + + {:else} + + {/if} + {#if $ae_loc.trusted_access} diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte index f30ed07b..f38ffa99 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte @@ -820,24 +820,27 @@ $effect(() => { - - + + Linked with Novi ID {#if !$ae_loc.trusted_access} - + + + + {post_form.external_person_id || '-- not set --'} + + value={post_form.external_person_id ?? ''} /> {:else} Primary link using the Novi API UUID. This must be @@ -855,16 +858,19 @@ $effect(() => { readonly={!$ae_loc.administrator_access} class="input preset-tonal-surface hover:preset-filled-surface-100-900 form-control w-96" /> {/if} - + - - + + Name {#if !$ae_loc.trusted_access} {:else} { title="Field is unlocked"> {/if} - - + {#if !$ae_loc.trusted_access} + + + {post_form.full_name || '-- not set --'} + + + {:else} + + {/if} + {#if $ae_loc.trusted_access}