refactor: migrate Element_ae_crud v1/v2 usages to element_ae_obj_field_editor_v3

Replace all active Element_ae_crud (v1) and Element_ae_crud_v2 usages across
22 files with Element_ae_obj_field_editor_v3. Also remove 9 commented-out v1
imports that were dead code.

Key changes:
- Remove trigger_patch pattern; replace with direct api.update_ae_obj_v3() calls
- Replace field_value prop with current_value, on:ae_crud_updated with on_success
- Remove legacy props: api_cfg, hide_edit_btn, outline_element, show_crud,
  display_inline, display_block_edit (→ display_block), class_li
- field_type 'boolean' → 'checkbox', 'email' → 'text' (v3 has no email type)
- Replace core_func.update_ae_obj_id_crud_v2() with api.update_ae_obj_v3()
- Keep core_func where still used (QR code generation, person create)

Files: presenter_view, person_view, location_view, device_obj_li,
presentation_obj_li, session_view, launcher_file_cont, session_alert,
event/session/location/presenter page menus, leads exhibit tracking page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-05 17:38:02 -05:00
parent cdf56aadcd
commit d846a39677
22 changed files with 685 additions and 2367 deletions

View File

@@ -65,14 +65,11 @@
import { events_func } from '$lib/ae_events_functions';
import AE_Comp_Hosted_Files_Download_Button from '$lib/ae_core/ae_comp__hosted_files_download_button.svelte';
import Element_ae_crud from '$lib/elements/element_ae_crud.svelte';
// Import the relay
import * as native from '$lib/electron/electron_relay';
let ae_promises: key_val = $state({});
let ae_tmp: key_val = $state({});
let ae_triggers: key_val = $state({});
let open_file_clicked: null | boolean = $state(null);
let open_file_status: null | string = $state(null);
@@ -355,46 +352,38 @@
class="event_file_meta grow text-sm text-gray-500 flex flex-col sm:flex-row gap-1 wrap items-center justify-between w-64 max-w-80 font-mono"
class:hidden={hide_meta}
>
<Element_ae_crud
trigger_patch={ae_triggers.open_in_os}
api_cfg={$ae_api}
object_type={'event_file'}
object_id={event_file_id}
field_name={'open_in_os'}
field_type={'button'}
field_value={ae_tmp.value__open_in_os}
on:ae_crud_updated={() => {
<button
type="button"
onclick={async () => {
let new_val: string | null;
if (!event_file_obj?.open_in_os) new_val = 'win';
else if (event_file_obj?.open_in_os == 'win') new_val = 'mac';
else new_val = null;
await api.update_ae_obj_v3({
api_cfg: $ae_api,
obj_type: 'event_file',
obj_id: event_file_id,
fields: { open_in_os: new_val }
});
events_func.load_ae_obj_id__event_file({
api_cfg: $ae_api,
event_file_id: event_file_obj?.event_file_id,
log_lvl
});
}}
class="btn btn-sm transition-all group"
class:preset-tonal-success={event_file_obj?.open_in_os == 'win'}
class:preset-tonal-warning={event_file_obj?.open_in_os == 'mac'}
disabled={!$ae_loc.trusted_access}
>
<button
type="button"
onclick={() => {
if (!event_file_obj?.open_in_os)
ae_tmp.value__open_in_os = 'win';
else if (event_file_obj?.open_in_os == 'win')
ae_tmp.value__open_in_os = 'mac';
else ae_tmp.value__open_in_os = null;
ae_triggers.open_in_os = true;
}}
class="btn btn-sm transition-all group"
class:preset-tonal-success={event_file_obj?.open_in_os == 'win'}
class:preset-tonal-warning={event_file_obj?.open_in_os == 'mac'}
disabled={!$ae_loc.trusted_access}
>
{#if event_file_obj?.open_in_os == 'win'}<span
class="fab fa-windows m-1"
></span>
{:else if event_file_obj?.open_in_os == 'mac'}<span
class="fab fa-apple m-1"
></span>
{:else}<span class="fas fa-folder-open m-1"></span>{/if}
</button>
</Element_ae_crud>
{#if event_file_obj?.open_in_os == 'win'}<span
class="fab fa-windows m-1"
></span>
{:else if event_file_obj?.open_in_os == 'mac'}<span
class="fab fa-apple m-1"
></span>
{:else}<span class="fas fa-folder-open m-1"></span>{/if}
</button>
<span
class="event_file_created_on text-xs text-center flex flex-row gap-1 items-center justify-end w-24 md:w-44 preset-filled-surface-100-900 rounded px-1 py-0.5"

View File

@@ -61,7 +61,6 @@
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import { api } from '$lib/api/api';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
// import Element_data_store from '$lib/element_data_store_v3.svelte';
import {

View File

@@ -12,7 +12,6 @@
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
import Event_launcher_file_cont from './launcher_file_cont.svelte';
import Launcher_presentation_view from './launcher_presentation_view.svelte';
import Launcher_presenter_view from './launcher_presenter_view.svelte';