Work on location views and editing. Also session list clean up.
This commit is contained in:
@@ -11,11 +11,15 @@ export async function load_ae_obj_id__event_presentation(
|
||||
{
|
||||
api_cfg,
|
||||
event_presentation_id,
|
||||
try_cache=false,
|
||||
log_lvl=0
|
||||
inc_file_li = false,
|
||||
inc_presenter_li = false,
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_presentation_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presenter_li?: boolean
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
@@ -35,8 +39,14 @@ export async function load_ae_obj_id__event_presentation(
|
||||
})
|
||||
.then(function (event_presentation_obj_get_result) {
|
||||
if (event_presentation_obj_get_result) {
|
||||
// This is expecting a list
|
||||
db_save_ae_obj_li__event_presentation({obj_type: 'event_presentation', obj_li: [event_presentation_obj_get_result]});
|
||||
if (try_cache) {
|
||||
// This is expecting a list
|
||||
db_save_ae_obj_li__event_presentation({
|
||||
obj_type: 'event_presentation',
|
||||
obj_li: [event_presentation_obj_get_result]
|
||||
|
||||
});
|
||||
}
|
||||
return event_presentation_obj_get_result;
|
||||
} else {
|
||||
console.log('No results returned.');
|
||||
@@ -47,6 +57,20 @@ export async function load_ae_obj_id__event_presentation(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
if (inc_file_li) {
|
||||
// Load the files for the presentation
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the file list for the presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_presenter_li) {
|
||||
// Load the presenters for the presentation
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the presenter list for the presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
return ae_promises.load__event_presentation_obj;
|
||||
}
|
||||
|
||||
@@ -55,19 +79,25 @@ export async function load_ae_obj_id__event_presentation(
|
||||
export async function load_ae_obj_li__event_presentation(
|
||||
{
|
||||
api_cfg,
|
||||
event_session_id,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
for_obj_type,
|
||||
for_obj_id,
|
||||
inc_file_li = false,
|
||||
inc_presenter_li = false,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_session_id: string,
|
||||
for_obj_type: string,
|
||||
for_obj_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presenter_li?: boolean
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** load_ae_obj_li__event_presentation() *** event_session_id=${event_session_id}`);
|
||||
console.log(`*** load_ae_obj_li__event_presentation() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
@@ -81,8 +111,8 @@ export async function load_ae_obj_li__event_presentation(
|
||||
ae_promises.load__event_presentation_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_presentation',
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_id,
|
||||
for_obj_type: for_obj_type,
|
||||
for_obj_id: for_obj_id,
|
||||
use_alt_table: true, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||
enabled: enabled,
|
||||
@@ -96,7 +126,11 @@ export async function load_ae_obj_li__event_presentation(
|
||||
})
|
||||
.then(function (event_presentation_obj_li_get_result) {
|
||||
if (event_presentation_obj_li_get_result) {
|
||||
db_save_ae_obj_li__event_presentation({obj_type: 'event_presentation', obj_li: event_presentation_obj_li_get_result});
|
||||
if (try_cache) {
|
||||
db_save_ae_obj_li__event_presentation({
|
||||
obj_type: 'event_presentation', obj_li: event_presentation_obj_li_get_result
|
||||
});
|
||||
}
|
||||
return event_presentation_obj_li_get_result;
|
||||
} else {
|
||||
return [];
|
||||
@@ -109,6 +143,21 @@ export async function load_ae_obj_li__event_presentation(
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_presentation_obj_li:', ae_promises.load__event_presentation_obj_li);
|
||||
}
|
||||
|
||||
if (inc_file_li) {
|
||||
// Load the files for the presentations
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the file list for each presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_presenter_li) {
|
||||
// Load the presenters for the presentations
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the presenter list for each presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
return ae_promises.load__event_presentation_obj_li;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,15 +136,17 @@ export async function load_ae_obj_li__event_session(
|
||||
for_obj_id,
|
||||
inc_file_li = false,
|
||||
inc_presentation_li = false,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
for_obj_type: string,
|
||||
for_obj_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presentation_li?: boolean,
|
||||
order_by_li?: key_val,
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
@@ -170,7 +172,7 @@ export async function load_ae_obj_li__event_session(
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
order_by_li: order_by_li,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
@@ -239,8 +241,11 @@ export async function load_ae_obj_li__event_session(
|
||||
|
||||
let load_event_presentation_obj_li = load_ae_obj_li__event_presentation({
|
||||
api_cfg: api_cfg,
|
||||
event_session_id: event_session_id,
|
||||
params: {enabled: 'all', qry__limit: 15},
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_id,
|
||||
inc_file_li: false, // This will need to be changed.
|
||||
inc_presenter_li: false, // This will need to be changed.
|
||||
params: {qry__enabled: 'all', qry__limit: 15},
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
|
||||
@@ -192,13 +192,16 @@ let events_local_data_struct: key_val = {
|
||||
saved_search__session: null,
|
||||
|
||||
// show_content__agree_text: false,
|
||||
show_content__location_qr: false,
|
||||
show_content__presentation_description: false,
|
||||
show_content__presenter_page_help: true,
|
||||
// show_content__presenter_start: false,
|
||||
show_content__presenter_view: null,
|
||||
show_content__presenter_qr: false,
|
||||
show_content__session_description: false,
|
||||
show_content__session_files: false,
|
||||
show_content__session_help: true,
|
||||
show_content__session_presentations: false,
|
||||
show_content__session_search_view: null,
|
||||
show_content__session_search_help: true,
|
||||
show_content__session_view: null,
|
||||
|
||||
@@ -168,6 +168,9 @@ export async function get_ae_obj_li_for_obj_id_crud(
|
||||
// NOTE: The order_by_li variable is in the "headers" because if is a the URL GET params do not handle multiple values very well. Maybe base64 encore in the future or something? Reminder that GET requests should not have a body (no JSON).
|
||||
// NOTE: The order_by_li should be a key value pair of the property/DB field to sort and how to sort (ASC or DESC)
|
||||
if (order_by_li) {
|
||||
if (log_lvl) {
|
||||
console.log('Order By:', order_by_li);
|
||||
}
|
||||
headers['order_by_li'] = order_by_li;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user