Fixes for the reports. General clean up all around. Better usage of log_lvl.

This commit is contained in:
Scott Idem
2024-08-16 13:14:18 -04:00
parent ca563fdf1f
commit 37801ca769
15 changed files with 161 additions and 58 deletions

View File

@@ -220,17 +220,23 @@ export async function handle_update_ae_obj__person(
export function handle_db_save_ae_obj_li__person(
{
obj_type,
obj_li
obj_li,
log_lvl=0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** handle_db_save_ae_obj_li__person() ***`);
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__person() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_core.person.put({

View File

@@ -126,17 +126,23 @@ export async function handle_load_ae_obj_li__event(
export function handle_db_save_ae_obj_li__event(
{
obj_type,
obj_li
obj_li,
log_lvl = 0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** handle_db_save_ae_obj_li__event() ***`);
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__event() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.events.put({

View File

@@ -260,17 +260,23 @@ export async function handle_search__event_badge(
export function handle_db_save_ae_obj_li__badge(
{
obj_type,
obj_li
obj_li,
log_lvl = 0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** handle_db_save_ae_obj_li__badge() ***`);
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__badge() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.badges.put({

View File

@@ -284,6 +284,7 @@ export async function handle_search__event_file(
like_search_qry_str = null,
like_presentation_search_qry_str = null,
like_file_search_qry_str = null,
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'filename': 'ASC', 'extension': 'ASC', 'hosted_file_size': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
params = {},
try_cache = true,
log_lvl = 0
@@ -296,12 +297,15 @@ export async function handle_search__event_file(
like_search_qry_str?: null|string,
like_presentation_search_qry_str?: null|string,
like_file_search_qry_str?: null|string,
order_by_li?: key_val,
params?: any,
try_cache?: boolean,
log_lvl?: number
}
) {
console.log(`*** handle_search__event_file() *** event_id=${event_id}`);
if (log_lvl) {
console.log(`*** handle_search__event_file() *** event_id=${event_id}`);
}
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
@@ -357,8 +361,6 @@ export async function handle_search__event_file(
// params_json['and_qry']['created_on'] = created_on;
// }
let order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'filename': 'ASC', 'extension': 'ASC', 'hosted_file_size': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'};
ae_promises.load__event_file_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'event_file',
@@ -400,17 +402,23 @@ export async function handle_search__event_file(
export function handle_db_save_ae_obj_li__event_file(
{
obj_type,
obj_li
obj_li,
log_lvl=0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** handle_db_save_ae_obj_li__event_file() ***`);
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__event_file() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.files.put({

View File

@@ -441,17 +441,23 @@ export async function create_ae_obj__event_location(
export function db_save_ae_obj_li__event_location(
{
obj_type,
obj_li
obj_li,
log_lvl=0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** db_save_ae_obj_li__event_location() ***`);
if (log_lvl) {
console.log(`*** db_save_ae_obj_li__event_location() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.locations.put({

View File

@@ -176,17 +176,23 @@ export async function create_ae_obj__event_presentation(
export function db_save_ae_obj_li__event_presentation(
{
obj_type,
obj_li
obj_li,
log_lvl=0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** db_save_ae_obj_li__event_presentation() ***`);
if (log_lvl) {
console.log(`*** db_save_ae_obj_li__event_presentation() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.presentations.put({

View File

@@ -304,6 +304,7 @@ export async function search__event_presenter(
like_search_qry_str = null,
like_presentation_search_qry_str = null,
like_presenter_search_qry_str = null,
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'given_name': 'ASC', 'family_name': 'ASC', 'email': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
params = {},
try_cache = true,
log_lvl = 0
@@ -317,6 +318,7 @@ export async function search__event_presenter(
like_search_qry_str?: null|string,
like_presentation_search_qry_str?: null|string,
like_presenter_search_qry_str?: null|string,
order_by_li?: key_val,
params?: any,
try_cache?: boolean,
log_lvl?: number
@@ -384,8 +386,6 @@ export async function search__event_presenter(
params_json['and_qry']['biography_check'] = biography;
}
let order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'given_name': 'ASC', 'family_name': 'ASC', 'email': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'};
ae_promises.load__event_presenter_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'event_presenter',
@@ -441,7 +441,9 @@ export function db_save_ae_obj_li__event_presenter(
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.presenters.put({

View File

@@ -510,17 +510,23 @@ export async function search__event_session(
export function db_save_ae_obj_li__event_session(
{
obj_type,
obj_li
obj_li,
log_lvl = 0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** db_save_ae_obj_li__event_session() ***`);
if (log_lvl) {
console.log(`*** db_save_ae_obj_li__event_session() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.sessions.put({

View File

@@ -413,12 +413,26 @@ export async function handle_download_export__event_exhibit_tracking(
// This function will loop through the event_exhibit_obj_li and save each one to the DB.
export function handle_db_save_ae_obj_li__exhibitor({obj_type, obj_li=[]}: {obj_type: string, obj_li: any[]}) {
console.log(`*** handle_db_save_ae_obj_li__exhibitor() ***`);
export function handle_db_save_ae_obj_li__exhibitor(
{
obj_type,
obj_li=[],
log_lvl=0
}: {
obj_type: string,
obj_li: any[],
log_lvl?: number
}
) {
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__exhibitor() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.exhibits.put({
@@ -468,17 +482,23 @@ export function handle_db_save_ae_obj_li__exhibitor({obj_type, obj_li=[]}: {obj_
export function handle_db_save_ae_obj_li__exhibitor_tracking(
{
obj_type,
obj_li
obj_li,
log_lvl=0
}: {
obj_type: string,
obj_li: any
obj_li: any,
log_lvl?: number
}
) {
console.log(`*** handle_db_save_ae_obj_li__exhibitor_tracking() ***`);
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__exhibitor_tracking() ***`);
}
if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj);
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
}
try {
const id_random = await db_events.exhibit_tracking.put({

View File

@@ -215,6 +215,8 @@ let events_local_data_struct: key_val = {
show_report__presenters_agree: false,
show_report__recent_files: false,
// time_format: 'time_us_short', // 'time_short', 'time_us_short'
disable_submit__opt_out: true,
submit_status__opt_out: null,
},

View File

@@ -98,7 +98,15 @@ if (file_type == 'CSV' || file_type == 'Excel') {
}
params['return_file'] = true;
ae_promises.download__sponsorship_export_file = await api.get_object({api_cfg: api_cfg, endpoint: endpoint, params: params, return_blob: return_file, filename: filename, auto_download: auto_download, log_lvl: log_lvl});
ae_promises.download__sponsorship_export_file = await api.get_object({
api_cfg: api_cfg,
endpoint: endpoint,
params: params,
return_blob: return_file,
filename: filename,
auto_download: auto_download,
log_lvl: log_lvl
});
console.log('ae_promises.download__sponsorship_export_file:', ae_promises.download__sponsorship_export_file);
return ae_promises.download__sponsorship_export_file;