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:
Scott Idem
2026-02-13 13:51:55 -05:00
parent de947c827a
commit 6bfd13f52c
16 changed files with 224 additions and 226 deletions

View File

@@ -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>

View File

@@ -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
}