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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user