Bug fix for QR scan. Clean up for the day!

This commit is contained in:
Scott Idem
2024-03-25 20:15:02 -04:00
parent 3ddef770c0
commit 54fb837581
2 changed files with 35 additions and 13 deletions

View File

@@ -13,7 +13,8 @@ import Element_qr_scanner from '$lib/element_qr_scanner.svelte';
// TEMPORARY: For testing and development
$events_sess.leads.show_form__search = true;
// $events_sess.leads.show_form__search = true;
// $events_sess.leads.show_form__scan = true;
// TEMPORARY: For testing and development
@@ -357,7 +358,7 @@ function handle_qr_camera(event) {
$events_sess.leads.show_confirm__add_lead[index] = true;
}}
disabled={!$ae_loc.trusted_access}
disabled={!$ae_loc.trusted_access && 2==4}
title="Add {event_badge_obj_v2.full_name} to the leads list?"
class="btn btn-md variant-soft-primary mx-1"
>
@@ -418,9 +419,16 @@ function handle_qr_camera(event) {
<button
type="button"
class="btn variant-soft-primary"
disabled={!$ae_loc.trusted_access}
on:click={() => {
console.log(`Add ${event_badge_obj_v2.full_name} ${event_badge_obj_v2.email} to the leads list`);
// TEMPORARY: For testing and development
if (!$ae_loc.trusted_access) {
console.log('You do not have permission to add this person to the leads list.');
return false;
}
// TEMPORARY: For testing and development
events_func.handle_create_ae_obj__exhibit_tracking({api_cfg: $ae_api, exhibit_id: $events_slct.exhibit_id, event_badge_id: event_badge_obj_v2.event_badge_id_random, external_person_id: $events_loc.leads.auth_exhibit_kv[$events_slct.exhibit_id].key, })
.then((result) => {
@@ -688,10 +696,10 @@ function handle_qr_camera(event) {
type="button"
class="btn variant-soft-primary"
on:click={() => {
$events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
$events_slct.badge_id = null;
$events_slct.badge_obj = null;
$events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
}}
>
<span class="fas fa-times mx-1"></span>
@@ -710,10 +718,13 @@ function handle_qr_camera(event) {
on:click={() => {
console.log(`Do not add ${$event_badge_obj.full_name} ${$event_badge_obj.email} to the leads list`);
$events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
$events_slct.badge_id = null;
$events_slct.badge_obj = null;
$events_sess.leads.show_confirm__add_lead[$events_sess.leads.qr_scan_result] = false;
// $events_slct = $events_slct;
// $events_sess = $events_sess;
}}
>
<span class="fas fa-times mx-1"></span>
@@ -723,9 +734,16 @@ function handle_qr_camera(event) {
<button
type="button"
class="btn variant-soft-primary"
disabled={!$ae_loc.trusted_access}
on:click={() => {
console.log(`Add ${event_badge_obj.full_name} ${event_badge_obj.email} to the leads list`);
// TEMPORARY: For testing and development
if (!$ae_loc.trusted_access) {
console.log('You do not have permission to add this person to the leads list.');
return false;
}
// TEMPORARY: For testing and development
events_func.handle_create_ae_obj__exhibit_tracking({api_cfg: $ae_api, exhibit_id: $events_slct.exhibit_id, event_badge_id: $events_slct.badge_id, external_person_id: $events_loc.leads.auth_exhibit_kv[$events_slct.exhibit_id].key, })
.then((result) => {
@@ -738,15 +756,16 @@ function handle_qr_camera(event) {
$events_slct.exhibit_tracking_id = exhibit_tracking_id;
$events_slct.exhibit_tracking_obj = exhibit_tracking_obj;
$events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
} else {
console.log('This badge ID has probably already been added to the lead list for this exhibit.');
// Need to look the old record up and set it to not hidden.
$events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
}
$events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
// $events_sess.leads.show_confirm__add_lead[$events_slct.badge_id] = false;
$events_slct.badge_id = null;
$events_slct.badge_obj = null;
if ($events_loc.leads.auto_view) {
$events_sess.leads.show_form__search = false;