diff --git a/src/lib/ae_stores.ts b/src/lib/ae_stores.ts index d3eee9f4..30422117 100644 --- a/src/lib/ae_stores.ts +++ b/src/lib/ae_stores.ts @@ -1,4 +1,7 @@ +import { localStorageStore } from '@skeletonlabs/skeleton' import { readable, writable } from 'svelte/store'; +import type { Writable } from 'svelte/store'; + import { PUBLIC_TESTING, PUBLIC_AE_API_PROTOCOL, PUBLIC_AE_API_SERVER, PUBLIC_AE_API_BAK_SERVER, PUBLIC_AE_API_PORT, PUBLIC_AE_API_PATH, PUBLIC_AE_API_SECRET_KEY, PUBLIC_AE_API_CRUD_SUPER_KEY, PUBLIC_AE_ACCOUNT_ID } from '$env/static/public'; console.log(`Aether Config - TESTING:`, PUBLIC_TESTING); @@ -29,7 +32,7 @@ type key_val = { // *** BEGIN *** Longer-term app data. This should be stored to local storage. export let ae_app_local_data_struct: key_val = { - 'ver': '0.0.1', + 'ver': '0.0.5', 'name': 'Aether App Template', 'theme': 'light', 'account_id': ae_account_id, // OSIT Demo _XY7DXtc9MY @@ -50,7 +53,16 @@ export let ae_app_local_data_struct: key_val = { }, } console.log(`Aether Config - App Local Storage Data:`, ae_app_local_data_struct); -export let ae_loc = writable(ae_app_local_data_struct); + +// This does not work yet... +// const ae_loc_store: Writable = localStorageStore('ae_loc', ae_app_local_data_struct); +// console.log(`store - $ae_loc:`, ae_loc_store); + +// Testing: +export let ae_loc: Writable = localStorageStore('ae_loc', ae_app_local_data_struct); + +// This works: +// export let ae_loc = writable(ae_loc_store); // *** BEGIN *** Temporary app data. This should be stored to session storage. diff --git a/src/routes/sponsorships/+page.svelte b/src/routes/sponsorships/+page.svelte index 9553959a..dc88fece 100644 --- a/src/routes/sponsorships/+page.svelte +++ b/src/routes/sponsorships/+page.svelte @@ -1,6 +1,10 @@ - - - - -
-
-

Sponsorships for One Sky IT Demo

-
- -
-

- ae: {($ae_app.ae_full_name ? $ae_app.ae_full_name : 'Name not set')} - - ( - {($ae_app.ae_email ? $ae_app.ae_email : 'Email not set')} - {#if $ae_app.administrator_access} - Administrator - {:else if $ae_app.trusted_access} - Trusted - {/if} - {$ae_app.ae_user ? $ae_app.ae_user : 'User not set'} - ) - -

-
- -
-
- {@html $ae_app.sponsorships.ds.sponsorships_info} -
-
- -{#if $ae_app.sponsorships.show_main__options} -
-
- {@html $ae_app.sponsorships.ds.sponsorships_options} -
- - - -
-{/if} - - -{#if $slct.sponsorship_obj_li && $ae_app.sponsorships.show_list__sponsorship_obj_li} - -{/if} - - -{#if $ae_app.sponsorships.show_edit__sponsorship_obj} - - { - $ae_app.sponsorships.show_main__options = true; - $ae_app.sponsorships.show_list__sponsorship_obj_li = true; - $ae_app.sponsorships.show_edit__sponsorship_obj = false; - $ae_app.sponsorships.show_view__sponsorship_obj = false; - - const url = new URL(location); - url.searchParams.delete('sponsorship_id'); - history.pushState({}, '', url); - - let message = {'sponsorship_id': null}; - window.parent.postMessage(message, "*"); - }} - on:report__modal_dimensions={ (event) => { - console.log('*** on:report__modal_dimensions ***'); - console.log(event.detail); - - $ae_app.modal_dimensions = event.detail.modal_dimensions; - }} - > - {@html ($slct.sponsorship_obj.name ? $slct.sponsorship_obj.name : 'New Sponsorship')} - - - - - - - - -{/if} - - -{#if $ae_app.sponsorships.show_view__sponsorship_obj && $slct.sponsorship_obj} - - { - $slct.sponsorship_id = null; - $slct.sponsorship_obj = {}; - - $ae_app.sponsorships.show_main__options = true; - $ae_app.sponsorships.show_list__sponsorship_obj_li = true; - $ae_app.sponsorships.show_view__sponsorship_obj = false; - $ae_app.sponsorships.show_edit__sponsorship_obj = false; - - const url = new URL(location); - url.searchParams.delete('sponsorship_id'); - history.pushState({}, '', url); - - let message = {'sponsorship_id': null}; - window.parent.postMessage(message, "*"); - }} - on:report__modal_dimensions={ (event) => { - console.log('*** on:report__modal_dimensions ***'); - console.log(event.detail); - - $ae_app.modal_dimensions = event.detail.modal_dimensions; - }} - > - {@html $slct.sponsorship_obj.name} - - - - - - - - -{/if} - -
- - - diff --git a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte index 9d049c5c..4569a25b 100644 --- a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte +++ b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte @@ -1,6 +1,12 @@ {#if $modalStore[0]}