chore: aggressive cleanup: remove legacy element_data_store.svelte (v1) after v3 migration
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Aether UI — Design System Style Guidelines
|
# Aether UI — Design System Style Guidelines
|
||||||
> **Version:** 1.0 (2026-03-06)
|
> **Version:** 1.1 (2026-03-17)
|
||||||
> **Author:** One Sky IT / Scott Idem
|
> **Author:** One Sky IT / Scott Idem
|
||||||
> **Scope:** All Aether SvelteKit frontend components
|
> **Scope:** All Aether SvelteKit frontend components
|
||||||
> **Related:** `AE__UI_Component_Patterns.md`, `ae-firefly.css`, `documentation/AE__Components.md`
|
> **Related:** `AE__UI_Component_Patterns.md`, `ae-firefly.css`, `documentation/AE__Components.md`
|
||||||
@@ -21,7 +21,28 @@ Core principles:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2. The AE_Firefly Theme
|
## 2. Technical Stack Mandates (2026 Standard)
|
||||||
|
|
||||||
|
To maintain codebase health and performance, all new development must adhere to the following stack:
|
||||||
|
|
||||||
|
### 🚀 Svelte 5 Runes
|
||||||
|
- **Mandatory**: Use `$state`, `$derived`, and `$effect`.
|
||||||
|
- **Snippet pattern**: Use `{@render snippet()}` for reusable UI blocks within components.
|
||||||
|
- **Avoid**: Legacy `export let` (use `$props()`), `onMount` for reactive derived state (use `$derived` or `$effect`), and `$$slots` (use Snippets).
|
||||||
|
|
||||||
|
### 🎨 Tailwind 4 + Skeleton v4
|
||||||
|
- **Mandatory**: Use `preset-*` classes for interactive elements (e.g., `preset-tonal-primary`).
|
||||||
|
- **Forbidden**: Legacy Skeleton v3 `variant-*` classes.
|
||||||
|
- **Customization**: Use Tailwind 4 `@theme` blocks for project-wide overrides.
|
||||||
|
|
||||||
|
### 🔣 Lucide Icons
|
||||||
|
- **Mandatory**: Use `@lucide/svelte` components (e.g., `<Calendar size="1em" />`).
|
||||||
|
- **Migration**: Replaced all FontAwesome `fas fa-*` icons in general modules.
|
||||||
|
- **🚨 Exception: IDAA Module**: The IDAA module **must** retain FontAwesome and Bootstrap classes. It integrates with Novi CMS which relies on these legacy standards. **Do not migrate IDAA icons.**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. The AE_Firefly Theme
|
||||||
|
|
||||||
**App default since 2026-03-06.** Set in `ae_stores.ts` as `theme_name = 'AE_Firefly'`.
|
**App default since 2026-03-06.** Set in `ae_stores.ts` as `theme_name = 'AE_Firefly'`.
|
||||||
File: `src/ae-firefly.css` | Activated by: `data-theme="AE_Firefly"`
|
File: `src/ae-firefly.css` | Activated by: `data-theme="AE_Firefly"`
|
||||||
@@ -43,7 +64,7 @@ File: `src/ae-firefly.css` | Activated by: `data-theme="AE_Firefly"`
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. Color Token Rules
|
## 4. Color Token Rules
|
||||||
|
|
||||||
### ✅ Always Use Theme Tokens
|
### ✅ Always Use Theme Tokens
|
||||||
|
|
||||||
@@ -109,20 +130,13 @@ bg-error-100 border border-error-300 ← inline error banners
|
|||||||
| `bg-white dark:bg-gray-800` | Manual light/dark pair | Let theme tokens handle it — remove entirely |
|
| `bg-white dark:bg-gray-800` | Manual light/dark pair | Let theme tokens handle it — remove entirely |
|
||||||
| `text-gray-600 dark:text-gray-400` | Manual light/dark pair | `opacity-60` |
|
| `text-gray-600 dark:text-gray-400` | Manual light/dark pair | `opacity-60` |
|
||||||
| `rounded-container-token` | Skeleton v3 class | `rounded-xl` |
|
| `rounded-container-token` | Skeleton v3 class | `rounded-xl` |
|
||||||
| | | |
|
| `variant-*` (v3) | Skeleton v3 class | `preset-*` (v4) |
|
||||||
| `preset-filled-surface-300-700` | v3 dual-shade notation | `bg-surface-200-800` or `bg-surface-100-900` |
|
| `preset-filled-surface-300-700` | v3 dual-shade notation | `bg-surface-200-800` or `bg-surface-100-900` |
|
||||||
| `preset-filled-surface-400-600` | v3 dual-shade notation | `bg-surface-100-900` |
|
| `preset-filled-surface-400-600` | v3 dual-shade notation | `bg-surface-100-900` |
|
||||||
| `overflow-x-scroll` | Forces scrollbar visible | `overflow-x-auto` |
|
| `overflow-x-scroll` | Forces scrollbar visible | `overflow-x-auto` |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## 4. Skeleton v3 → v4 Migration Reference
|
|
||||||
|
|
||||||
All Skeleton v3 `variant-*` classes are now fully removed from the codebase. Use only `preset-*` classes for all buttons and interactive elements.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 5. Transitions & Animation
|
## 5. Transitions & Animation
|
||||||
|
|
||||||
All interactive state changes must be smoothed — no hard pops.
|
All interactive state changes must be smoothed — no hard pops.
|
||||||
@@ -170,7 +184,7 @@ Always wrap in `{#if $lq__obj}{...}{:else}...skeleton...{/if}` — **never** sho
|
|||||||
|
|
||||||
| Requirement | Implementation |
|
| Requirement | Implementation |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Decorative icons | `aria-hidden="true"` on all `<span class="fas ...">` |
|
| Decorative icons | `aria-hidden="true"` on all icons |
|
||||||
| Icon-only buttons | `aria-label="..."` or `title="..."` + visible context |
|
| Icon-only buttons | `aria-label="..."` or `title="..."` + visible context |
|
||||||
| Async content regions | `role="status" aria-live="polite"` on loading/empty sections |
|
| Async content regions | `role="status" aria-live="polite"` on loading/empty sections |
|
||||||
| Focus indicators | `focus-visible:ring-2 focus-visible:ring-primary-500` on custom interactive elements |
|
| Focus indicators | `focus-visible:ring-2 focus-visible:ring-primary-500` on custom interactive elements |
|
||||||
|
|||||||
@@ -1,430 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { browser } from '$app/environment';
|
|
||||||
import { onMount, untrack } from 'svelte';
|
|
||||||
import { Modal } from 'flowbite-svelte';
|
|
||||||
import { liveQuery } from 'dexie';
|
|
||||||
|
|
||||||
import { api } from '$lib/api/api';
|
|
||||||
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
|
|
||||||
import { db_core } from '$lib/ae_core/db_core';
|
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
|
||||||
import type { key_val } from '$lib/stores/ae_stores';
|
|
||||||
import type { ae_DataStore } from '$lib/types/ae_types';
|
|
||||||
import { LoaderCircle, Pencil, Save, Trash2 } from '@lucide/svelte';
|
|
||||||
interface Props {
|
|
||||||
log_lvl?: number;
|
|
||||||
expire_minutes?: number;
|
|
||||||
mount_reload_sec?: number;
|
|
||||||
ds_code: string;
|
|
||||||
ds_name?: null | string;
|
|
||||||
ds_type?: string;
|
|
||||||
for_type?: null | string;
|
|
||||||
for_id?: null | string;
|
|
||||||
class_li?: string;
|
|
||||||
display?: string;
|
|
||||||
try_cache?: boolean;
|
|
||||||
hide?: boolean;
|
|
||||||
show_edit?: boolean;
|
|
||||||
show_edit_btn?: boolean;
|
|
||||||
show_view?: boolean;
|
|
||||||
ds_loaded?: boolean;
|
|
||||||
debug?: boolean;
|
|
||||||
ds_loading_status?: string;
|
|
||||||
val_sql?: null | any;
|
|
||||||
}
|
|
||||||
|
|
||||||
let {
|
|
||||||
log_lvl = 0,
|
|
||||||
expire_minutes = 15,
|
|
||||||
mount_reload_sec = 0,
|
|
||||||
ds_code,
|
|
||||||
ds_name = null,
|
|
||||||
ds_type = 'text',
|
|
||||||
for_type = null,
|
|
||||||
for_id = null,
|
|
||||||
class_li = '',
|
|
||||||
display = undefined as string | undefined,
|
|
||||||
try_cache = true,
|
|
||||||
hide = false,
|
|
||||||
show_edit = $bindable(false),
|
|
||||||
show_edit_btn = false,
|
|
||||||
show_view = $bindable(true),
|
|
||||||
ds_loaded = $bindable(false),
|
|
||||||
debug = false,
|
|
||||||
ds_loading_status = $bindable('starting'),
|
|
||||||
val_sql = $bindable(null)
|
|
||||||
}: Props = $props();
|
|
||||||
|
|
||||||
// Local reactive state
|
|
||||||
let trigger: null | string = $state(null);
|
|
||||||
let ds_submit_results: Promise<any> | key_val | undefined = $state();
|
|
||||||
|
|
||||||
// Dexie LiveQuery for data store
|
|
||||||
// This derived observable will automatically update when dependencies change
|
|
||||||
let lq__ds_obj = $derived(
|
|
||||||
liveQuery(async () => {
|
|
||||||
const current_code = ds_code;
|
|
||||||
const account_id = $ae_loc.account_id;
|
|
||||||
const current_for_type = for_type;
|
|
||||||
const current_for_id = for_id;
|
|
||||||
|
|
||||||
if (!current_code) return null;
|
|
||||||
|
|
||||||
if (log_lvl) console.log(`ae_e_data_store [${current_code}]: LQ Lookup...`, { account_id, current_for_type, current_for_id });
|
|
||||||
|
|
||||||
// Hierarchical Local Lookup (Specific -> Account -> Global)
|
|
||||||
// Mimics backend SQL priority: WHERE code = :code ORDER BY for_id DESC, account_id DESC
|
|
||||||
if (log_lvl) console.log(`ae_e_data_store [${current_code}]: Fetching all matching codes for priority sorting...`);
|
|
||||||
|
|
||||||
const results = await db_core.data_store
|
|
||||||
.where('code')
|
|
||||||
.equals(current_code)
|
|
||||||
.toArray();
|
|
||||||
|
|
||||||
if (!results || results.length === 0) return null;
|
|
||||||
|
|
||||||
// Sort by specificity
|
|
||||||
results.sort((a, b) => {
|
|
||||||
// 1. Priority: Specific Context match (for_type + for_id)
|
|
||||||
const a_context = (current_for_id && a.for_id === current_for_id && a.for_type === current_for_type) ? 1 : 0;
|
|
||||||
const b_context = (current_for_id && b.for_id === current_for_id && b.for_type === current_for_type) ? 1 : 0;
|
|
||||||
if (a_context !== b_context) return b_context - a_context;
|
|
||||||
|
|
||||||
// 2. Priority: Account-specific match
|
|
||||||
const a_account = (account_id && a.account_id === account_id) ? 1 : 0;
|
|
||||||
const b_account = (account_id && b.account_id === account_id) ? 1 : 0;
|
|
||||||
if (a_account !== b_account) return b_account - a_account;
|
|
||||||
|
|
||||||
// 3. Tie-breaker: Newest updated
|
|
||||||
const a_time = new Date(a.updated_on || a.created_on || 0).getTime();
|
|
||||||
const b_time = new Date(b.updated_on || b.created_on || 0).getTime();
|
|
||||||
return b_time - a_time;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (log_lvl) console.log(`ae_e_data_store [${current_code}]: Best match found (ID: ${results[0].id}, Account: ${results[0].account_id})`);
|
|
||||||
return results[0];
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// Sync status and bound props when the live data changes
|
|
||||||
$effect(() => {
|
|
||||||
const entry = $lq__ds_obj as ae_DataStore | null;
|
|
||||||
|
|
||||||
untrack(() => {
|
|
||||||
ds_loaded = !!entry;
|
|
||||||
if (entry) {
|
|
||||||
ds_loading_status = 'loaded';
|
|
||||||
// Handle val_sql binding if type is sql
|
|
||||||
if (ds_type === 'sql') {
|
|
||||||
val_sql = entry.text || entry.html || null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Initial Trigger & Context Change Guard
|
|
||||||
$effect(() => {
|
|
||||||
const account_id = $slct.account_id;
|
|
||||||
const api_ready = !!$ae_api?.base_url;
|
|
||||||
const entry = $lq__ds_obj;
|
|
||||||
|
|
||||||
if (browser && api_ready && !entry && ds_loading_status === 'starting') {
|
|
||||||
trigger = 'load__ds__code';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Fetch handler
|
|
||||||
$effect(() => {
|
|
||||||
if (trigger === 'load__ds__code') {
|
|
||||||
untrack(() => {
|
|
||||||
trigger = null;
|
|
||||||
load_data_store();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Mount reload logic
|
|
||||||
onMount(() => {
|
|
||||||
if (mount_reload_sec > 0) {
|
|
||||||
const random_ms = Math.floor(Math.random() * mount_reload_sec * 1000);
|
|
||||||
setTimeout(() => { trigger = 'load__ds__code'; }, random_ms);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
async function load_data_store() {
|
|
||||||
if (ds_loading_status === 'loading') return;
|
|
||||||
ds_loading_status = 'loading';
|
|
||||||
const api_cfg = untrack(() => $ae_api);
|
|
||||||
|
|
||||||
if (log_lvl) console.log(`ae_e_data_store [${ds_code}]: Fetching...`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Attempt 1: Context-specific fetch
|
|
||||||
let ds_results = await api.get_data_store_v3({
|
|
||||||
api_cfg,
|
|
||||||
code: ds_code,
|
|
||||||
for_type: for_type,
|
|
||||||
for_id: for_id,
|
|
||||||
log_lvl: log_lvl
|
|
||||||
});
|
|
||||||
|
|
||||||
// V3 API structured check
|
|
||||||
const is_error = ds_results?.meta?.success === false;
|
|
||||||
const status_code = ds_results?.meta?.status_code || (ds_results === false ? 500 : 200);
|
|
||||||
|
|
||||||
// Fallback to Global if not found (404), unauthorized (403/401), or explicitly failed
|
|
||||||
if (!ds_results || is_error || status_code === 404 || status_code === 403 || status_code === 401) {
|
|
||||||
if (log_lvl) console.log(`ae_e_data_store [${ds_code}]: Not found in context (Status ${status_code}). Trying global fallback.`);
|
|
||||||
|
|
||||||
ds_results = await api.get_data_store_v3({
|
|
||||||
api_cfg,
|
|
||||||
code: ds_code,
|
|
||||||
no_account_id: true,
|
|
||||||
log_lvl: log_lvl
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const ds_id = ds_results?.data_store_id || ds_results?.id;
|
|
||||||
|
|
||||||
if (ds_results && ds_id) {
|
|
||||||
// Map fields correctly for V3 alignment
|
|
||||||
const text_val = ds_results.text || '';
|
|
||||||
const json_val = ds_results.json || (ds_results.json_str ? JSON.parse(ds_results.json_str) : null);
|
|
||||||
|
|
||||||
// Save to Dexie
|
|
||||||
const ds_to_save: ae_DataStore = {
|
|
||||||
...ds_results,
|
|
||||||
id: ds_id,
|
|
||||||
data_store_id: ds_results.data_store_id || ds_id,
|
|
||||||
// data_store_id: ds_id,
|
|
||||||
account_id: ds_results.account_id || ds_results.account_id,
|
|
||||||
// account_id: ds_results.account_id || ds_results.account_id,
|
|
||||||
updated_on: ds_results.updated_on || new Date().toISOString(),
|
|
||||||
text: text_val,
|
|
||||||
html: text_val, // Default map text to html
|
|
||||||
json: json_val
|
|
||||||
};
|
|
||||||
|
|
||||||
await db_core.data_store.put(ds_to_save);
|
|
||||||
if (log_lvl) console.log(`ae_e_data_store [${ds_code}]: Saved to Dexie. ID: ${ds_id}`);
|
|
||||||
} else {
|
|
||||||
ds_loading_status = 'not found';
|
|
||||||
if (log_lvl) console.warn(`ae_e_data_store [${ds_code}]: Result had no valid ID.`);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`ae_e_data_store [${ds_code}]: Fetch failed.`, err);
|
|
||||||
ds_loading_status = 'error';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handle_submit_form(event: Event) {
|
|
||||||
const target = event.target as HTMLFormElement;
|
|
||||||
$ae_sess.ds.submit_status = 'processing';
|
|
||||||
|
|
||||||
const form_data = new FormData(target);
|
|
||||||
const data_store_di = ae_util.extract_prefixed_form_data({
|
|
||||||
prefix: null,
|
|
||||||
form_data,
|
|
||||||
trim_values: true,
|
|
||||||
bool_tf_str: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const data_store_do: key_val = {
|
|
||||||
code: data_store_di.ds_code ?? ds_code,
|
|
||||||
name: data_store_di.ds_name ?? ds_name,
|
|
||||||
type: data_store_di.ds_type ?? ds_type,
|
|
||||||
for_type: data_store_di.ds_for_type ?? null,
|
|
||||||
for_id: data_store_di.ds_for_id ?? null,
|
|
||||||
access_read: data_store_di.ds_access_read,
|
|
||||||
access_write: data_store_di.ds_access_write,
|
|
||||||
access_delete: data_store_di.ds_access_delete,
|
|
||||||
enable: data_store_di.ds_enable ?? true,
|
|
||||||
account_id: data_store_di.ds_use_account_id ? (data_store_di.ds_account_id ?? $slct.account_id) : null
|
|
||||||
};
|
|
||||||
|
|
||||||
const content_val = data_store_di.ds_value;
|
|
||||||
if (data_store_do.type === 'json') {
|
|
||||||
data_store_do.json = content_val;
|
|
||||||
try {
|
|
||||||
// Ensure it's valid JSON if stringified
|
|
||||||
if (typeof content_val === 'string') JSON.parse(content_val);
|
|
||||||
} catch (e) {
|
|
||||||
console.error("Invalid JSON content");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
data_store_do.text = content_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
const api_cfg = untrack(() => $ae_api);
|
|
||||||
|
|
||||||
if ($lq__ds_obj?.id) {
|
|
||||||
ds_submit_results = api.update_ae_obj_v3({
|
|
||||||
api_cfg,
|
|
||||||
obj_type: 'data_store',
|
|
||||||
obj_id: $lq__ds_obj.id,
|
|
||||||
fields: data_store_do
|
|
||||||
}).then((res) => {
|
|
||||||
if (res) {
|
|
||||||
$ae_sess.ds.submit_status = 'updated';
|
|
||||||
trigger = 'load__ds__code';
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ds_submit_results = api.create_ae_obj_v3({
|
|
||||||
api_cfg,
|
|
||||||
obj_type: 'data_store',
|
|
||||||
fields: data_store_do
|
|
||||||
}).then((res) => {
|
|
||||||
if (res) {
|
|
||||||
$ae_sess.ds.submit_status = 'created';
|
|
||||||
trigger = 'load__ds__code';
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handle_delete() {
|
|
||||||
if (!$lq__ds_obj?.id || !confirm('Are you sure you want to delete this data store?')) return;
|
|
||||||
|
|
||||||
const api_cfg = untrack(() => $ae_api);
|
|
||||||
const res = await api.delete_ae_obj_v3({
|
|
||||||
api_cfg,
|
|
||||||
obj_type: 'data_store',
|
|
||||||
obj_id: $lq__ds_obj.id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res) {
|
|
||||||
await db_core.data_store.delete($lq__ds_obj.id);
|
|
||||||
ds_loading_status = 'not found';
|
|
||||||
show_edit = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="ae__elem__data_store relative {class_li}" class:hidden={hide} style={display ? `display: ${display}` : undefined}>
|
|
||||||
|
|
||||||
{#if $lq__ds_obj}
|
|
||||||
{#if debug || $ae_loc.debug === 'debug'}
|
|
||||||
Debug is ON!
|
|
||||||
<pre class="text-[10px] bg-black/10 p-2 rounded mb-2 overflow-x-auto">
|
|
||||||
ID: {$lq__ds_obj.id}
|
|
||||||
Code: {$lq__ds_obj.code}
|
|
||||||
Name: {$lq__ds_obj.name}
|
|
||||||
Type: {$lq__ds_obj.type}
|
|
||||||
Account: {$lq__ds_obj.account_id || 'Global / NULL'}
|
|
||||||
Created: {$lq__ds_obj.created_on}
|
|
||||||
Updated: {$lq__ds_obj.updated_on}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<Modal
|
|
||||||
title="{$lq__ds_obj.name || 'Unnamed'} - {$lq__ds_obj.code}"
|
|
||||||
bind:open={show_edit}
|
|
||||||
autoclose={false}
|
|
||||||
size="xl"
|
|
||||||
class="w-full max-w-6xl"
|
|
||||||
>
|
|
||||||
<form class="flex flex-col gap-4" onsubmit={(e) => { e.preventDefault(); handle_submit_form(e); }}>
|
|
||||||
<input type="hidden" name="ds_id_random" value={$lq__ds_obj.id} />
|
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
||||||
<div class="space-y-2">
|
|
||||||
<label class="label">
|
|
||||||
<span class="text-xs font-bold opacity-70">Code</span>
|
|
||||||
<input type="text" name="ds_code" class="input font-mono" value={$lq__ds_obj.code} readonly={!$ae_loc.manager_access} required />
|
|
||||||
</label>
|
|
||||||
<label class="label">
|
|
||||||
<span class="text-xs font-bold opacity-70">Name</span>
|
|
||||||
<input type="text" name="ds_name" class="input" value={$lq__ds_obj.name} required />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="space-y-2">
|
|
||||||
<label class="label">
|
|
||||||
<span class="text-xs font-bold opacity-70">Type</span>
|
|
||||||
<select name="ds_type" class="select" value={$lq__ds_obj.type}>
|
|
||||||
<option value="text">Text</option>
|
|
||||||
<option value="html">HTML</option>
|
|
||||||
<option value="json">JSON</option>
|
|
||||||
<option value="md">Markdown</option>
|
|
||||||
<option value="sql">SQL</option>
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
<div class="flex items-center gap-2 pt-6">
|
|
||||||
<input type="checkbox" name="ds_use_account_id" class="checkbox" checked={!!$lq__ds_obj.account_id} />
|
|
||||||
<span class="text-xs">Account Specific</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="space-y-2">
|
|
||||||
<span class="text-xs font-bold opacity-70">Content</span>
|
|
||||||
<textarea
|
|
||||||
name="ds_value"
|
|
||||||
class="textarea font-mono text-sm"
|
|
||||||
rows="15"
|
|
||||||
placeholder="Enter content here..."
|
|
||||||
>{$lq__ds_obj.type === 'json' ? (typeof $lq__ds_obj.json === 'string' ? $lq__ds_obj.json : JSON.stringify($lq__ds_obj.json, null, 2)) : ($lq__ds_obj.text || $lq__ds_obj.html || '')}</textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="text-xs text-surface-500">
|
|
||||||
Created on: {$lq__ds_obj.created_on} | Last Updated: {$lq__ds_obj.updated_on}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="flex justify-between items-center pt-4">
|
|
||||||
<button type="button" class="btn variant-filled-error" onclick={handle_delete}>
|
|
||||||
<Trash2 size="1em" class="mr-2" /> Delete
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div class="flex gap-2">
|
|
||||||
<button type="button" class="btn variant-soft" onclick={() => show_edit = false}>Cancel</button>
|
|
||||||
<button type="submit" class="btn variant-filled-primary">
|
|
||||||
<Save size="1em" class="mr-2" /> Save
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
{#if show_view}
|
|
||||||
{#if $lq__ds_obj.type === 'html' && $lq__ds_obj.html}
|
|
||||||
{@html $lq__ds_obj.html}
|
|
||||||
{:else if $lq__ds_obj.type === 'text' && $lq__ds_obj.text}
|
|
||||||
<div class="whitespace-pre-wrap">{$lq__ds_obj.text}</div>
|
|
||||||
{:else if $lq__ds_obj.type === 'sql' && $lq__ds_obj.text}
|
|
||||||
{#if debug}<div class="font-mono text-xs opacity-50">SQL: {$lq__ds_obj.text}</div>{/if}
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if $ae_loc.edit_mode && ($ae_loc.manager_access || (show_edit_btn && $ae_loc.administrator_access))}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="absolute top-0 right-0 btn btn-sm variant-soft-warning opacity-20 hover:opacity-100 z-10"
|
|
||||||
ondblclick={() => { show_edit = true; show_view = false; }}
|
|
||||||
title="Edit Data Store: {ds_code}"
|
|
||||||
>
|
|
||||||
<Pencil size="1em" />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
{:else if ds_loading_status === 'not found'}
|
|
||||||
<!-- Only show diagnostic to administrator+ (no edit_mode needed) or trusted staff in edit mode.
|
|
||||||
Anonymous/user/public visitors must never see internal data store codes or gaps. -->
|
|
||||||
{#if $ae_loc.administrator_access || ($ae_loc.trusted_access && $ae_loc.edit_mode)}
|
|
||||||
<div class="p-2 border border-dashed border-surface-500/30 rounded text-xs opacity-50">
|
|
||||||
Data Store not found: {ds_code}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if ds_loading_status === 'loading'}
|
|
||||||
<div class="absolute bottom-0 left-0 p-1 opacity-50">
|
|
||||||
<LoaderCircle size="1em" class="text-xs animate-spin" />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
// import { api } from '$lib/api';
|
// import { api } from '$lib/api';
|
||||||
// import Element_data_store from '$lib/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/element_data_store.svelte';
|
||||||
|
|
||||||
// import { core_func } from '$lib/ae_core_functions';
|
// import { core_func } from '$lib/ae_core_functions';
|
||||||
import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/stores/ae_stores';
|
import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/stores/ae_stores';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
// import { api } from '$lib/api';
|
// import { api } from '$lib/api';
|
||||||
// import Element_data_store from '$lib/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/element_data_store.svelte';
|
||||||
import Element_manage_hosted_file_li from '$lib/elements/element_manage_hosted_file_li.svelte';
|
import Element_manage_hosted_file_li from '$lib/elements/element_manage_hosted_file_li.svelte';
|
||||||
|
|
||||||
// import { core_func } from '$lib/ae_core_functions';
|
// import { core_func } from '$lib/ae_core_functions';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
// import { PUBLIC_TESTING } from '$env/static/public';
|
// import { PUBLIC_TESTING } from '$env/static/public';
|
||||||
// console.log(`AE Config - +page.svelte PUBLIC_TESTING:`, PUBLIC_TESTING);
|
// console.log(`AE Config - +page.svelte PUBLIC_TESTING:`, PUBLIC_TESTING);
|
||||||
|
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
// import { api } from '$lib/api';
|
// import { api } from '$lib/api';
|
||||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/stores/ae_stores';
|
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/stores/ae_stores';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
// import { api } from '$lib/api';
|
// import { api } from '$lib/api';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
import { liveQuery } from 'dexie';
|
import { liveQuery } from 'dexie';
|
||||||
// import { core_func } from '$lib/ae_core_functions';
|
// import { core_func } from '$lib/ae_core_functions';
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
// *** Import Aether specific variables and functions
|
// *** Import Aether specific variables and functions
|
||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
|
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import {
|
import {
|
||||||
events_loc,
|
events_loc,
|
||||||
events_sess,
|
events_sess,
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
// import Element_data_store from '$lib/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/element_data_store.svelte';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ae_snip,
|
ae_snip,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Comp__events_menu_nav from '../../ae_comp__events_menu_nav.svelte';
|
import Comp__events_menu_nav from '../../ae_comp__events_menu_nav.svelte';
|
||||||
import Comp__pres_mgmt_menu_opts from '../../ae_comp__events_menu_opts.svelte';
|
import Comp__pres_mgmt_menu_opts from '../../ae_comp__events_menu_opts.svelte';
|
||||||
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
|
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
|
||||||
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import Element_ae_obj_field_editor_v3 from '$lib/elements/element_ae_obj_field_editor_v3.svelte';
|
import Element_ae_obj_field_editor_v3 from '$lib/elements/element_ae_obj_field_editor_v3.svelte';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
let ae_promises: key_val = $state({});
|
let ae_promises: key_val = $state({});
|
||||||
// let ae_tmp: key_val = {};
|
// let ae_tmp: key_val = {};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
let ae_promises: key_val = {};
|
let ae_promises: key_val = {};
|
||||||
let ae_tmp: key_val = {};
|
let ae_tmp: key_val = {};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
events_slct
|
events_slct
|
||||||
} from '$lib/stores/ae_events_stores';
|
} from '$lib/stores/ae_events_stores';
|
||||||
|
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Comp__events_menu_nav from '../../../ae_comp__events_menu_nav.svelte';
|
import Comp__events_menu_nav from '../../../ae_comp__events_menu_nav.svelte';
|
||||||
|
|
||||||
let show_modal = $state(false);
|
let show_modal = $state(false);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
// Imports (external and then internal)
|
// Imports (external and then internal)
|
||||||
// import type { key_val } from '$lib/stores/ae_stores';
|
// import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
import { liveQuery } from 'dexie';
|
import { liveQuery } from 'dexie';
|
||||||
import { Modal } from 'flowbite-svelte';
|
import { Modal } from 'flowbite-svelte';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ae_loc,
|
ae_loc,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
|
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
|
||||||
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
import Element_ae_obj_field_editor_v3 from '$lib/elements/element_ae_obj_field_editor_v3.svelte';
|
import Element_ae_obj_field_editor_v3 from '$lib/elements/element_ae_obj_field_editor_v3.svelte';
|
||||||
// import Element_data_store from '$lib/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/element_data_store.svelte';
|
||||||
import MyClipboard from '$lib/app_components/e_app_clipboard.svelte';
|
import MyClipboard from '$lib/app_components/e_app_clipboard.svelte';
|
||||||
|
|
||||||
import { core_func } from '$lib/ae_core/ae_core_functions';
|
import { core_func } from '$lib/ae_core/ae_core_functions';
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
import type { key_val } from '$lib/stores/ae_stores';
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
// import Element_data_store from '$lib/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/element_data_store.svelte';
|
||||||
|
|
||||||
import { core_func } from '$lib/ae_core/ae_core_functions';
|
import { core_func } from '$lib/ae_core/ae_core_functions';
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
events_slct
|
events_slct
|
||||||
} from '$lib/stores/ae_events_stores';
|
} from '$lib/stores/ae_events_stores';
|
||||||
|
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Comp__events_menu_nav from '../../../ae_comp__events_menu_nav.svelte';
|
import Comp__events_menu_nav from '../../../ae_comp__events_menu_nav.svelte';
|
||||||
|
|
||||||
let show_modal = $state(false);
|
let show_modal = $state(false);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
// Import components and elements
|
// Import components and elements
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import { Check, CheckCircle, LoaderCircle, TriangleAlert, X } from '@lucide/svelte';
|
import { Check, CheckCircle, LoaderCircle, TriangleAlert, X } from '@lucide/svelte';
|
||||||
// Local Variables
|
// Local Variables
|
||||||
let ae_promises: key_val = $state({});
|
let ae_promises: key_val = $state({});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import { api } from '$lib/api/api';
|
import { api } from '$lib/api/api';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Sign_in_out from '../../../sign_in_out.svelte';
|
import Sign_in_out from '../../../sign_in_out.svelte';
|
||||||
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
|
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
|
||||||
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
import AE_Record_Controls from '$lib/ae_elements/AE_Record_Controls.svelte';
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
slct,
|
slct,
|
||||||
slct_trigger
|
slct_trigger
|
||||||
} from '$lib/stores/ae_stores';
|
} from '$lib/stores/ae_stores';
|
||||||
// import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/** @type {import('./$types').LayoutData} */
|
/** @type {import('./$types').LayoutData} */
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
|
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
|
||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Comp__event_obj_qry from './ae_idaa_comp__event_obj_qry.svelte';
|
import Comp__event_obj_qry from './ae_idaa_comp__event_obj_qry.svelte';
|
||||||
import Comp__event_obj_li_wrapper from './ae_idaa_comp__event_obj_li_wrapper.svelte';
|
import Comp__event_obj_li_wrapper from './ae_idaa_comp__event_obj_li_wrapper.svelte';
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
} from '$lib/stores/ae_stores';
|
} from '$lib/stores/ae_stores';
|
||||||
import { core_func } from '$lib/ae_core/ae_core_functions';
|
import { core_func } from '$lib/ae_core/ae_core_functions';
|
||||||
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/stores/ae_idaa_stores';
|
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/stores/ae_idaa_stores';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/** @type {import('./$types').LayoutData} */
|
/** @type {import('./$types').LayoutData} */
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
journals_slct,
|
journals_slct,
|
||||||
journals_trig
|
journals_trig
|
||||||
} from '$lib/ae_journals/ae_journals_stores';
|
} from '$lib/ae_journals/ae_journals_stores';
|
||||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import Help_tech from '$lib/app_components/e_app_help_tech.svelte';
|
import Help_tech from '$lib/app_components/e_app_help_tech.svelte';
|
||||||
|
|
||||||
// *** Setup Svelte properties
|
// *** Setup Svelte properties
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
} from '$lib/ae_journals/ae_journals_stores';
|
} from '$lib/ae_journals/ae_journals_stores';
|
||||||
|
|
||||||
import Journal_entry_view from './../../../ae_comp__journal_entry_obj_id_view.svelte';
|
import Journal_entry_view from './../../../ae_comp__journal_entry_obj_id_view.svelte';
|
||||||
// import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
// import Element_data_store from '$lib/elements/element_data_store.svelte';
|
||||||
import AeCompModalJournalExport from '../../../ae_comp__modal_journal_export.svelte';
|
import AeCompModalJournalExport from '../../../ae_comp__modal_journal_export.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import AE_Element_Data_Store_V3 from '$lib/elements/element_data_store_v3.svelte';
|
import AE_Element_Data_Store from '$lib/elements/element_data_store.svelte';
|
||||||
import { ae_loc } from '$lib/stores/ae_stores';
|
import { ae_loc } from '$lib/stores/ae_stores';
|
||||||
import { db_core } from '$lib/ae_core/db_core';
|
import { db_core } from '$lib/ae_core/db_core';
|
||||||
import { RefreshCw, Trash2 } from '@lucide/svelte';
|
import { RefreshCw, Trash2 } from '@lucide/svelte';
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<h2 class="h3">Scenario 1: Global Default</h2>
|
<h2 class="h3">Scenario 1: Global Default</h2>
|
||||||
<p class="text-sm">Fetching code <code>{test_null_act_and_for}</code>. Should fall back to <code>account_id = NULL</code> if not found for account.</p>
|
<p class="text-sm">Fetching code <code>{test_null_act_and_for}</code>. Should fall back to <code>account_id = NULL</code> if not found for account.</p>
|
||||||
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
||||||
<AE_Element_Data_Store_V3
|
<AE_Element_Data_Store
|
||||||
ds_code={test_null_act_and_for}
|
ds_code={test_null_act_and_for}
|
||||||
ds_name={'Global Default Test'}
|
ds_name={'Global Default Test'}
|
||||||
{log_lvl}
|
{log_lvl}
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<h2 class="h3">Scenario 2: Account Default</h2>
|
<h2 class="h3">Scenario 2: Account Default</h2>
|
||||||
<p class="text-sm">Fetching code <code>{test_code_account}</code> for Account ID: <code>{$ae_loc.account_id}</code>.</p>
|
<p class="text-sm">Fetching code <code>{test_code_account}</code> for Account ID: <code>{$ae_loc.account_id}</code>.</p>
|
||||||
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
||||||
<AE_Element_Data_Store_V3
|
<AE_Element_Data_Store
|
||||||
ds_code={test_code_account}
|
ds_code={test_code_account}
|
||||||
ds_name={'Account Default Test'}
|
ds_name={'Account Default Test'}
|
||||||
{log_lvl}
|
{log_lvl}
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<h2 class="h3">Scenario 3: Specific Record (Event Override)</h2>
|
<h2 class="h3">Scenario 3: Specific Record (Event Override)</h2>
|
||||||
<p class="text-sm">Fetching code <code>{test_code_and_for}</code> linked to <code>for_type: event</code> and <code>for_id: {testing_event_id}</code>.</p>
|
<p class="text-sm">Fetching code <code>{test_code_and_for}</code> linked to <code>for_type: event</code> and <code>for_id: {testing_event_id}</code>.</p>
|
||||||
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
||||||
<AE_Element_Data_Store_V3
|
<AE_Element_Data_Store
|
||||||
ds_code={test_code_and_for}
|
ds_code={test_code_and_for}
|
||||||
ds_name={'Specific Record Test'}
|
ds_name={'Specific Record Test'}
|
||||||
for_type="event"
|
for_type="event"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<h2 class="h3">Scenario 4: Change Props Passed</h2>
|
<h2 class="h3">Scenario 4: Change Props Passed</h2>
|
||||||
<p class="text-sm">Fetching code <code>{test_code_and_for}</code> linked to <code>for_type: event</code> and <code>for_id: {testing_event_id}</code>.</p>
|
<p class="text-sm">Fetching code <code>{test_code_and_for}</code> linked to <code>for_type: event</code> and <code>for_id: {testing_event_id}</code>.</p>
|
||||||
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
<div class="bg-surface-100 dark:bg-surface-800 p-4 rounded-lg border border-surface-500/20">
|
||||||
<AE_Element_Data_Store_V3
|
<AE_Element_Data_Store
|
||||||
ds_code={test_code_and_for}
|
ds_code={test_code_and_for}
|
||||||
ds_name={'Specific Record Test'}
|
ds_name={'Specific Record Test'}
|
||||||
ds_type="html"
|
ds_type="html"
|
||||||
|
|||||||
Reference in New Issue
Block a user