refactor: standardize event file actions and apply batch formatting
- Updated 'create_event_file_obj_from_hosted_file_async' to use the modern V3 action endpoint. - Standardized 'prevent_default' helper names in root Event and Archive components. - Applied batch formatting (printWidth: 80) across the settings and events modules.
This commit is contained in:
@@ -83,7 +83,9 @@
|
||||
upload_complete = false;
|
||||
|
||||
const target = event.currentTarget as HTMLFormElement;
|
||||
const file_input = target ? (target[input_element_id] as HTMLInputElement) : null;
|
||||
const file_input = target
|
||||
? (target[input_element_id] as HTMLInputElement)
|
||||
: null;
|
||||
|
||||
if (file_input && file_input.files && file_input.files.length > 0) {
|
||||
// Sequential upload to provide reliable progress and avoid server race conditions
|
||||
@@ -126,7 +128,10 @@
|
||||
input_upload_files: any[];
|
||||
task_id: string;
|
||||
}) {
|
||||
if (log_lvl) console.log(`*** handle_input_upload_files() *** task_id = ${task_id}`);
|
||||
if (log_lvl)
|
||||
console.log(
|
||||
`*** handle_input_upload_files() *** task_id = ${task_id}`
|
||||
);
|
||||
|
||||
const form_data = new FormData();
|
||||
form_data.append('account_id', $ae_loc.account_id);
|
||||
@@ -161,12 +166,14 @@
|
||||
};
|
||||
|
||||
// STEP 2: Create Event File Link
|
||||
return await events_func.create_event_file_obj_from_hosted_file_async({
|
||||
api_cfg: $ae_api,
|
||||
hosted_file_id: hosted_file_id,
|
||||
data: event_file_data,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
return await events_func.create_event_file_obj_from_hosted_file_async(
|
||||
{
|
||||
api_cfg: $ae_api,
|
||||
hosted_file_id: hosted_file_id,
|
||||
data: event_file_data,
|
||||
log_lvl: log_lvl
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(function (error: any) {
|
||||
console.error('Upload Process Failed:', error);
|
||||
@@ -216,9 +223,13 @@
|
||||
{#if label}{@render label()}{:else}
|
||||
<div class="flex items-center justify-center gap-2 mb-2 pt-2">
|
||||
<Lucide.Upload class="text-primary-500" />
|
||||
<strong class="preset-tonal-primary px-3 py-1 rounded-full">Select Files</strong>
|
||||
<strong class="preset-tonal-primary px-3 py-1 rounded-full"
|
||||
>Select Files</strong
|
||||
>
|
||||
</div>
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400 italic pb-2">
|
||||
<div
|
||||
class="text-sm text-gray-600 dark:text-gray-400 italic pb-2"
|
||||
>
|
||||
<strong>Presentation materials only</strong><br />
|
||||
(PPTX, Keynote, PDF, MP4, etc)
|
||||
</div>
|
||||
@@ -281,11 +292,14 @@
|
||||
<span class="text-sm"> Upload </span>
|
||||
<span class="grow font-bold ml-2">
|
||||
{#if $events_sess.files.processed_file_list?.length > 0}
|
||||
{$events_sess.files.processed_file_list.length} { $events_sess.files.processed_file_list.length === 1 ? 'file' : 'files' }
|
||||
{$events_sess.files.processed_file_list.length}
|
||||
{$events_sess.files.processed_file_list.length === 1
|
||||
? 'file'
|
||||
: 'files'}
|
||||
{:else}
|
||||
<span class="text-xs"> 0 </span>
|
||||
{/if}
|
||||
</span>
|
||||
{/await}
|
||||
</button>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user