Fix for disabling and hiding event file purpose options.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "osit-aether-app-svelte",
|
||||
"version": "3.9.1",
|
||||
"version": "3.9.2",
|
||||
"description": "One Sky IT's Aether App created with Svelte, SvelteKit, Tailwind CSS, Lucide, Font Awesome, and Skeleton UI. -Scott Idem",
|
||||
"homepage": "https://oneskyit.com/",
|
||||
"private": true,
|
||||
|
||||
@@ -490,7 +490,7 @@ let clipboard_success = $state(false);
|
||||
class="event_file__status"
|
||||
class:hidden={!allow_basic && !$ae_loc.trusted_access}
|
||||
>
|
||||
<div class="flex flex-col gap-1 items-center text-sm">
|
||||
<div class="flex flex-col gap-1 items-center justify-center text-sm">
|
||||
|
||||
<div class="">
|
||||
{#if event_file_obj.open_in_os == 'win'}
|
||||
@@ -541,15 +541,16 @@ let clipboard_success = $state(false);
|
||||
|
||||
// ae_triggers.update_event_file_purpose = true;
|
||||
}}
|
||||
class="select min-w-fit max-w-fit text-sm mx-1 border border-gray-300 rounded-md p-1 hover:border-gray-400"
|
||||
class="select min-w-fit max-w-fit text-xs mx-1 border border-gray-300 rounded-md p-1 hover:border-gray-400"
|
||||
>
|
||||
<option value={null} selected={!event_file_obj.file_purpose} class="text-xs">-- purpose not set --</option>
|
||||
<option value={null} selected={!event_file_obj.file_purpose}>-- purpose not set --</option>
|
||||
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
|
||||
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv) as [key, file_purpose_option]}
|
||||
<option
|
||||
value={key} selected={event_file_obj.file_purpose === key}
|
||||
disabled={file_purpose_option?.disabled}
|
||||
class:hidden={file_purpose_option?.hidden}
|
||||
value={key}
|
||||
selected={event_file_obj.file_purpose === key}
|
||||
disabled={file_purpose_option?.disabled && !$ae_loc.edit_mode}
|
||||
class:hidden={file_purpose_option?.hidden && !$ae_loc.edit_mode}
|
||||
>
|
||||
{file_purpose_option?.name}
|
||||
</option>
|
||||
|
||||
@@ -350,137 +350,9 @@ async function handle_qry__event_file(
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Show files that were recently uploaded -->
|
||||
{#if rpt__name == 'recent_files'}
|
||||
<header class="w-full flex flex-row flex-wrap items-center justify-center gap-1">
|
||||
<h3 class="h4 text-center">
|
||||
{#if qry__status == 'loading'}
|
||||
<span class="fas fa-spinner fa-spin m-1"></span>
|
||||
<!-- <span>Loading...</span> -->
|
||||
{:else}
|
||||
<span class="fas fa-bell m-1"></span>
|
||||
{/if}
|
||||
Recent File Uploads
|
||||
</h3>
|
||||
|
||||
<div class="flex flex-row items-center justify-center">
|
||||
<select
|
||||
class="inline-block select text-sm px-1 w-40 m-1 ae_btn_info"
|
||||
bind:value={$events_loc.pres_mgmt.qry__files_offset_seconds}
|
||||
onchange={() => {
|
||||
if ($events_loc.pres_mgmt?.qry__files_offset_seconds) {
|
||||
// Calculate the datetime to pass based on the selected offset.
|
||||
// let offset = $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0;
|
||||
// let created_on = new Date()
|
||||
// console.log(`Created on:`, created_on);
|
||||
// created_on.setSeconds(created_on.getSeconds() - offset);
|
||||
// handle_qry__event_file({
|
||||
// created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0,
|
||||
// file_purpose: $events_loc.pres_mgmt.qry__file_purpose ?? null,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
qry__trigger = true;
|
||||
} else {
|
||||
console.log('No offset is will be used.');
|
||||
// handle_qry__event_file({
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
qry__trigger = true;
|
||||
}
|
||||
|
||||
$events_loc.pres_mgmt.show_report = 'recent_files';
|
||||
}}
|
||||
>
|
||||
<option value="">-- offset not set --</option>
|
||||
<option value="600">10 minutes</option>
|
||||
<option value="1800">30 minutes</option>
|
||||
<option value="3600">1 hour</option>
|
||||
<option value="10800">2 hours</option>
|
||||
<option value="21600">6 hours</option>
|
||||
<option value="43200">12 hours</option>
|
||||
<option value="86400">24 hours</option>
|
||||
<option value="129600">36 hours</option>
|
||||
<option value="172800">48 hours</option>
|
||||
<option value="259200">72 hours</option>
|
||||
<option value="604800">1 week</option>
|
||||
<option value="1209600">2 weeks</option>
|
||||
<option value="2419200">4 weeks</option>
|
||||
<option value="7776000">12 weeks</option>
|
||||
<option value="15552000">24 weeks</option>
|
||||
</select>
|
||||
|
||||
<select
|
||||
id="file_purpose"
|
||||
name="file_purpose"
|
||||
class="inline-block select text-sm w-40 px-1 m-1 ae_btn_info"
|
||||
bind:value={$events_loc.pres_mgmt.qry__file_purpose}
|
||||
onchange={() => {
|
||||
// handle_qry__event_file({
|
||||
// created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0,
|
||||
// file_purpose: $events_loc.pres_mgmt.qry__file_purpose ?? null,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
qry__trigger = true;
|
||||
$events_loc.pres_mgmt.show_report = 'recent_files';
|
||||
}}
|
||||
>
|
||||
<option
|
||||
value={null}
|
||||
selected={!$events_loc.pres_mgmt.qry__file_purpose}
|
||||
class="text-xs"
|
||||
>
|
||||
-- purpose not set --
|
||||
</option>
|
||||
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
|
||||
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv) as [key, file_purpose_option]}
|
||||
<option
|
||||
value={key} selected={$events_loc.pres_mgmt.qry__file_purpose === key}
|
||||
disabled={file_purpose_option?.disabled}
|
||||
class:hidden={file_purpose_option?.hidden}
|
||||
>
|
||||
{file_purpose_option?.name}
|
||||
</option>
|
||||
{/each}
|
||||
{/if}
|
||||
</select>
|
||||
|
||||
<!-- Max files select options -->
|
||||
|
||||
<select
|
||||
id="qry_limit__files"
|
||||
bind:value={$events_loc.pres_mgmt.qry_limit__files}
|
||||
class="inline-block select text-sm px-1 w-40 m-1 ae_btn_info"
|
||||
onchange={() => {
|
||||
// handle_qry__event_file({
|
||||
// created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0,
|
||||
// file_purpose: $events_loc.pres_mgmt.qry__file_purpose ?? null,
|
||||
// limit: $events_loc.pres_mgmt.qry_limit__files ?? 100,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
qry__trigger = true;
|
||||
$events_loc.pres_mgmt.show_report = 'recent_files';
|
||||
}}
|
||||
>
|
||||
<option value={0}>-- max not set --</option>
|
||||
<option value={25}>25 files</option>
|
||||
<option value={50}>50 files</option>
|
||||
<option value={75}>75 files</option>
|
||||
<option value={100}>100 files</option>
|
||||
<option value={200}>200 files</option>
|
||||
<option value={500}>500 files</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
</header>
|
||||
{/if}
|
||||
|
||||
|
||||
<!-- Show large files -->
|
||||
{#if rpt__name == 'event_files' || rpt__name == 'large_files'}
|
||||
<header class="w-full flex flex-row flex-wrap items-center justify-center gap-1">
|
||||
<h3 class="h4 text-center">
|
||||
@@ -495,6 +367,7 @@ async function handle_qry__event_file(
|
||||
|
||||
|
||||
<div class="flex flex-row items-center justify-center">
|
||||
|
||||
<select
|
||||
class="inline-block select text-sm px-1 w-40 m-1 ae_btn_info"
|
||||
bind:value={$events_loc.pres_mgmt.qry__files_offset_seconds}
|
||||
@@ -540,7 +413,6 @@ async function handle_qry__event_file(
|
||||
<option value="15552000">24 weeks</option>
|
||||
</select>
|
||||
|
||||
|
||||
<select
|
||||
class="inline-block select text-sm w-40 px-1 m-1 ae_btn_info"
|
||||
bind:value={$events_loc.pres_mgmt.qry__files_min_size}
|
||||
@@ -592,9 +464,8 @@ async function handle_qry__event_file(
|
||||
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
|
||||
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv) as [key, file_purpose_option]}
|
||||
<option
|
||||
value={key} selected={$events_loc.pres_mgmt.qry__file_purpose === key}
|
||||
disabled={file_purpose_option?.disabled}
|
||||
class:hidden={file_purpose_option?.hidden}
|
||||
value={key}
|
||||
selected={$events_loc.pres_mgmt.qry__file_purpose === key}
|
||||
>
|
||||
{file_purpose_option?.name}
|
||||
</option>
|
||||
|
||||
Reference in New Issue
Block a user