style: Apply Prettier formatting with 4-space indentation

Applied consistent code formatting across the project using Prettier, now configured to use 4-space indentation instead of tabs.
This commit is contained in:
Scott Idem
2025-11-18 18:40:50 -05:00
parent 6d1f9989d0
commit 0987cd6ad9
346 changed files with 86645 additions and 84459 deletions

View File

@@ -1,59 +1,59 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
let log_lvl: number = 0;
/** @type {import('./$types').LayoutData} */
let log_lvl: number = 0;
// *** Import Svelte specific
// import { goto } from '$app/navigation';
// import type { Writable } from 'svelte/store';
// *** Import Svelte specific
// import { goto } from '$app/navigation';
// import type { Writable } from 'svelte/store';
// *** Import Aether specific variables and functions
// import type { key_val } from '$lib/ae_stores';
// import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
import {
events_loc,
events_slct,
events_trigger,
events_trig_kv
} from '$lib/stores/ae_events_stores';
// *** Import Aether specific variables and functions
// import type { key_val } from '$lib/ae_stores';
// import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
import {
events_loc,
events_slct,
events_trigger,
events_trig_kv
} from '$lib/stores/ae_events_stores';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
interface Props {
data: any;
children?: import('svelte').Snippet;
}
interface Props {
data: any;
children?: import('svelte').Snippet;
}
let { data, children }: Props = $props();
let { data, children }: Props = $props();
$events_loc.qry__enabled = 'enabled';
$events_loc.qry__hidden = 'not_hidden';
$events_loc.qry__limit = 15;
$events_loc.qry__offset = 0;
$events_loc.qry__enabled = 'enabled';
$events_loc.qry__hidden = 'not_hidden';
$events_loc.qry__limit = 15;
$events_loc.qry__offset = 0;
if (log_lvl) {
console.log(`$slct.account_id = `, $slct.account_id);
}
// let ae_acct = data[$slct.account_id];
// if (log_lvl) {
// console.log(`ae_acct = `, ae_acct);
// }
if (log_lvl) {
console.log(`$slct.account_id = `, $slct.account_id);
}
// let ae_acct = data[$slct.account_id];
// if (log_lvl) {
// console.log(`ae_acct = `, ae_acct);
// }
</script>
<svelte:head>
<title>Core - {$ae_loc.title ?? 'Æ loading...'}</title>
<title>Core - {$ae_loc.title ?? 'Æ loading...'}</title>
</svelte:head>
<div class="ae_core h-full max-h-full max-w-6xl overflow-auto flex flex-col gap-1 m-auto">
{#if $ae_loc?.manager_access === 'test-new-submenu'}
<section class="submenu flex flex-row justify-center" class:hidden={$ae_loc.iframe}>
<span class=" preset-tonal-secondary px-4 py-2">
{#each Object.entries(data.submenu) as [key, item]}
<!-- <a href="/settings/{item.slug}">{item.title}</a> -->
<!-- class:hidden={!$ae_loc.trusted_access && item.access} -->
{#if item.disable}
<!-- <button
{#if $ae_loc?.manager_access === 'test-new-submenu'}
<section class="submenu flex flex-row justify-center" class:hidden={$ae_loc.iframe}>
<span class=" preset-tonal-secondary px-4 py-2">
{#each Object.entries(data.submenu) as [key, item]}
<!-- <a href="/settings/{item.slug}">{item.title}</a> -->
<!-- class:hidden={!$ae_loc.trusted_access && item.access} -->
{#if item.disable}
<!-- <button
title={item.title}
class="hover:variant-ghost-secondary"
class:hidden={(!$ae_loc.trusted_access && item.access === 'trusted') || (!$ae_loc.administrator_access && item.access === 'administrator' || item.hide)}
@@ -65,8 +65,8 @@
>
{item.name}
</button> -->
{:else}
<!-- <a
{:else}
<!-- <a
href={item.href}
title={item.title}
class="hover:variant-ghost-secondary"
@@ -75,15 +75,15 @@
>
{item.name}
</a> -->
{/if}
{/each}
</span>
</section>
{/if}
{/if}
{/each}
</span>
</section>
{/if}
<section class="main_content grow px-1 md:px-2 pb-28">
<!-- <div class="container m-auto"> -->
{@render children?.()}
<!-- </div> -->
</section>
<section class="main_content grow px-1 md:px-2 pb-28">
<!-- <div class="container m-auto"> -->
{@render children?.()}
<!-- </div> -->
</section>
</div>

View File

@@ -1,232 +1,234 @@
<script lang="ts">
/** @type {import('./$types').PageData} */
export let data: any;
// console.log(`ae_core root +page.svelte data:`, data);
/** @type {import('./$types').PageData} */
export let data: any;
// console.log(`ae_core root +page.svelte data:`, data);
// import { onMount } from 'svelte';
import { goto, invalidate, pushState, replaceState } from '$app/navigation';
// import { onMount } from 'svelte';
import { goto, invalidate, pushState, replaceState } from '$app/navigation';
import type { key_val } from '$lib/stores/ae_stores';
// import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
import Comp_person_obj_tbl from './ae_comp__person_obj_tbl.svelte';
import type { key_val } from '$lib/stores/ae_stores';
// import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
import Comp_person_obj_tbl from './ae_comp__person_obj_tbl.svelte';
// import { liveQuery } from "dexie";
import { core_func } from '$lib/ae_core/ae_core_functions';
// import { db_core } from "$lib/db_core";
// import { db_events } from "$lib/db_events";
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { events_loc, events_sess, events_slct, events_trigger } from '$lib/stores/ae_events_stores';
// import { events_func } from '$lib/ae_events_functions';
// import { liveQuery } from "dexie";
import { core_func } from '$lib/ae_core/ae_core_functions';
// import { db_core } from "$lib/db_core";
// import { db_events } from "$lib/db_events";
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { events_loc, events_sess, events_slct, events_trigger } from '$lib/stores/ae_events_stores';
// import { events_func } from '$lib/ae_events_functions';
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
$slct.account_id = data.account_id;
console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
console.log(`ae_acct = `, ae_acct);
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
$slct.account_id = data.account_id;
console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
console.log(`ae_acct = `, ae_acct);
let person_id_random_li: string[] = [];
let person_id_random_li: string[] = [];
// let load_obj_li_results: Promise<any>|key_val;
// let search_submit_results: Promise<any>|key_val;
// let load_obj_li_results: Promise<any>|key_val;
// let search_submit_results: Promise<any>|key_val;
</script>
<section class="ae_core md:container mx-auto">
<h2 class="h3">Æ Core for {$ae_loc.account_name ?? 'Æ loading...'}</h2>
<h2 class="h3">Æ Core for {$ae_loc.account_name ?? 'Æ loading...'}</h2>
<button
type="button"
on:click={() => {
console.log('Edit the POC person for the session.');
<button
type="button"
on:click={() => {
console.log('Edit the POC person for the session.');
// let params = {
// qry__limit: $ae_loc.person.qry_limit__people,
// }
// let params = {
// qry__limit: $ae_loc.person.qry_limit__people,
// }
// $slct.person_obj_li = await core_func.load_ae_obj_li__person({api_cfg: $ae_api, account_id: $slct.account_id, params: params});
// $slct.person_obj_li = await core_func.load_ae_obj_li__person({api_cfg: $ae_api, account_id: $slct.account_id, params: params});
let person_results = core_func
.load_ae_obj_li__person({
api_cfg: $ae_api,
for_obj_type: 'account',
for_obj_id: $slct.account_id,
limit: $ae_loc.person.qry_limit__people,
// params: params,
log_lvl: 1
})
.then(function (load_results) {
console.log(`Loaded person_obj_li:`, load_results);
let person_results = core_func
.load_ae_obj_li__person({
api_cfg: $ae_api,
for_obj_type: 'account',
for_obj_id: $slct.account_id,
limit: $ae_loc.person.qry_limit__people,
// params: params,
log_lvl: 1
})
.then(function (load_results) {
console.log(`Loaded person_obj_li:`, load_results);
// We need to make this ready for the select option list. Convert the list to a key value pair with the person_id_random as the key. We also need to set the option text value to: full_name (primary_email)
if (load_results) {
$slct.person_id_random_li = load_results;
// We need to make this ready for the select option list. Convert the list to a key value pair with the person_id_random as the key. We also need to set the option text value to: full_name (primary_email)
if (load_results) {
$slct.person_id_random_li = load_results;
person_id_random_li = [];
person_id_random_li = [];
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
for (let i = 0; i < $slct.person_id_random_li.length; i++) {
let person_obj = $slct.person_id_random_li[i];
let person_id_random = person_obj.person_id_random;
tmp_li.push(person_id_random);
}
person_id_random_li = tmp_li;
for (let i = 0; i < $slct.person_id_random_li.length; i++) {
let person_obj = $slct.person_id_random_li[i];
let person_id_random = person_obj.person_id_random;
tmp_li.push(person_id_random);
}
person_id_random_li = tmp_li;
// $slct.person_id_random_li = load_results.map((person_obj) => person_obj.person_id_random);
// let person_obj_li = load_results;
// let person_obj_kv = {};
// person_obj_kv[''] = '-- Select a person --';
// person_obj_li.forEach((person_obj) => {
// let option_text = `${person_obj.full_name} (${person_obj.primary_email})`;
// person_obj_kv[person_obj.person_id_random] = option_text;
// });
// $slct.person_obj_kv = person_obj_kv;
}
// $slct.person_obj_kv = $slct.person_obj_kv;
// console.log(`$slct.person_obj_kv = `, $slct.person_obj_kv);
// $slct.person_id_random_li = load_results.map((person_obj) => person_obj.person_id_random);
// let person_obj_li = load_results;
// let person_obj_kv = {};
// person_obj_kv[''] = '-- Select a person --';
// person_obj_li.forEach((person_obj) => {
// let option_text = `${person_obj.full_name} (${person_obj.primary_email})`;
// person_obj_kv[person_obj.person_id_random] = option_text;
// });
// $slct.person_obj_kv = person_obj_kv;
}
// $slct.person_obj_kv = $slct.person_obj_kv;
// console.log(`$slct.person_obj_kv = `, $slct.person_obj_kv);
return load_results;
})
.finally(() => {
console.log(`person_id_random_li:`, person_id_random_li);
$ae_sess.person.show_report__person_li = true;
});
}}
class="btn btn-sm preset-tonal-warning hover:preset-tonal-warning border border-warning-500"
>
<span class="fas fa-user mx-1"></span>
List People
</button>
return load_results;
})
.finally(() => {
console.log(`person_id_random_li:`, person_id_random_li);
$ae_sess.person.show_report__person_li = true;
});
}}
class="btn btn-sm preset-tonal-warning hover:preset-tonal-warning border border-warning-500"
>
<span class="fas fa-user mx-1"></span>
List People
</button>
<button
type="button"
on:click={async () => {
console.log('Add Person');
if (
!confirm(
`Add a new person to the account?\n${$ae_loc.account_name}\nID: ${$slct.account_id}`
)
) {
return;
}
<button
type="button"
on:click={async () => {
console.log('Add Person');
if (
!confirm(
`Add a new person to the account?\n${$ae_loc.account_name}\nID: ${$slct.account_id}`
)
) {
return;
}
let person_data = {
account_id_random: $slct.account_id,
// user_id_random: user_obj.user_id_random,
source_code: 'manual:SK-core',
given_name: 'New',
family_name: 'Person',
// professional_title: 'Temp Prof Title',
// affiliations: 'Temp Org',
// primary_email: 'tmp+person@oneskyit.com',
// allow_auth_key: false,
auth_key: Math.floor(Math.random() * 90000000) + 10000000,
// Random number between 100000 and 999999
passcode: Math.floor(Math.random() * 900000) + 100000,
enable: true
};
let person_data = {
account_id_random: $slct.account_id,
// user_id_random: user_obj.user_id_random,
source_code: 'manual:SK-core',
given_name: 'New',
family_name: 'Person',
// professional_title: 'Temp Prof Title',
// affiliations: 'Temp Org',
// primary_email: 'tmp+person@oneskyit.com',
// allow_auth_key: false,
auth_key: Math.floor(Math.random() * 90000000) + 10000000,
// Random number between 100000 and 999999
passcode: Math.floor(Math.random() * 900000) + 100000,
enable: true
};
let new_person_obj = await core_func.create_ae_obj__person({
api_cfg: $ae_api,
// user_id: $ae_loc.user_id,
data_kv: person_data,
log_lvl: 1
});
let new_person_obj = await core_func.create_ae_obj__person({
api_cfg: $ae_api,
// user_id: $ae_loc.user_id,
data_kv: person_data,
log_lvl: 1
});
console.log('new_person_obj:', new_person_obj);
console.log('new_person_obj:', new_person_obj);
if (
confirm(
`Person created:\n${new_person_obj.full_name} (${new_person_obj.primary_email ?? 'no email'})\nID: ${new_person_obj.person_id_random}\n\nView this person?`
)
) {
// window.location.reload();
// invalidateAll();
goto(`/core/person/${new_person_obj.person_id_random}`, { replaceState: true });
// pushState(`/core/person/${new_person_obj.person_id_random}`, { replace: true });
// replaceState(`/core/person/${new_person_obj.person_id_random}`);
}
}}
class:hidden={!$ae_loc.edit_mode}
class="btn btn-sm preset-tonal-warning hover:preset-filled-warning-500"
>
<span class="fas fa-plus mx-1"></span>
Add Person
</button>
if (
confirm(
`Person created:\n${new_person_obj.full_name} (${new_person_obj.primary_email ?? 'no email'})\nID: ${new_person_obj.person_id_random}\n\nView this person?`
)
) {
// window.location.reload();
// invalidateAll();
goto(`/core/person/${new_person_obj.person_id_random}`, { replaceState: true });
// pushState(`/core/person/${new_person_obj.person_id_random}`, { replace: true });
// replaceState(`/core/person/${new_person_obj.person_id_random}`);
}
}}
class:hidden={!$ae_loc.edit_mode}
class="btn btn-sm preset-tonal-warning hover:preset-filled-warning-500"
>
<span class="fas fa-plus mx-1"></span>
Add Person
</button>
<!-- Show people for this account -->
{#if $ae_sess.person.show_report__person_li && person_id_random_li?.length > 0}
<h3 class="h4 text-center">Person Records</h3>
<!-- Show people for this account -->
{#if $ae_sess.person.show_report__person_li && person_id_random_li?.length > 0}
<h3 class="h4 text-center">Person Records</h3>
<label class="text-sm" for="qry_limit__people"
>Max results:
<label class="text-sm" for="qry_limit__people"
>Max results:
<select
id="qry_limit__people"
bind:value={$ae_loc.person.qry_limit__people}
on:change={() => {
core_func
.load_ae_obj_li__person({
api_cfg: $ae_api,
for_obj_type: 'account',
for_obj_id: $slct.account_id,
enabled: 'enabled',
hidden: 'not_hidden',
limit: $ae_loc.person.qry_limit__people,
// params: {
// 'qry__enabled': 'enabled',
// 'qry__hidden': 'not_hidden',
// 'qry__limit': $ae_loc.person.qry_limit__people,},
log_lvl: 1
})
.then(function (load_results) {
console.log(`Loaded person_obj_li:`, load_results);
if (load_results) {
$slct.person_id_random_li = load_results;
<select
id="qry_limit__people"
bind:value={$ae_loc.person.qry_limit__people}
on:change={() => {
core_func
.load_ae_obj_li__person({
api_cfg: $ae_api,
for_obj_type: 'account',
for_obj_id: $slct.account_id,
enabled: 'enabled',
hidden: 'not_hidden',
limit: $ae_loc.person.qry_limit__people,
// params: {
// 'qry__enabled': 'enabled',
// 'qry__hidden': 'not_hidden',
// 'qry__limit': $ae_loc.person.qry_limit__people,},
log_lvl: 1
})
.then(function (load_results) {
console.log(`Loaded person_obj_li:`, load_results);
if (load_results) {
$slct.person_id_random_li = load_results;
person_id_random_li = [];
person_id_random_li = [];
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
for (let i = 0; i < $slct.person_id_random_li.length; i++) {
let person_obj = $slct.person_id_random_li[i];
let person_id_random = person_obj.person_id_random;
tmp_li.push(person_id_random);
}
person_id_random_li = tmp_li;
}
return load_results;
});
}}
class="select max-w-20 text-sm"
>
<option value={25}>25</option>
<option value={50}>50</option>
<option value={75}>75</option>
<option value={100}>100</option>
<option value={150}>150</option>
<option value={200}>200</option>
<option value={250}>250</option>
<option value={500}>500</option>
<option value={750}>750</option>
<option value={1000}>1000</option>
</select>
</label>
for (let i = 0; i < $slct.person_id_random_li.length; i++) {
let person_obj = $slct.person_id_random_li[i];
let person_id_random = person_obj.person_id_random;
tmp_li.push(person_id_random);
}
person_id_random_li = tmp_li;
}
return load_results;
});
}}
class="select max-w-20 text-sm"
>
<option value={25}>25</option>
<option value={50}>50</option>
<option value={75}>75</option>
<option value={100}>100</option>
<option value={150}>150</option>
<option value={200}>200</option>
<option value={250}>250</option>
<option value={500}>500</option>
<option value={750}>750</option>
<option value={1000}>1000</option>
</select>
</label>
<div class="outline">
<!-- Count: {person_id_random_li?.length} -->
<Comp_person_obj_tbl bind:person_id_random_li show_user_fields={$ae_loc.administrator_access}
></Comp_person_obj_tbl>
</div>
{/if}
<div class="outline">
<!-- Count: {person_id_random_li?.length} -->
<Comp_person_obj_tbl
bind:person_id_random_li
show_user_fields={$ae_loc.administrator_access}
></Comp_person_obj_tbl>
</div>
{/if}
</section>

View File

@@ -22,8 +22,8 @@ The Aether system is built on a foundation of several core modules. The UI compo
- **Description:** Manages information about individuals. A "person" can be a user, a contact, an event presenter, etc. This is the central object for representing people in the system.
- **Logic:** `src/lib/ae_core/core__person.ts`
- **UI Components:**
- `ae_comp__person_obj_tbl.svelte`: A table for displaying a list of people.
- `person_view.svelte`: A component for displaying the details of a single person.
- `ae_comp__person_obj_tbl.svelte`: A table for displaying a list of people.
- `person_view.svelte`: A component for displaying the details of a single person.
### Sites & Site Domains

View File

@@ -1,148 +1,150 @@
<script lang="ts">
// Imports
// import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
// Imports
// import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import { liveQuery } from 'dexie';
import { db_core } from '$lib/ae_core/db_core';
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { core_func } from '$lib/ae_core_functions';
// import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/stores/ae_events_stores';
// import { events_func } from '$lib/ae_events_functions';
import { liveQuery } from 'dexie';
import { db_core } from '$lib/ae_core/db_core';
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { core_func } from '$lib/ae_core_functions';
// import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/stores/ae_events_stores';
// import { events_func } from '$lib/ae_events_functions';
// Exports
export let container_class_li: string | Array<string> = [];
export let person_id_random_li: Array<string> = [''];
export let allow_basic: boolean = false;
export let allow_moderator: boolean = false;
export let show_user_fields: boolean = false;
// Exports
export let container_class_li: string | Array<string> = [];
export let person_id_random_li: Array<string> = [''];
export let allow_basic: boolean = false;
export let allow_moderator: boolean = false;
export let show_user_fields: boolean = false;
export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
// Variables
// Variables
// *** Functions and Logic
// let lq__person_obj = liveQuery(
// () => db_core.person.get($events_slct.person_id)
// );
// *** Functions and Logic
// let lq__person_obj = liveQuery(
// () => db_core.person.get($events_slct.person_id)
// );
let lq_kv__person_obj_li = liveQuery(() => db_core.person.bulkGet(person_id_random_li));
let lq_kv__person_obj_li = liveQuery(() => db_core.person.bulkGet(person_id_random_li));
</script>
<section class="ae_comp person_obj_tbl container {container_class_li}">
{#if person_id_random_li && $lq_kv__person_obj_li && $lq_kv__person_obj_li?.length > 0}
<div class="overflow-auto">
<h2 class="h3">
<span class="text-md"> Results: </span>
{#if person_id_random_li && $lq_kv__person_obj_li && $lq_kv__person_obj_li?.length > 0}
<div class="overflow-auto">
<h2 class="h3">
<span class="text-md"> Results: </span>
{#if $lq_kv__person_obj_li.length}
<span
class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-200"
title="Count {$lq_kv__person_obj_li.length ?? 'None'}"
>
<span class="fas fa-list-ol mx-4"></span>
{$lq_kv__person_obj_li.length ?? 'None'}
</span>
{/if}
</h2>
{#if $lq_kv__person_obj_li.length}
<span
class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-200"
title="Count {$lq_kv__person_obj_li.length ?? 'None'}"
>
<span class="fas fa-list-ol mx-4"></span>
{$lq_kv__person_obj_li.length ?? 'None'}
</span>
{/if}
</h2>
<table class="table table-auto table-striped w-full text-xs lg:text-sm">
<thead>
<tr>
<th class="px-4 py-2">Name ({$lq_kv__person_obj_li?.length}×)</th>
<th class="px-4 py-2">Email</th>
<th class="px-4 py-2">Affiliations</th>
{#if show_user_fields}
<th class="px-4 py-2">Username</th>
<th class="px-4 py-2">Access</th>
{/if}
<th class="px-4 py-2">Created/Updated</th>
</tr>
</thead>
<tbody>
{#each $lq_kv__person_obj_li as person_obj}
<tr class:dim={person_obj?.hide}>
<td class="px-4 py-2">
<span class="fas fa-user"></span>
<a
href="/core/person/{person_obj?.person_id_random}"
class="text-blue-500 underline hover:text-blue-800"
title="View {person_obj?.full_name ??
'no name'} (ID={person_obj?.person_id_random})"
>
<!-- {@html person_obj?.full_name ?? ae_snip.html__not_set} -->
{@html person_obj?.full_name ? person_obj?.full_name : ae_snip.html__not_set}
</a>
</td>
<td class="px-4 py-2">
<span class="fas fa-envelope"></span>
{#if person_obj?.primary_email}
<a
href="mailto:{person_obj?.primary_email}"
class="text-blue-500 underline hover:text-blue-800"
>
{@html person_obj?.primary_email ?? ae_snip.html__not_set}
</a>
{:else}
{@html ae_snip.html__not_set}
{/if}
</td>
<td class="px-4 py-2">
<span class="fas fa-building"></span>
{@html person_obj?.affiliations ?? ae_snip.html__not_set}
</td>
<table class="table table-auto table-striped w-full text-xs lg:text-sm">
<thead>
<tr>
<th class="px-4 py-2">Name ({$lq_kv__person_obj_li?.length}×)</th>
<th class="px-4 py-2">Email</th>
<th class="px-4 py-2">Affiliations</th>
{#if show_user_fields}
<th class="px-4 py-2">Username</th>
<th class="px-4 py-2">Access</th>
{/if}
<th class="px-4 py-2">Created/Updated</th>
</tr>
</thead>
<tbody>
{#each $lq_kv__person_obj_li as person_obj}
<tr class:dim={person_obj?.hide}>
<td class="px-4 py-2">
<span class="fas fa-user"></span>
<a
href="/core/person/{person_obj?.person_id_random}"
class="text-blue-500 underline hover:text-blue-800"
title="View {person_obj?.full_name ??
'no name'} (ID={person_obj?.person_id_random})"
>
<!-- {@html person_obj?.full_name ?? ae_snip.html__not_set} -->
{@html person_obj?.full_name
? person_obj?.full_name
: ae_snip.html__not_set}
</a>
</td>
<td class="px-4 py-2">
<span class="fas fa-envelope"></span>
{#if person_obj?.primary_email}
<a
href="mailto:{person_obj?.primary_email}"
class="text-blue-500 underline hover:text-blue-800"
>
{@html person_obj?.primary_email ?? ae_snip.html__not_set}
</a>
{:else}
{@html ae_snip.html__not_set}
{/if}
</td>
<td class="px-4 py-2">
<span class="fas fa-building"></span>
{@html person_obj?.affiliations ?? ae_snip.html__not_set}
</td>
{#if show_user_fields}
<td class="px-4 py-2">
{#if person_obj?.user_id_random}
<span class="fas fa-user"></span>
<a
href="/core/user/{person_obj?.user_id_random}"
class="text-blue-500 underline hover:text-blue-800"
>
{@html person_obj?.username ?? ae_snip.html__not_set}
</a>
{:else}
{@html ae_snip.html__not_set}
{/if}
</td>
<td class="px-4 py-2">
{person_obj?.user_super ? 'Super' : ''}
{person_obj?.user_manager ? 'Manager' : ''}
{person_obj?.user_administrator ? 'Administrator' : ''}
</td>
{/if}
{#if show_user_fields}
<td class="px-4 py-2">
{#if person_obj?.user_id_random}
<span class="fas fa-user"></span>
<a
href="/core/user/{person_obj?.user_id_random}"
class="text-blue-500 underline hover:text-blue-800"
>
{@html person_obj?.username ?? ae_snip.html__not_set}
</a>
{:else}
{@html ae_snip.html__not_set}
{/if}
</td>
<td class="px-4 py-2">
{person_obj?.user_super ? 'Super' : ''}
{person_obj?.user_manager ? 'Manager' : ''}
{person_obj?.user_administrator ? 'Administrator' : ''}
</td>
{/if}
<td class="px-4 py-2">
{ae_util.iso_datetime_formatter(
person_obj?.created_on,
'datetime_iso_12_no_seconds'
)}
<br />
{ae_util.iso_datetime_formatter(
person_obj?.updated_on,
'datetime_iso_12_no_seconds'
)}
</td>
</tr>
{/each}
</tbody>
</table>
</div>
{/if}
<td class="px-4 py-2">
{ae_util.iso_datetime_formatter(
person_obj?.created_on,
'datetime_iso_12_no_seconds'
)}
<br />
{ae_util.iso_datetime_formatter(
person_obj?.updated_on,
'datetime_iso_12_no_seconds'
)}
</td>
</tr>
{/each}
</tbody>
</table>
</div>
{/if}
</section>
<style>
.dim {
opacity: 0.5;
color: #999;
}
.dim {
opacity: 0.5;
color: #999;
}
</style>

View File

@@ -4,33 +4,33 @@
// import { core_func } from '$lib/ae_core_functions';
export async function load({ parent }) {
const log_lvl: number = 0;
const log_lvl: number = 0;
const data = await parent();
// console.log(`ae_events_pres_mgmt +layout.ts data:`, data);
const data = await parent();
// console.log(`ae_events_pres_mgmt +layout.ts data:`, data);
// let account_id = data.account_id;
// if (!account_id) {
// console.log(`events_pres_mgmt +layout.ts: The account_id was not found in the data!!!`);
// return false;
// }
// let account_id = data.account_id;
// if (!account_id) {
// console.log(`events_pres_mgmt +layout.ts: The account_id was not found in the data!!!`);
// return false;
// }
// let ae_acct = data[account_id];
// if (log_lvl) {
// console.log(`ae_acct = `, ae_acct);
// }
// let ae_acct = data[account_id];
// if (log_lvl) {
// console.log(`ae_acct = `, ae_acct);
// }
// let submenu = {
// main: {name: 'Main', href: '/events', access: false},
// // manage: {name: 'Manage', href: '/events/manage', access: 'administrator', disable: true, hide: true},
// locations: {name: 'Locations', href: '/events/locations', access: false, disable: false, hide: false},
// };
// data.submenu = submenu
// let submenu = {
// main: {name: 'Main', href: '/events', access: false},
// // manage: {name: 'Manage', href: '/events/manage', access: 'administrator', disable: true, hide: true},
// locations: {name: 'Locations', href: '/events/locations', access: false, disable: false, hide: false},
// };
// data.submenu = submenu
// // WARNING: Precaution against shared data between sites and sessions.
// data[account_id] = ae_acct;
// // WARNING: Precaution against shared data between sites and sessions.
// data[account_id] = ae_acct;
return data;
return data;
}
// export const prerender = false;

View File

@@ -1,198 +1,198 @@
<script lang="ts">
/** @type {import('./$types').PageData} */
// import { page } from '$app/stores';
// console.log($page.params.slug);
export let data: any;
/** @type {import('./$types').PageData} */
// import { page } from '$app/stores';
// console.log($page.params.slug);
export let data: any;
// Imports
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
// Imports
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import { liveQuery } from 'dexie';
// import { core_func } from '$lib/ae_core_functions';
import { db_core } from '$lib/ae_core/db_core';
// import { db_events } from "$lib/db_events";
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { events_loc, events_sess, slct, events_trigger } from '$lib/stores/ae_events_stores';
// import { events_func } from '$lib/ae_events_functions';
import { liveQuery } from 'dexie';
// import { core_func } from '$lib/ae_core_functions';
import { db_core } from '$lib/ae_core/db_core';
// import { db_events } from "$lib/db_events";
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { events_loc, events_sess, slct, events_trigger } from '$lib/stores/ae_events_stores';
// import { events_func } from '$lib/ae_events_functions';
import Person_view from './../../person_view.svelte';
import Person_view from './../../person_view.svelte';
// Exports
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
// Exports
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
// Variables
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
$slct.account_id = data.account_id;
// console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
// console.log(`ae_acct = `, ae_acct);
// Variables
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
$slct.account_id = data.account_id;
// console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
// console.log(`ae_acct = `, ae_acct);
$ae_loc.url_origin = data.url.origin;
$ae_loc.url_origin = data.url.origin;
$slct.person_id = ae_acct.slct.person_id;
$slct.person_obj = ae_acct.slct.person_obj;
$slct.person_id = ae_acct.slct.person_id;
$slct.person_obj = ae_acct.slct.person_obj;
$ae_sess.person.show_edit__person = false;
$ae_sess.person.show_edit__person = false;
let lq__person_obj = liveQuery(() => db_core.person.get($slct.person_id));
$slct.lq__person_obj = lq__person_obj;
let lq__person_obj = liveQuery(() => db_core.person.get($slct.person_id));
$slct.lq__person_obj = lq__person_obj;
if (!$ae_loc.person) {
$ae_loc.person = {};
}
$ae_loc.person.show_content__person_page_help = false;
if (!$ae_loc.person) {
$ae_loc.person = {};
}
$ae_loc.person.show_content__person_page_help = false;
// *** Functions and Logic
// *** Functions and Logic
</script>
<svelte:head>
<title>
Person: {ae_util.shorten_string({
string: $lq__person_obj?.full_name,
max_length: 20,
begin_length: 10,
end_length: 4
})}
({$lq__person_obj?.person_id ?? 'loading...'}) - Core - {$ae_loc?.title}
</title>
<title>
Person: {ae_util.shorten_string({
string: $lq__person_obj?.full_name,
max_length: 20,
begin_length: 10,
end_length: 4
})}
({$lq__person_obj?.person_id ?? 'loading...'}) - Core - {$ae_loc?.title}
</title>
</svelte:head>
<section class="ae_core__person md:container h-full mx-auto flex flex-col space-y-4 pt-0 pb-8">
<div
class="core__person_view_menu {ae_snip.classes__core_menu}"
class:border-gray-100={!$ae_loc.person.show_content__person_page_help}
>
<div>
<a href="/core" class={ae_snip.classes__core_menu__button}>
<span class="fas fa-arrow-left mx-1"></span>
Back to Core
</a>
<div
class="core__person_view_menu {ae_snip.classes__core_menu}"
class:border-gray-100={!$ae_loc.person.show_content__person_page_help}
>
<div>
<a href="/core" class={ae_snip.classes__core_menu__button}>
<span class="fas fa-arrow-left mx-1"></span>
Back to Core
</a>
<button
type="button"
on:click={() => {
$ae_loc.person.show_content__person_page_help =
!$ae_loc.person.show_content__person_page_help;
}}
class={ae_snip.classes__core_menu__button}
title="Help and information about the session search"
>
<span class="fas fa-question-circle mx-1"></span>
{#if $ae_loc.person.show_content__person_page_help}
Hide
{:else}
Show
{/if}
Help?
</button>
</div>
<button
type="button"
on:click={() => {
$ae_loc.person.show_content__person_page_help =
!$ae_loc.person.show_content__person_page_help;
}}
class={ae_snip.classes__core_menu__button}
title="Help and information about the session search"
>
<span class="fas fa-question-circle mx-1"></span>
{#if $ae_loc.person.show_content__person_page_help}
Hide
{:else}
Show
{/if}
Help?
</button>
</div>
<Element_data_store
ds_code="events__core__person_page_help"
ds_name="Default: Core - Person Page Help"
ds_type="html"
for_type="event"
for_id={$slct.event_id}
class_li="bg-yellow-100 p-2 rounded-md border border-yellow-200"
show_edit={false}
show_edit_btn={true}
hide={!$ae_loc.person.show_content__person_page_help}
/>
<Element_data_store
ds_code="events__core__person_page_help"
ds_name="Default: Core - Person Page Help"
ds_type="html"
for_type="event"
for_id={$slct.event_id}
class_li="bg-yellow-100 p-2 rounded-md border border-yellow-200"
show_edit={false}
show_edit_btn={true}
hide={!$ae_loc.person.show_content__person_page_help}
/>
<div>
<button
type="button"
on:click={() => {
$ae_loc.person.show_content__person_page_help =
!$ae_loc.person.show_content__person_page_help;
}}
class="btn btn-sm mx-1 preset-tonal-error border border-error-500 hover:preset-filled-error-500"
class:hidden={!$ae_loc.person.show_content__person_page_help}
title="Help and information about the session search"
>
<span class="fas fa-question-circle mx-1"></span>
{#if $ae_loc.person.show_content__person_page_help}
Hide
{:else}
Show
{/if}
Help?
</button>
</div>
</div>
<div>
<button
type="button"
on:click={() => {
$ae_loc.person.show_content__person_page_help =
!$ae_loc.person.show_content__person_page_help;
}}
class="btn btn-sm mx-1 preset-tonal-error border border-error-500 hover:preset-filled-error-500"
class:hidden={!$ae_loc.person.show_content__person_page_help}
title="Help and information about the session search"
>
<span class="fas fa-question-circle mx-1"></span>
{#if $ae_loc.person.show_content__person_page_help}
Hide
{:else}
Show
{/if}
Help?
</button>
</div>
</div>
{#if !$lq__person_obj}
<div class="flex flex-row items-center justify-center">
<span class="fas fa-spinner fa-spin mx-1"></span>
<span>Loading...</span>
</div>
{:else}
<!-- {$lq__person_obj?.full_name} -->
{/if}
{#if !$lq__person_obj}
<div class="flex flex-row items-center justify-center">
<span class="fas fa-spinner fa-spin mx-1"></span>
<span>Loading...</span>
</div>
{:else}
<!-- {$lq__person_obj?.full_name} -->
{/if}
<!-- <hr class="w-full border border-gray-200" /> -->
<!-- <hr class="w-full border border-gray-200" /> -->
<!-- {#await $slct.person_obj}
<!-- {#await $slct.person_obj}
<span class="fas fa-spinner fa-spin text-xl text-blue-500"></span>
{:then result} -->
<Person_view person_id={$slct.person_id} />
<!-- {:catch error}
<Person_view person_id={$slct.person_id} />
<!-- {:catch error}
<div class="text-red-800">
<span class="fas fa-exclamation-triangle text-xl"></span>
<span>Error: {error.message}</span>
</div>
{/await} -->
<!-- {$slct.person_id ?? 'Unknown ID'} -->
<!-- {$slct.person_id ?? 'Unknown ID'} -->
</section>
<style lang="postcss">
/* Use the div.ae_quick_modal_container to block background clicks when using the section.ae_quick_popover. */
div.ae_quick_modal_container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
background-color: hsla(0, 0%, 50%, 0.75);
/* padding: 1rem; */
/* border: solid thick red; */
}
/* Use the div.ae_quick_modal_container to block background clicks when using the section.ae_quick_popover. */
div.ae_quick_modal_container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
background-color: hsla(0, 0%, 50%, 0.75);
/* padding: 1rem; */
/* border: solid thick red; */
}
/* The section.ae_quick_popover should be above the rest of the content and centered on the page. */
section.ae_quick_popover {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
background-color: hsla(0, 0%, 97%, 0.97);
/* margin-top: 1rem;
/* The section.ae_quick_popover should be above the rest of the content and centered on the page. */
section.ae_quick_popover {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
background-color: hsla(0, 0%, 97%, 0.97);
/* margin-top: 1rem;
margin-bottom: 2rem; */
/* padding: 1rem;
/* padding: 1rem;
padding-top:4rem; */
/* padding-bottom: 4rem; */
border: solid thin hsla(0, 0%, 0%, 0.9);
border-radius: 0.5rem;
box-shadow: 0 0 1rem hsla(0, 0%, 0%, 0.5);
/* padding-bottom: 4rem; */
border: solid thin hsla(0, 0%, 0%, 0.9);
border-radius: 0.5rem;
box-shadow: 0 0 1rem hsla(0, 0%, 0%, 0.5);
min-height: 30%;
/* max-height: 100vh; */
min-width: 80%;
min-height: 30%;
/* max-height: 100vh; */
min-width: 80%;
/* overflow-y: auto; */
}
/* overflow-y: auto; */
}
</style>

View File

@@ -5,40 +5,40 @@ console.log(`ae core person [person_id] +page.ts: start`);
import { core_func } from '$lib/ae_core/ae_core_functions';
export async function load({ params, parent }) {
// route
const log_lvl: number = 0;
// route
const log_lvl: number = 0;
const data = await parent();
// console.log(`ae core person [person_id] +page.ts data:`, data);
data.log_lvl = log_lvl;
const data = await parent();
// console.log(`ae core person [person_id] +page.ts data:`, data);
data.log_lvl = log_lvl;
const account_id = data.account_id;
const ae_acct = data[account_id];
console.log(`ae_acct = `, ae_acct);
const account_id = data.account_id;
const ae_acct = data[account_id];
console.log(`ae_acct = `, ae_acct);
const person_id = params.person_id;
console.log(`person_id = `, person_id);
if (!person_id) {
console.log(
`ae core person [person_id] +page.ts: The person_id was not found in the params!!!`
);
error(404, {
message: 'Person not found'
});
}
const person_id = params.person_id;
console.log(`person_id = `, person_id);
if (!person_id) {
console.log(
`ae core person [person_id] +page.ts: The person_id was not found in the params!!!`
);
error(404, {
message: 'Person not found'
});
}
ae_acct.slct.person_id = person_id;
ae_acct.slct.person_id = person_id;
const load_person_obj = await core_func.load_ae_obj_id__person({
api_cfg: ae_acct.api,
person_id: person_id,
try_cache: true
});
const load_person_obj = await core_func.load_ae_obj_id__person({
api_cfg: ae_acct.api,
person_id: person_id,
try_cache: true
});
ae_acct.slct.person_obj = load_person_obj;
ae_acct.slct.person_obj = load_person_obj;
// WARNING: Precaution against shared data between sites and presentations.
data[account_id] = ae_acct;
// WARNING: Precaution against shared data between sites and presentations.
data[account_id] = ae_acct;
return data;
return data;
}

File diff suppressed because it is too large Load Diff