I am done for the night...

This commit is contained in:
Scott Idem
2024-03-08 00:09:17 -05:00
parent 1694dfb5c5
commit 5a147a98bb
18 changed files with 414 additions and 250 deletions

6
package-lock.json generated
View File

@@ -11,6 +11,7 @@
"@floating-ui/dom": "1.6.3",
"axios": "^1.6.7",
"dayjs": "^1.11.10",
"dexie": "^4.0.1-beta.14",
"highlight.js": "11.9.0"
},
"devDependencies": {
@@ -2166,6 +2167,11 @@
"integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==",
"dev": true
},
"node_modules/dexie": {
"version": "4.0.1-beta.14",
"resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.1-beta.14.tgz",
"integrity": "sha512-1Glgs4nyHUriknstBku1T0Qz9qxJbHQy49JFeDEacHQK+XljN/sn1zyIH/HwouQ7a+WAdWHInm51i0GqWOAyHg=="
},
"node_modules/didyoumean": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",

View File

@@ -52,6 +52,7 @@
"@floating-ui/dom": "1.6.3",
"axios": "^1.6.7",
"dayjs": "^1.11.10",
"dexie": "^4.0.1-beta.14",
"highlight.js": "11.9.0"
}
}

View File

@@ -75,6 +75,7 @@ let events_session_data_struct: key_val = {
// Badge Printing
'badges': {
'fulltext_search_qry_str': null,
'status_qry__search': null,
},

35
src/lib/db_events.ts Normal file
View File

@@ -0,0 +1,35 @@
import Dexie, { type Table } from 'dexie';
export interface Badge {
// id?: number;
id_random: string;
full_name: string;
full_name_override: null|string;
email: string;
email_override: null|string;
affiliations: string;
affiliations_override: null|string;
badge_type: string;
badge_type_code: string;
badge_type_code_override: null|string;
badge_type_override: null|string;
external_event_id: string;
external_id: string;
external_person_id: string;
}
export class MySubClassedDexie extends Dexie {
// 'badges' is added by dexie when declaring the stores()
// We just tell the typing system this is the case
badges!: Table<Badge>;
constructor() {
super('ae_events_db');
this.version(1).stores({
// badges: '++id, full_name, email' // Primary key and indexed props
badges: 'id_random, full_name, full_name_override, email, email_override, affiliations, affiliations_override, badge_type, badge_type_code, badge_type_code_override, badge_type_override, external_event_id, external_id, external_person_id' // Primary key and indexed props
});
}
}
export const db_events = new MySubClassedDexie();

View File

@@ -86,6 +86,8 @@ onMount(() => {
// console.log(`ae_ ds_code_li = `, ds_code_li);
$: if (trigger == 'load__ds__code' && ds_code && ds_type) {
console.log(`ae_ load__ds__code: ${ds_code} ${ds_type} ${for_type} ${for_id} ${try_cache}`);
trigger = null;
load_data_store({
@@ -294,6 +296,8 @@ async function handle_submit_form(event) {
return ds_results;
})
.finally(function (ds_val_result) {
console.log(`ae_ ds_val_result = `, ds_val_result);
trigger = 'load__ds__code';
$ae_sess.ds.submit_status = 'created';
});
} else {
@@ -323,7 +327,10 @@ async function handle_submit_form(event) {
// .finally(function (ds_val_result) {
// // console.log(`ae_ ds_code_val = `, ds_val_result);
})
.finally(function (ds_val_result) {
.finally(function () {
// console.log(`ae_ ds_val_result = `, ds_val_result);
console.log(`ae_ load__ds__code: ${ds_code} ${ds_type} ${for_type} ${for_id} ${try_cache}`);
trigger = 'load__ds__code';
$ae_sess.ds.submit_status = 'updated';
});
}
@@ -376,31 +383,31 @@ async function handle_update__data_store({
$ae_sess.ds.update_status = 'starting';
ae_promises.update__data_store_obj = api.update_ae_obj_id_crud({
api_cfg: $ae_api,
obj_type: obj_type,
obj_id: obj_id,
fields: data,
key: $ae_api.api_crud_super_key,
log_lvl: 2
})
.then(async function (update__obj_result) {
if (!update__obj_result) {
console.log('The result was null or false.');
return false;
}
return update__obj_result;
api_cfg: $ae_api,
obj_type: obj_type,
obj_id: obj_id,
fields: data,
key: $ae_api.api_crud_super_key,
log_lvl: 2
})
.catch(function (error) {
console.log('Something went wrong.');
console.log(error);
.then(async function (update__obj_result) {
if (!update__obj_result) {
console.log('The result was null or false.');
return false;
})
.finally(function (update__obj_result) {
$ae_sess.ds.update_status = 'finished';
return update__obj_result;
})
}
return update__obj_result;
})
.catch(function (error) {
console.log('Something went wrong.');
console.log(error);
return false;
})
.finally(function (update__obj_result) {
$ae_sess.ds.update_status = 'finished';
return update__obj_result;
})
return ae_promises.update__data_store_obj;
return ae_promises.update__data_store_obj;
}
</script>
@@ -581,7 +588,7 @@ async function handle_update__data_store({
<button
type="submit"
class="btn variant-soft-primary"
disabled={ds_submit_results instanceof Promise}
disabled={ds_submit_results instanceof Promise && !ds_submit_results}
on:click={() => {
trigger = 'save__ds__code';
// $slct_trigger = 'save__ds__code';
@@ -600,10 +607,12 @@ async function handle_update__data_store({
</div>
{:then ds_submit_results}
{#if ds_submit_results}
<span class="fas fa-check text-green-500"></span>
<span class="saved-text">
Saved
</span>
<div>
<span class="fas fa-check text-green-500"></span>
<span class="saved-text">
Saved
</span>
</div>
{/if}
{/await}
@@ -644,6 +653,7 @@ async function handle_update__data_store({
type="button"
class="ae_btn_edit__ds btn hover:variant-glass-warning text-xs absolute top-0 right-0 opacity-75 hover:opacity-100 transition delay-700 hover:delay-200 m-1 p-1"
on:click={() => {
trigger = 'load__ds__code';
show_edit = true;
show_view = false;
}}

View File

@@ -55,9 +55,9 @@ import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
import type { key_val } from '$lib/ae_stores';
// console.log($ae_loc, $ae_sess, $ae_api);
import Element_access_type from '$lib/element_access_type.svelte';
import Element_app_cfg from '$lib/element_app_cfg.svelte';
import Element_data_store from '$lib/element_data_store.svelte';
@@ -271,7 +271,12 @@ $: if ($slct_trigger == 'set_access_code_li' && !$ae_loc.ds['hub__page__access_c
</svelte:fragment>
<!-- OSIT's Aether App -->
{@html $ae_loc.ds['hub__site__appshell_header']}
<!-- {@html $ae_loc.ds['hub__site__appshell_header']} -->
<Element_data_store
ds_code="hub__site__appshell_header"
ds_type="html"
display="block"
/>
<svelte:fragment slot="trail">
{#if $ae_loc.ds['hub__page__appshell_header_trail']}
{@html $ae_loc.ds['hub__page__appshell_header_trail']}

View File

@@ -19,9 +19,15 @@ import { onMount } from 'svelte';
import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils';
import { api } from '$lib/api';
import { liveQuery } from "dexie";
import { db_events } from "$lib/db_events";
import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { events_loc, events_sess, events_slct, events_trigger } from '$lib/ae_events_stores';
let event_badge_li = liveQuery(
() => db_events.badges.toArray()
);
// import Edit_modal_event_badge from '../10_edit_modal__event_badge_obj.svelte';
let ae_promises: key_val = {};
@@ -227,40 +233,77 @@ async function handle_load_ae_obj_id__event_badge({event_badge_id, try_cache=fal
// Updated 2024-03-06 late
$: if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
console.log(`$events_slct.event_id=${$events_slct.event_id}`);
$events_trigger = null;
load_obj_li_results = handle_load_ae_obj_li__badge({event_id: $events_slct.event_id, try_cache: false})
.then(function (load_results) {
if (load_results) {
if ($events_sess.status_qry__search == 'loading') {
console.log('*** $events_sess.status_qry__search == loading ***');
setTimeout(() => {
console.log("Delayed for X second.");
$events_trigger = null;
load_obj_li_results = handle_load_ae_obj_li__badge({event_id: $events_slct.event_id, try_cache: false})
.then(function (load_results) {
if (load_results) {
console.log(`load_results=`, load_results);
} else {
console.log('No results returned.');
}
// return load_results;
console.log(`load_results=`, load_results);
// $events_slct.badge_obj_li = load_results;
return load_results;
});
}, 250);
} else {
console.log('*** $events_sess.status_qry__search != loading ***');
$events_trigger = null;
load_obj_li_results = handle_load_ae_obj_li__badge({event_id: $events_slct.event_id, try_cache: false})
.then(function (load_results) {
if (load_results) {
console.log(`load_results=`, load_results);
} else {
console.log('No results returned.');
}
// return load_results;
console.log(`load_results=`, load_results);
} else {
console.log('No results returned.');
}
// return load_results;
console.log(`load_results=`, load_results);
$events_slct.badge_obj_li = load_results;
return load_results;
});
// $events_slct.badge_obj_li = load_results;
return load_results;
});
}
}
// Updated 2024-03-06
async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
console.log(`*** handle_load_ae_obj_li__badge() *** event_id=${event_id}`);
let fulltext_search_qry_str = $events_sess.badges.fulltext_search_qry_str;
let enabled = $events_loc.qry_enabled;
let hidden = $events_loc.qry__hidden;
let limit = $events_loc.qry__limit;
let offset = $events_loc.qry__offset;
if ($ae_loc.trusted_access) {
if ($ae_loc.administrator_access) {
enabled = 'all';
hidden = 'all';
limit = 500;
} else if ($ae_loc.trusted_access) {
// enabled = 'all';
hidden = 'all';
limit = 30;
limit = 50;
}
let params = {};
let params_json: key_val = {};
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) {
params_json['ft_qry'] = {
'default_qry_str': fulltext_search_qry_str,
// 'location_address_json_ext': fulltext_search_qry_str, // JSON extracted text DB field
// 'contact_li_json_ext': fulltext_search_qry_str, // JSON extracted text DB field
};
}
// console.log('params_json:', params_json);
// console.log(params_json);
@@ -285,8 +328,10 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
})
.then(function (badge_obj_li_get_result) {
// console.log('Badge list:', badge_obj_li_get_result);
if (badge_obj_li_get_result) {
// $slct.badge_obj_li = badge_obj_li_get_result;
handle_db_save_ae_obj_li({obj_type: 'event_badge', obj_li: badge_obj_li_get_result});
return badge_obj_li_get_result;
} else {
// $slct.badge_obj_li = [];
@@ -295,15 +340,55 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
})
.catch(function (error) {
console.log('No results returned or failed.', error);
});
// .finally(function () {
// $events_sess.badges.status_qry__search = 'done';
// // console.log('Sponsorship list:', $slct.badge_obj_li);
// });
})
.finally(function () {
$events_sess.badges.status_qry__search = 'done';
// console.log('Badge list:', badge_obj_li_get_result);
// return badge_obj_li_get_result;
});
console.log('ae_promises.load__event_badge_obj_li:', ae_promises.load__event_badge_obj_li);
return ae_promises.load__event_badge_obj_li;
}
// This function will loop through the badge_obj_li and save each one to the DB.
function handle_db_save_ae_obj_li({obj_type, obj_li}) {
console.log(`*** handle_db_save_ae_obj_li() ***`);
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj) {
// console.log(`ae_obj ${obj_type}:`, obj);
try {
const id_random = await db_events.badges.put({
id_random: obj.event_badge_id_random,
full_name: obj.full_name,
full_name_override: obj.full_name_override,
email: obj.email,
email_override: obj.email_override,
affiliations: obj.affiliations,
affiliations_override: obj.affiliations_override,
badge_type: obj.badge_type,
badge_type_override: obj.badge_type_override,
badge_type_code: obj.badge_type_code,
badge_type_code_override: obj.badge_type_code_override,
external_event_id: obj.external_event_id,
external_id: obj.external_id,
external_person_id: obj.external_person_id,
});
// console.log(`Put obj with ID: ${obj.event_badge_id_random} or ${id_random}`);
} catch (error) {
let status = `Failed to put ${obj.event_badge_id_random}: ${error}`;
console.log(status);
}
// const id_random = await db_events.badges.put(obj);
// console.log(`Put obj with ID: ${obj.event_badge_id_random}`);
});
}
}
</script>
@@ -320,12 +405,22 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
{/if}
<!-- <section class="btn btn-group"> -->
<input
type="search"
placeholder="Search (name, email, affiliatons, etc.)"
id="badge_fulltext_search_qry_str"
name="fulltext_search_qry_str"
bind:value={$events_sess.badges.fulltext_search_qry_str}
class="input w-96"
>
<button
class="btn variant-ghost-primary w-96"
class="btn variant-ghost-primary w-48"
on:click={() => {
$events_trigger = 'load__event_badge_obj_li';
$events_trigger = $events_trigger;
// $events_trigger = $events_trigger;
// handle_oninput_fulltext_search_qry_str();
// handle_badge_search('event_id', null);
// modalStore.trigger(modal_edit__event_badge);
@@ -358,7 +453,9 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
{/await}
{#if $events_slct.badge_obj_li && $events_slct.badge_obj_li.length}
<!-- {#if $events_slct.badge_obj_li && $events_slct.badge_obj_li.length} -->
{#if $event_badge_li}
<section class="ae_h_scrollfix">
<h2 class="h3">Results:</h2>
<table class="table">
<thead>
@@ -370,7 +467,8 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
</tr>
</thead>
<tbody>
{#each $events_slct.badge_obj_li as badge_obj}
<!-- {#each $events_slct.badge_obj_li as badge_obj} -->
{#each $event_badge_li as badge_obj}
<tr>
<td>
<button
@@ -403,7 +501,7 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
{/each}
</tbody>
</table>
</section>
{:else}
<div class="alert alert-info">
No badges found.

View File

@@ -5,7 +5,7 @@ export let data;
<svelte:head>
<title>Events Speakers - {data.ae_loc.title}</title>
<title>Speaker Hub - {data.ae_loc.title}</title>
</svelte:head>

View File

@@ -279,45 +279,47 @@ async function handle_load_ae_obj_id__event_presenter({event_presenter_id, try_c
</script>
<div class="ae_events_speakers md:container h-full mx-auto">
<div class="space-y-10 flex flex-col">
<section class="ae_events_speakers md:container h-full mx-auto flex flex-col items-center space-y-4">
<h1 class="h1 text-center">
<!-- &AElig; - Events: Speakers -->
Speakers Hub
</h1>
<section>
<button
class="btn variant-ghost-primary"
on:click={() => {
// $ae_loc.mod.events.show_edit__event_presenter_obj = true;
$slct.event_presenter_id = null;
$slct.event_presenter_obj = null;
<header>
<h1 class="h2">
<!-- &AElig; - Events: Speakers -->
Speaker Hub
</h1>
</header>
// modalStore.trigger(modal_edit__event_presenter_obj);
$ae_loc.mod.events.show_edit__event_presenter_obj = true;
$slct_trigger = 'show_edit__event_presenter_obj';
}}
>
<span class="fas fa-edit mx-1"></span>
Start Speaker Submission Form
</button>
</section>
<section>
<button
class="btn variant-ghost-primary"
on:click={() => {
// $ae_loc.mod.events.show_edit__event_presenter_obj = true;
$slct.event_presenter_id = null;
$slct.event_presenter_obj = null;
<section class="events_speakers_list">
{#await ae_event_presenter_obj_li_get_promise}
<span class="fas fa-spinner fa-spin"></span>
<span class="loading-text">
Loading...
</span>
{/await}
// modalStore.trigger(modal_edit__event_presenter_obj);
$ae_loc.mod.events.show_edit__event_presenter_obj = true;
$slct_trigger = 'show_edit__event_presenter_obj';
}}
>
<span class="fas fa-edit mx-1"></span>
Start Speaker Submission Form
</button>
</section>
{#if $slct.event_presenter_obj_li && $ae_loc.mod.events.show_list__event_presenter_obj_li}
<List_event_presenter_obj />
{/if}
</section>
</div>
</div>
<section class="events_speakers_list ae_h_scrollfix">
{#await ae_event_presenter_obj_li_get_promise}
<span class="fas fa-spinner fa-spin"></span>
<span class="loading-text">
Loading...
</span>
{/await}
{#if $slct.event_presenter_obj_li && $ae_loc.mod.events.show_list__event_presenter_obj_li}
<List_event_presenter_obj class_li=""/>
{/if}
</section>
</section>
<style lang="postcss">

View File

@@ -531,7 +531,7 @@ async function handle_update__event_presenter({
{/if}
<span class="fas fa-file-upload"></span>
</svelte:fragment>
Files
Headshot
</Tab>
<Tab
bind:group={$store_current_tab}
@@ -818,7 +818,7 @@ async function handle_update__event_presenter({
>
<svelte:fragment slot="lead"><span class="fas fa-file-upload"></svelte:fragment>
<svelte:fragment slot="message"><strong>Upload your file</strong> (drag and drop)</svelte:fragment>
<svelte:fragment slot="meta">Image file types only (PNG, WEBP, JPG, etc)</svelte:fragment>
<svelte:fragment slot="meta">High resolution image files only<br>(PNG, WEBP, JPG, etc)</svelte:fragment>
</FileDropzone>
{@html placeholder_li.image_headshot}
</label>

View File

@@ -10,7 +10,7 @@ import { ae_util } from '$lib/ae_utils';
// import { ae } from 'aether_npm_lib';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
export let container_class_li = [];
export let class_li: string = '';
onMount(() => {
console.log('** Component Mounted: ** List - Event Presenters Obj');
@@ -18,7 +18,7 @@ onMount(() => {
</script>
<section class="svelte_component ae_section ae_list list__event_presenter_obj event_presenter_obj_li {container_class_li.join(' ')} ae_h_scrollfix">
<section class="svelte_component ae_section ae_list list__event_presenter_obj event_presenter_obj_li {class_li}">
{#if $slct.event_presenter_obj_li}
<table class="table table-compact table-hover">
<thead>

View File

@@ -245,13 +245,11 @@ $: if (testing) {
{@html $ae_loc.ds.hub__page__events_speakers__create_info_header}
{:else}
<header>
<h1 class="h1">Information Goes Here</h1>
<h1 class="h2">Speaker Hub Infor Goes Here</h1>
</header>
{/if}
<!-- <section class="btn btn-group"> -->
<section>
{#if $slct.event_presenter_id}
<button
class="btn variant-ghost-primary w-96"
@@ -289,15 +287,15 @@ $: if (testing) {
Start Speaker Submission Form
</button>
{/if}
<!-- </section> -->
</section>
{#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">
More information goes here.
</div>
<div class="alert alert-info">
More information can go here or this can be hidden.
</div>
</section>
{/if}

View File

@@ -5,7 +5,7 @@ export let data;
<svelte:head>
<title>Sponsorships - {data.ae_loc.title}</title>
<title>Sponsor Hub - {data.ae_loc.title}</title>
</svelte:head>
<!-- <h1>Sponsorships Layout?</h1> -->

View File

@@ -32,7 +32,7 @@ const modalComponentEditSponsorshipObj: ModalComponent = { ref: Edit_modal_spons
const modal_edit__sponsorship_obj: ModalSettings = {
type: 'component',
component: modalComponentEditSponsorshipObj,
title: 'Sponsor Submission Form', // Editing Sponsorship
title: 'Sponsor Form', // Editing Sponsorship
position: '', // default is "items-center"
response: (r: boolean | undefined) => handle_modal_close(r)
@@ -333,72 +333,74 @@ async function handle_load_ae_obj_id__sponsorship({sponsorship_id, try_cache=fal
</script>
<section class="ae_sponsorships md:container h-full mx-auto">
<div class="space-y-10 flex flex-col">
<section class="ae_events_speakers md:container h-full mx-auto flex flex-col items-center space-y-4">
<h1 class="h1 text-center">
<!-- &AElig; - Sponsorships -->
Sponsors Hub
</h1>
<section>
<button
class="btn variant-ghost-primary"
on:click={() => {
// $ae_loc.mod.sponsorships.show_edit__sponsorship_obj = true;
$slct.sponsorship_id = null;
$slct.sponsorship_obj = null;
<header>
<h1 class="h1 text-center">
<!-- &AElig; - Sponsorships -->
Sponsor Hub
</h1>
</header>
// modalStore.trigger(modal_edit__sponsorship_obj);
$ae_loc.mod.sponsorships.show_edit__sponsorship_obj = true;
$slct_trigger = 'show_edit__sponsorship_obj';
}}
>
<span class="fas fa-edit mx-1"></span>
Start Sponsor Submission Form
</button>
<section>
<button
class="btn variant-ghost-primary"
on:click={() => {
// $ae_loc.mod.sponsorships.show_edit__sponsorship_obj = true;
$slct.sponsorship_id = null;
$slct.sponsorship_obj = null;
<!-- <button
on:click={() => {
console.log('Open drawer');
drawerStore.open(drawer_settings_x);
}}
>
Open Drawer X
</button> -->
// modalStore.trigger(modal_edit__sponsorship_obj);
$ae_loc.mod.sponsorships.show_edit__sponsorship_obj = true;
$slct_trigger = 'show_edit__sponsorship_obj';
}}
>
<span class="fas fa-edit mx-1"></span>
Start Sponsor Submission Form
</button>
<!-- <button
on:click={() => {
console.log('Open drawer');
drawerStore.open(drawer_settings_y);
}}
>
Open Drawer Y
</button> -->
<!-- <button
on:click={() => {
console.log('Open drawer');
drawerStore.open(drawer_settings_x);
}}
>
Open Drawer X
</button> -->
<!-- <button
on:click={() => {
console.log('Open drawer');
drawerStore.open(drawer_settings_edit);
}}
>
Open Drawer Edit
</button> -->
</section>
<!-- <button
on:click={() => {
console.log('Open drawer');
drawerStore.open(drawer_settings_y);
}}
>
Open Drawer Y
</button> -->
<!-- <button
on:click={() => {
console.log('Open drawer');
drawerStore.open(drawer_settings_edit);
}}
>
Open Drawer Edit
</button> -->
</section>
<section class="sponsorships_list ae_h_scrollfix">
{#await ae_sponsorship_obj_li_get_promise}
<div class="modal-loading">
<span class="fas fa-spinner fa-spin"></span>
<span class="loading-text">
Loading...
</span>
</div>
{/await}
{#if $slct.sponsorship_obj_li && $ae_loc.mod.sponsorships.show_list__sponsorship_obj_li}
<List_sponsorship_obj />
{/if}
</section>
<section class="sponsorships_list">
{#await ae_sponsorship_obj_li_get_promise}
<div class="modal-loading">
<span class="fas fa-spinner fa-spin"></span>
<span class="loading-text">
Loading...
</span>
</div>
{/await}
{#if $slct.sponsorship_obj_li && $ae_loc.mod.sponsorships.show_list__sponsorship_obj_li}
<List_sponsorship_obj />
{/if}
</section>
</div>
</section>

View File

@@ -45,10 +45,49 @@ if ($slct.sponsorship_id) {
console.log(`Sponsorship object selected:`, $slct.sponsorship_obj);
$slct_trigger = 'load__sponsorship_obj';
} else {
$store_current_tab = 'start';
$slct.sponsorship_id = null;
$slct.sponsorship_obj = {
sponsorship_cfg_id_random: $ae_loc.mod.sponsorships.cfg_id,
name: null,
description: null,
poc_person_id: null,
logo_li_json: null,
media_li_json: null,
questions_li_json: {},
social_li_json: null,
guest_li_json: null,
level_num: '',
level_str: null,
amount: null,
paid: null,
enable: null,
};
}
let ae_promises: key_val = {}; // Promise<any>;
$ae_sess.mod.sponsorships.submit_status = null;
$ae_sess.mod.sponsorships.disable_submit__sponsorship_obj = false;
let placeholder_li: key_val = {
file_logo_primary: '-- No File Selected --',
file_logo_light: '-- No File Selected --',
file_logo_dark: '-- No File Selected --',
file_media_promo_video: '-- No File Selected --',
};
onMount(() => {
console.log('** Component Mounted: ** View Modal - Sponsorship Obj');
console.log('** Component Mounted: ** Edit Modal - Sponsorship Obj');
if ($slct.sponsorship_id && $ae_loc.href_url) {
// $ae_loc.mod.sponsorships.link = `${$ae_loc.href_url}/load?sponsorship_id=${$slct.sponsorship_id}`;
@@ -88,48 +127,6 @@ onMount(() => {
});
let ae_promises: key_val = {}; // Promise<any>;
$ae_sess.mod.sponsorships.submit_status = null;
$ae_sess.mod.sponsorships.disable_submit__sponsorship_obj = false;
let placeholder_li: key_val = {
file_logo_primary: '-- No File Selected --',
file_logo_light: '-- No File Selected --',
file_logo_dark: '-- No File Selected --',
file_media_promo_video: '-- No File Selected --',
};
if ($slct.sponsorship_id) {
console.log(`Sponsorship ID selected: ${$slct.sponsorship_id}`);
console.log(`Sponsorship object selected:`, $slct.sponsorship_obj);
} else {
$store_current_tab = 'start';
$slct.sponsorship_id = null;
$slct.sponsorship_obj = {
sponsorship_cfg_id_random: $ae_loc.mod.sponsorships.cfg_id,
name: null,
description: null,
poc_person_id: null,
logo_li_json: null,
media_li_json: null,
questions_li_json: {},
social_li_json: null,
guest_li_json: null,
level_num: '',
level_str: null,
amount: null,
paid: null,
enable: null,
};
}
$: if ($slct.sponsorship_obj) {
@@ -492,24 +489,25 @@ async function handle_submit_form(event) {
if ($store_current_tab == 'start' && $slct.sponsorship_id) {
$store_current_tab = 'marketing';
// If level is above 1 then they can go to the exhibits tab.
} else if ($store_current_tab == 'marketing' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num > 1) {
// If level is 2 or above then they can go to the exhibits tab.
} else if ($store_current_tab == 'marketing' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num >= 2) {
$store_current_tab = 'exhibit';
} else if ($store_current_tab == 'marketing' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num == 1) {
$store_current_tab = 'files';
// If level is above 2 then they can go to the sessions tab.
} else if ($store_current_tab == 'exhibit' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num > 2) {
// If level is 3 or above then they can go to the sessions tab.
} else if ($store_current_tab == 'exhibit' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num >= 3) {
$store_current_tab = 'sessions';
} else if ($store_current_tab == 'exhibit' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num <= 2) {
// All levels can go to the files tab.
} else if ($store_current_tab == 'exhibit' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num) {
$store_current_tab = 'files';
} else if ($store_current_tab == 'sessions') {
} else if ($store_current_tab == 'sessions' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num) {
$store_current_tab = 'files';
} else if ($store_current_tab == 'files') {
} else if ($store_current_tab == 'files' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num) {
$store_current_tab = 'guests';
}
} else {
@@ -733,9 +731,10 @@ async function handle_update__sponsorship({
{#if $modalStore[0]}
<div class="svelte_component ae_edit_modal ae_obj__sponsorship {container_class_li}">
<header class={parent.regionHeader}>
{$modalStore[0].title ?? '-- No Title --'}:
{$slct.sponsorship_obj.level_str}
({$slct.sponsorship_obj.level_num})
<h2>{$modalStore[0].title ?? '-- No Title --'}:
{$slct.sponsorship_obj.level_str ?? '-- Please Select Level --'}
<!-- ({$slct.sponsorship_obj.level_num}) -->
</h2>
{#await ae_promises.update__sponsorship_obj}
@@ -841,7 +840,7 @@ async function handle_update__sponsorship({
Marketing
</Tab>
<!-- Exhibit Level 2 and above -->
{#if $slct.sponsorship_obj.level_num > 1}
{#if $slct.sponsorship_obj.level_num >= 2}
<Tab bind:group={$store_current_tab} name="tab_exhibit" value={'exhibit'} disabled={!$slct.sponsorship_id || $slct.sponsorship_obj.level_num < 2}
regionTab={!$slct.sponsorship_id || $slct.sponsorship_obj.level_num < 2 ? 'text-slate-400' : ''}
>
@@ -854,7 +853,7 @@ async function handle_update__sponsorship({
Exhibitor Info
</Tab>
{/if}
{#if $slct.sponsorship_obj.level_num > 2}
{#if $slct.sponsorship_obj.level_num >= 3}
<Tab bind:group={$store_current_tab} name="tab_session" value={'sessions'} disabled={!$slct.sponsorship_id || $slct.sponsorship_obj.level_num < 3}>
<svelte:fragment slot="lead">
{#if $slct.sponsorship_obj.questions_li_json && ($slct.sponsorship_obj.questions_li_json.virtual_session || $slct.sponsorship_obj.questions_li_json.virtual_session === 0)}
@@ -865,6 +864,7 @@ async function handle_update__sponsorship({
Session Info
</Tab>
{/if}
<!-- All levels with some restrictions within the section -->
<Tab bind:group={$store_current_tab} name="tab_files" value={'files'} disabled={!$slct.sponsorship_id}
regionTab={!$slct.sponsorship_id ? 'text-slate-400' : ''}
>
@@ -968,7 +968,7 @@ async function handle_update__sponsorship({
<span class="fas fa-check-circle"></span>
<span class="ae_value">Yes, marked as paid</span>
{:else}
<p class="variant-glass-error">Deadline to complete payment: April 15th, 2024</p>
<p class="variant-glass-error max-w-96">Deadline to complete payment: April 15, 2024</p>
<!-- <p>Return to the <a href="https://preconvirtual.com/chow-2024-faq/#Sponsorship">CHOW Sponsor Hub for Payment Options and Instruction</a> details.</p> -->
<p>Please refer to the sponsorship
@@ -1447,6 +1447,7 @@ async function handle_update__sponsorship({
</div>
</label>
{#if $slct.sponsorship_obj.level_num >= 4}
<h3 class="h4 input_required">Social Media &amp; Email Inclusion</h3>
<label for="q_social_email" class="label">
<div>Would you like social and email inclusion at CHOW?</div>
@@ -1476,7 +1477,9 @@ async function handle_update__sponsorship({
</label>
</div>
</label>
{/if}
{#if $slct.sponsorship_obj.level_num >= 6}
<h3 class="h4 input_required">Dedicated Social Promos</h3>
<label for="q_dedicated_promos" class="label">
<div>Would you like dedicated social media promotions at CHOW?</div>
@@ -1506,6 +1509,7 @@ async function handle_update__sponsorship({
</label>
</div>
</label>
{/if}
<button
type="submit"
@@ -1783,6 +1787,7 @@ async function handle_update__sponsorship({
<section class="space-y-4">
<h2 class="h3">Logos</h2>
<Element_data_store
ds_code="sponsorships__form__logos_info_html"
ds_type="html"
@@ -1790,19 +1795,8 @@ async function handle_update__sponsorship({
for_id={$slct.sponsorship_cfg_id}
ds_name="Default: Sponsorships Form - Logos Information HTML"
display="block"
class_li=""
class_li="hidden"
/>
<!-- <div class="text-sm">
<p>Add your logo here. Your logo will be used throughout Capitol Hill Ocean Week.</p>
<div>Recommend specs:
<ul class="list-disc list-inside">
<li>High resolution image</li>
<li>Most image types: PNG, WEBP, SVG, JPG, Illustrator, etc</li>
<li>Max file size: 20 MB</li>
</ul>
</div>
</div> -->
<div class="flex flex-wrap gap-4">
@@ -1816,7 +1810,7 @@ async function handle_update__sponsorship({
padding="p-1"
accept="image/*"
class="w-96 variant-glass-warning"
required={!placeholder_li.file_logo_primary}
required={!$slct.sponsorship_obj.logo_li_json}
on:change={(e) => {
console.log('*** FileDropzone change event ***', e);
@@ -1829,7 +1823,7 @@ async function handle_update__sponsorship({
>
<svelte:fragment slot="lead"><span class="fas fa-file-upload"></span></svelte:fragment>
<svelte:fragment slot="message"><strong>Upload your file</strong> (drag and drop)</svelte:fragment>
<svelte:fragment slot="meta">Image file types only (PNG, WEBP, JPG, etc)</svelte:fragment>
<svelte:fragment slot="meta">High resolution and vector image files only<br>(PNG, WEBP, SVG, JPG, Illustrator, etc)</svelte:fragment>
</FileDropzone>
</label>
{@html placeholder_li.file_logo_primary}
@@ -1857,7 +1851,7 @@ async function handle_update__sponsorship({
>
<svelte:fragment slot="lead"><span class="fas fa-file-upload"></span></svelte:fragment>
<svelte:fragment slot="message"><strong>Upload your file</strong> (drag and drop)</svelte:fragment>
<svelte:fragment slot="meta">Image file types only (PNG, WEBP, JPG, etc)</svelte:fragment>
<svelte:fragment slot="meta">High resolution and vector image files only<br>(PNG, WEBP, SVG, JPG, Illustrator, etc)</svelte:fragment>
</FileDropzone>
</label>
{@html placeholder_li.file_logo_light}
@@ -1885,7 +1879,7 @@ async function handle_update__sponsorship({
>
<svelte:fragment slot="lead"><span class="fas fa-file-upload"></span></svelte:fragment>
<svelte:fragment slot="message"><strong>Upload your file</strong> (drag and drop)</svelte:fragment>
<svelte:fragment slot="meta">Image file types only (PNG, WEBP, JPG, etc)</svelte:fragment>
<svelte:fragment slot="meta">High resolution and vector image files only<br>(PNG, WEBP, SVG, JPG, Illustrator, etc)</svelte:fragment>
</FileDropzone>
</label>
{@html placeholder_li.file_logo_dark}
@@ -1974,19 +1968,19 @@ async function handle_update__sponsorship({
<h2 class="h3">Ocean Awards Gala Guests</h2>
<div class="text-sm space-y-4">
<p>These are the guests that will be attending the Ocean Awards Gala. The maximum number is based on your currently selected sponsorship level.</p>
{#if $slct.sponsorship_obj.level_num == 0}
<!-- These are the guests that will be attending the Ocean Awards Gala. -->
{#if $slct.sponsorship_obj.level_num < 1}
<p class="variant-glass-error">Please select a sponsorship level before adding guests.</p>
{:else}
<p class="">Included in your sponsorship are <strong>{$ae_loc.mod.sponsorships.level_guest_max_li[$slct.sponsorship_obj.level_num]} seats (
{$ae_loc.mod.sponsorships.level_guest_max_li[$slct.sponsorship_obj.level_num] == 4 ? 'half table' : ''}
{$ae_loc.mod.sponsorships.level_guest_max_li[$slct.sponsorship_obj.level_num] == 8 ? 'one table' : ''}
{$ae_loc.mod.sponsorships.level_guest_max_li[$slct.sponsorship_obj.level_num] == 16 ? 'two tables' : ''}
)</strong> at the 2024 Oceans Award Gala.</p>
)</strong> at the 2024 Oceans Award Gala. The maximum number is based on your currently selected sponsorship level.</p>
<p>
Submit RSVPs below. You will have the opportunity to add names at a later date.
Submit RSVPs below. You will have the opportunity to add and update names at a later date.
</p>
<p class="variant-glass-error">Deadline to submit RSVPs is May 15, 2024.</p>
<p class="variant-glass-error max-w-96">Deadline to submit RSVPs is May 15, 2024.</p>
{/if}
</div>
@@ -2076,7 +2070,18 @@ async function handle_update__sponsorship({
</label>
<label for="guest_{index}_family_name" class="label max-w-64">
<!-- Family name -->
<input type="text" class="input text-xs" id="guest_{index}_family_name" name="guest_{index}_family_name" placeholder="Last name" value={guest.family_name ?? ''} autocomplete="name">
<input
type="text"
class="input text-xs variant-glass-warning"
id="guest_{index}_family_name"
name="guest_{index}_family_name"
placeholder="Last name"
value={guest.family_name ?? ''}
autocomplete="off"
required
class:variant-soft-error={!guest.family_name}
>
</label>
<label for="guest_{index}_title" class="label max-w-64">
<!-- Title -->

View File

@@ -10,7 +10,7 @@ import { ae_util } from '$lib/ae_utils';
// import { ae } from 'aether_npm_lib';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
export let container_class_li = [];
export let class_li: string = '';
onMount(() => {
console.log('** Component Mounted: ** List - Sponsorships Obj');
@@ -18,7 +18,7 @@ onMount(() => {
</script>
<section class="svelte_component ae_section ae_list list__sponsorship_obj sponsorship_obj_li {container_class_li.join(' ')} ae_h_scrollfix">
<section class="svelte_component ae_section ae_list list__sponsorship_obj sponsorship_obj_li {class_li} ae_h_scrollfix">
{#if $slct.sponsorship_obj_li}
<table class="table table-compact table-hover">
<thead>

7
tests/.directory Normal file
View File

@@ -0,0 +1,7 @@
[Dolphin]
Timestamp=2024,3,7,13,34,34.831
Version=4
ViewMode=1
[Settings]
HiddenFilesShown=true

View File

@@ -1,6 +0,0 @@
import { expect, test } from '@playwright/test';
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible();
});