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:
@@ -39,7 +39,7 @@
|
||||
events_trigger,
|
||||
events_trig_kv
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import Element_ae_crud from '$lib/elements/element_ae_crud.svelte';
|
||||
import Element_ae_obj_field_editor_v3 from '$lib/elements/element_ae_obj_field_editor_v3.svelte';
|
||||
import Comp_event_presenter_obj_li from '../events/[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li_wrapper.svelte';
|
||||
import Element_manage_event_file_li_wrap from '$lib/elements/element_manage_event_file_li_all.svelte';
|
||||
|
||||
@@ -193,76 +193,29 @@
|
||||
)}
|
||||
</span>
|
||||
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_presentation'}
|
||||
object_id={event_presentation_obj?.event_presentation_id}
|
||||
field_name={'name'}
|
||||
field_type={'text'}
|
||||
field_value={event_presentation_obj?.name}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access ||
|
||||
!$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={(e) => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func
|
||||
.load_ae_obj_id__event_presentation({
|
||||
api_cfg: $ae_api,
|
||||
event_presentation_id:
|
||||
event_presentation_obj.event_presentation_id,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (load_results) {})
|
||||
.then(function (load_results) {
|
||||
// $events_trigger = 'load__event_presentation_obj_id';
|
||||
// $events_trig_kv['event_presentation_id'] = event_presentation_obj.event_presentation_id;
|
||||
});
|
||||
}}
|
||||
current_value={event_presentation_obj?.name}
|
||||
display_block={true}
|
||||
on_success={() => events_func.load_ae_obj_id__event_presentation({ api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id, log_lvl: 1 })}
|
||||
>
|
||||
<!-- <strong class="text-sm">Name/Title:</strong> -->
|
||||
<span class="italic">
|
||||
{event_presentation_obj?.name}
|
||||
</span>
|
||||
</Element_ae_crud>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
<!-- "{event_presentation_obj.name}" -->
|
||||
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_presentation'}
|
||||
object_id={event_presentation_obj?.event_presentation_id}
|
||||
field_name={'code'}
|
||||
field_type={'text'}
|
||||
field_value={event_presentation_obj?.code}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access ||
|
||||
!$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={(e) => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func
|
||||
.load_ae_obj_id__event_presentation({
|
||||
api_cfg: $ae_api,
|
||||
event_presentation_id:
|
||||
event_presentation_obj.event_presentation_id,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (load_results) {})
|
||||
.then(function (load_results) {
|
||||
// $events_trigger = 'load__event_presentation_obj_id';
|
||||
// $events_trig_kv['event_presentation_id'] = event_presentation_obj.event_presentation_id;
|
||||
});
|
||||
}}
|
||||
current_value={event_presentation_obj?.code}
|
||||
display_block={true}
|
||||
on_success={() => events_func.load_ae_obj_id__event_presentation({ api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id, log_lvl: 1 })}
|
||||
>
|
||||
{#if (event_presentation_obj?.code || event_presentation_obj?.abstract_code) && !$events_loc.pres_mgmt.hide__presentation_code}
|
||||
<span
|
||||
@@ -289,7 +242,7 @@
|
||||
</span>
|
||||
</span>
|
||||
{/if}
|
||||
</Element_ae_crud>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
<!-- Can not edit the abstract code here at this time. -->
|
||||
</h4>
|
||||
|
||||
@@ -328,75 +281,37 @@
|
||||
>
|
||||
<span class="fas fa-calendar-alt text-success-800-400"
|
||||
></span>
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_presentation'}
|
||||
object_id={event_presentation_obj?.event_presentation_id}
|
||||
field_name={'start_datetime'}
|
||||
field_type={'datetime'}
|
||||
field_value={event_presentation_obj.start_datetime}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access ||
|
||||
!$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={(e) => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_presentation({
|
||||
api_cfg: $ae_api,
|
||||
event_presentation_id:
|
||||
event_presentation_obj?.event_presentation_id
|
||||
});
|
||||
// $events_trigger = 'load__event_presentation_obj_id';
|
||||
// $events_trig_kv['event_presentation_id'] = event_presentation_obj?.event_presentation_id;
|
||||
}}
|
||||
current_value={event_presentation_obj.start_datetime}
|
||||
on_success={() => events_func.load_ae_obj_id__event_presentation({ api_cfg: $ae_api, event_presentation_id: event_presentation_obj?.event_presentation_id })}
|
||||
>
|
||||
{ae_util.iso_datetime_formatter(
|
||||
event_presentation_obj.start_datetime,
|
||||
'dddd'
|
||||
)}
|
||||
<!-- , -->
|
||||
<!-- {ae_util.iso_datetime_formatter(event_presentation_obj.start_datetime, $events_loc.pres_mgmt.datetime_format)} -->
|
||||
{ae_util.iso_datetime_formatter(
|
||||
event_presentation_obj.start_datetime,
|
||||
$events_loc.pres_mgmt.time_format
|
||||
)}
|
||||
</Element_ae_crud>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
-
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_presentation'}
|
||||
object_id={event_presentation_obj?.event_presentation_id}
|
||||
field_name={'end_datetime'}
|
||||
field_type={'datetime'}
|
||||
field_value={event_presentation_obj.end_datetime}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access ||
|
||||
!$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={(e) => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_presentation({
|
||||
api_cfg: $ae_api,
|
||||
event_presentation_id:
|
||||
event_presentation_obj?.event_presentation_id
|
||||
});
|
||||
// $events_trigger = 'load__event_presentation_obj_id';
|
||||
// $events_trig_kv['event_presentation_id'] = event_presentation_obj?.event_presentation_id;
|
||||
}}
|
||||
current_value={event_presentation_obj.end_datetime}
|
||||
on_success={() => events_func.load_ae_obj_id__event_presentation({ api_cfg: $ae_api, event_presentation_id: event_presentation_obj?.event_presentation_id })}
|
||||
>
|
||||
{ae_util.iso_datetime_formatter(
|
||||
event_presentation_obj.end_datetime,
|
||||
$events_loc.pres_mgmt.time_format
|
||||
)}
|
||||
</Element_ae_crud>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -404,32 +319,16 @@
|
||||
.show_content__presentation_description &&
|
||||
!($ae_loc.trusted_access && $ae_loc.edit_mode)}
|
||||
>
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_presentation'}
|
||||
object_id={event_presentation_obj?.event_presentation_id}
|
||||
field_name={'description'}
|
||||
field_type={'textarea'}
|
||||
field_value={event_presentation_obj?.description}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access ||
|
||||
!$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
current_value={event_presentation_obj?.description}
|
||||
allow_null={true}
|
||||
display_block={true}
|
||||
textarea_rows={15}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={(e) => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_presentation({
|
||||
api_cfg: $ae_api,
|
||||
event_presentation_id:
|
||||
event_presentation_obj.event_presentation_id,
|
||||
log_lvl: 1
|
||||
});
|
||||
}}
|
||||
on_success={() => events_func.load_ae_obj_id__event_presentation({ api_cfg: $ae_api, event_presentation_id: event_presentation_obj.event_presentation_id, log_lvl: 1 })}
|
||||
>
|
||||
<span
|
||||
class="text-sm text-semibold text-success-800-400"
|
||||
@@ -490,7 +389,7 @@
|
||||
No description provided.
|
||||
</div>
|
||||
{/if} -->
|
||||
</Element_ae_crud>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
</div>
|
||||
|
||||
<!-- Show presenters for this presentation -->
|
||||
|
||||
Reference in New Issue
Block a user