diff --git a/.prettierrc b/.prettierrc index 2363b8db..9043b7fe 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,6 +4,14 @@ "singleQuote": true, "trailingComma": "none", "printWidth": 80, - "plugins": ["prettier-plugin-svelte"], + "bracketSameLine": true, + + "svelteSortOrder": "options-scripts-markup-styles", + "svelteIndentScriptAndStyle": false, + "svelteAllowShorthand": true, + "plugins": [ + "prettier-plugin-svelte", + "prettier-plugin-tailwindcss" + ], "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/package-lock.json b/package-lock.json index 90b8fb56..a3aae862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "osit-aether-app-svelte", - "version": "3.12.08", + "version": "3.00.05", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "osit-aether-app-svelte", - "version": "3.12.08", + "version": "3.00.05", "dependencies": { "@codemirror/autocomplete": "^6.20.0", "@codemirror/commands": "^6.10.0", @@ -34,6 +34,7 @@ "lucide-svelte": "^0.*.0", "marked": "^17.0.0", "openai": "^6.10.0", + "prettier-plugin-tailwindcss": "^0.7.2", "qrcode": "^1.5.4", "shadcn-svelte": "^1.0.11", "svelte-persisted-store": "^0.12.0", @@ -6161,6 +6162,16 @@ } } }, + "node_modules/postcss-load-config/node_modules/yaml": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", + "integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, "node_modules/postcss-safe-parser": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-7.0.1.tgz", @@ -6242,7 +6253,6 @@ "version": "3.8.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", - "dev": true, "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -6258,13 +6268,91 @@ "version": "3.5.1", "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.5.1.tgz", "integrity": "sha512-65+fr5+cgIKWKiqM1Doum4uX6bY8iFCdztvvp2RcF+AJoieaw9kJOFMNcJo/bkmKYsxFaM9OsVZK/gWauG/5mg==", - "dev": true, + "devOptional": true, "license": "MIT", "peerDependencies": { "prettier": "^3.0.0", "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.7.2.tgz", + "integrity": "sha512-LkphyK3Fw+q2HdMOoiEHWf93fNtYJwfamoKPl7UwtjFQdei/iIBoX11G6j706FzN3ymX9mPVi97qIY8328vdnA==", + "license": "MIT", + "engines": { + "node": ">=20.19" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-hermes": "*", + "@prettier/plugin-oxc": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-hermes": { + "optional": true + }, + "@prettier/plugin-oxc": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/proxy-compare": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/proxy-compare/-/proxy-compare-3.0.1.tgz", @@ -7737,16 +7825,6 @@ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "license": "ISC" }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "devOptional": true, - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, "node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", diff --git a/package.json b/package.json index f5692dee..f1a5878e 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "lucide-svelte": "^0.*.0", "marked": "^17.0.0", "openai": "^6.10.0", + "prettier-plugin-tailwindcss": "^0.7.2", "qrcode": "^1.5.4", "shadcn-svelte": "^1.0.11", "svelte-persisted-store": "^0.12.0", diff --git a/src/routes/core/+layout.svelte b/src/routes/core/+layout.svelte index 29a41178..1f3d36ef 100644 --- a/src/routes/core/+layout.svelte +++ b/src/routes/core/+layout.svelte @@ -1,34 +1,47 @@ Core - {$ae_loc.title ?? 'Æ loading...'} -
+
{#if $ae_loc.manager_access} -
\ No newline at end of file +
diff --git a/src/routes/core/+page.svelte b/src/routes/core/+page.svelte index afc7df97..a3dc7fac 100644 --- a/src/routes/core/+page.svelte +++ b/src/routes/core/+page.svelte @@ -1,163 +1,238 @@
-
+
-

Æ Core Management

-

System Infrastructure & Identity

+

+ Æ Core Management +

+

+ System Infrastructure & Identity +

-
-

+

+

Active Account

-

{$ae_loc.account_name ?? 'Loading...'}

+

+ {$ae_loc.account_name ?? 'Loading...'} +

-
+
-
+
-
+

Accounts

-

Manage client accounts and high-level system settings.

+

+ Manage client accounts and high-level system settings. +

- + Manage
-
+
-
+

Sites

-

Configure sites and domains associated with the active account.

+

+ Configure sites and domains associated with the active + account. +

- + Manage
-
+
-
+

Users

-

Manage system access, permissions, and user credentials.

+

+ Manage system access, permissions, and user credentials. +

- + Manage
-
+
-
+

People

-

Search and manage person records and their user linking.

+

+ Search and manage person records and their user linking. +

- + Manage
-
+
-
+

Addresses

-

Manage physical locations, shipping, and billing addresses.

+

+ Manage physical locations, shipping, and billing addresses. +

- + Manage
-
+
-
+

Contacts

-

Maintain support contacts, office numbers, and digital links.

+

+ Maintain support contacts, office numbers, and digital + links. +

- + Manage
-
+
-
+

Activity Logs

-

Monitor system actions and historical changes for the account.

+

+ Monitor system actions and historical changes for the + account. +

- + View Logs
-
+
-
+

Lookups

-

View system lookup tables (countries, time zones, etc).

+

+ View system lookup tables (countries, time zones, etc). +

- + View
-
\ No newline at end of file +
diff --git a/src/routes/core/+page.ts b/src/routes/core/+page.ts index adbbf7d5..4f5c94fd 100644 --- a/src/routes/core/+page.ts +++ b/src/routes/core/+page.ts @@ -3,14 +3,14 @@ import { error } from '@sveltejs/kit'; export const load: PageLoad = async ({ parent }) => { const data = await parent(); - + if (!data.account_id) { console.error('Core Dashboard: No account_id found in parent data'); // We could throw an error here, but for now let's just log it and return // to avoid a hard crash if the user is just navigating. } - + return { account_id: data.account_id }; -}; \ No newline at end of file +}; diff --git a/src/routes/core/accounts/+page.svelte b/src/routes/core/accounts/+page.svelte index f66f2772..7823462b 100644 --- a/src/routes/core/accounts/+page.svelte +++ b/src/routes/core/accounts/+page.svelte @@ -1,96 +1,125 @@
-
+

Account Management

-

Client Entities & Billing

+

+ Client Entities & Billing +

-
-
+
- Search Accounts -
-
+ Search Accounts +
+
-
@@ -98,8 +127,13 @@
- Status - @@ -107,8 +141,13 @@
- Visibility - @@ -120,56 +159,87 @@ {#if loading}
-
+
+
{:else if filtered_li.length === 0} -
+

No Accounts Found

-

Try adjusting your filters or add a new client account.

+

+ Try adjusting your filters or add a new client account. +

{:else} -
-

+
+

Directory Results - {filtered_li.length} found + {filtered_li.length} found

{#each filtered_li as acct (acct.account_id_random)} -
+
{#if acct.hide} - Hidden + Hidden {/if} - + {acct.enable ? 'Active' : 'Disabled'}
-
+
-

{acct.name}

-

Code: {acct.code || '--'}

+

+ {acct.name} +

+

+ Code: {acct.code || '--'} +

-
- - Created: {new Date(acct.created_on).toLocaleDateString()} +
+ + Created: {new Date( + acct.created_on + ).toLocaleDateString()}
-
- - {acct.account_id_random} +
+ + {acct.account_id_random}
- + Manage Account
diff --git a/src/routes/core/accounts/+page.ts b/src/routes/core/accounts/+page.ts index 0e2417e5..b7c1e8a6 100644 --- a/src/routes/core/accounts/+page.ts +++ b/src/routes/core/accounts/+page.ts @@ -6,7 +6,7 @@ import { ae_api } from '$lib/stores/ae_stores'; export const load: PageLoad = async ({ parent }) => { // Ensure we have parent data if needed, but for listing accounts we mostly need the api_cfg const parentData = await parent(); - + return { // We could pre-load here, but listing accounts might be better handled in the component // to support interactive filtering/pagination more easily. diff --git a/src/routes/core/accounts/[account_id]/+page.svelte b/src/routes/core/accounts/[account_id]/+page.svelte index 612ecbd1..a8ed15e6 100644 --- a/src/routes/core/accounts/[account_id]/+page.svelte +++ b/src/routes/core/accounts/[account_id]/+page.svelte @@ -1,91 +1,114 @@
-
+
- +
-

{account?.name ?? 'Loading...'}

+

+ {account?.name ?? 'Loading...'} +

- -
-
+
- Search Keywords -
-
+ Search Keywords + +
-
- Display Limit - @@ -103,26 +135,34 @@ {#if loading}
-
+
+
{:else if log_li.length === 0} -
+

No Logs Found

-

Try broadening your search or check another account.

+

+ Try broadening your search or check another account. +

{:else} -
-

+
+

System Events - {log_li.length} entries shown + {log_li.length} entries shown

- + @@ -136,11 +176,22 @@ @@ -200,13 +273,21 @@ diff --git a/src/routes/core/addresses/+page.svelte b/src/routes/core/addresses/+page.svelte index f4d584c9..7c12a8f5 100644 --- a/src/routes/core/addresses/+page.svelte +++ b/src/routes/core/addresses/+page.svelte @@ -1,50 +1,69 @@
-
+
@@ -53,8 +72,7 @@
{/if} -
+
- Search Directory -
-
+ Search Directory +
+
-
@@ -104,55 +129,84 @@ {#if loading}
-
+
+
{:else if filtered_li.length === 0} -
+

No Addresses Found

-

Addresses associated with this account will appear here.

+

+ Addresses associated with this account will appear here. +

{:else} -
-

+
+

Linked Addresses - {filtered_li.length} entries + {filtered_li.length} entries

{#each filtered_li as addr (addr.address_id_random)} -
+
- + {addr.enable ? 'Active' : 'Disabled'}
-
+
-

{addr.city || '--'}

-

{addr.state_province || '--'}

+

+ {addr.city || '--'} +

+

+ {addr.state_province || '--'} +

{#if addr.organization_name} -
- - {addr.organization_name} +
+ + {addr.organization_name}
{/if} -
- - {addr.country_name || addr.country || '--'} +
+ + {addr.country_name || + addr.country || + '--'}
- + View Details
diff --git a/src/routes/core/addresses/[address_id]/+page.svelte b/src/routes/core/addresses/[address_id]/+page.svelte index 7f840071..891fad47 100644 --- a/src/routes/core/addresses/[address_id]/+page.svelte +++ b/src/routes/core/addresses/[address_id]/+page.svelte @@ -1,56 +1,74 @@
-
+
- +
@@ -58,20 +76,33 @@
-

{address ? `${address.city}, ${address.state_province}` : 'Loading...'}

-

Address Detail

+

+ {address + ? `${address.city}, ${address.state_province}` + : 'Loading...'} +

+

+ Address Detail +

- -
@@ -79,88 +110,132 @@ {#if loading}
-
+
+
{:else if address} {#if is_editing}
- { address = updated; is_editing = false; }} - onCancel={() => is_editing = false} - /> + onCancel={() => (is_editing = false)} />
{:else}
-
-

+
+

Location Information

-

+

Attention To

-

{address.attention_to || '--'}

+

+ {address.attention_to || '--'} +

-

+

Organization

-

{address.organization_name || '--'}

+

+ {address.organization_name || '--'} +

-
-

Street Address

+
+

+ Street Address +

-

{address.line_1}

- {#if address.line_2}

{address.line_2}

{/if} - {#if address.line_3}

{address.line_3}

{/if} +

+ {address.line_1} +

+ {#if address.line_2}

+ {address.line_2} +

{/if} + {#if address.line_3}

+ {address.line_3} +

{/if}
-

+

City, State/Province

-

{address.city}, {address.state_province || '--'}

+

+ {address.city}, {address.state_province || + '--'} +

-

+

Postal Code / Country

-

{address.postal_code || '--'} / {address.country_name || address.country || '--'}

+

+ {address.postal_code || '--'} / + {address.country_name || + address.country || + '--'} +

-
-

+
+

Technical Details

-

+

Timezone

-

{address.timezone || '--'}

+

+ {address.timezone || '--'} +

-

+

Coordinates

-

{address.latitude || '--'}, {address.longitude || '--'}

+

+ {address.latitude || '--'}, {address.longitude || + '--'} +

-

+

Internal Notes

-
- {address.notes || 'No internal notes provided for this address.'} +
+ {address.notes || + 'No internal notes provided for this address.'}
@@ -168,40 +243,77 @@
-
-

+
+

Visibility & Status

-
- Enabled - +
+ Enabled + {address.enable ? 'ACTIVE' : 'DISABLED'}
-
- Hidden - +
+ Hidden + {address.hide ? 'YES' : 'NO'}
-
- Priority - +
+ Priority + {address.priority ? 'YES' : 'NO'}
-
-

System Audit

+
+

+ System Audit +

-

ID: {address.address_id_random}

-

Created: {new Date(address.created_on).toLocaleString()}

+

+ ID: + {address.address_id_random} +

+

+ Created: + {new Date( + address.created_on + ).toLocaleString()} +

{#if address.updated_on} -

Updated: {new Date(address.updated_on).toLocaleString()}

+

+ Updated: + {new Date( + address.updated_on + ).toLocaleString()} +

{/if}
diff --git a/src/routes/core/addresses/ae_comp__address_form.svelte b/src/routes/core/addresses/ae_comp__address_form.svelte index 5340ae8c..21ece2fe 100644 --- a/src/routes/core/addresses/ae_comp__address_form.svelte +++ b/src/routes/core/addresses/ae_comp__address_form.svelte @@ -1,128 +1,140 @@ -
-
+ +

{address ? 'Edit Address' : 'Create New Address'}

{#if onCancel} - {/if} -

-

Timestamp Identity Action
- +
- {ae_util.iso_datetime_formatter(log.created_on, 'date_short')} - - {ae_util.iso_datetime_formatter(log.created_on, 'time_12_short')} + {ae_util.iso_datetime_formatter( + log.created_on, + 'date_short' + )} + + + {ae_util.iso_datetime_formatter( + log.created_on, + 'time_12_short' + )}
@@ -149,17 +200,28 @@
-
- +
+
-
+
{#if log.person_full_name || log.person_id_random} - {log.person_full_name || 'Person'} - ID: {log.person_id_random || '--'} + {log.person_full_name || + 'Person'} + ID: {log.person_id_random || + '--'} {:else if log.name} - {log.name} + {log.name} {:else} - Unknown + Unknown {/if}
@@ -168,11 +230,13 @@
- + {log.action} {#if log.action_with} - + via {log.action_with} {/if} @@ -182,17 +246,26 @@
{#if log.object_type} -
- -
- {log.object_type} +
+ +
+ {log.object_type} {#if log.external_client_id} - {log.external_client_id} + {log.external_client_id} {/if}
{:else} - -- + -- {/if}
{#if log.summary} - {log.summary} + {log.summary} {/if} {#if log.description} -

{log.description}

+

+ {log.description} +

{/if} {#if !log.summary && !log.description} - No detail record + No detail record {/if}
+
- + {#if show_user_fields} @@ -83,8 +93,7 @@ href="/core/people/{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})" - > + 'no name'} (ID={person_obj?.person_id_random})"> {@html person_obj?.full_name ? person_obj?.full_name @@ -96,9 +105,9 @@ {#if person_obj?.primary_email} - {@html person_obj?.primary_email ?? ae_snip.html__not_set} + class="text-blue-500 underline hover:text-blue-800"> + {@html person_obj?.primary_email ?? + ae_snip.html__not_set} {:else} {@html ae_snip.html__not_set} @@ -106,26 +115,33 @@ {#if show_user_fields} {/if} @@ -161,8 +188,8 @@ diff --git a/src/routes/core/contacts/+page.svelte b/src/routes/core/contacts/+page.svelte index ad830e3f..088ca227 100644 --- a/src/routes/core/contacts/+page.svelte +++ b/src/routes/core/contacts/+page.svelte @@ -1,50 +1,67 @@
-
+
@@ -53,8 +70,7 @@
{/if} -
+
- Search Directory -
-
+ Search Directory +
+
-
@@ -104,53 +127,82 @@ {#if loading}
-
+
+
{:else if filtered_li.length === 0} -
+

No Contacts Found

-

Business and support contacts will appear here.

+

+ Business and support contacts will appear here. +

{:else} -
-

+
+

Directory Results - {filtered_li.length} entries + {filtered_li.length} entries

{#each filtered_li as con (con.contact_id_random)} -
+
- + {con.enable ? 'Active' : 'Disabled'}
-
+
-

{con.name || con.title || '--'}

-

{con.title || 'Support Contact'}

+

+ {con.name || con.title || '--'} +

+

+ {con.title || 'Support Contact'} +

-
- - {con.email || 'No Email'} +
+ + {con.email || 'No Email'}
-
- - {con.phone_office || con.phone_mobile || '--'} +
+ + {con.phone_office || + con.phone_mobile || + '--'}
- + Manage Contact
diff --git a/src/routes/core/contacts/[contact_id]/+page.svelte b/src/routes/core/contacts/[contact_id]/+page.svelte index 7d7564a1..093208b9 100644 --- a/src/routes/core/contacts/[contact_id]/+page.svelte +++ b/src/routes/core/contacts/[contact_id]/+page.svelte @@ -1,56 +1,75 @@
-
+
- +
@@ -58,20 +77,31 @@
-

{contact?.name || contact?.title || 'Loading...'}

-

Contact Detail

+

+ {contact?.name || contact?.title || 'Loading...'} +

+

+ Contact Detail +

- -
@@ -79,54 +109,74 @@ {#if loading}
-
+
+
{:else if contact} {#if is_editing}
- { contact = updated; is_editing = false; }} - onCancel={() => is_editing = false} - /> + onCancel={() => (is_editing = false)} />
{:else}
-
-

+
+

Core Information

-

+

Full Name / Title

-

{contact.name || contact.title || '--'}

+

+ {contact.name || contact.title || '--'} +

-

+

Tagline / Role

-

{contact.tagline || '--'}

+

+ {contact.tagline || '--'} +

-
-

+

+

Email Address

-

{contact.email || '--'}

+

+ {contact.email || '--'} +

-
-

+

+

Website

{#if contact.website_url} - - {contact.website_url} + + {contact.website_url} + {:else}

--

@@ -135,36 +185,52 @@
-
-

+
+

Communication & Social

-

+

Mobile Phone

-

{contact.phone_mobile || contact.phone || '--'}

+

+ {contact.phone_mobile || + contact.phone || + '--'} +

-

+

Office Phone

-

{contact.phone_office || '--'}

+

+ {contact.phone_office || '--'} +

-

+

LinkedIn

-

{contact.linkedin_url || '--'}

+

+ {contact.linkedin_url || '--'} +

-

+

Internal Notes

-
- {contact.notes || 'No internal notes provided for this contact.'} +
+ {contact.notes || + 'No internal notes provided for this contact.'}
@@ -172,40 +238,77 @@
-
-

+
+

Status & Flags

-
- Enabled - +
+ Enabled + {contact.enable ? 'ACTIVE' : 'DISABLED'}
-
- Hidden - +
+ Hidden + {contact.hide ? 'YES' : 'NO'}
-
- Priority - +
+ Priority + {contact.priority ? 'YES' : 'NO'}
-
-

System Audit

+
+

+ System Audit +

-

ID: {contact.contact_id_random}

-

Created: {new Date(contact.created_on).toLocaleString()}

+

+ ID: + {contact.contact_id_random} +

+

+ Created: + {new Date( + contact.created_on + ).toLocaleString()} +

{#if contact.updated_on} -

Updated: {new Date(contact.updated_on).toLocaleString()}

+

+ Updated: + {new Date( + contact.updated_on + ).toLocaleString()} +

{/if}
diff --git a/src/routes/core/contacts/ae_comp__contact_form.svelte b/src/routes/core/contacts/ae_comp__contact_form.svelte index 89401311..b959d704 100644 --- a/src/routes/core/contacts/ae_comp__contact_form.svelte +++ b/src/routes/core/contacts/ae_comp__contact_form.svelte @@ -1,122 +1,144 @@ - -
+ +

{contact ? 'Edit Contact' : 'Create New Contact'}

{#if onCancel} - {/if} -

Name ({$lq_kv__person_obj_li?.length}×)Name ({$lq_kv__person_obj_li?.length}×) Email Affiliations - {@html person_obj?.affiliations ?? ae_snip.html__not_set} + {@html person_obj?.affiliations ?? + ae_snip.html__not_set} {#if person_obj?.user_id_random} {:else} - + Not Linked @@ -133,10 +149,21 @@
- {#if person_obj?.user_super}Super{/if} - {#if person_obj?.user_manager}Manager{/if} - {#if person_obj?.user_administrator}Admin{/if} - {#if !person_obj?.user_id_random}--{/if} + {#if person_obj?.user_super}Super{/if} + {#if person_obj?.user_manager}Manager{/if} + {#if person_obj?.user_administrator}Admin{/if} + {#if !person_obj?.user_id_random}--{/if}
- + @@ -103,8 +135,13 @@ {#each lookups.countries as c (c.alpha_2_code)} - - + + {/each} @@ -113,17 +150,23 @@ -
-

+
+

Country Subdivisions (States/Provinces) - {lookups.subdivisions.length} Records + {lookups.subdivisions.length} Records

-
+

Name ISO Alpha-2
{c.name || c.english_short_name}{c.alpha_2_code}{c.name || c.english_short_name}{c.alpha_2_code}
- + @@ -132,9 +175,14 @@ {#each lookups.subdivisions as s, i (i)} - + - + {/each} @@ -143,27 +191,40 @@ -
-
+
+

Time Zone Reference - {lookups.time_zones.length} Zones + {lookups.time_zones.length} Zones

-
+
Country Name Code
{s.country_alpha_2_code}{s.country_alpha_2_code} {s.name}{s.code}{s.code}
- + @@ -172,7 +233,11 @@ {#each lookups.time_zones as tz (tz.name)} - + {/each} @@ -181,9 +246,13 @@ -
+
-

Lookup data is synchronized with the global system database and used for addresses, event scheduling, and localized displays.

+

+ Lookup data is synchronized with the global system database and + used for addresses, event scheduling, and localized displays. +

{/if}
diff --git a/src/routes/core/people/+page.svelte b/src/routes/core/people/+page.svelte index 77c085a1..b3a7a4fe 100644 --- a/src/routes/core/people/+page.svelte +++ b/src/routes/core/people/+page.svelte @@ -1,26 +1,27 @@
-
+
@@ -29,10 +30,9 @@
{/if} - { - person_id_random_li = results.map(p => p.person_id_random); - $ae_sess.person.show_report__person_li = true; - }} /> + { + person_id_random_li = results.map((p) => p.person_id_random); + $ae_sess.person.show_report__person_li = true; + }} /> {#if $ae_sess.person.show_report__person_li} -
-

+
+

- Search Results - {person_id_random_li.length} found + Search Results + {person_id_random_li.length} found

- /** @type {import('./$types').PageData} */ - // import { page } from '$app/stores'; +/** @type {import('./$types').PageData} */ +// import { page } from '$app/stores'; - // Imports - import { onMount, untrack } from 'svelte'; - import { goto } 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_data_store from '$lib/elements/element_data_store.svelte'; +// Imports +import { onMount, untrack } from 'svelte'; +import { goto } 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_data_store from '$lib/elements/element_data_store.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/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/ae_events_functions'; - import Person_view from './../../person_view.svelte'; - import Person_form from './../ae_comp__person_form.svelte'; - import { load_ae_obj_li__user } from '$lib/ae_core/ae_core__user'; - import { update_ae_obj__person } from '$lib/ae_core/ae_core__person'; - import { qry_ae_obj_li__event } from '$lib/ae_events/ae_events__event'; - import { qry__post } from '$lib/ae_posts/ae_posts__post'; - import { qry__activity_log } from '$lib/ae_core/ae_core__activity_log'; - import { Activity, ArrowLeft, Calendar, Edit, Eye, HelpCircle, History, Link, LoaderCircle, MessageSquare, ShieldCheck, Unlink, User, UserPlus, Users } from '@lucide/svelte'; - interface Props { - data: any; - } +import Person_view from './../../person_view.svelte'; +import Person_form from './../ae_comp__person_form.svelte'; +import { load_ae_obj_li__user } from '$lib/ae_core/ae_core__user'; +import { update_ae_obj__person } from '$lib/ae_core/ae_core__person'; +import { qry_ae_obj_li__event } from '$lib/ae_events/ae_events__event'; +import { qry__post } from '$lib/ae_posts/ae_posts__post'; +import { qry__activity_log } from '$lib/ae_core/ae_core__activity_log'; +import { + Activity, + ArrowLeft, + Calendar, + Edit, + Eye, + HelpCircle, + History, + Link, + LoaderCircle, + MessageSquare, + ShieldCheck, + Unlink, + User, + UserPlus, + Users +} from '@lucide/svelte'; +interface Props { + data: any; +} - let { data }: Props = $props(); +let { data }: Props = $props(); - // Variables - let ae_acct = $derived(data[data.account_id]); +// Variables +let ae_acct = $derived(data[data.account_id]); - $effect(() => { - if (!ae_acct) return; - untrack(() => { - $slct.account_id = data.account_id; - $ae_loc.url_origin = data.url.origin; - $slct.person_id = ae_acct.slct.person_id; - $slct.person_obj = ae_acct.slct.person_obj; - }); +$effect(() => { + if (!ae_acct) return; + untrack(() => { + $slct.account_id = data.account_id; + $ae_loc.url_origin = data.url.origin; + $slct.person_id = ae_acct.slct.person_id; + $slct.person_obj = ae_acct.slct.person_obj; + }); +}); + +let is_editing = $state(false); + +let lq__person_obj = liveQuery(() => db_core.person.get($slct.person_id)); +$slct.lq__person_obj = lq__person_obj; + +let available_users: any[] = $state([]); +let loading_users = $state(false); +let show_link_ui = $state(false); + +let related_events: any[] = $state([]); +let related_posts: any[] = $state([]); +let related_activity_logs: any[] = $state([]); +let loading_activity = $state(false); + +async function load_activity() { + if (!$slct.person_id) return; + loading_activity = true; + + // Load related data using search queries + const [events, posts, logs] = await Promise.all([ + qry_ae_obj_li__event({ + api_cfg: $ae_api, + for_obj_id: $ae_loc.account_id, + qry_person_id: $slct.person_id, + log_lvl: 1 + }), + qry__post({ + api_cfg: $ae_api, + account_id: $ae_loc.account_id, + qry_person_id: $slct.person_id, + log_lvl: 1 + }), + qry__activity_log({ + api_cfg: $ae_api, + account_id: $ae_loc.account_id, + qry_person_id: $slct.person_id, + limit: 10, + log_lvl: 1 + }) + ]); + + related_events = events || []; + related_posts = posts || []; + related_activity_logs = logs || []; + loading_activity = false; +} + +async function load_unlinked_users() { + if (!$ae_loc.manager_access) return; + loading_users = true; + const all_users = await load_ae_obj_li__user({ + api_cfg: $ae_api, + enabled: 'enabled', + log_lvl: 1 + }); + // Filter users that don't have a person_id linked + // NOTE: The backend might return person_id or person_id + available_users = all_users.filter((u) => !u.person_id && !u.person_id); + loading_users = false; +} + +async function handle_link_user(user_id: string) { + if (!confirm('Link this person to this user account?')) return; + + const result = await update_ae_obj__person({ + api_cfg: $ae_api, + person_id: $slct.person_id, + data_kv: { user_id }, + log_lvl: 1 }); - let is_editing = $state(false); - - let lq__person_obj = liveQuery(() => db_core.person.get($slct.person_id)); - $slct.lq__person_obj = lq__person_obj; - - let available_users: any[] = $state([]); - let loading_users = $state(false); - let show_link_ui = $state(false); - - let related_events: any[] = $state([]); - let related_posts: any[] = $state([]); - let related_activity_logs: any[] = $state([]); - let loading_activity = $state(false); - - async function load_activity() { - if (!$slct.person_id) return; - loading_activity = true; - - // Load related data using search queries - const [events, posts, logs] = await Promise.all([ - qry_ae_obj_li__event({ - api_cfg: $ae_api, - for_obj_id: $ae_loc.account_id, - qry_person_id: $slct.person_id, - log_lvl: 1 - }), - qry__post({ - api_cfg: $ae_api, - account_id: $ae_loc.account_id, - qry_person_id: $slct.person_id, - log_lvl: 1 - }), - qry__activity_log({ - api_cfg: $ae_api, - account_id: $ae_loc.account_id, - qry_person_id: $slct.person_id, - limit: 10, - log_lvl: 1 - }) - ]); - - related_events = events || []; - related_posts = posts || []; - related_activity_logs = logs || []; - loading_activity = false; + if (result) { + show_link_ui = false; + available_users = []; } +} - async function load_unlinked_users() { - if (!$ae_loc.manager_access) return; - loading_users = true; - const all_users = await load_ae_obj_li__user({ - api_cfg: $ae_api, - enabled: 'enabled', - log_lvl: 1 - }); - // Filter users that don't have a person_id linked - // NOTE: The backend might return person_id or person_id - available_users = all_users.filter(u => !u.person_id && !u.person_id); - loading_users = false; - } +async function handle_unlink_user() { + if (!confirm('Unlink this person from their user account?')) return; - async function handle_link_user(user_id: string) { - if (!confirm('Link this person to this user account?')) return; - - const result = await update_ae_obj__person({ - api_cfg: $ae_api, - person_id: $slct.person_id, - data_kv: { user_id }, - log_lvl: 1 - }); - - if (result) { - show_link_ui = false; - available_users = []; - } - } - - async function handle_unlink_user() { - if (!confirm('Unlink this person from their user account?')) return; - - const result = await update_ae_obj__person({ - api_cfg: $ae_api, - person_id: $slct.person_id, - data_kv: { user_id: null }, - log_lvl: 1 - }); - } - - onMount(() => { - if (!$ae_loc.manager_access) { - goto('/core'); - return; - } - load_activity(); + const result = await update_ae_obj__person({ + api_cfg: $ae_api, + person_id: $slct.person_id, + data_kv: { user_id: null }, + log_lvl: 1 }); +} - if (!$ae_loc.person) { - $ae_loc.person = {}; +onMount(() => { + if (!$ae_loc.manager_access) { + goto('/core'); + return; } - $ae_loc.person.show_content__person_page_help = false; + load_activity(); +}); - // *** Functions and Logic +if (!$ae_loc.person) { + $ae_loc.person = {}; +} +$ae_loc.person.show_content__person_page_help = false; + +// *** Functions and Logic @@ -169,11 +185,11 @@ -
+

{#if $lq__person_obj?.user_id}
-
+
-

Linked User ID

-

{$lq__person_obj.user_id}

-

Username: {$lq__person_obj.username || '--'}

+

+ Linked User ID +

+

+ {$lq__person_obj.user_id} +

+

+ Username: {$lq__person_obj.username || '--'} +

{:else if show_link_ui}
-

Select a user account to link to this person. Only accounts without a linked person are shown.

+

+ Select a user account to link to this person. Only + accounts without a linked person are shown. +

{#if loading_users} -
+
+
{:else if available_users.length === 0} -

No unlinked user accounts found.

+

+ No unlinked user accounts found. +

{:else} -
+
{#each available_users as user (user.user_id)} {/each} @@ -310,14 +352,17 @@ {:else}
-

This person is not currently linked to a user account.

+

+ This person is not currently linked to a user account. +

{/if}
-
+
Linked Activity & Content
@@ -325,19 +370,29 @@
-

+

Related Events

{#if loading_activity} -
+
+
{:else if related_events.length === 0} -

No related events found.

+

+ No related events found. +

{:else}
@@ -346,21 +401,34 @@
-

+

Related Posts

{#if loading_activity} -
+
+
{:else if related_posts.length === 0} -

No related posts found.

+

+ No related posts found. +

{:else}
{#each related_posts as post (post.post_id)} - - {post.title} -
- {new Date(post.created_on).toLocaleDateString()} - {post.post_comment_count || 0} comments + + {post.title} +
+ {new Date( + post.created_on + ).toLocaleDateString()} + {post.post_comment_count || 0} comments
{/each} @@ -370,27 +438,42 @@
-

+

Recent Activity

{#if loading_activity} -
+
+
{:else if related_activity_logs.length === 0} -

No recent activity logs.

+

+ No recent activity logs. +

{:else}
{#each related_activity_logs as log, index (index)} -
-
- {log.action} - {new Date(log.created_on).toLocaleDateString()} +
+
+ {log.action} + {new Date( + log.created_on + ).toLocaleDateString()}
{#if log.summary} - {log.summary} + {log.summary} {/if}
{/each} - + View All Activity
@@ -412,11 +495,9 @@ onSave={(updated) => { is_editing = false; }} - onCancel={() => is_editing = false} - /> + onCancel={() => (is_editing = false)} />
{:else} {/if} - diff --git a/src/routes/core/people/[person_id]/+page.ts b/src/routes/core/people/[person_id]/+page.ts index e3cb84de..234a7517 100644 --- a/src/routes/core/people/[person_id]/+page.ts +++ b/src/routes/core/people/[person_id]/+page.ts @@ -18,7 +18,7 @@ export async function load({ params, parent }) { // We specifically clone 'slct' because we will be mutating it below. const ae_acct = { ...data[account_id] }; ae_acct.slct = { ...ae_acct.slct }; - + // console.log(`ae_acct = `, ae_acct); const person_id = params.person_id; @@ -36,7 +36,7 @@ export async function load({ params, parent }) { if (browser) { // OPTIMIZATION: Fire the refresh in the background. - // The Person View UI uses LiveQuery/Dexie and will update + // The Person View UI uses LiveQuery/Dexie and will update // automatically once this background task finishes. core_func.load_ae_obj_id__person({ api_cfg: ae_acct.api, diff --git a/src/routes/core/people/ae_comp__person_form.svelte b/src/routes/core/people/ae_comp__person_form.svelte index be20b284..3776840e 100644 --- a/src/routes/core/people/ae_comp__person_form.svelte +++ b/src/routes/core/people/ae_comp__person_form.svelte @@ -1,147 +1,167 @@ - -
+ +

{person ? 'Edit Person' : 'Create New Person'}

{#if onCancel} - {/if} - {#if $ae_loc.trusted_access} - {$lq__person_obj?.priority ? 'Priority' : 'Not Priority'} + {$lq__person_obj?.priority + ? 'Priority' + : 'Not Priority'} {/if} @@ -332,7 +437,9 @@ + placeholder="Enter data_json here">
@@ -393,8 +499,7 @@ // console.log(update_result); // return update_result; }); - }} - > + }}> {#await ae_promises.update__person_obj} {:then} diff --git a/src/routes/core/sites/+page.svelte b/src/routes/core/sites/+page.svelte index 68b66467..9635fae3 100644 --- a/src/routes/core/sites/+page.svelte +++ b/src/routes/core/sites/+page.svelte @@ -1,99 +1,127 @@
-
+

Site Management

-

Digital Properties & Domains

+

+ Digital Properties & Domains +

-
-
+
- Search Sites -
-
+ Search Sites +
+
-
@@ -101,8 +129,13 @@
- Status - @@ -110,8 +143,13 @@
- Visibility - @@ -123,56 +161,88 @@ {#if loading}
-
+
+
{:else if filtered_li.length === 0} -
+

No Sites Found

-

Sites for this account will appear here. Add your first site to get started.

+

+ Sites for this account will appear here. Add your first site to + get started. +

{:else} -
-

+
+

Linked Properties - {filtered_li.length} found + {filtered_li.length} found

{#each filtered_li as site (site.site_id_random)} -
+
{#if site.hide} - Hidden + Hidden {/if} - + {site.enable ? 'Active' : 'Disabled'}
-
+
-

{site.name}

-

Code: {site.code || '--'}

+

+ {site.name} +

+

+ Code: {site.code || '--'} +

-
- - Created: {new Date(site.created_on).toLocaleDateString()} +
+ + Created: {new Date( + site.created_on + ).toLocaleDateString()}
-
- - {site.site_id_random} +
+ + {site.site_id_random}
- + Manage Site
diff --git a/src/routes/core/sites/[site_id]/+page.svelte b/src/routes/core/sites/[site_id]/+page.svelte index 13e88be3..a12a0a34 100644 --- a/src/routes/core/sites/[site_id]/+page.svelte +++ b/src/routes/core/sites/[site_id]/+page.svelte @@ -1,125 +1,145 @@
-
+
- +
-

{site?.name ?? 'Loading...'}

+

+ {site?.name ?? 'Loading...'} +

-
{#if domain_li.length === 0} -

No domains configured.

+

+ No domains configured. +

{:else}
{#each domain_li as dom (dom.site_domain_id_random)} -
+
- + {dom.fqdn} - + - - Key: {dom.access_key || '--'} • {dom.enable ? 'Active' : 'Disabled'} + + Key: {dom.access_key || '--'} + • {dom.enable + ? 'Active' + : 'Disabled'}
- -
@@ -234,18 +321,32 @@ {/if}
-
-

+
+

System Status

-
diff --git a/src/routes/core/users/+page.svelte b/src/routes/core/users/+page.svelte index 97902e96..981d5b2e 100644 --- a/src/routes/core/users/+page.svelte +++ b/src/routes/core/users/+page.svelte @@ -1,75 +1,94 @@
-
+

User Management

-
-
+
- Search Users -
-
+ Search Users +
+
e.key === 'Enter' && load_users()} - /> -
@@ -105,8 +132,13 @@
- Scope - @@ -114,8 +146,13 @@
- Status - @@ -127,47 +164,67 @@ {#if loading}
-
+
+
{:else if user_li.length === 0} -
+

No Users Found

-

Try adjusting your search or scope filters.

+

+ Try adjusting your search or scope filters. +

{:else} -
-

+
+

Directory Results - {user_li.length} found + {user_li.length} found

{#each user_li as user (user.user_id_random)} -
+
-
+
-

{user.username}

-

{user.name || 'No Display Name'}

+

+ {user.username} +

+

+ {user.name || 'No Display Name'} +

{#if user.super} - Super + Super {:else if user.manager} - Manager + Manager {/if} {#if !user.account_id && !user.account_id_random} - + Global {:else} - + Account {/if} @@ -175,17 +232,25 @@
-
+
- {user.email || '--'} + {user.email || '--'}
-
- - {user.user_id_random} +
+ + {user.user_id_random}
- + Manage User
diff --git a/src/routes/core/users/[user_id]/+page.svelte b/src/routes/core/users/[user_id]/+page.svelte index 0d0e9759..6c9fdb69 100644 --- a/src/routes/core/users/[user_id]/+page.svelte +++ b/src/routes/core/users/[user_id]/+page.svelte @@ -1,87 +1,120 @@
-
+
- +
-
+
-

{user.username}

-

UID: {user.user_id_random}

+

+ {user.username} +

+

+ UID: {user.user_id_random} +

- - @@ -346,8 +351,7 @@ window.parent.postMessage({ scroll_to: scroll_y }, '*'); }} - title="Scroll to bottom" - > + title="Scroll to bottom">

Zone Name Offset (Hours)
{tz.name}{tz.offset_seconds / 3600}h{tz.offset_seconds / 3600}h