Work on the new session POC functions and permissions. General code clean up and bug fixes.

This commit is contained in:
Scott Idem
2024-09-13 13:20:04 -04:00
parent e7e532f61a
commit 7e610ead67
16 changed files with 264 additions and 128 deletions

View File

@@ -231,9 +231,12 @@ export function sync_config__event_pres_mgmt(
pres_mgmt_cfg_local.label__presenter_external_id = pres_mgmt_cfg_remote?.label__presenter_external_id ?? 'External ID';
pres_mgmt_cfg_local.label__session_poc_type = pres_mgmt_cfg_remote?.label__session_poc_type ?? 'poc';
pres_mgmt_cfg_local.label__session_poc_name = pres_mgmt_cfg_remote?.label__session_poc_name_short ?? 'POC';
pres_mgmt_cfg_local.label__session_poc_name = pres_mgmt_cfg_remote?.label__session_poc_name ?? 'Point of Contact';
// Hide content:
pres_mgmt_cfg_local.hide__location_code = pres_mgmt_cfg_remote?.hide__location_code ?? false;
pres_mgmt_cfg_local.hide__presentation_code = pres_mgmt_cfg_remote?.hide__presentation_code ?? false;
pres_mgmt_cfg_local.hide__presenter_code = pres_mgmt_cfg_remote?.hide__presenter_code ?? false;
@@ -255,7 +258,7 @@ export function sync_config__event_pres_mgmt(
// Required fields or options (agreements):
pres_mgmt_cfg_local.require__presenter_agree = pres_mgmt_cfg_remote?.require__presenter_agree ?? false; // In use
pres_mgmt_cfg_local.session__require_agree = pres_mgmt_cfg_remote?.session__require_agree ?? false; // New and in progress
pres_mgmt_cfg_local.require__session_agree = pres_mgmt_cfg_remote?.require__session_agree ?? false; // New and in progress
// Show content:
pres_mgmt_cfg_local.show__email_access_link = pres_mgmt_cfg_remote?.show__email_access_link ?? false;

View File

@@ -16,8 +16,8 @@ export async function load_ae_obj_id__event_location(
event_location_id,
inc_file_li = false,
inc_session_li = false,
try_cache=true,
log_lvl=0
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
event_location_id: string,
@@ -136,9 +136,9 @@ export async function load_ae_obj_li__event_location(
event_id,
inc_file_li = false,
inc_session_li = false,
params={},
try_cache=true,
log_lvl=0
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
event_id: string,

View File

@@ -241,24 +241,26 @@ export async function create_ae_obj__event_presenter(
}
// Updated 2024-06-13
// Updated 2024-09-13
export async function update_ae_obj__event_presenter(
{
api_cfg,
event_presenter_id,
data_kv,
params={},
log_lvl=0
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
event_presenter_id: string,
data_kv: key_val,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
) {
if (log_lvl) {
console.log(`*** update_ae_obj__event_presenter() *** event_presenter_id=${event_presenter_id}`);
console.log(`*** update_ae_obj__event_presenter() *** event_presenter_id=${event_presenter_id}`, data_kv);
}
ae_promises.update__event_presenter_obj = await api.update_ae_obj_id_crud({
@@ -273,7 +275,12 @@ export async function update_ae_obj__event_presenter(
})
.then(function (event_presenter_obj_update_result) {
if (event_presenter_obj_update_result) {
db_save_ae_obj_li__event_presenter({obj_type: 'event_presenter', obj_li: [event_presenter_obj_update_result]});
if (try_cache) {
db_save_ae_obj_li__event_presenter({
obj_type: 'event_presenter',
obj_li: [event_presenter_obj_update_result]
});
}
return event_presenter_obj_update_result;
} else {
return null;
@@ -404,6 +411,12 @@ export async function search__event_presenter(
})
.then(function (event_presenter_obj_li_get_result) {
if (event_presenter_obj_li_get_result) {
if (try_cache) {
db_save_ae_obj_li__event_presenter({
obj_type: 'event_presenter',
obj_li: event_presenter_obj_li_get_result
});
}
db_save_ae_obj_li__event_presenter({obj_type: 'event_presenter', obj_li: event_presenter_obj_li_get_result});
return event_presenter_obj_li_get_result;
} else {

View File

@@ -276,19 +276,21 @@ export async function load_ae_obj_li__event_session(
}
// Updated 2024-09-12
// Updated 2024-09-13
export async function update_ae_obj__event_session(
{
api_cfg,
event_session_id,
data_kv,
params={},
log_lvl=0
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
event_session_id: string,
data_kv: key_val,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
) {
@@ -308,7 +310,11 @@ export async function update_ae_obj__event_session(
})
.then(function (event_session_obj_update_result) {
if (event_session_obj_update_result) {
db_save_ae_obj_li__event_session({obj_type: 'event_session', obj_li: [event_session_obj_update_result]});
if (try_cache) {
db_save_ae_obj_li__event_session({
obj_type: 'event_session', obj_li: [event_session_obj_update_result]
});
}
return event_session_obj_update_result;
} else {
return null;
@@ -426,7 +432,10 @@ export async function qry__event_session(
})
.then(function (event_session_obj_li_get_result) {
if (event_session_obj_li_get_result) {
db_save_ae_obj_li__event_session({obj_type: 'event_session', obj_li: event_session_obj_li_get_result});
db_save_ae_obj_li__event_session({
obj_type: 'event_session',
obj_li: event_session_obj_li_get_result
});
return event_session_obj_li_get_result;
} else {
return [];
@@ -440,10 +449,12 @@ export async function qry__event_session(
}
// Updated 2024-09-13
export async function search__event_session(
{
api_cfg,
event_id,
poc_agree = null,
fulltext_search_qry_str,
ft_presenter_search_qry_str,
like_search_qry_str = null,
@@ -457,6 +468,7 @@ export async function search__event_session(
}: {
api_cfg: any,
event_id: any,
poc_agree?: null|boolean,
fulltext_search_qry_str?: null|string,
ft_presenter_search_qry_str?: null|string,
like_search_qry_str?: null|string,
@@ -478,10 +490,10 @@ export async function search__event_session(
let params_json: key_val = {};
if (!fulltext_search_qry_str && !like_search_qry_str) {
console.log('No search string provided!!!');
return false; // Returning false instead of [] because no search was performed.
}
// if (!fulltext_search_qry_str && !like_search_qry_str) {
// console.log('No search string provided!!!');
// return false; // Returning false instead of [] because no search was performed.
// }
if (fulltext_search_qry_str || ft_presenter_search_qry_str) {
params_json['ft_qry'] = {};
@@ -521,6 +533,10 @@ export async function search__event_session(
params_json['and_qry'] = {};
if (poc_agree) {
params_json['and_qry']['poc_agree'] = poc_agree;
}
if (file_count) {
params_json['and_qry']['file_count'] = file_count;
}
@@ -550,7 +566,12 @@ export async function search__event_session(
})
.then(function (event_session_obj_li_get_result) {
if (event_session_obj_li_get_result) {
db_save_ae_obj_li__event_session({obj_type: 'event_session', obj_li: event_session_obj_li_get_result});
if (try_cache) {
db_save_ae_obj_li__event_session({
obj_type: 'event_session',
obj_li: event_session_obj_li_get_result
});
}
return event_session_obj_li_get_result;
} else {
return [];
@@ -613,6 +634,7 @@ export function db_save_ae_obj_li__event_session(
poc_person_id: obj.poc_person_id_random,
poc_person_id_random: obj.poc_person_id_random,
poc_agree: obj.poc_agree,
poc_kv_json: obj.poc_kv_json ?? {},
name: obj.name,

View File

@@ -112,6 +112,7 @@ let events_local_data_struct: key_val = {
show_content__hidden_presenters: false,
show_content__hidden_sessions: false,
// These should be renamed to match the pres_mgmt section. Use "hide" instead of "show".
show_content__session_code: true,
show_content__presentation_code: true,
show_content__presenter_code: true,
@@ -218,9 +219,10 @@ let events_local_data_struct: key_val = {
show_content__hidden_presenters: false,
show_content__hidden_sessions: false,
show_content__presentation_code: true,
show_content__presenter_code: true,
show_content__session_code: true,
// No longer used. Use "hide" instead of "show". Now it is initially set in the remote event config sync.
// show_content__presentation_code: true,
// show_content__presenter_code: true,
// show_content__session_code: true,
show_menu__presenter: null,
show_menu__session: null,

View File

@@ -331,6 +331,7 @@ export interface Session {
poc_person_id?: null|string;
poc_person_id_random?: null|string;
poc_agree?: null|boolean; // General catchall for agreement or consent by the POC
poc_kv_json?: null|key_val; // Key value list of the POC by type (examples: 'advocate', 'chair', 'champion', 'moderator', 'organizer')
name: string;
@@ -485,7 +486,7 @@ export interface Presenter {
biography?: null|string;
agree?: null|boolean;
agree?: null|boolean; // General catchall for agreement or consent
comments?: null|string;
passcode?: null|string;