General clean up. Improved event search and listing for IDAA.
This commit is contained in:
@@ -337,6 +337,7 @@ async function handle_download_export__obj_type(
|
||||
get_obj_type, // The type of object to return: event_badge, event_presenter, sponsorship, etc.
|
||||
for_obj_type, // Usually for an account, event, event_exhibit, or sponsorship_cfg
|
||||
for_obj_id, // The ID of the object
|
||||
exp_alt = null, // Export name (idaa, other, not 'default')
|
||||
file_type='CSV', // 'CSV' or 'Excel'
|
||||
return_file=true,
|
||||
filename='no_filename.csv',
|
||||
@@ -349,6 +350,7 @@ async function handle_download_export__obj_type(
|
||||
get_obj_type: string,
|
||||
for_obj_type: string,
|
||||
for_obj_id: string,
|
||||
exp_alt?: null|string,
|
||||
file_type?: string,
|
||||
return_file?: boolean,
|
||||
filename?: string,
|
||||
@@ -373,6 +375,10 @@ async function handle_download_export__obj_type(
|
||||
|
||||
params['mdl_alt'] = 'out';
|
||||
|
||||
if (exp_alt) {
|
||||
params['exp_alt'] = exp_alt;
|
||||
}
|
||||
|
||||
// let clean_filename = filename.replace(/[^a-z0-9]/gi, '_');
|
||||
// let clean_filename = filename.replace(/[^a-z0-9\[\]-]/gi, '_');
|
||||
let clean_filename = filename.replace(/[^a-zA-Z0-9\[\]-_.]/gi, '_');
|
||||
@@ -382,7 +388,7 @@ async function handle_download_export__obj_type(
|
||||
params['limit'] = limit;
|
||||
}
|
||||
|
||||
ae_promises.download__sponsorship_export_file = await api.get_object({
|
||||
ae_promises.download__export_file = await api.get_object({
|
||||
api_cfg: api_cfg,
|
||||
endpoint: endpoint,
|
||||
params: params,
|
||||
@@ -393,8 +399,8 @@ async function handle_download_export__obj_type(
|
||||
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;
|
||||
console.log('ae_promises.download__export_file:', ae_promises.download__export_file);
|
||||
return ae_promises.download__export_file;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ export async function load_ae_obj_li__event(
|
||||
if (qry_conference) {
|
||||
params_json['and_qry']['conference'] = qry_conference;
|
||||
} else if (qry_conference === false) {
|
||||
console.log('qry_conference is false!');
|
||||
params_json['and_qry']['conference'] = qry_conference;
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ export async function qry__post(
|
||||
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 = {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC', 'title': 'ASC'};
|
||||
|
||||
ae_promises.load__post_obj_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
|
||||
api_cfg: api_cfg,
|
||||
|
||||
@@ -63,7 +63,7 @@ export async function load_ae_obj_li__post_comment(
|
||||
api_cfg,
|
||||
for_obj_type = 'post',
|
||||
for_obj_id,
|
||||
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC', 'title': 'ASC'},
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
101
src/lib/api.ts
101
src/lib/api.ts
@@ -5,15 +5,15 @@
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
|
||||
|
||||
import { delete_object } from './api_delete_object'; // Exported at the end of this file
|
||||
import { get_object } from './api_get_object'; // Exported at the end of this file
|
||||
import { patch_object } from './api_patch_object'; // Exported at the end of this file
|
||||
import { post_object } from './api_post_object'; // Exported at the end of this file
|
||||
import { delete_object } from './ae_api/api_delete_object'; // Exported at the end of this file
|
||||
import { get_object } from './ae_api/api_get_object'; // Exported at the end of this file
|
||||
import { patch_object } from './ae_api/api_patch_object'; // Exported at the end of this file
|
||||
import { post_object } from './ae_api/api_post_object'; // Exported at the end of this file
|
||||
|
||||
|
||||
import { get_ae_obj_id_crud } from '$lib/api_get__crud_obj_id';
|
||||
import { get_ae_obj_li_for_obj_id_crud } from '$lib/api_get__crud_obj_li_v1';
|
||||
import { get_ae_obj_li_for_obj_id_crud_v2 } from '$lib/api_get__crud_obj_li_v2';
|
||||
import { get_ae_obj_id_crud } from '$lib/ae_api/api_get__crud_obj_id';
|
||||
import { get_ae_obj_li_for_obj_id_crud } from '$lib/ae_api/api_get__crud_obj_li_v1';
|
||||
import { get_ae_obj_li_for_obj_id_crud_v2 } from '$lib/ae_api/api_get__crud_obj_li_v2';
|
||||
|
||||
|
||||
// This new function has not been tested yet!!!
|
||||
@@ -308,16 +308,16 @@ export let update_ae_obj_id_crud = async function update_ae_obj_id_crud(
|
||||
obj_id,
|
||||
field_name,
|
||||
field_value,
|
||||
fields={},
|
||||
fields = {},
|
||||
key,
|
||||
jwt=null,
|
||||
headers={},
|
||||
params={},
|
||||
data={},
|
||||
return_obj=false,
|
||||
obj_v_name='',
|
||||
return_meta=false,
|
||||
log_lvl=0
|
||||
jwt = null,
|
||||
headers = {},
|
||||
params = {},
|
||||
data = {},
|
||||
return_obj = false,
|
||||
obj_v_name = '',
|
||||
return_meta = false,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
obj_type: string,
|
||||
@@ -326,7 +326,7 @@ export let update_ae_obj_id_crud = async function update_ae_obj_id_crud(
|
||||
field_value?: any,
|
||||
fields?: key_val,
|
||||
key: string,
|
||||
jwt?: string,
|
||||
jwt?: null|string,
|
||||
headers?: key_val,
|
||||
params?: key_val,
|
||||
data?: null|key_val,
|
||||
@@ -340,8 +340,11 @@ export let update_ae_obj_id_crud = async function update_ae_obj_id_crud(
|
||||
console.log('*** update_ae_obj_id_crud() ***');
|
||||
}
|
||||
|
||||
data['super_key'] = key;
|
||||
data['jwt'] = jwt;
|
||||
if (!data) {
|
||||
data = {};
|
||||
data['super_key'] = key;
|
||||
data['jwt'] = jwt;
|
||||
}
|
||||
// NOTE: The key and or JWT should be in the header of the DELETE, GET, PATCH, POST
|
||||
|
||||
// This obj_v_name is the view name to use when returning data. Do not prefix it with v_. This is checked and done automatically by the API.
|
||||
@@ -516,19 +519,19 @@ export let delete_ae_obj_id_crud = async function delete_ae_obj_id_crud(
|
||||
obj_type,
|
||||
obj_id,
|
||||
key,
|
||||
jwt=null,
|
||||
headers={},
|
||||
params={},
|
||||
data={},
|
||||
method='delete', // 'delete', 'disable', 'hide'
|
||||
return_meta=false,
|
||||
log_lvl=0
|
||||
jwt = null,
|
||||
headers = {},
|
||||
params = {},
|
||||
data = {},
|
||||
method = 'delete', // 'delete', 'disable', 'hide'
|
||||
return_meta = false,
|
||||
log_lvl = 0
|
||||
} : {
|
||||
api_cfg: any,
|
||||
obj_type: string,
|
||||
obj_id: string,
|
||||
key: string,
|
||||
jwt?: string,
|
||||
jwt?: null|string,
|
||||
headers?: any,
|
||||
params?: any,
|
||||
data?: any,
|
||||
@@ -795,40 +798,42 @@ export let send_email = async function send_email(
|
||||
{
|
||||
api_cfg,
|
||||
from_email,
|
||||
from_name='',
|
||||
from_name = '',
|
||||
to_email,
|
||||
to_name='',
|
||||
cc_email=null,
|
||||
cc_name=null,
|
||||
bcc_email=null,
|
||||
bcc_name=null,
|
||||
to_name = '',
|
||||
cc_email = null,
|
||||
cc_name = null,
|
||||
bcc_email = null,
|
||||
bcc_name = null,
|
||||
subject,
|
||||
body_html,
|
||||
body_text=null,
|
||||
headers={},
|
||||
params={},
|
||||
data={},
|
||||
return_obj=false,
|
||||
return_meta=false,
|
||||
log_lvl=0
|
||||
body_text = null,
|
||||
// headers = {},
|
||||
params = {},
|
||||
data = {},
|
||||
return_obj = false,
|
||||
return_meta = false,
|
||||
test = true,
|
||||
log_lvl = 0
|
||||
} : {
|
||||
api_cfg: any,
|
||||
from_email: string,
|
||||
from_name?: string,
|
||||
to_email: string,
|
||||
to_name?: string,
|
||||
cc_email?: string,
|
||||
cc_name?: string,
|
||||
bcc_email?: string,
|
||||
bcc_name?: string,
|
||||
cc_email?: null|string,
|
||||
cc_name?: null|string,
|
||||
bcc_email?: null|string,
|
||||
bcc_name?: null|string,
|
||||
subject: string,
|
||||
body_html: string,
|
||||
body_text?: string,
|
||||
headers?: key_val,
|
||||
body_text?: null|string,
|
||||
// headers?: key_val,
|
||||
params?: key_val,
|
||||
data?: key_val,
|
||||
return_obj?: boolean,
|
||||
return_meta?: boolean,
|
||||
test?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
@@ -861,6 +866,10 @@ export let send_email = async function send_email(
|
||||
params['return_obj'] = true;
|
||||
}
|
||||
|
||||
if (test) {
|
||||
params['test'] = true;
|
||||
}
|
||||
|
||||
let send_email_post_promise = await api.post_object({
|
||||
api_cfg: api_cfg,
|
||||
endpoint: endpoint,
|
||||
|
||||
@@ -30,6 +30,7 @@ export async function load({ params, parent }) { // route
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC', 'name': 'ASC'},
|
||||
qry_conference: false,
|
||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
|
||||
@@ -27,14 +27,14 @@ import Comp__event_obj_id_view from './ae_idaa_comp__event_obj_id_view.svelte';
|
||||
|
||||
let event_id_random_li: Array<string>;
|
||||
|
||||
$: lq__event_obj_li = liveQuery(async () => {
|
||||
let results = await db_events.events
|
||||
.where('account_id')
|
||||
.equals($slct.account_id)
|
||||
.sortBy('name');
|
||||
// $: lq__event_obj_li = liveQuery(async () => {
|
||||
// let results = await db_events.events
|
||||
// .where('account_id')
|
||||
// .equals($slct.account_id)
|
||||
// .sortBy('name');
|
||||
|
||||
return results;
|
||||
});
|
||||
// return results;
|
||||
// });
|
||||
|
||||
$: lq__event_obj = liveQuery(async () => {
|
||||
let results = await db_events.events
|
||||
@@ -75,21 +75,21 @@ $: lq_new__event_obj_li = liveQuery(async () => {
|
||||
console.log('Trying... HERE!!! END');
|
||||
});
|
||||
|
||||
$: lq_bulk__event_obj_li = liveQuery(async () => {
|
||||
console.log('Trying... HERE!!! BULK BEGIN');
|
||||
// $: lq_bulk__event_obj_li = liveQuery(async () => {
|
||||
// console.log('Trying... HERE!!! BULK BEGIN');
|
||||
|
||||
if (event_id_random_li.length) {
|
||||
console.log(`Trying bulkGet:`, event_id_random_li);
|
||||
let results = await db_events.events
|
||||
.bulkGet(event_id_random_li);
|
||||
// if (event_id_random_li.length) {
|
||||
// console.log(`Trying bulkGet:`, event_id_random_li);
|
||||
// let results = await db_events.events
|
||||
// .bulkGet(event_id_random_li);
|
||||
|
||||
return results;
|
||||
} else {
|
||||
console.log('Trying... Nothing to load');
|
||||
return null;
|
||||
}
|
||||
console.log('Trying... HERE!!! BULK END');
|
||||
});
|
||||
// return results;
|
||||
// } else {
|
||||
// console.log('Trying... Nothing to load');
|
||||
// return null;
|
||||
// }
|
||||
// console.log('Trying... HERE!!! BULK END');
|
||||
// });
|
||||
|
||||
</script>
|
||||
|
||||
@@ -110,7 +110,7 @@ $: lq_bulk__event_obj_li = liveQuery(async () => {
|
||||
bind:event_id_random_li={event_id_random_li}
|
||||
/>
|
||||
|
||||
<h1>Recovery Meetings {$lq_new__event_obj_li?.length}</h1>
|
||||
<!-- <h1>Recovery Meetings {$lq_new__event_obj_li?.length}</h1> -->
|
||||
|
||||
<!-- Search results: {$lq_bulk__event_obj_li?.length}? -->
|
||||
|
||||
@@ -118,6 +118,8 @@ $: lq_bulk__event_obj_li = liveQuery(async () => {
|
||||
<Comp__event_obj_li
|
||||
lq__event_obj_li={lq_new__event_obj_li}
|
||||
/>
|
||||
{:else}
|
||||
<p>No recovery meetings available to show.</p>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
@@ -19,35 +19,52 @@ onMount(() => {
|
||||
|
||||
|
||||
<section class="svelte_component ae_section ae_list event_obj_li list__event_obj recovery_meeting_list {container_class_li.join(' ')}">
|
||||
<!-- <h1>Recovery Meetings {$lq__event_obj_li?.length}</h1> -->
|
||||
|
||||
{#if $lq__event_obj_li && $lq__event_obj_li.length}
|
||||
<div class="overflow-auto space-y-2">
|
||||
<h2 class="h3">
|
||||
<span class="text-base">
|
||||
Results:
|
||||
</span>
|
||||
|
||||
{#if $lq__event_obj_li?.length}
|
||||
<span class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
||||
title="Count {$lq__event_obj_li.length ?? 'None'}"
|
||||
>
|
||||
<span class="fas fa-list-ol mx-4"></span>
|
||||
{$lq__event_obj_li.length ?? 'None'}
|
||||
</span>
|
||||
{/if}
|
||||
</h2>
|
||||
|
||||
{#each $lq__event_obj_li as idaa_event_obj, index}
|
||||
<div
|
||||
id={`idaa_recovery_meeting_id__${idaa_event_obj.event_id_random}`}
|
||||
id={`idaa_recovery_meeting_id__${idaa_event_obj?.event_id_random}`}
|
||||
class="container recovery_meeting ae_object event_obj border border-1 rounded p-2 mb-2"
|
||||
class:meeting_physical={idaa_event_obj.physical}
|
||||
class:meeting_virtual={idaa_event_obj.virtual}
|
||||
class:meeting_physical={idaa_event_obj?.physical}
|
||||
class:meeting_virtual={idaa_event_obj?.virtual}
|
||||
>
|
||||
|
||||
<header class="ae_header event__header">
|
||||
<h3>
|
||||
<span class="event__name">{idaa_event_obj.name}</span>
|
||||
<span class="event__name">{idaa_event_obj?.name}</span>
|
||||
<span class="badge badge-info bg-info">
|
||||
{#if idaa_event_obj.physical && idaa_event_obj.virtual}
|
||||
{#if idaa_event_obj?.physical && idaa_event_obj?.virtual}
|
||||
<span class="fas fa-home m-1"></span> F2F and <span class="fas fa-laptop m-1"></span> Virtual
|
||||
{:else if idaa_event_obj.physical}
|
||||
{:else if idaa_event_obj?.physical}
|
||||
<span class="fas fa-home m-1"></span> F2F
|
||||
{:else if idaa_event_obj.virtual}
|
||||
{:else if idaa_event_obj?.virtual}
|
||||
<span class="fas fa-laptop m-1"></span> Virtual
|
||||
{/if}
|
||||
</span>
|
||||
{#if idaa_event_obj.type}
|
||||
<span class="badge badge-info bg-info"><span class="fas fa-user-md m-1"></span> {idaa_event_obj.type}</span>
|
||||
{#if idaa_event_obj?.type}
|
||||
<span class="badge badge-info bg-info"><span class="fas fa-user-md m-1"></span> {idaa_event_obj?.type}</span>
|
||||
{/if}
|
||||
{#if $ae_loc.trusted_access && idaa_event_obj.hide}
|
||||
{#if $ae_loc.trusted_access && idaa_event_obj?.hide}
|
||||
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Hidden</span>
|
||||
{/if}
|
||||
{#if $ae_loc.administrator_access && !idaa_event_obj.enable}
|
||||
{#if $ae_loc.administrator_access && !idaa_event_obj?.enable}
|
||||
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Not enabled</span>
|
||||
{/if}
|
||||
</h3>
|
||||
@@ -56,17 +73,17 @@ onMount(() => {
|
||||
<div class="ae_options event_obj__options">
|
||||
<button
|
||||
on:click={() => {
|
||||
$idaa_slct.event_id = idaa_event_obj.event_id_random;
|
||||
$idaa_slct.event_id = idaa_event_obj?.event_id_random;
|
||||
$idaa_slct.event_obj = idaa_event_obj;
|
||||
$slct_trigger = 'load__event_obj';
|
||||
|
||||
// // handle_load_event_id_obj({event_id: $idaa_slct.event_id, try_cache: false});
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('event_id', idaa_event_obj.event_id_random);
|
||||
// url.searchParams.set('event_id', idaa_event_obj?.event_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// let message = {'event_id': idaa_event_obj.event_id_random};
|
||||
// let message = {'event_id': idaa_event_obj?.event_id_random};
|
||||
// window.parent.postMessage(message, "*");
|
||||
|
||||
$idaa_loc.recovery_meetings.show_main__options = true;
|
||||
@@ -75,7 +92,7 @@ onMount(() => {
|
||||
$idaa_loc.recovery_meetings.show_edit__event_obj = false;
|
||||
}}
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary transition"
|
||||
title={`Open to see details: ${idaa_event_obj.name}`}
|
||||
title={`Open to see details: ${idaa_event_obj?.name}`}
|
||||
>
|
||||
<span class="fas fa-envelope-open m-1"></span>
|
||||
<!-- <span class="fas fa-info-circle"></span> -->
|
||||
@@ -83,15 +100,15 @@ onMount(() => {
|
||||
</button>
|
||||
|
||||
<!-- This checks if the currently logged in Novi user has a matching UUID or email address. -->
|
||||
{#if $ae_loc.trusted_access || idaa_event_obj.external_person_id === $ae_loc.novi_uuid || idaa_event_obj.contact_li_json[0].email === $ae_loc.novi_email}
|
||||
{#if $ae_loc.trusted_access || idaa_event_obj?.external_person_id === $ae_loc.novi_uuid || idaa_event_obj?.contact_li_json[0].email === $ae_loc.novi_email}
|
||||
<button
|
||||
on:click={() => {
|
||||
$idaa_slct.event_id = idaa_event_obj.event_id_random;
|
||||
$idaa_slct.event_id = idaa_event_obj?.event_id_random;
|
||||
$idaa_slct.event_obj = idaa_event_obj;
|
||||
$slct_trigger = 'load__event_obj';
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('event_id', idaa_event_obj.event_id_random);
|
||||
// url.searchParams.set('event_id', idaa_event_obj?.event_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// $idaa_loc.recovery_meetings.show_main__options = true;
|
||||
@@ -100,7 +117,7 @@ onMount(() => {
|
||||
$idaa_loc.recovery_meetings.show_edit__event_obj = true;
|
||||
}}
|
||||
class="btn btn-sm variant-ghost-warning hover:variant-filled-warning transition"
|
||||
title={`Edit meeting: ${idaa_event_obj.name}`}
|
||||
title={`Edit meeting: ${idaa_event_obj?.name}`}
|
||||
>
|
||||
<span class="fas fa-edit m-1"></span>
|
||||
Edit Meeting
|
||||
@@ -109,7 +126,7 @@ onMount(() => {
|
||||
on:click={() => {
|
||||
// Copy URL to clipboard
|
||||
// Is there a URL anymore?
|
||||
// const copy_text = document.getElementById(`meeting_edit_url_${idaa_event_obj.event_id_random}`);
|
||||
// const copy_text = document.getElementById(`meeting_edit_url_${idaa_event_obj?.event_id_random}`);
|
||||
}}
|
||||
class="ae_btn btn_sm btn_outline_info meeting_edit_help"
|
||||
>
|
||||
@@ -125,16 +142,16 @@ onMount(() => {
|
||||
>
|
||||
<div class="ae_label event__description">Description:</div>
|
||||
<pre class="ae_value event__description">
|
||||
{@html idaa_event_obj.description}
|
||||
{@html idaa_event_obj?.description}
|
||||
</pre>
|
||||
</div> -->
|
||||
|
||||
<div
|
||||
class="event__type"
|
||||
class:ae_d_none={!idaa_event_obj.type}
|
||||
class:ae_d_none={!idaa_event_obj?.type}
|
||||
>
|
||||
<span class="ae_label">Type of Recovery Meeting:</span>
|
||||
<span class="ae_value">{idaa_event_obj.type}</span>
|
||||
<span class="ae_value">{idaa_event_obj?.type}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -144,27 +161,27 @@ onMount(() => {
|
||||
<span class="fas fa-clock m-1"></span>
|
||||
When:
|
||||
</span>
|
||||
<!-- class:ae_d_none={!idaa_event_obj.timezone} -->
|
||||
{#if idaa_event_obj.weekday_sunday || idaa_event_obj.weekday_monday || idaa_event_obj.weekday_tuesday || idaa_event_obj.weekday_wednesday || idaa_event_obj.weekday_thursday || idaa_event_obj.weekday_friday || idaa_event_obj.weekday_saturday}
|
||||
<!-- class:ae_d_none={!idaa_event_obj?.timezone} -->
|
||||
{#if idaa_event_obj?.weekday_sunday || idaa_event_obj?.weekday_monday || idaa_event_obj?.weekday_tuesday || idaa_event_obj?.weekday_wednesday || idaa_event_obj?.weekday_thursday || idaa_event_obj?.weekday_friday || idaa_event_obj?.weekday_saturday}
|
||||
<span class="event__weekdays event__recurring_days_of_week">
|
||||
<!-- <span class="ae_label">Days of week:</span> -->
|
||||
{#if idaa_event_obj.weekday_sunday}<span class="ae_value">Sunday</span>{/if}
|
||||
{#if idaa_event_obj.weekday_monday}<span class="ae_value">Monday</span>{/if}
|
||||
{#if idaa_event_obj.weekday_tuesday}<span class="ae_value">Tuesday</span>{/if}
|
||||
{#if idaa_event_obj.weekday_wednesday}<span class="ae_value">Wednesday</span>{/if}
|
||||
{#if idaa_event_obj.weekday_thursday}<span class="ae_value">Thursday</span>{/if}
|
||||
{#if idaa_event_obj.weekday_friday}<span class="ae_value">Friday</span>{/if}
|
||||
{#if idaa_event_obj.weekday_saturday}<span class="ae_value">Saturday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_sunday}<span class="ae_value">Sunday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_monday}<span class="ae_value">Monday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_tuesday}<span class="ae_value">Tuesday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_wednesday}<span class="ae_value">Wednesday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_thursday}<span class="ae_value">Thursday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_friday}<span class="ae_value">Friday</span>{/if}
|
||||
{#if idaa_event_obj?.weekday_saturday}<span class="ae_value">Saturday</span>{/if}
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#if idaa_event_obj.recurring_start_time}
|
||||
{#if idaa_event_obj?.recurring_start_time}
|
||||
<!-- <span class="ae_label">Time:</span> -->
|
||||
<span class="ae_value">{ae_util.iso_datetime_formatter(`2023-01-01 ${idaa_event_obj.recurring_start_time}`, 'time_short')}</span>
|
||||
<span class="ae_value">{ae_util.iso_datetime_formatter(`2023-01-01 ${idaa_event_obj?.recurring_start_time}`, 'time_short')}</span>
|
||||
{/if}
|
||||
{#if idaa_event_obj.timezone}
|
||||
{#if idaa_event_obj?.timezone}
|
||||
<!-- <span class="ae_label">Timezone:</span> -->
|
||||
(<span class="ae_value">{idaa_event_obj.timezone}</span>)
|
||||
(<span class="ae_value">{idaa_event_obj?.timezone}</span>)
|
||||
{:else}
|
||||
<div class="event__tiemzone ae_warning">Required: No timezone was given!</div>
|
||||
{/if}
|
||||
@@ -172,30 +189,30 @@ onMount(() => {
|
||||
|
||||
<div class="event__contacts">
|
||||
|
||||
{#if idaa_event_obj.contact_li_json && idaa_event_obj.contact_li_json.length && idaa_event_obj.contact_li_json[0].full_name}
|
||||
{#if idaa_event_obj?.contact_li_json && idaa_event_obj?.contact_li_json.length && idaa_event_obj?.contact_li_json[0].full_name}
|
||||
<div class="event__contact"
|
||||
class:ae_d_none={!idaa_event_obj.contact_li_json[0].full_name}
|
||||
class:ae_d_none={!idaa_event_obj?.contact_li_json[0].full_name}
|
||||
>
|
||||
<span class="ae_label">
|
||||
<span class="fas fa-user m-1"></span> Contact:
|
||||
</span>
|
||||
{idaa_event_obj.contact_li_json[0].full_name}
|
||||
{#if idaa_event_obj.contact_li_json[0].email}
|
||||
| <a href="mailto:{idaa_event_obj.contact_li_json[0].email}?Subject={idaa_event_obj.full_name}">{idaa_event_obj.contact_li_json[0].email}</a>
|
||||
{idaa_event_obj?.contact_li_json[0].full_name}
|
||||
{#if idaa_event_obj?.contact_li_json[0].email}
|
||||
| <a href="mailto:{idaa_event_obj?.contact_li_json[0].email}?Subject={idaa_event_obj?.full_name}">{idaa_event_obj?.contact_li_json[0].email}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[0].phone_mobile}
|
||||
{#if idaa_event_obj?.contact_li_json[0].phone_mobile}
|
||||
<span class="ae_label">| Mobile:</span>
|
||||
<a href="tel:{idaa_event_obj.contact_li_json[0].phone_mobile}">{idaa_event_obj.contact_li_json[0].phone_mobile}</a>
|
||||
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_mobile}">{idaa_event_obj?.contact_li_json[0].phone_mobile}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[0].phone_home}
|
||||
{#if idaa_event_obj?.contact_li_json[0].phone_home}
|
||||
<span class="ae_label">| Home:</span>
|
||||
<a href="tel:{idaa_event_obj.contact_li_json[0].phone_home}">{idaa_event_obj.contact_li_json[0].phone_home}</a>
|
||||
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_home}">{idaa_event_obj?.contact_li_json[0].phone_home}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[0].phone_office}
|
||||
{#if idaa_event_obj?.contact_li_json[0].phone_office}
|
||||
<span class="ae_label">| Office:</span>
|
||||
<a href="tel:{idaa_event_obj.contact_li_json[0].phone_office}">{idaa_event_obj.contact_li_json[0].phone_office}</a>
|
||||
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_office}">{idaa_event_obj?.contact_li_json[0].phone_office}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[0].other_text}| {idaa_event_obj.contact_li_json[0].other_text}{/if}
|
||||
{#if idaa_event_obj?.contact_li_json[0].other_text}| {idaa_event_obj?.contact_li_json[0].other_text}{/if}
|
||||
</div>
|
||||
{:else}
|
||||
{#if $ae_loc.trusted_access}
|
||||
@@ -206,37 +223,37 @@ onMount(() => {
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if idaa_event_obj.contact_li_json && idaa_event_obj.contact_li_json.length && idaa_event_obj.contact_li_json[1].full_name}
|
||||
{#if idaa_event_obj?.contact_li_json && idaa_event_obj?.contact_li_json.length && idaa_event_obj?.contact_li_json[1].full_name}
|
||||
<div class="event__contact"
|
||||
class:ae_d_none={!idaa_event_obj.contact_li_json[1].full_name}
|
||||
class:ae_d_none={!idaa_event_obj?.contact_li_json[1].full_name}
|
||||
>
|
||||
<span class="ae_label">
|
||||
<span class="fas fa-user m-1"></span> Contact:
|
||||
</span>
|
||||
{idaa_event_obj.contact_li_json[1].full_name}
|
||||
{#if idaa_event_obj.contact_li_json[1].email}
|
||||
| <a href="mailto:{idaa_event_obj.contact_li_json[1].email}?Subject={idaa_event_obj.full_name}">{idaa_event_obj.contact_li_json[1].email}</a>
|
||||
{idaa_event_obj?.contact_li_json[1].full_name}
|
||||
{#if idaa_event_obj?.contact_li_json[1].email}
|
||||
| <a href="mailto:{idaa_event_obj?.contact_li_json[1].email}?Subject={idaa_event_obj?.full_name}">{idaa_event_obj?.contact_li_json[1].email}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[1].phone_mobile}
|
||||
{#if idaa_event_obj?.contact_li_json[1].phone_mobile}
|
||||
<span class="ae_label">| Mobile:</span>
|
||||
<a href="tel:{idaa_event_obj.contact_li_json[1].phone_mobile}">{idaa_event_obj.contact_li_json[1].phone_mobile}</a>
|
||||
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_mobile}">{idaa_event_obj?.contact_li_json[1].phone_mobile}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[1].phone_home}
|
||||
{#if idaa_event_obj?.contact_li_json[1].phone_home}
|
||||
<span class="ae_label">| Home:</span>
|
||||
<a href="tel:{idaa_event_obj.contact_li_json[1].phone_home}">{idaa_event_obj.contact_li_json[1].phone_home}</a>
|
||||
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_home}">{idaa_event_obj?.contact_li_json[1].phone_home}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[1].phone_office}
|
||||
{#if idaa_event_obj?.contact_li_json[1].phone_office}
|
||||
<span class="ae_label">| Office:</span>
|
||||
<a href="tel:{idaa_event_obj.contact_li_json[1].phone_office}">{idaa_event_obj.contact_li_json[1].phone_office}</a>
|
||||
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_office}">{idaa_event_obj?.contact_li_json[1].phone_office}</a>
|
||||
{/if}
|
||||
{#if idaa_event_obj.contact_li_json[0].other_text}| {idaa_event_obj.contact_li_json[0].other_text}{/if}
|
||||
{#if idaa_event_obj?.contact_li_json[0].other_text}| {idaa_event_obj?.contact_li_json[0].other_text}{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{#if $ae_loc.trusted_access}
|
||||
{#if (idaa_event_obj.contact_li_json && idaa_event_obj.contact_li_json.length && !idaa_event_obj.contact_li_json[0].full_name)}
|
||||
{#if (idaa_event_obj?.contact_li_json && idaa_event_obj?.contact_li_json.length && !idaa_event_obj?.contact_li_json[0].full_name)}
|
||||
<div class="event__contact ae_warning">Required: No primary contact information was found!</div>
|
||||
{/if}
|
||||
{#if !idaa_event_obj.external_person_id}
|
||||
{#if !idaa_event_obj?.external_person_id}
|
||||
<div class="event__contact ae_warning">Warning: Not linked to a Novi record!</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -266,26 +283,29 @@ onMount(() => {
|
||||
<span
|
||||
class="event__created_on"
|
||||
>
|
||||
Created on: {ae_util.iso_datetime_formatter(idaa_event_obj.created_on, 'datetime_short')}
|
||||
Created on: {ae_util.iso_datetime_formatter(idaa_event_obj?.created_on, 'datetime_short')}
|
||||
</span>
|
||||
<span
|
||||
class="event__updated_on"
|
||||
class:ae_d_none={!idaa_event_obj.updated_on}
|
||||
class:ae_d_none={!idaa_event_obj?.updated_on}
|
||||
>
|
||||
Updated on: {ae_util.iso_datetime_formatter(idaa_event_obj.updated_on, 'datetime_short')}
|
||||
Updated on: {ae_util.iso_datetime_formatter(idaa_event_obj?.updated_on, 'datetime_short')}
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
{:else}
|
||||
<div class="space-y-2">
|
||||
{#if $idaa_loc.recovery_meetings.qry_status === 'loading'}
|
||||
<div class="ae_highlight ae_padding_md ae_row ae_flex_justify_center"><Spinner class="me-3" /> Loading...</div>
|
||||
{:else}
|
||||
<div class="ae_highlight ae_padding_md ae_row ae_flex_justify_center"> No recovery meetings avalible to show. The search may need to be changed.</div>
|
||||
<div class="ae_highlight ae_padding_md ae_row ae_flex_justify_center"> No recovery meetings available to show. The search may need to be changed.</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Spinner } from 'flowbite-svelte';
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
@@ -15,6 +16,7 @@ export let event_id_random_li: Array<string>;
|
||||
|
||||
// export let container_class_li = [];
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_trigger: any = null;
|
||||
let ae_triggers: key_val = {};
|
||||
@@ -57,7 +59,7 @@ async function handle_search__event(
|
||||
params = {
|
||||
'qry__enabled': $idaa_loc.recovery_meetings.qry_enabled ?? 'enabled',
|
||||
'qry__hidden': $idaa_loc.recovery_meetings.qry_hidden ?? 'not_hidden',
|
||||
'qry__limit': $idaa_loc.recovery_meetings.qry_limit__events ?? 35,
|
||||
'qry__limit': $idaa_loc.recovery_meetings.qry_limit ?? 35,
|
||||
},
|
||||
try_cache=false,
|
||||
log_lvl=1,
|
||||
@@ -111,6 +113,7 @@ async function handle_search__event(
|
||||
api_cfg: $ae_api,
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: $ae_loc.account_id,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC', 'name': 'ASC'},
|
||||
qry_conference: false,
|
||||
qry_str: lk_search_str,
|
||||
// type_code: type_code,
|
||||
@@ -322,6 +325,45 @@ async function handle_search__event(
|
||||
|
||||
<div class="ae_group ae_row flex flex-row gap-1 w-full items-center justify-center">
|
||||
|
||||
<!-- Max events select options -->
|
||||
<span
|
||||
class="flex flex-row gap-1 items-center justify-around"
|
||||
>
|
||||
<label
|
||||
class="text-sm w-32 text-right"
|
||||
for="qry_limit__events">
|
||||
Max events:
|
||||
</label>
|
||||
<select
|
||||
id="qry_limit__events"
|
||||
bind:value={$idaa_loc.recovery_meetings.qry_limit}
|
||||
on:change={() => {
|
||||
// search__event_presenter({
|
||||
// api_cfg: $ae_api,
|
||||
// event_id: $events_slct.event_id,
|
||||
// agree: true,
|
||||
// biography: null,
|
||||
// ft_search_str: '',
|
||||
// lk_search_str: '',
|
||||
// params: {
|
||||
// 'qry__enabled': 'enabled',
|
||||
// 'qry__hidden': 'not_hidden',
|
||||
// 'qry__limit': $idaa_loc.recovery_meetings.qry_limit__events,},
|
||||
// try_cache: false,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
}}
|
||||
class="select w-20 text-sm"
|
||||
>
|
||||
<option value={25}>25</option>
|
||||
<option value={50}>50</option>
|
||||
<option value={75}>75</option>
|
||||
<option value={100}>100</option>
|
||||
<option value={200}>200</option>
|
||||
<option value={500}>500</option>
|
||||
</select>
|
||||
</span>
|
||||
|
||||
{#if $ae_loc.trusted_access && !$idaa_loc.recovery_meetings.hidden}
|
||||
<button
|
||||
on:click={() => {
|
||||
@@ -389,6 +431,42 @@ async function handle_search__event(
|
||||
<span class="fas fa-plus m-1"></span> Create new Meeting
|
||||
</button>
|
||||
|
||||
{#if $ae_loc.trusted_access}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
if (!confirm('Download exported data Excel file?')) {
|
||||
return false;
|
||||
}
|
||||
ae_promises.download__events_speakers_export = core_func.handle_download_export__obj_type({
|
||||
api_cfg: $ae_api,
|
||||
get_obj_type: 'event',
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: $slct.account_id,
|
||||
exp_alt: 'idaa',
|
||||
file_type: 'Excel',
|
||||
return_file: true,
|
||||
filename: `${$ae_loc.account_code}_IDAA_Recovery_Meetings_export_${ae_util.iso_datetime_formatter()}.xlsx`,
|
||||
auto_download: true,
|
||||
log_lvl: 2
|
||||
});
|
||||
|
||||
}}
|
||||
class="btn btn-sm variant-ghost-warning w-42 mb-1 export_data_btn text-xs"
|
||||
title={`Download sponsorship data for ${$ae_loc.account_name}`}
|
||||
>
|
||||
{#await ae_promises.download__sponsorship_export}
|
||||
<span class="fas fa-spinner fa-spin"></span>
|
||||
<!-- <span class="loading-text">
|
||||
Downloading...
|
||||
</span> -->
|
||||
{:then}
|
||||
<!-- Done? -->
|
||||
{/await}
|
||||
<span class="fas fa-download mx-1"></span> Export All Data
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
</section> <!-- END: div filters_and_search -->
|
||||
|
||||
Reference in New Issue
Block a user