Better (less) logging and other clean up
This commit is contained in:
@@ -106,9 +106,10 @@ export async function handle_load_ae_obj_li__event(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_obj_li:', ae_promises.load__event_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_obj_li:', ae_promises.load__event_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_obj_li;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -261,7 +261,9 @@ export async function handle_search__event_badge(
|
||||
// return badge_obj_li_get_result;
|
||||
});
|
||||
|
||||
console.log('ae_promises.search__event_badge:', ae_promises.search__event_badge);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.search__event_badge:', ae_promises.search__event_badge);
|
||||
}
|
||||
return ae_promises.search__event_badge;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,9 @@ export async function handle_load_ae_obj_li__event_file(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_file_obj_li:', ae_promises.load__event_file_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_file_obj_li:', ae_promises.load__event_file_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_file_obj_li;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,9 @@ export async function handle_load_ae_obj_li__event_presentation(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_presentation_obj_li:', ae_promises.load__event_presentation_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_presentation_obj_li:', ae_promises.load__event_presentation_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_presentation_obj_li;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,9 @@ export async function handle_load_ae_obj_li__event_presenter(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_presenter_obj_li:', ae_promises.load__event_presenter_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_presenter_obj_li:', ae_promises.load__event_presenter_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_presenter_obj_li;
|
||||
}
|
||||
|
||||
@@ -153,7 +155,9 @@ export async function handle_update_ae_obj__event_presenter(
|
||||
.finally(function () {
|
||||
});
|
||||
|
||||
console.log('ae_promises.update__event_presenter_obj:', ae_promises.update__event_presenter_obj);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.update__event_presenter_obj:', ae_promises.update__event_presenter_obj);
|
||||
}
|
||||
return ae_promises.update__event_presenter_obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,9 @@ export async function handle_load_ae_obj_li__event_session(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_session_obj_li:', ae_promises.load__event_session_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_session_obj_li:', ae_promises.load__event_session_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_session;
|
||||
}
|
||||
|
||||
@@ -225,7 +227,9 @@ export async function handle_search__event_session(
|
||||
.finally(function () {
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_session_obj_li:', ae_promises.load__event_session_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_session_obj_li:', ae_promises.load__event_session_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_session_obj_li;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,53 +146,13 @@ export async function handle_load_ae_obj_li__exhibit(
|
||||
// return exhibit_obj_li_get_result;
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_exhibit_obj_li:', ae_promises.load__event_exhibit_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_exhibit_obj_li:', ae_promises.load__event_exhibit_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_exhibit_obj_li;
|
||||
}
|
||||
|
||||
|
||||
// // This function will loop through the badge_obj_li and save each one to the DB.
|
||||
// function handle_db_save_ae_obj_li({obj_type, obj_li}) {
|
||||
// console.log(`*** handle_db_save_ae_obj_li() ***`);
|
||||
|
||||
// if (obj_li && obj_li.length) {
|
||||
// obj_li.forEach(async function (obj) {
|
||||
// // console.log(`ae_obj ${obj_type}:`, obj);
|
||||
|
||||
// try {
|
||||
// const id_random = await db_events.badges.put({
|
||||
// id_random: obj.event_badge_id_random,
|
||||
// full_name: obj.full_name,
|
||||
// full_name_override: obj.full_name_override,
|
||||
// email: obj.email,
|
||||
// email_override: obj.email_override,
|
||||
// affiliations: obj.affiliations,
|
||||
// affiliations_override: obj.affiliations_override,
|
||||
// badge_type: obj.badge_type,
|
||||
// badge_type_override: obj.badge_type_override,
|
||||
// badge_type_code: obj.badge_type_code,
|
||||
// badge_type_code_override: obj.badge_type_code_override,
|
||||
// external_event_id: obj.external_event_id,
|
||||
// external_id: obj.external_id,
|
||||
// external_person_id: obj.external_person_id,
|
||||
// created_on: obj.created_on,
|
||||
// updated_on: obj.updated_on,
|
||||
// });
|
||||
// console.log(`Put obj with ID: ${obj.event_badge_id_random} or ${id_random}`);
|
||||
// } catch (error) {
|
||||
// let status = `Failed to put ${obj.event_badge_id_random}: ${error}`;
|
||||
// console.log(status);
|
||||
// }
|
||||
|
||||
// // const id_random = await db_events.badges.put(obj);
|
||||
// // console.log(`Put obj with ID: ${obj.event_badge_id_random}`);
|
||||
// });
|
||||
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
export async function handle_load_ae_obj_id__exhibit_tracking(
|
||||
{
|
||||
api_cfg,
|
||||
@@ -299,7 +259,9 @@ export async function handle_load_ae_obj_li__exhibit_tracking(
|
||||
// return exhibit_tracking_obj_li_get_result;
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_exhibit_tracking_obj_li:', ae_promises.load__event_exhibit_tracking_obj_li);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_exhibit_tracking_obj_li:', ae_promises.load__event_exhibit_tracking_obj_li);
|
||||
}
|
||||
return ae_promises.load__event_exhibit_tracking_obj_li;
|
||||
}
|
||||
|
||||
@@ -360,7 +322,9 @@ export async function handle_create_ae_obj__exhibit_tracking(
|
||||
// return exhibit_tracking_obj_create_result;
|
||||
});
|
||||
|
||||
console.log('ae_promises.create__event_exhibit_tracking:', ae_promises.create__event_exhibit_tracking);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.create__event_exhibit_tracking:', ae_promises.create__event_exhibit_tracking);
|
||||
}
|
||||
return ae_promises.create__event_exhibit_tracking;
|
||||
}
|
||||
|
||||
@@ -407,7 +371,9 @@ export async function handle_update_ae_obj__exhibit_tracking(
|
||||
.finally(function () {
|
||||
});
|
||||
|
||||
console.log('ae_promises.update__event_exhibit_tracking:', ae_promises.update__event_exhibit_tracking);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.update__event_exhibit_tracking:', ae_promises.update__event_exhibit_tracking);
|
||||
}
|
||||
return ae_promises.update__event_exhibit_tracking;
|
||||
}
|
||||
|
||||
@@ -451,7 +417,9 @@ export async function handle_download_export__event_exhibit_tracking(
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
|
||||
console.log('ae_promises.download__event_exhibit_tracking_export_file:', ae_promises.download__event_exhibit_tracking_export_file);
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.download__event_exhibit_tracking_export_file:', ae_promises.download__event_exhibit_tracking_export_file);
|
||||
}
|
||||
return ae_promises.download__event_exhibit_tracking_export_file;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,12 +119,16 @@ export let get_object = async function get_object(
|
||||
let percent_completed = Math.round(
|
||||
(progressEvent.loaded * 100) / progressEvent.total
|
||||
);
|
||||
console.log('GET Data Progress:', progressEvent.progress, 'Total:', progressEvent.total, 'Loaded:', progressEvent.loaded, 'Percent Completed', percent_completed);
|
||||
if (log_lvl) {
|
||||
console.log('GET Data Progress:', progressEvent.progress, 'Total:', progressEvent.total, 'Loaded:', progressEvent.loaded, 'Percent Completed', percent_completed);
|
||||
}
|
||||
|
||||
temp_get_object_percent_completed = percent_completed;
|
||||
|
||||
// WARNING: This needs to be tied to an object type and ID. This is a temporary solution.
|
||||
try {
|
||||
// Check if window is defined. This is to prevent errors in SvelteKit.
|
||||
if (typeof window !== 'undefined') {
|
||||
window.postMessage({
|
||||
type: 'api_download_data',
|
||||
status: 'downloading',
|
||||
@@ -137,6 +141,7 @@ export let get_object = async function get_object(
|
||||
},
|
||||
'*'
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Error posting message to window:', error);
|
||||
}
|
||||
@@ -153,6 +158,7 @@ export let get_object = async function get_object(
|
||||
|
||||
// Post file download message
|
||||
try {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.postMessage({
|
||||
type: 'api_download_data',
|
||||
status: 'complete',
|
||||
@@ -165,6 +171,7 @@ export let get_object = async function get_object(
|
||||
},
|
||||
'*'
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Error posting message to window:', error);
|
||||
}
|
||||
@@ -287,6 +294,7 @@ export let get_object = async function get_object(
|
||||
|
||||
// WARNING: This needs to be tied to an object type and ID. This is a temporary solution.
|
||||
try {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.postMessage({
|
||||
type: 'api_download_blob',
|
||||
status: 'downloading',
|
||||
@@ -299,6 +307,7 @@ export let get_object = async function get_object(
|
||||
},
|
||||
'*'
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Error posting message to window:', error);
|
||||
}
|
||||
@@ -325,6 +334,7 @@ export let get_object = async function get_object(
|
||||
|
||||
// WARNING: This needs to be tied to an object type and ID. This is a temporary solution.
|
||||
try {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.postMessage({
|
||||
type: 'api_download_blob',
|
||||
status: 'complete',
|
||||
@@ -337,6 +347,7 @@ export let get_object = async function get_object(
|
||||
},
|
||||
'*'
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Error posting message to window:', error);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ export interface Event {
|
||||
file_count: number;
|
||||
}
|
||||
|
||||
|
||||
export interface Badge {
|
||||
// id?: number;
|
||||
id_random: string;
|
||||
@@ -104,6 +105,7 @@ export interface Badge {
|
||||
updated_on: null|Date;
|
||||
}
|
||||
|
||||
|
||||
export interface Exhibit {
|
||||
// id?: number;
|
||||
id_random: string;
|
||||
@@ -135,6 +137,7 @@ export interface Exhibit {
|
||||
updated_on: null|Date;
|
||||
}
|
||||
|
||||
|
||||
export interface Exhibit_tracking {
|
||||
// id?: number;
|
||||
id_random: string;
|
||||
@@ -184,6 +187,11 @@ export interface Exhibit_tracking {
|
||||
updated_on: null|Date;
|
||||
}
|
||||
|
||||
|
||||
export interface Registration {
|
||||
// Nothing here yet
|
||||
}
|
||||
|
||||
export interface File {
|
||||
id: string;
|
||||
id_random: string;
|
||||
@@ -229,6 +237,12 @@ export interface File {
|
||||
hosted_file_size: number; // In bytes
|
||||
}
|
||||
|
||||
|
||||
export interface Location {
|
||||
// Nothing here yet
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-19
|
||||
export interface Session {
|
||||
id: string;
|
||||
@@ -295,6 +309,7 @@ export interface Session {
|
||||
event_location_name: null|string;
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
export interface Presentation {
|
||||
id: string;
|
||||
@@ -346,6 +361,7 @@ export interface Presentation {
|
||||
event_session_name: null|string;
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
export interface Presenter {
|
||||
id: string;
|
||||
|
||||
@@ -18,15 +18,15 @@ export let for_type: null|string = null;
|
||||
export let for_id: null|string = null;
|
||||
console.log(`ae_e_data_store ${ds_code} for_type=${for_type} for_id=${for_id} account_id=${$ae_loc.account_id}`);
|
||||
|
||||
export let store: string = 'local';
|
||||
export let display: string = 'block';
|
||||
// export let store: string = 'local';
|
||||
// export let display: string = 'block';
|
||||
export let class_li: string = ''; // : string[] = [];
|
||||
export let try_cache: boolean = true;
|
||||
|
||||
export let show_edit: boolean = false;
|
||||
export let show_edit_btn: boolean = true;
|
||||
export let show_view: boolean = true;
|
||||
export let show_delete_btn: boolean = false;
|
||||
// export let show_delete_btn: boolean = false;
|
||||
|
||||
export let ds_loaded: boolean = false;
|
||||
|
||||
@@ -410,7 +410,7 @@ async function handle_create__data_store({
|
||||
obj_type: obj_type,
|
||||
fields: data,
|
||||
key: $ae_api.api_crud_super_key,
|
||||
log_lvl: 2
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(async function (create__obj_result) {
|
||||
if (!create__obj_result) {
|
||||
@@ -750,8 +750,7 @@ async function handle_update__data_store({
|
||||
|
||||
<!-- {/if} -->
|
||||
{:else}
|
||||
|
||||
|
||||
<!-- Nothing to see yet -->
|
||||
{/if}
|
||||
|
||||
<!-- Text:
|
||||
|
||||
Reference in New Issue
Block a user