General clean up and renaming of functions.

This commit is contained in:
Scott Idem
2024-08-19 14:53:28 -04:00
parent 6aa499c79b
commit 75b0e53114
6 changed files with 17 additions and 116 deletions

View File

@@ -40,7 +40,7 @@ let dq__where_eq_id_val: string = link_to_id;
// Functions and Logic
import { browser } from '$app/environment';
import { hide } from '@floating-ui/dom';
if (browser) {
console.log('Browser environment detected.');
}

View File

@@ -88,7 +88,7 @@ async function handle_search__event_file(
$events_sess.pres_mgmt.status_qry__search = 'loading';
$events_sess.pres_mgmt.status_rpt[$events_sess.pres_mgmt.show_report] = 'loading';
ae_promises.handle_search__event_file = events_func.handle_search__event_file({
ae_promises.search__event_file = events_func.search__event_file({
api_cfg: $ae_api,
event_id: $events_slct.event_id,
created_on: created_on,

View File

@@ -14,7 +14,6 @@ import { ae_util } from '$lib/ae_utils';
import { api } from '$lib/api';
import Element_ae_crud from '$lib/element_ae_crud.svelte';
// import Element_data_store from '$lib/element_data_store.svelte';
import Element_manage_event_file_li from '$lib/element_manage_event_file_li.svelte';
import { core_func } from '$lib/ae_core_functions';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
@@ -1433,103 +1432,6 @@ $: if ($lq__event_presenter_obj) {
</li>
</ul>
<!-- <h3 class="h4">
Upload File(s):
</h3> -->
<!-- <button
type="button"
on:click={() => {
console.log('*** Refresh button clicked ***');
ae_tmp.show__file_li = false;
console.log(`$lq__event_file_obj_li:`, $lq__event_file_obj_li);
$slct_trigger = 'load__event_file_obj_li';
ae_tmp.show__file_li = true;
}}
class="btn btn-sm variant-soft-tertiary hover:variant-ghost-warning float-right transition hover:transition-all"
>
<span class="fas fa-sync-alt mx-1"></span>
Refresh Files
</button> -->
<!-- <div class="text-sm text-center bg-orange-100 rounded-md p-2">
WARNING: The file upload and management is a work in progress. You can upload and delete files, but not yet rename them. You may need to refresh the page if your changes are not showing up.
</div> -->
<!-- <form
on:submit|preventDefault={handle_submit_form_files}
class:hidden={!$ae_loc.trusted_access && !$events_loc.auth__kv.presenter[$lq__event_presenter_obj?.event_presenter_id_random] && !$events_loc.auth__kv.session[$lq__event_presenter_obj.event_session_id_random]}
class="modal-form {$ae_loc.hub.classes__form} flex flex-col space-y-2 items-center w-full"
>
<label for="input__presenter_event_file">
Upload outline or draft file(s):
<FileDropzone
id="input__presenter_event_file"
name="presenter_event_file"
padding="p-1"
accept="*"
class="w-96 variant-glass-warning"
on:change={(e) => {
console.log('*** FileDropzone change event ***', e);
if (e.target.files.length) {
ae_placeholder_li.new_file = `Ready to upload: ${e.target.files[0].name}`;
$events_sess.pres_mgmt.disable_submit__event_file_obj = false;
} else {
$events_sess.pres_mgmt.disable_submit__event_file_obj = true;
ae_placeholder_li.new_file = null;
}
}}
>
<svelte:fragment slot="lead"><span class="fas fa-file-upload"></svelte:fragment>
<svelte:fragment slot="message"><strong>Upload your file</strong> (drag and drop)</svelte:fragment>
<svelte:fragment slot="meta">Presentation related files only<br>(PowerPoint, Keynote, PDF, mp4, Word Doc, Excel, txt, etc)</svelte:fragment>
{ae_placeholder_li.new_file ?? 'No files selected.'}
</FileDropzone>
</label>
<button
type="submit"
class="btn btn-md variant-ghost-secondary m-2"
disabled={($events_sess.pres_mgmt.disable_submit__event_file_obj)}
on:click={() => {
console.log('*** Save button clicked ***');
// if (!confirm('Are you sure you want to save this event_presenter?')) {return false;}
// handle_submit_form();
// handle_submit_form;
}}
>
{#await ae_promises.upload__hosted_file_obj}
<span class="fas fa-spinner fa-spin mx-1"></span>
<span class="">
Uploading
{#if $ae_sess.api_upload_kv[$lq__event_presenter_obj?.event_presenter_id_random]}
{$ae_sess.api_upload_kv[$lq__event_presenter_obj?.event_presenter_id_random].percent_completed}%
{/if}
</span>
{:then}
<span class="fas fa-upload mx-1"></span>
<span class="text-sm">
Upload:
</span>
<span class="grow">
File
</span>
{/await}
</button>
</form> -->
<!-- <div class="overflow-x-auto w-max max-w-full">
<Element_manage_event_file_li
link_to_type={'event_presenter'}
link_to_id={$lq__event_presenter_obj?.event_presenter_id_random}
allow_basic={$events_loc.auth__kv.session[$lq__event_presenter_obj.event_session_id_random] || $events_loc.auth__kv.presenter[$lq__event_presenter_obj?.event_presenter_id_random]}
allow_moderator={$events_loc.auth__kv.session[$lq__event_presenter_obj.event_session_id_random]}
container_class_li={''}
/>
</div> -->
</section>
{/if}