A lot of work to get the LCI Champions able to add a biography and agree to Terms and Conditions.

This commit is contained in:
Scott Idem
2024-09-12 18:37:03 -04:00
parent 225dd678a5
commit e3b808a0e0
17 changed files with 744 additions and 80 deletions

View File

@@ -201,3 +201,70 @@ export function handle_db_save_ae_obj_li__event(
return true;
}
}
// This function will process the event config, specifically for presentation management.
export function sync_config__event_pres_mgmt(
{
pres_mgmt_cfg_remote, // This is the remote config that will be compared.
pres_mgmt_cfg_local, // This is the local config that will be updated.
log_lvl = 0
}: {
pres_mgmt_cfg_remote: key_val,
pres_mgmt_cfg_local: key_val,
log_lvl?: number
}
) {
console.log(`*** sync_config__event_pres_mgmt() *** pres_mgmt_cfg_remote:`, pres_mgmt_cfg_remote);
// Locking the config is targeted at the trusted staff level and below. It is more or less ignored at the global manager and super levels. It may be enforced at the staff admin level?
pres_mgmt_cfg_local.lock_config = pres_mgmt_cfg_remote?.lock_config ?? true; // This disables the sync local config button and options.
if (pres_mgmt_cfg_local.lock_config) {
// This is to forcibly sync the local config with the remote config.
pres_mgmt_cfg_local.sync_local_config = pres_mgmt_cfg_remote?.sync_local_config ?? true;
} else {
// Do not override the preference for syncing the local config with the remote config.
}
// Labels:
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 ?? 'Point of Contact';
// Hide content:
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;
pres_mgmt_cfg_local.hide__presenter_biography = pres_mgmt_cfg_remote?.hide__presenter_biography ?? false;
pres_mgmt_cfg_local.hide__session_code = pres_mgmt_cfg_remote?.hide__session_code ?? false;
pres_mgmt_cfg_local.hide__session_description = pres_mgmt_cfg_remote?.hide__session_description ?? false;
pres_mgmt_cfg_local.hide__session_location = pres_mgmt_cfg_remote?.hide__session_location ?? false;
pres_mgmt_cfg_local.hide__session_poc = pres_mgmt_cfg_remote?.hide__session_poc ?? false;
pres_mgmt_cfg_local.hide__session_poc_profile = pres_mgmt_cfg_remote?.hide__session_poc_profile ?? false; // This should still allow the POC name to be shown.
pres_mgmt_cfg_local.hide__session_poc_biography = pres_mgmt_cfg_remote?.hide__session_poc_biography ?? false; // New and in progress
pres_mgmt_cfg_local.hide__session_poc_profile_pic = pres_mgmt_cfg_remote?.hide__session_poc_profile_pic ?? false; // New and in progress
// pres_mgmt_cfg_local.hide__report_kv = pres_mgmt_cfg_remote?.hide__report_kv ?? null;
// pres_mgmt_cfg_local.limit__navigation = pres_mgmt_cfg_remote?.limit__navigation ?? false;
// pres_mgmt_cfg_local.limit__options = pres_mgmt_cfg_remote?.limit__options ?? false;
// 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
// Show content:
pres_mgmt_cfg_local.show__email_access_link = pres_mgmt_cfg_remote?.show__email_access_link ?? false;
pres_mgmt_cfg_local.show__launcher_link = pres_mgmt_cfg_remote?.show__launcher_link ?? false;
pres_mgmt_cfg_local.show__launcher_link_legacy = pres_mgmt_cfg_remote?.show__launcher_link_legacy ?? false;
// pres_mgmt_cfg_local.show__navigation = pres_mgmt_cfg_remote?.show__navigation ?? false;
if (log_lvl) {
console.log(`pres_mgmt_cfg_local:`, pres_mgmt_cfg_local);
}
return pres_mgmt_cfg_local;
}

View File

@@ -276,6 +276,57 @@ export async function load_ae_obj_li__event_session(
}
// Updated 2024-09-12
export async function update_ae_obj__event_session(
{
api_cfg,
event_session_id,
data_kv,
params={},
log_lvl=0
}: {
api_cfg: any,
event_session_id: string,
data_kv: key_val,
params?: key_val,
log_lvl?: number
}
) {
if (log_lvl) {
console.log(`*** update_ae_obj__event_session() *** event_session_id=${event_session_id}`, data_kv);
}
// ae_promises.update__event_session_obj = 'test';
ae_promises.update__event_session_obj = await api.update_ae_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'event_session',
obj_id: event_session_id, // NOTE: This is the FQDN, not normally the ID.
fields: data_kv,
key: api_cfg.api_crud_super_key,
params: params,
return_obj: true,
log_lvl: log_lvl
})
.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]});
return event_session_obj_update_result;
} else {
return null;
}
})
.catch(function (error) {
console.log('No results returned or failed.', error);
})
.finally(function () {
});
if (log_lvl) {
console.log('ae_promises.update__event_session_obj:', ae_promises.update__event_session_obj);
}
return ae_promises.update__event_session_obj;
}
// This new function is using CRUD v2. This should allow for more flexibility in the queries.
// Updated 2024-08-14
export async function qry__event_session(
@@ -562,6 +613,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_kv_json: obj.poc_kv_json,
name: obj.name,
description: obj.description,
@@ -600,7 +652,6 @@ export function db_save_ae_obj_li__event_session(
poc_person_full_name: obj.poc_person_full_name,
poc_person_primary_email: obj.poc_person_primary_email,
poc_person_passcode: obj.poc_person_passcode,
poc_kv_json: obj.poc_kv_json,
event_name: obj.event_name,

View File

@@ -4,6 +4,7 @@ import {
handle_load_ae_obj_id__event,
handle_load_ae_obj_li__event,
handle_db_save_ae_obj_li__event,
sync_config__event_pres_mgmt,
} from "$lib/ae_events__event";
import {
@@ -37,6 +38,7 @@ import {
import {
load_ae_obj_id__event_session,
load_ae_obj_li__event_session,
update_ae_obj__event_session,
qry__event_session,
search__event_session,
db_save_ae_obj_li__event_session,
@@ -73,6 +75,7 @@ let export_obj = {
handle_load_ae_obj_id__event: handle_load_ae_obj_id__event,
handle_load_ae_obj_li__event: handle_load_ae_obj_li__event,
handle_db_save_ae_obj_li__event: handle_db_save_ae_obj_li__event,
sync_config__event_pres_mgmt: sync_config__event_pres_mgmt,
handle_load_ae_obj_id__event_file: handle_load_ae_obj_id__event_file,
handle_load_ae_obj_li__event_file: handle_load_ae_obj_li__event_file,
@@ -88,6 +91,7 @@ let export_obj = {
load_ae_obj_id__event_session: load_ae_obj_id__event_session,
load_ae_obj_li__event_session: load_ae_obj_li__event_session,
update_ae_obj__event_session: update_ae_obj__event_session,
qry__event_session: qry__event_session,
search__event_session: search__event_session,
email_sign_in__event_session: email_sign_in__event_session,

View File

@@ -331,6 +331,7 @@ export interface Session {
poc_person_id?: null|string;
poc_person_id_random?: null|string;
poc_kv_json?: null|key_val; // Key value list of the POC by type (examples: 'advocate', 'chair', 'champion', 'moderator', 'organizer')
name: string;
description?: null|string;
@@ -371,7 +372,7 @@ export interface Session {
poc_person_full_name?: null|string;
poc_person_primary_email?: null|string;
poc_person_passcode?: null|string;
poc_kv_json?: null|string;
event_name?: null|string;