Progress
This commit is contained in:
@@ -236,7 +236,7 @@ async function handle_update_ae_obj_id_crud(
|
||||
object_id: string,
|
||||
field_name: string,
|
||||
new_field_value: any,
|
||||
params: key_val,
|
||||
params: any|key_val,
|
||||
try_cache: boolean,
|
||||
log_lvl: number
|
||||
}) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { createEventDispatcher, onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { api } from '$lib/api';
|
||||
// import { api } from '$lib/api';
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
// import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
|
||||
@@ -34,10 +34,11 @@ export let hide_edit_btn = false;
|
||||
export let outline_element = false;
|
||||
export let show_crud = false;
|
||||
export let btn_label = '<span class="fas fa-check"></span> Save'; // PATCH
|
||||
export let show_field_name = true;
|
||||
export let show_original_value = true;
|
||||
export let trim_string = false;
|
||||
export let remove_breaks = false;
|
||||
|
||||
// export let show_field_name = true;
|
||||
// export let show_original_value = true;
|
||||
// export let trim_string = false;
|
||||
// export let remove_breaks = false;
|
||||
|
||||
export let class_li: string = '';
|
||||
|
||||
@@ -94,6 +95,9 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
object_id: object_id,
|
||||
field_name: field_name,
|
||||
new_field_value: new_field_value,
|
||||
params: {},
|
||||
try_cache: false,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (results) {
|
||||
console.log('PATCH Promise', results);
|
||||
|
||||
@@ -106,7 +106,7 @@ let lq__event_exhibit_tracking_obj_li = liveQuery(
|
||||
|
||||
|
||||
<div class="flex flex-row gap-1">
|
||||
{#if $ae_loc.trusted_access}
|
||||
<!-- {#if $ae_loc.trusted_access} -->
|
||||
|
||||
<button
|
||||
on:click={async () => {
|
||||
@@ -126,7 +126,7 @@ let lq__event_exhibit_tracking_obj_li = liveQuery(
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
{/if}
|
||||
<!-- {/if} -->
|
||||
|
||||
{#if $ae_loc.trusted_access}
|
||||
<button
|
||||
|
||||
@@ -610,7 +610,9 @@ async function handle_submit_form_lead_update(event) {
|
||||
events_func.handle_load_ae_obj_id__exhibit_tracking({api_cfg: $ae_api, exhibit_tracking_id: $events_slct.exhibit_tracking_id});
|
||||
}}
|
||||
>
|
||||
{#if $ae_loc.trusted_access}
|
||||
{($event_exhibit_tracking_obj?.hide ? 'Hidden' : 'Not Hidden')}
|
||||
{/if}
|
||||
<button
|
||||
on:click={() => {
|
||||
$events_slct.exhibit_tracking_obj.hide = !$event_exhibit_tracking_obj?.hide;
|
||||
@@ -618,11 +620,16 @@ async function handle_submit_form_lead_update(event) {
|
||||
}}
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
>
|
||||
{#if $ae_loc.trusted_access}
|
||||
{@html ($event_exhibit_tracking_obj?.hide ? '<span class="fas fa-eye m-1"></span> Unhide?' : '<span class="fas fa-eye-slash m-1"></span> Hide?')}
|
||||
{:else}
|
||||
<!-- Users see this as the "Archive" option button -->
|
||||
{@html ($event_exhibit_tracking_obj?.hide ? '<span class="fas fa-archive m-1"></span> Unarchive' : '<span class="fas fa-archive m-1"></span> Archive')}
|
||||
{/if}
|
||||
</button>
|
||||
</Element_ae_crud>
|
||||
|
||||
{#if $ae_loc.administrator_access}
|
||||
<!-- {#if $ae_loc.trusted_access} -->
|
||||
<Element_ae_crud
|
||||
trigger_patch={ae_triggers.enable}
|
||||
api_cfg={$ae_api}
|
||||
@@ -642,18 +649,38 @@ async function handle_submit_form_lead_update(event) {
|
||||
events_func.handle_load_ae_obj_id__exhibit_tracking({api_cfg: $ae_api, exhibit_tracking_id: $events_slct.exhibit_tracking_id});
|
||||
}}
|
||||
>
|
||||
{($event_exhibit_tracking_obj?.enable ? 'Enabled' : 'Not Enabled')}
|
||||
{#if $ae_loc.trusted_access}
|
||||
{($event_exhibit_tracking_obj?.enable ? 'Enabled' : 'Not Enabled')}:
|
||||
{/if}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (confirm('Are you sure you want to remove this lead?')) {
|
||||
console.log('Removing lead...');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
$events_slct.exhibit_tracking_obj.enable = !$event_exhibit_tracking_obj?.enable;
|
||||
ae_triggers.enable = true;
|
||||
|
||||
if (!$ae_loc.trusted_access) {
|
||||
$events_sess.leads.show_form__view_lead = false;
|
||||
$events_sess.leads.lead_data_changed = null;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm variant-soft-success"
|
||||
>
|
||||
{@html ($event_exhibit_tracking_obj?.enable ? '<span class="fas fa-toggle-on m-1"></span> Disable' : '<span class="fas fa-toggle-off m-1"></span> Enable')}
|
||||
{#if $ae_loc.trusted_access}
|
||||
{@html ($event_exhibit_tracking_obj?.enable ? '<span class="fas fa-toggle-on m-1"></span> Disable' : '<span class="fas fa-toggle-off m-1"></span> Enable')}
|
||||
{:else}
|
||||
<!-- Users see this as the "Remove" or trash option button -->
|
||||
{@html ($event_exhibit_tracking_obj?.enable ? '<span class="fas fa-trash m-1"></span> Remove' : 'Nope')}
|
||||
|
||||
{/if}
|
||||
|
||||
</button>
|
||||
</Element_ae_crud>
|
||||
{/if}
|
||||
<!-- {/if} -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user