Another round of lots of updates to fix little bugs here there and everywhere.
This commit is contained in:
8
TODO.md
8
TODO.md
@@ -4,6 +4,14 @@ This is a list of tasks to be completed before the next event/show/conference.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Big Picture Goals
|
||||||
|
|
||||||
|
* Able to cache data and mostly work offline.
|
||||||
|
* The new Events Launcher must be able to work offline and query the API for changes to data.
|
||||||
|
* The new Events Launcher must be able to run inside an Electron app and have access to local files and commands. This includes loading a special library that only works in Electron.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Codebase Standardization
|
## Codebase Standardization
|
||||||
|
|
||||||
### 1. Naming Conventions
|
### 1. Naming Conventions
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export let get_object = async function get_object(
|
|||||||
params = {},
|
params = {},
|
||||||
data = {},
|
data = {},
|
||||||
timeout = 60000,
|
timeout = 60000,
|
||||||
// return_meta = false,
|
return_meta = false,
|
||||||
return_blob = false,
|
return_blob = false,
|
||||||
filename = '',
|
filename = '',
|
||||||
auto_download = false,
|
auto_download = false,
|
||||||
@@ -30,7 +30,7 @@ export let get_object = async function get_object(
|
|||||||
params?: any,
|
params?: any,
|
||||||
data?: any,
|
data?: any,
|
||||||
timeout?: number,
|
timeout?: number,
|
||||||
// return_meta?: boolean,
|
return_meta?: boolean,
|
||||||
return_blob?: boolean,
|
return_blob?: boolean,
|
||||||
filename?: null | string,
|
filename?: null | string,
|
||||||
auto_download?: boolean,
|
auto_download?: boolean,
|
||||||
@@ -105,7 +105,7 @@ export let get_object = async function get_object(
|
|||||||
for (let attempt = 1; attempt <= retry_count; attempt++) {
|
for (let attempt = 1; attempt <= retry_count; attempt++) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch_method(url.toString(), fetchOptions)
|
const response = await fetch_method(url.toString(), fetchOptions)
|
||||||
.catch(function (error) {
|
.catch(function (error: any) {
|
||||||
console.log('API GET Object *fetch* request was aborted or failed in an unexpected way.', error);
|
console.log('API GET Object *fetch* request was aborted or failed in an unexpected way.', error);
|
||||||
});
|
});
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
|
|||||||
@@ -267,8 +267,8 @@ export async function qry__activity_log(
|
|||||||
qry_str?: string,
|
qry_str?: string,
|
||||||
qry_files?: null|boolean,
|
qry_files?: null|boolean,
|
||||||
qry_start_datetime?: null|string, // Greater than this datetime
|
qry_start_datetime?: null|string, // Greater than this datetime
|
||||||
enabled?: string, // all, disabled, enabled
|
enabled?: "enabled" | "all" | "not_enabled" | undefined, // all, disabled, enabled
|
||||||
hidden?: string, // all, hidden, not_hidden
|
hidden?: "hidden" | "all" | "not_hidden" | undefined, // all, hidden, not_hidden
|
||||||
limit?: number,
|
limit?: number,
|
||||||
offset?: number,
|
offset?: number,
|
||||||
params?: any,
|
params?: any,
|
||||||
@@ -323,7 +323,7 @@ export async function qry__activity_log(
|
|||||||
params_json['qry'].push(qry_param);
|
params_json['qry'].push(qry_param);
|
||||||
}
|
}
|
||||||
|
|
||||||
let order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'};
|
let order_by_li: { [key: string]: "ASC" | "DESC" }[] = [{'priority': 'DESC'}, {'sort': 'DESC'}, {'start_datetime': 'ASC'}, {'name': 'ASC'}, {'updated_on': 'DESC'}, {'created_on': 'DESC'}];
|
||||||
|
|
||||||
ae_promises.load__activity_log_obj_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
|
ae_promises.load__activity_log_obj_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
|
||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ export async function db_save_ae_obj_li__ae_obj<T extends Record<string, any>>({
|
|||||||
const db_table: Table<T> = db_instance.table(table_name);
|
const db_table: Table<T> = db_instance.table(table_name);
|
||||||
if (!db_table) {
|
if (!db_table) {
|
||||||
const error_msg = `Table not found in Dexie instance: ${table_name}`;
|
const error_msg = `Table not found in Dexie instance: ${table_name}`;
|
||||||
console.error(errorMsg);
|
console.error(error_msg);
|
||||||
throw new Error(errorMsg);
|
throw new Error(error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data_to_save = obj_li
|
const data_to_save = obj_li
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export async function load_ae_obj_li__person(
|
|||||||
hidden = 'not_hidden',
|
hidden = 'not_hidden',
|
||||||
limit = 99,
|
limit = 99,
|
||||||
offset = 0,
|
offset = 0,
|
||||||
order_by_li = {'family_name': 'ASC', 'given_name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
order_by_li = [{'family_name': 'ASC'}, {'given_name': 'ASC'}, {'updated_on': 'DESC'}, {'created_on': 'DESC'}],
|
||||||
// params_json = {},
|
// params_json = {},
|
||||||
params = {},
|
params = {},
|
||||||
try_cache = true,
|
try_cache = true,
|
||||||
@@ -110,11 +110,11 @@ export async function load_ae_obj_li__person(
|
|||||||
for_obj_id: string,
|
for_obj_id: string,
|
||||||
qry_email?: string|null,
|
qry_email?: string|null,
|
||||||
qry_user_id?: string|null,
|
qry_user_id?: string|null,
|
||||||
enabled?: string, // all, disabled, enabled
|
enabled?: "enabled" | "all" | "not_enabled" | undefined, // all, disabled, enabled
|
||||||
hidden?: string, // all, hidden, not_hidden
|
hidden?: "hidden" | "all" | "not_hidden" | undefined, // all, hidden, not_hidden
|
||||||
limit?: number,
|
limit?: number,
|
||||||
offset?: number,
|
offset?: number,
|
||||||
order_by_li?: key_val,
|
order_by_li?: { [key: string]: "ASC" | "DESC" }[] | null,
|
||||||
// params_json?: null|key_val,
|
// params_json?: null|key_val,
|
||||||
params?: key_val,
|
params?: key_val,
|
||||||
try_cache?: boolean,
|
try_cache?: boolean,
|
||||||
@@ -688,13 +688,13 @@ async function _process_generic_props<T extends Record<string, any>>({
|
|||||||
for (const key in processed_obj) {
|
for (const key in processed_obj) {
|
||||||
if (key.endsWith('_random')) {
|
if (key.endsWith('_random')) {
|
||||||
const new_key = key.slice(0, -7); // Remove '_random' suffix
|
const new_key = key.slice(0, -7); // Remove '_random' suffix
|
||||||
processed_obj[newKey] = processed_obj[key];
|
(processed_obj as any)[new_key] = processed_obj[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ensure 'id' is set from '[obj_type]_id_random'
|
// Ensure 'id' is set from '[obj_type]_id_random'
|
||||||
const random_id_key = `${obj_type}_id_random`;
|
const random_id_key = `${obj_type}_id_random`;
|
||||||
if (processed_obj[random_id_key]) {
|
if (processed_obj[random_id_key]) {
|
||||||
processed_obj.id = processed_obj[randomIdKey];
|
(processed_obj as any).id = processed_obj[random_id_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Create common computed properties for client-side sorting.
|
// 2. Create common computed properties for client-side sorting.
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ async function get_url_cfg(cfg) {
|
|||||||
}
|
}
|
||||||
return return_data;
|
return return_data;
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error: any) {
|
||||||
console.log(`Base URL: ${base_url} | Endpoint: ${endpoint}`);
|
console.log(`Base URL: ${base_url} | Endpoint: ${endpoint}`);
|
||||||
|
|
||||||
console.log('Error Message:', error.message); // Is this needed here or below in the in the else portion???
|
console.log('Error Message:', error.message); // Is this needed here or below in the in the else portion???
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ async function handle_obj_field_patch(new_field_value: any) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error: any) {
|
||||||
console.log('Something went wrong patching the record.');
|
console.log('Something went wrong patching the record.');
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ async function handle_get_device_info(event_device_id) {
|
|||||||
console.log(up_event_device_result);
|
console.log(up_event_device_result);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error: any) {
|
||||||
console.log('No results returned or failed.');
|
console.log('No results returned or failed.');
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ let ae_promises: key_val = $state({});
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
// Optionally, you can provide feedback to the user
|
// Optionally, you can provide feedback to the user
|
||||||
alert('Journal entry deleted successfully!');
|
alert('Journal entry deleted successfully!');
|
||||||
}).catch((error) => {
|
}).catch((error: any) => {
|
||||||
console.error('Error deleting journal entry:', error);
|
console.error('Error deleting journal entry:', error);
|
||||||
alert('Failed to delete journal entry.');
|
alert('Failed to delete journal entry.');
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user