refactor(crud): migrate v2 component usages to field-editor-v3
Replaces all active Element_ae_crud_v2 usages with Element_ae_obj_field_editor_v3, and direct core_func.update_ae_obj_id_crud_v2 calls with api.update_ae_obj_v3. Adds 'number' field_type to v3 editor. All on_success callbacks trigger SWR refresh via events_func load functions so liveQuery updates Dexie correctly. - element_ae_obj_field_editor_v3: add 'number' input type - ae_comp__event_session_obj_li: replace core_func v2 API calls + dead import - ae_comp__event_location_obj_li: migrate 2x Element_ae_crud_v2 (name, description) - ae_tab__manage: migrate 7x Element_ae_crud_v2 (priority/checkbox, numbers, text, tiptap) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Comp_event_session_obj_li from '../../../ae_comp__event_session_obj_li_wrapper.svelte';
|
||||
import Element_ae_crud_v2 from '$lib/elements/element_ae_crud_v2.svelte';
|
||||
import Element_ae_obj_field_editor_v3 from '$lib/elements/element_ae_obj_field_editor_v3.svelte';
|
||||
import Comp_event_device_obj_li from '../device/device/ae_comp__event_device_obj_li_wrapper.svelte';
|
||||
|
||||
// if (log_lvl) {
|
||||
@@ -138,28 +138,23 @@
|
||||
class="h5 rounded-md p-2 bg-gray-200 flex flex-row gap-1 items-center justify-between"
|
||||
>
|
||||
<span>
|
||||
<Element_ae_crud_v2
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_location'}
|
||||
object_id={event_location_obj?.event_location_id}
|
||||
object_reload={true}
|
||||
field_name={'name'}
|
||||
field_type={'text'}
|
||||
current_field_value={event_location_obj?.name}
|
||||
current_value={event_location_obj?.name}
|
||||
allow_null={false}
|
||||
hide_element={!$ae_loc.edit_mode}
|
||||
hide_edit_btn={false}
|
||||
outline_element={false}
|
||||
display_block={false}
|
||||
display_absolute_edit={false}
|
||||
class_li={'m-1'}
|
||||
on_success={() => events_func.load_ae_obj_id__event_location({ api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id })}
|
||||
>
|
||||
<!-- <strong class="text-sm">Name/Title:</strong> -->
|
||||
<span
|
||||
class="fas fa-map-marker-alt m-1 text-neutral-800/80"
|
||||
></span>
|
||||
"{event_location_obj?.name ?? '-- not set --'}"
|
||||
</Element_ae_crud_v2>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
|
||||
<!-- "{event_location_obj.name}" -->
|
||||
{#if event_location_obj?.code && !$events_loc.pres_mgmt?.hide__location_code}
|
||||
@@ -320,23 +315,18 @@
|
||||
{/if}
|
||||
</Element_ae_crud> -->
|
||||
|
||||
<Element_ae_crud_v2
|
||||
api_cfg={$ae_api}
|
||||
<Element_ae_obj_field_editor_v3
|
||||
object_type={'event_location'}
|
||||
object_id={event_location_obj?.event_location_id}
|
||||
object_reload={true}
|
||||
field_name={'description'}
|
||||
field_type={'textarea'}
|
||||
current_field_value={event_location_obj?.description}
|
||||
current_value={event_location_obj?.description}
|
||||
allow_null={true}
|
||||
hide_element={!$ae_loc.edit_mode}
|
||||
hide_edit_btn={!$ae_loc.trusted_access ||
|
||||
!$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
display_block={false}
|
||||
display_absolute_edit={false}
|
||||
textarea_rows={15}
|
||||
class_li={'m-1'}
|
||||
on_success={() => events_func.load_ae_obj_id__event_location({ api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id })}
|
||||
>
|
||||
<strong class="text-sm"> Description: </strong>
|
||||
|
||||
@@ -388,7 +378,7 @@
|
||||
{:else}
|
||||
{@html ae_snip.html__not_set}
|
||||
{/if}
|
||||
</Element_ae_crud_v2>
|
||||
</Element_ae_obj_field_editor_v3>
|
||||
</div>
|
||||
|
||||
{#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'}
|
||||
|
||||
Reference in New Issue
Block a user