More quick updates and clean up

This commit is contained in:
Scott Idem
2024-03-04 13:43:24 -05:00
parent a0947e349a
commit 6c60ee3086
8 changed files with 138 additions and 87 deletions

View File

@@ -35,12 +35,12 @@ export async function load({ params, url }) { // route
let loading_results = null;
ds_code = 'hub__page__events__create_info';
ds_code = 'hub__page__events_speakers__create_info';
ds_type = 'text';
// loading_results = await handle_get_data_store_obj_w_code({ code: ds_code })
// .then( function (ds_hub_page_events_create_info_results) {
// if (ds_hub_page_events_create_info_results) {
// console.log(`ae_ hub__page__events__create_info = `, ds_hub_page_events_create_info_results);
// console.log(`ae_ hub__page__events_speakers__create_info = `, ds_hub_page_events_create_info_results);
// // let ae_loc_tmp = get(ae_loc);
// ds_code_li[ds_code] = ds_hub_page_events_create_info_results;

View File

@@ -25,7 +25,7 @@ import Edit_modal_event_presenter from '../10_edit_modal__event_presenter_obj.sv
// Editing
const modalComponentEditEventPresenterObj: ModalComponent = { ref: Edit_modal_event_presenter, props: {container_class_li: 'w-full p-4 space-y-4 card ae_modal_scrollfix'} };
const modalComponentEditEventPresenterObj: ModalComponent = { ref: Edit_modal_event_presenter, props: {container_class_li: 'w-full p-4 space-y-4 card'} };
const modal_edit__event_presenter: ModalSettings = {
type: 'component',
@@ -65,6 +65,7 @@ $ae_loc.mod.events.show_edit__event_presenter_obj = false;
$ae_loc.mod.events.show_view__event_presenter_obj = false;
let ae_event_presenter_get_promise: Promise<any>;
let ae_event_obj_get_promise;
onMount(() => {
@@ -104,8 +105,6 @@ $: if ($slct_trigger == 'load__event_obj' && $slct.event_id) {
handle_load_ae_obj_id__event({event_id: $slct.event_id, try_cache: false});
}
let ae_event_obj_get_promise;
async function handle_load_ae_obj_id__event({event_id, try_cache=false}) {
console.log(`*** handle_load_ae_obj_id__event() *** event_id=${event_id}`);
@@ -124,12 +123,12 @@ async function handle_load_ae_obj_id__event({event_id, try_cache=false}) {
.then(function (event_obj_get_result) {
if (event_obj_get_result) {
$slct.event_obj = event_obj_get_result;
console.log(`sponsorship object:`, $slct.event_obj);
console.log(`event object:`, $slct.event_obj);
}
// Auto show the selected sponsorship ID
// Auto show the selected event_presenter ID
// Is this pushState needed here?
// Set the URL param "event_id" to the current sponsorship ID.
// Set the URL param "event_id" to the current event_presenter ID.
// const url = new URL(location);
// url.searchParams.set('event_id', $slct.event_id);
// history.pushState({}, '', url);
@@ -189,12 +188,12 @@ async function handle_load_ae_obj_id__event_presenter({event_presenter_id, try_c
.then(function (event_presenter_get_result) {
if (event_presenter_get_result) {
$slct.event_presenter_obj = event_presenter_get_result;
console.log(`sponsorship object:`, $slct.event_presenter);
console.log(`event_presenter object:`, $slct.event_presenter);
}
// Auto show the selected sponsorship ID
// Auto show the selected event_presenter ID
// Is this pushState needed here?
// Set the URL param "event_presenter_id" to the current sponsorship ID.
// Set the URL param "event_presenter_id" to the current event_presenter ID.
// const url = new URL(location);
// url.searchParams.set('event_presenter_id', $slct.event_presenter_id);
// history.pushState({}, '', url);
@@ -235,32 +234,6 @@ $: if (testing) {
// modalStore.clear();
modalStore.trigger(modal_edit__event_presenter);
}
// KEEP and MOVE: This is the original function.
// The name should be something like "example_id".
function handle_url_and_message(name: string, value: null|string) {
console.log(`*** handle_url_and_message() *** name=${name} value=${value}`);
if (value) {
let location = window.location.href;
const url = new URL(location);
url.searchParams.set(name, value);
history.pushState({}, '', url);
let message = {name: value};
window.parent.postMessage(message, "*");
} else {
let location = window.location.href;
const url = new URL(location);
url.searchParams.delete(name);
history.pushState({}, '', url);
let message = {name: null};
window.parent.postMessage(message, "*");
}
// console.log('Message sent to parent (iframe):', message);
}
</script>
@@ -268,8 +241,8 @@ function handle_url_and_message(name: string, value: null|string) {
class="ae_events_speakers md:container h-full mx-auto flex flex-col items-center space-y-4"
>
{#if $ae_loc.ds.hub__page__events__create_info_header}
{@html $ae_loc.ds.hub__page__events__create_info_header}
{#if $ae_loc.ds.hub__page__events_speakers__create_info_header}
{@html $ae_loc.ds.hub__page__events_speakers__create_info_header}
{:else}
<header>
<h1 class="h1">Information Goes Here</h1>
@@ -313,13 +286,13 @@ function handle_url_and_message(name: string, value: null|string) {
}}
>
<span class="fas fa-edit mx-1"></span>
Start Sponsor Submission Form
Start Speaker Submission Form
</button>
{/if}
<!-- </section> -->
{#if $ae_loc.ds.hub__page__events__create_info}
{@html $ae_loc.ds.hub__page__events__create_info}
{#if $ae_loc.ds.hub__page__events_speakers__create_info}
{@html $ae_loc.ds.hub__page__events_speakers__create_info}
{:else}
<section>
<div class="alert alert-info">