refactor(events, idaa): standardize on String-only IDs and remove '_random' suffix
Aligned the Events Badges, Templates, and IDAA Bulletin Board modules with Aether UI/UX v3 standards by prioritizing semantic String IDs (e.g., event_id, badge_id) over legacy '_random' variants in API helpers, Dexie processors, and UI components. - Refactored badge and template loaders to use clean ID field names. - Updated search and LiveQuery logic in badge management views. - Cleaned up unused imports and legacy code in +layout and +page components. - Standardized ID mapping in generic object processors. - Improved IDAA post creation UX with autofocus and empty title defaults.
This commit is contained in:
@@ -4,16 +4,15 @@
|
||||
|
||||
## 📋 Active Task: Badge Rendering Fix
|
||||
- [x] **Step 1:** Investigate `event_badge_template` table for corrupted numeric IDs. (Confirmed Fine / Database Integrity OK)
|
||||
- [ ] **Step 2:** Verify Pydantic model alignment in backend for Badge types.
|
||||
- [ ] **Step 3:** Implement field editing for "Full Name", "Title", "Affiliations" using `Element_ae_crud_v2`.
|
||||
- [ ] **Step 4:** Coordination (Handshake with Backend regarding MariaDB schema integrity).
|
||||
- [ ] **Step 5:** Finalize & Commit.
|
||||
- [ ] **Step 2:** Refactor `badge_template` lookup in `+page.svelte` to use V3 Triple ID pattern (`id_random` or `event_badge_template_id_random`).
|
||||
- [ ] **Step 3:** Implement inline field editing using `Element_ae_crud_v2.svelte` for badge fields (Admin tool pattern).
|
||||
- [ ] **Step 4:** Finalize & Commit.
|
||||
|
||||
## 🚧 Upcoming High Priority
|
||||
- **CRUD v2 Refactor:** Implement V3 API alignment for `Element_ae_crud_v2.svelte`.
|
||||
- **Temp Cleanup:** Auto-removal of native `.tmp` files older than 24h.
|
||||
|
||||
## 📝 Session Notes (Feb 11, 2026)
|
||||
- **Resolved:** Launcher Session Selection Hang.
|
||||
- **Pattern:** Implemented "Navigation Shield" and "Side-Effect Purge" to stop reactivity loops.
|
||||
- **Linter:** Fixed missing Lucide icon imports.
|
||||
## ✅ Completed Recently
|
||||
- [x] **[IDAA]** Verify Bulletin Board functionality.
|
||||
- [x] **[IDAA]** Verify Recovery Meetings functionality.
|
||||
- [x] **[Journals]** Fix buttons missing `type="button"`.
|
||||
|
||||
@@ -51,11 +51,11 @@ export async function load_ae_obj_id__event_badge({
|
||||
if (ae_promises.load__event_badge_obj) {
|
||||
if (try_cache) {
|
||||
// In theory we should be able to use the event_id found in the Badge load object. 2026-02-04
|
||||
// This keeps coming up as undefined: ae_promises.load__event_badge_obj.event_id_random
|
||||
if (log_lvl) console.log(`Saving to local cache... Event ID: ${event_id} or ${ae_promises.load__event_badge_obj.event_id_random}`);
|
||||
// This keeps coming up as undefined: ae_promises.load__event_badge_obj.event_id
|
||||
if (log_lvl) console.log(`Saving to local cache... Event ID: ${event_id} or ${ae_promises.load__event_badge_obj.event_id}`);
|
||||
const processed_obj_li = await process_ae_obj__event_badge_props({
|
||||
obj_li: [ae_promises.load__event_badge_obj],
|
||||
event_id: event_id || ae_promises.load__event_badge_obj.event_id_random,
|
||||
event_id: event_id || ae_promises.load__event_badge_obj.event_id,
|
||||
log_lvl
|
||||
});
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
@@ -85,7 +85,7 @@ export async function load_ae_obj_id__event_badge({
|
||||
|
||||
if (inc_template && ae_promises.load__event_badge_obj) {
|
||||
// Load the templates for the event badge
|
||||
const current_template_id = ae_promises.load__event_badge_obj.event_badge_template_id || ae_promises.load__event_badge_obj.event_badge_template_id_random;
|
||||
const current_template_id = ae_promises.load__event_badge_obj.event_badge_template_id;
|
||||
if (current_template_id) {
|
||||
ae_promises.load__event_badge_obj.event_badge_template = await load_ae_obj_id__event_badge_template({
|
||||
api_cfg: api_cfg,
|
||||
@@ -187,7 +187,7 @@ export async function load_ae_obj_li__event_badge({
|
||||
|
||||
if (inc_template && ae_promises.load__event_badge_obj_li) {
|
||||
for (const badge_obj of ae_promises.load__event_badge_obj_li) {
|
||||
const current_template_id = badge_obj.event_badge_template_id || badge_obj.event_badge_template_id_random;
|
||||
const current_template_id = badge_obj.event_badge_template_id;
|
||||
if (current_template_id) {
|
||||
badge_obj.event_badge_template = await load_ae_obj_id__event_badge_template({
|
||||
api_cfg: api_cfg,
|
||||
@@ -388,7 +388,7 @@ export async function search__event_badge({
|
||||
|
||||
const search_query: any = {
|
||||
q: '',
|
||||
and: [{ field: 'event_id_random', op: 'eq', value: event_id }]
|
||||
and: [{ field: 'event_id', op: 'eq', value: event_id }]
|
||||
};
|
||||
|
||||
const params: key_val = {};
|
||||
@@ -577,7 +577,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
(processed_obj as any)[newKey] = processed_obj[key];
|
||||
}
|
||||
}
|
||||
const randomIdKey = `${obj_type}_id_random`;
|
||||
const randomIdKey = `${obj_type}_id`;
|
||||
if (processed_obj[randomIdKey]) {
|
||||
(processed_obj as any).id = processed_obj[randomIdKey];
|
||||
}
|
||||
@@ -621,7 +621,7 @@ export async function process_ae_obj__event_badge_props({
|
||||
}
|
||||
if (event_id) {
|
||||
if (!obj.event_id) obj.event_id = event_id;
|
||||
if (!obj.event_id_random) obj.event_id_random = event_id;
|
||||
// if (!obj.event_id_random) obj.event_id_random = event_id;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
(processed_obj as any)[newKey] = processed_obj[key];
|
||||
}
|
||||
}
|
||||
const randomIdKey = `${obj_type}_id_random`;
|
||||
const randomIdKey = `${obj_type}_id`;
|
||||
if (processed_obj[randomIdKey]) {
|
||||
(processed_obj as any).id = processed_obj[randomIdKey];
|
||||
}
|
||||
@@ -129,7 +129,7 @@ export async function load_ae_obj_id__event_badge_template({
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__event_badge_template() *** [V3] id=${event_badge_template_id}`);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
ae_promises.load__event_badge_template_obj = await api.get_ae_obj_v3({
|
||||
api_cfg,
|
||||
@@ -161,7 +161,7 @@ export async function load_ae_obj_id__event_badge_template({
|
||||
ae_promises.load__event_badge_template_obj = await db_events.badge_template.get(event_badge_template_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ae_promises.load__event_badge_template_obj || null;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ export async function load_ae_obj_li__event_badge_template({
|
||||
.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ae_promises.load__event_badge_template_obj_li || [];
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ export async function create_ae_obj__event_badge_template({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge_template',
|
||||
fields: {
|
||||
event_id_random: event_id,
|
||||
event_id: event_id,
|
||||
...data_kv
|
||||
},
|
||||
log_lvl
|
||||
@@ -376,7 +376,7 @@ export async function search__event_badge_template({
|
||||
}) {
|
||||
const search_query: any = {
|
||||
q: qry_str,
|
||||
and: [{ field: 'event_id_random', op: 'eq', value: event_id }]
|
||||
and: [{ field: 'event_id', op: 'eq', value: event_id }]
|
||||
};
|
||||
|
||||
if (enabled === 'enabled') search_query.and.push({ field: 'enable', op: 'eq', value: true });
|
||||
|
||||
@@ -11,9 +11,7 @@ const ae_promises: key_val = {};
|
||||
export const properties_to_save_exhibit = [
|
||||
'id',
|
||||
'event_exhibit_id',
|
||||
// 'event_exhibit_id_random',
|
||||
'event_id',
|
||||
// 'event_id_random',
|
||||
'code',
|
||||
'name',
|
||||
'description',
|
||||
@@ -74,7 +72,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
// 2. Primary Key Mapping (Dexie compatible)
|
||||
const randomIdKey = `${obj_type}_id_random`;
|
||||
const baseIdKey = `${obj_type}_id`;
|
||||
|
||||
|
||||
// Prioritize the base ID field as the primary source of truth
|
||||
if (processed_obj[baseIdKey]) {
|
||||
(processed_obj as any).id = String(processed_obj[baseIdKey]);
|
||||
|
||||
@@ -9,46 +9,46 @@
|
||||
let { data, children, log_lvl = 0 }: Props = $props();
|
||||
|
||||
// *** Import Svelte specific
|
||||
import { liveQuery } from 'dexie';
|
||||
// import { liveQuery } from 'dexie';
|
||||
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import type { key_val } from '$lib/stores/ae_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
import { db_events } from '$lib/ae_events/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 { db_events } from '$lib/ae_events/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';
|
||||
|
||||
let lq__event_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}`
|
||||
);
|
||||
}
|
||||
let results = await db_events.event.get(
|
||||
$events_slct?.event_id ?? ''
|
||||
);
|
||||
// let lq__event_obj = $derived(
|
||||
// liveQuery(async () => {
|
||||
// if (log_lvl) {
|
||||
// console.log(
|
||||
// `*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}`
|
||||
// );
|
||||
// }
|
||||
// let results = await db_events.event.get(
|
||||
// $events_slct?.event_id ?? ''
|
||||
// );
|
||||
|
||||
return results;
|
||||
})
|
||||
);
|
||||
// return results;
|
||||
// })
|
||||
// );
|
||||
|
||||
let nav_y_height = $state(0);
|
||||
// let nav_y_height = $state(0);
|
||||
|
||||
let box: any;
|
||||
let xLeft = $state(0);
|
||||
@@ -58,8 +58,8 @@
|
||||
let yScroll = $state(0);
|
||||
let yHeight = $state(0);
|
||||
|
||||
let scroll_x = $state(0);
|
||||
let scroll_y = $state(0);
|
||||
// let scroll_x = $state(0);
|
||||
// let scroll_y = $state(0);
|
||||
|
||||
function parse_scroll() {
|
||||
// console.log(`parse_scroll() called`);
|
||||
@@ -73,13 +73,13 @@
|
||||
}
|
||||
|
||||
// *** Functions and Logic
|
||||
$effect(() => {
|
||||
// if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
|
||||
// }
|
||||
});
|
||||
// $effect(() => {
|
||||
// // if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
|
||||
// // }
|
||||
// });
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<!-- <svelte:head>
|
||||
<title>
|
||||
Æ: Badges for
|
||||
{ae_util.shorten_string({
|
||||
@@ -89,7 +89,7 @@
|
||||
- Badges v3 -
|
||||
{$events_loc?.title}
|
||||
</title>
|
||||
</svelte:head>
|
||||
</svelte:head> -->
|
||||
<!-- - Badges - {$events_loc?.title} -->
|
||||
|
||||
<!-- +layout: Where is here??? -->
|
||||
|
||||
@@ -61,6 +61,22 @@
|
||||
let last_search_id = 0;
|
||||
let last_executed_key = ''; // Search Guard Key
|
||||
|
||||
|
||||
let lq__event_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}`
|
||||
);
|
||||
}
|
||||
let results = await db_events.event.get(
|
||||
$events_slct?.event_id ?? ''
|
||||
);
|
||||
|
||||
return results;
|
||||
})
|
||||
);
|
||||
|
||||
// Stable LiveQuery Pattern (Aether UI V3)
|
||||
let lq__event_badge_obj_li = $derived.by(() => {
|
||||
const ids = event_badge_id_li;
|
||||
@@ -88,7 +104,7 @@
|
||||
`Badge Page LQ: Fallback search for event: ${event_id}`
|
||||
);
|
||||
return await db_events.badge
|
||||
.where('event_id_random')
|
||||
.where('event_id')
|
||||
.equals(event_id)
|
||||
.limit(50)
|
||||
.sortBy('given_name');
|
||||
@@ -159,7 +175,7 @@
|
||||
try {
|
||||
if (event_id) {
|
||||
let local_results = await db_events.badge
|
||||
.where('event_id_random')
|
||||
.where('event_id')
|
||||
.equals(event_id)
|
||||
.filter((badge) => {
|
||||
if (
|
||||
@@ -258,7 +274,7 @@
|
||||
});
|
||||
|
||||
const local_ids = local_results
|
||||
.map((b) => b.id || b.event_badge_id_random)
|
||||
.map((b) => b.event_badge_id)
|
||||
.filter(Boolean);
|
||||
|
||||
if (current_search_id === last_search_id) {
|
||||
@@ -321,7 +337,7 @@
|
||||
if (current_search_id === last_search_id) {
|
||||
const api_results = results || [];
|
||||
const api_ids = api_results
|
||||
.map((b: any) => b.id || b.event_badge_id_random)
|
||||
.map((b: any) => b.event_badge_id)
|
||||
.filter(Boolean);
|
||||
|
||||
untrack(() => {
|
||||
@@ -349,9 +365,9 @@
|
||||
|
||||
<svelte:head>
|
||||
<title>
|
||||
Badges -
|
||||
Æ: Badges -
|
||||
{ae_util.shorten_string({
|
||||
string: $events_slct?.event_obj?.name ?? '-- not set --',
|
||||
string: $lq__event_obj?.name ?? '-- not set --',
|
||||
max_length: 12
|
||||
})}
|
||||
- OSIT's Æ Events
|
||||
|
||||
@@ -36,18 +36,16 @@
|
||||
import { LoaderCircle } from 'lucide-svelte';
|
||||
|
||||
// *** Variables
|
||||
// let test_event_id = data.params.event_id;
|
||||
// Use page.params for robust reactivity in Svelte 5
|
||||
let event_badge_id = $derived(page.params.badge_id);
|
||||
|
||||
|
||||
// Track if we are waiting for initial IDB result
|
||||
let is_loading_idb = $state(true);
|
||||
|
||||
// console.log(`Data Params: event_id=${test_event_id}; badge_id=${test_event_badge_id}`);
|
||||
let url_test_val = $derived(data.url.searchParams.get('test_val'));
|
||||
$effect(() => {
|
||||
console.log(`URL test_val = ${url_test_val}`);
|
||||
});
|
||||
// let url_test_val = $derived(data.url.searchParams.get('test_val'));
|
||||
// $effect(() => {
|
||||
// console.log(`URL test_val = ${url_test_val}`);
|
||||
// });
|
||||
|
||||
let lq__event_badge_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
@@ -57,14 +55,7 @@
|
||||
`*** LiveQuery: lq__event_badge_obj *** event_badge_id=${event_badge_id}`
|
||||
);
|
||||
}
|
||||
// Attempt lookup by the ID provided in the URL
|
||||
let results = await db_events.badge.get(event_badge_id);
|
||||
|
||||
// Fallback: If not found by PK, try searching the event_badge_id index
|
||||
// (Standardizing on semantic IDs)
|
||||
if (!results) {
|
||||
results = await db_events.badge.where('event_badge_id').equals(event_badge_id).first();
|
||||
}
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
// import { createEventDispatcher } from 'svelte';
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
import { ae_api } from '$lib/stores/ae_stores';
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
let { event_id }: Props = $props();
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
// const dispatch = createEventDispatcher();
|
||||
|
||||
let full_name_override: string = $state('');
|
||||
let professional_title_override: string = $state('');
|
||||
@@ -60,20 +60,20 @@
|
||||
});
|
||||
if (new_badge) {
|
||||
submit_status = 'success';
|
||||
dispatch('success', new_badge);
|
||||
// dispatch('success', new_badge);
|
||||
} else {
|
||||
submit_status = 'error';
|
||||
dispatch('error', 'Failed to create badge');
|
||||
// dispatch('error', 'Failed to create badge');
|
||||
}
|
||||
} catch (error) {
|
||||
submit_status = 'error';
|
||||
console.error('Error creating badge:', error);
|
||||
dispatch('error', error);
|
||||
// dispatch('error', error);
|
||||
}
|
||||
}
|
||||
|
||||
function handle_cancel() {
|
||||
dispatch('cancel');
|
||||
// dispatch('cancel');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</header>
|
||||
|
||||
<ul class="w-full space-y-1">
|
||||
{#each visible_badge_obj_li as event_badge_obj (event_badge_obj.event_badge_id_random)}
|
||||
{#each visible_badge_obj_li as event_badge_obj (event_badge_obj.event_badge_id)}
|
||||
<li
|
||||
class="
|
||||
border border-surface-200 dark:border-surface-700 rounded-lg p-2
|
||||
|
||||
@@ -89,11 +89,11 @@
|
||||
{#if $lq__filtered_badges}
|
||||
{#if $lq__filtered_badges.length > 0}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{#each $lq__filtered_badges as badge_obj (badge_obj.event_badge_id_random)}
|
||||
{#each $lq__filtered_badges as badge_obj (badge_obj.event_badge_id)}
|
||||
<div class="badge-print-container">
|
||||
<Comp_badge_obj_view
|
||||
{event_id}
|
||||
event_badge_id={badge_obj.event_badge_id_random}
|
||||
event_badge_id={badge_obj.event_badge_id}
|
||||
lq__event_badge_obj={badge_obj}
|
||||
is_review_mode={false}
|
||||
log_lvl={0}
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
{#if $lq__badge_templates.length > 0}
|
||||
<div class="card p-4">
|
||||
<ul class="list-group">
|
||||
{#each $lq__badge_templates as template (template.event_badge_template_id_random)}
|
||||
{#each $lq__badge_templates as template (template.event_badge_template_id)}
|
||||
<li
|
||||
class="list-group-item flex justify-between items-center"
|
||||
>
|
||||
@@ -105,7 +105,7 @@
|
||||
class="btn btn-sm variant-filled-primary"
|
||||
onclick={() =>
|
||||
edit_template(
|
||||
template.event_badge_template_id_random
|
||||
template.event_badge_template_id
|
||||
)}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit
|
||||
@@ -115,7 +115,7 @@
|
||||
class="btn btn-sm variant-filled-error ml-2"
|
||||
onclick={() =>
|
||||
delete_template(
|
||||
template.event_badge_template_id_random
|
||||
template.event_badge_template_id
|
||||
)}
|
||||
>
|
||||
<span class="fas fa-trash"></span> Delete
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
}
|
||||
|
||||
let location_data = {
|
||||
event_id_random: $events_slct.event_id,
|
||||
event_id: $events_slct.event_id,
|
||||
name: 'TEMP Location Name',
|
||||
enable: true
|
||||
};
|
||||
@@ -261,7 +261,7 @@
|
||||
<!-- <Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_location'}
|
||||
object_id={event_location_obj?.event_location_id_random}
|
||||
object_id={event_location_obj?.event_location_id}
|
||||
field_name={'description'}
|
||||
field_type={'textarea'}
|
||||
field_value={event_location_obj?.description}
|
||||
@@ -276,7 +276,7 @@
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_location({api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id_random, log_lvl: 1});
|
||||
events_func.load_ae_obj_id__event_location({api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id, log_lvl: 1});
|
||||
}}
|
||||
>
|
||||
<strong class="text-sm">
|
||||
@@ -287,21 +287,21 @@
|
||||
<button type="button"
|
||||
onclick={() => {
|
||||
console.log('Show/Hide Description');
|
||||
if ($events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random) {
|
||||
if ($events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id) {
|
||||
$events_sess.pres_mgmt.show_content__location_description = null;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_location_id = null;
|
||||
} else {
|
||||
$events_sess.pres_mgmt.show_content__location_description = event_location_obj.event_location_id_random;
|
||||
$events_sess.pres_mgmt.show_content__location_description = event_location_obj.event_location_id;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_location_id = event_location_obj.event_location_id_random;
|
||||
$events_slct.event_location_id = event_location_obj.event_location_id;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm preset-tonal-surface hover:preset-filled-surface-500 text-xs"
|
||||
>
|
||||
{#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random}
|
||||
{#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id}
|
||||
<span class="fas fa-eye-slash mx-1"></span>
|
||||
<span>Hide Description</span>
|
||||
{:else}
|
||||
@@ -312,7 +312,7 @@
|
||||
|
||||
<pre
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={$events_sess.pres_mgmt.show_content__location_description !== event_location_obj.event_location_id_random}
|
||||
class:hidden={$events_sess.pres_mgmt.show_content__location_description !== event_location_obj.event_location_id}
|
||||
>{event_location_obj.description}</pre>
|
||||
|
||||
{:else}
|
||||
@@ -323,7 +323,7 @@
|
||||
<Element_ae_crud_v2
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_location'}
|
||||
object_id={event_location_obj?.event_location_id_random}
|
||||
object_id={event_location_obj?.event_location_id}
|
||||
object_reload={true}
|
||||
field_name={'description'}
|
||||
field_type={'textarea'}
|
||||
@@ -350,7 +350,7 @@
|
||||
if (
|
||||
$events_sess.pres_mgmt
|
||||
.show_content__location_description ==
|
||||
event_location_obj.event_location_id_random
|
||||
event_location_obj.event_location_id
|
||||
) {
|
||||
$events_sess.pres_mgmt.show_content__location_description =
|
||||
null;
|
||||
@@ -360,16 +360,16 @@
|
||||
null;
|
||||
} else {
|
||||
$events_sess.pres_mgmt.show_content__location_description =
|
||||
event_location_obj.event_location_id_random;
|
||||
event_location_obj.event_location_id;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_location_id =
|
||||
event_location_obj.event_location_id_random;
|
||||
event_location_obj.event_location_id;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm preset-tonal-surface hover:preset-filled-surface-500 text-xs"
|
||||
>
|
||||
{#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random}
|
||||
{#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id}
|
||||
<span class="fas fa-eye-slash mx-1"
|
||||
></span>
|
||||
<span>Hide Description</span>
|
||||
@@ -384,7 +384,7 @@
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={$events_sess.pres_mgmt
|
||||
.show_content__location_description !==
|
||||
event_location_obj.event_location_id_random}>{event_location_obj.description}</pre>
|
||||
event_location_obj.event_location_id}>{event_location_obj.description}</pre>
|
||||
{:else}
|
||||
{@html ae_snip.html__not_set}
|
||||
{/if}
|
||||
@@ -393,20 +393,20 @@
|
||||
|
||||
{#if !$events_loc.pres_mgmt.show_content__location_devices_sessions || $events_loc.pres_mgmt.show_content__location_devices_sessions == 'default' || $events_loc.pres_mgmt.show_content__location_devices_sessions == 'sessions'}
|
||||
<!-- Show sessions for this location -->
|
||||
{#if event_location_obj?.event_location_id_random}
|
||||
{#if event_location_obj?.event_location_id}
|
||||
<Comp_event_session_obj_li
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id_random}
|
||||
link_to_id={event_location_obj?.event_location_id}
|
||||
event_session_id_random_li={[]}
|
||||
{log_lvl}
|
||||
></Comp_event_session_obj_li>
|
||||
{/if}
|
||||
{:else if $events_loc.pres_mgmt.show_content__location_devices_sessions == 'devices'}
|
||||
<!-- Show devices for this location -->
|
||||
{#if event_location_obj?.event_location_id_random}
|
||||
{#if event_location_obj?.event_location_id}
|
||||
<Comp_event_device_obj_li
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id_random}
|
||||
link_to_id={event_location_obj?.event_location_id}
|
||||
event_device_id_random_li={[]}
|
||||
auto_refresh={$events_loc.pres_mgmt
|
||||
.refresh_interval ?? 90000}
|
||||
@@ -416,20 +416,13 @@
|
||||
{/if}
|
||||
|
||||
<!-- Show files for this location -->
|
||||
<!-- <Element_manage_event_file_li_wrap
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id_random}
|
||||
allow_basic={$events_loc.trusted_access}
|
||||
allow_moderator={$events_loc.trusted_access}
|
||||
container_class_li={''}
|
||||
/> -->
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{:else}
|
||||
<!-- <p class:hidden={display_mode != 'default'}>
|
||||
No locations available to show at this time
|
||||
</p> -->
|
||||
<!-- <p>
|
||||
No locations available to show at this time
|
||||
</p> -->
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<ul class="space-y-1 px-4 m-2 bg-gray-100 rounded-md">
|
||||
{#each $lq__event_presenter_obj_li as event_presenter_obj}
|
||||
<!-- This is a hack. I can not get the LiveQuery to work with specific presentation IDs. It only works with the session ID. I need to figure out how to get the presenters for the specific presentation. -->
|
||||
<!-- {#if event_presenter_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random} -->
|
||||
<!-- {#if event_presenter_obj.event_presentation_id == event_presentation_obj.event_presentation_id} -->
|
||||
<li
|
||||
class:dim={event_presenter_obj?.hide}
|
||||
class:dim_warning={!event_presenter_obj?.enable}
|
||||
@@ -150,7 +150,7 @@
|
||||
font-bold min-w-64 max-w-96 my-0.5
|
||||
overflow-hidden
|
||||
"
|
||||
title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.person_primary_email}"
|
||||
title="Person ID: {event_presenter_obj.person_id}; Email: {event_presenter_obj.person_primary_email}"
|
||||
>
|
||||
{#if event_presenter_obj?.given_name && event_presenter_obj?.given_name != 'Group'}
|
||||
<span
|
||||
@@ -228,18 +228,18 @@
|
||||
'-- not set --',
|
||||
base_url: $ae_loc.url_origin,
|
||||
person_id:
|
||||
event_presenter_obj?.person_id_random,
|
||||
event_presenter_obj?.person_id,
|
||||
person_passcode:
|
||||
event_presenter_obj.person_passcode ??
|
||||
'-- not set --',
|
||||
event_id:
|
||||
event_presenter_obj.event_id_random,
|
||||
event_presenter_obj.event_id,
|
||||
event_session_id:
|
||||
event_presenter_obj.event_session_id_random,
|
||||
event_presenter_obj.event_session_id,
|
||||
event_presentation_id:
|
||||
event_presenter_obj.event_presentation_id_random,
|
||||
event_presenter_obj.event_presentation_id,
|
||||
event_presenter_id:
|
||||
event_presenter_obj.event_presenter_id_random,
|
||||
event_presenter_obj.event_presenter_id,
|
||||
session_name:
|
||||
event_presenter_obj?.event_session_name ??
|
||||
'-- not set --',
|
||||
@@ -259,26 +259,26 @@
|
||||
|
||||
{#if $events_loc.pres_mgmt?.require__presenter_agree}
|
||||
{#if event_presenter_obj?.agree}
|
||||
<!-- {#if $ae_loc.trusted_access || $events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id_random]} -->
|
||||
<!-- {#if $ae_loc.trusted_access || $events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id]} -->
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.trusted_access &&
|
||||
!$events_loc.auth__kv.presenter[
|
||||
event_presenter_obj
|
||||
.event_presenter_id_random
|
||||
.event_presenter_id
|
||||
]}
|
||||
onclick={() => {
|
||||
console.log('View terms and conditions');
|
||||
$events_slct.event_presentation_id =
|
||||
event_presenter_obj.event_presentation_id_random;
|
||||
event_presenter_obj.event_presentation_id;
|
||||
// $events_slct.event_presentation_obj = $lq__event_presentation_obj;
|
||||
|
||||
$events_slct.event_presenter_id =
|
||||
event_presenter_obj.event_presenter_id_random;
|
||||
event_presenter_obj.event_presenter_id;
|
||||
// $events_slct.event_presenter_obj = event_presenter_obj;
|
||||
|
||||
$events_sess.pres_mgmt.show_modal__presenter_agree =
|
||||
event_presenter_obj.event_presenter_id_random;
|
||||
event_presenter_obj.event_presenter_id;
|
||||
}}
|
||||
class="btn preset-tonal-success hover:preset-filled-success-500 my-0.5"
|
||||
class:btn-sm={display_mode != 'default'}
|
||||
@@ -296,21 +296,21 @@
|
||||
disabled={!$ae_loc.trusted_access &&
|
||||
!$events_loc.auth__kv.presenter[
|
||||
event_presenter_obj
|
||||
.event_presenter_id_random
|
||||
.event_presenter_id
|
||||
]}
|
||||
onclick={() => {
|
||||
console.log('View terms and conditions');
|
||||
|
||||
$events_slct.event_presentation_id =
|
||||
event_presenter_obj.event_presentation_id_random;
|
||||
event_presenter_obj.event_presentation_id;
|
||||
// $events_slct.event_presentation_obj = $lq__event_presentation_obj;
|
||||
|
||||
$events_slct.event_presenter_id =
|
||||
event_presenter_obj.event_presenter_id_random;
|
||||
event_presenter_obj.event_presenter_id;
|
||||
// $events_slct.event_presenter_obj = event_presenter_obj;
|
||||
|
||||
$events_sess.pres_mgmt.show_modal__presenter_agree =
|
||||
event_presenter_obj.event_presenter_id_random;
|
||||
event_presenter_obj.event_presenter_id;
|
||||
}}
|
||||
class="btn preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 my-0.5"
|
||||
class:btn-sm={display_mode != 'default'}
|
||||
@@ -326,7 +326,7 @@
|
||||
{/if}
|
||||
|
||||
<div class="float-right space-2 flex flex-row items-center">
|
||||
{#if $ae_loc.administrator_access && !event_presenter_obj.person_id_random}
|
||||
{#if $ae_loc.administrator_access && !event_presenter_obj.person_id}
|
||||
<button
|
||||
type="button"
|
||||
onclick={async () => {
|
||||
@@ -340,8 +340,8 @@
|
||||
}
|
||||
|
||||
let person_data = {
|
||||
account_id_random: $slct.account_id,
|
||||
// user_id_random: user_obj.user_id_random,
|
||||
account_id: $slct.account_id,
|
||||
// user_id: user_obj.user_id,
|
||||
given_name: 'New',
|
||||
family_name: 'Presenter',
|
||||
primary_email:
|
||||
@@ -373,10 +373,10 @@
|
||||
{
|
||||
api_cfg: $ae_api,
|
||||
event_presenter_id:
|
||||
event_presenter_obj.event_presenter_id_random,
|
||||
event_presenter_obj.event_presenter_id,
|
||||
data_kv: {
|
||||
person_id_random:
|
||||
new_person_obj.person_id_random
|
||||
person_id:
|
||||
new_person_obj.person_id
|
||||
},
|
||||
log_lvl: log_lvl
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
// *** Import Svelte specific
|
||||
import { page } from '$app/state';
|
||||
import { browser } from '$app/environment';
|
||||
import { untrack } from 'svelte';
|
||||
// import { untrack } from 'svelte';
|
||||
// import { goto, invalidate, pushState, replaceState } from '$app/navigation';
|
||||
|
||||
// *** Import other supporting libraries
|
||||
import { Modal } from 'flowbite-svelte';
|
||||
// import { Modal } from 'flowbite-svelte';
|
||||
import { liveQuery } from 'dexie';
|
||||
|
||||
// *** Import Aether specific variables and functions
|
||||
@@ -83,33 +83,33 @@
|
||||
});
|
||||
});
|
||||
|
||||
let lq__post_obj = $derived.by(() => {
|
||||
const post_id = $idaa_slct.post_id ?? '';
|
||||
return liveQuery(async () => {
|
||||
if (!post_id) return null;
|
||||
return await db_posts.post.get(post_id);
|
||||
});
|
||||
});
|
||||
// let lq__post_obj = $derived.by(() => {
|
||||
// const post_id = $idaa_slct.post_id ?? '';
|
||||
// return liveQuery(async () => {
|
||||
// if (!post_id) return null;
|
||||
// return await db_posts.post.get(post_id);
|
||||
// });
|
||||
// });
|
||||
|
||||
let lq__post_comment_obj_li = $derived.by(() => {
|
||||
const post_id = $idaa_slct.post_id ?? '';
|
||||
return liveQuery(async () => {
|
||||
if (!post_id) return [];
|
||||
return await db_posts.comment
|
||||
.where('post_id')
|
||||
.equals(post_id)
|
||||
.reverse()
|
||||
.sortBy('updated_on');
|
||||
});
|
||||
});
|
||||
// let lq__post_comment_obj_li = $derived.by(() => {
|
||||
// const post_id = $idaa_slct.post_id ?? '';
|
||||
// return liveQuery(async () => {
|
||||
// if (!post_id) return [];
|
||||
// return await db_posts.comment
|
||||
// .where('post_id')
|
||||
// .equals(post_id)
|
||||
// .reverse()
|
||||
// .sortBy('updated_on');
|
||||
// });
|
||||
// });
|
||||
|
||||
let lq__post_comment_obj = $derived.by(() => {
|
||||
const comment_id = $idaa_slct.post_comment_id ?? '';
|
||||
return liveQuery(async () => {
|
||||
if (!comment_id) return null;
|
||||
return await db_posts.comment.get(comment_id);
|
||||
});
|
||||
});
|
||||
// let lq__post_comment_obj = $derived.by(() => {
|
||||
// const comment_id = $idaa_slct.post_comment_id ?? '';
|
||||
// return liveQuery(async () => {
|
||||
// if (!comment_id) return null;
|
||||
// return await db_posts.comment.get(comment_id);
|
||||
// });
|
||||
// });
|
||||
|
||||
// Handle Single Post Load Trigger
|
||||
$effect(() => {
|
||||
@@ -188,57 +188,57 @@
|
||||
// );
|
||||
}
|
||||
|
||||
function add_activity_log({
|
||||
action = 'idaa_bb_page',
|
||||
action_with = 'none'
|
||||
}: {
|
||||
action?: string;
|
||||
action_with?: string;
|
||||
}) {
|
||||
let last_cache_refresh_iso = new Date($ae_loc?.last_cache_refresh);
|
||||
// function add_activity_log({
|
||||
// action = 'idaa_bb_page',
|
||||
// action_with = 'none'
|
||||
// }: {
|
||||
// action?: string;
|
||||
// action_with?: string;
|
||||
// }) {
|
||||
// let last_cache_refresh_iso = new Date($ae_loc?.last_cache_refresh);
|
||||
|
||||
let activity_description = `
|
||||
${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? 'no-email'}
|
||||
allow=${$ae_loc?.allow_access}
|
||||
last_cache_refresh=${last_cache_refresh_iso.toLocaleString()}
|
||||
data_route=${data?.route.toString() ?? 'unknown'}
|
||||
`;
|
||||
// let activity_description = `
|
||||
// ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? 'no-email'}
|
||||
// allow=${$ae_loc?.allow_access}
|
||||
// last_cache_refresh=${last_cache_refresh_iso.toLocaleString()}
|
||||
// data_route=${data?.route.toString() ?? 'unknown'}
|
||||
// `;
|
||||
|
||||
let data_kv = {
|
||||
external_client_id: data?.route.id,
|
||||
name: `IDAA: ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? ''}`,
|
||||
description: activity_description ?? null,
|
||||
object_type: 'post', // archive, post, event
|
||||
// object_id: data?.params?.event_id ?? null,
|
||||
// object_id: ae_acct.slct.archive_id, // data?.params?.archive_id ?? null,
|
||||
url_root: data?.url.origin,
|
||||
// url_full_path: data?.url.href,
|
||||
url_full_path: data?.url.pathname,
|
||||
url_params: data?.url.searchParams.toString(),
|
||||
action: action,
|
||||
action_with: action_with ?? 'none',
|
||||
meta_json: {
|
||||
allow_access: $ae_loc?.allow_access,
|
||||
last_cache_refresh: $ae_loc?.last_cache_refresh,
|
||||
last_cache_refresh_iso: last_cache_refresh_iso.toISOString(),
|
||||
last_cache_refresh_locale: last_cache_refresh_iso.toLocaleString(),
|
||||
access_level: $ae_loc?.access_level,
|
||||
iframe: $ae_loc?.iframe
|
||||
// site_access_key: $ae_loc?.site_access_key,
|
||||
// site_domain_access_key: $ae_loc?.site_domain_access_key,
|
||||
// site_domain: $ae_loc?.site_domain,
|
||||
// extra_data: extra_data ?? '',
|
||||
// log_lvl: log_lvl,
|
||||
}
|
||||
};
|
||||
// let data_kv = {
|
||||
// external_client_id: data?.route.id,
|
||||
// name: `IDAA: ${$idaa_loc.novi_full_name ?? 'none'} ${$idaa_loc.novi_email ?? ''}`,
|
||||
// description: activity_description ?? null,
|
||||
// object_type: 'post', // archive, post, event
|
||||
// // object_id: data?.params?.event_id ?? null,
|
||||
// // object_id: ae_acct.slct.archive_id, // data?.params?.archive_id ?? null,
|
||||
// url_root: data?.url.origin,
|
||||
// // url_full_path: data?.url.href,
|
||||
// url_full_path: data?.url.pathname,
|
||||
// url_params: data?.url.searchParams.toString(),
|
||||
// action: action,
|
||||
// action_with: action_with ?? 'none',
|
||||
// meta_json: {
|
||||
// allow_access: $ae_loc?.allow_access,
|
||||
// last_cache_refresh: $ae_loc?.last_cache_refresh,
|
||||
// last_cache_refresh_iso: last_cache_refresh_iso.toISOString(),
|
||||
// last_cache_refresh_locale: last_cache_refresh_iso.toLocaleString(),
|
||||
// access_level: $ae_loc?.access_level,
|
||||
// iframe: $ae_loc?.iframe
|
||||
// // site_access_key: $ae_loc?.site_access_key,
|
||||
// // site_domain_access_key: $ae_loc?.site_domain_access_key,
|
||||
// // site_domain: $ae_loc?.site_domain,
|
||||
// // extra_data: extra_data ?? '',
|
||||
// // log_lvl: log_lvl,
|
||||
// }
|
||||
// };
|
||||
|
||||
core_func.create_ae_obj__activity_log({
|
||||
api_cfg: $ae_api,
|
||||
account_id: $ae_loc.account_id,
|
||||
data_kv: data_kv,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
}
|
||||
// core_func.create_ae_obj__activity_log({
|
||||
// api_cfg: $ae_api,
|
||||
// account_id: $ae_loc.account_id,
|
||||
// data_kv: data_kv,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// }
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
@@ -473,6 +473,7 @@ Copy and paste link: <a href="${link_base_url}?post_id=${$idaa_slct.post_id}">${
|
||||
Title of BB post:
|
||||
</span>
|
||||
<input
|
||||
autofocus
|
||||
type="text"
|
||||
id="title"
|
||||
name="title"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
// let search_submit_results: any = null;
|
||||
|
||||
if (log_lvl) console.log('** Component Loaded: ** Post Options');
|
||||
// if (log_lvl) console.log('** Component Loaded: ** Post Options');
|
||||
</script>
|
||||
|
||||
<!-- preset-filled-surface-500 -->
|
||||
@@ -180,7 +180,7 @@
|
||||
|
||||
let data_kv = {
|
||||
external_person_id: $idaa_loc.novi_uuid,
|
||||
title: 'Change NEW Post Title',
|
||||
title: '',
|
||||
full_name: $idaa_loc.novi_full_name,
|
||||
email: $idaa_loc.novi_email,
|
||||
enable: true
|
||||
|
||||
Reference in New Issue
Block a user