From 4ae9ecc3815a1035f767d79a6ec813a6f9747268 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 22 Apr 2026 23:24:55 -0400 Subject: [PATCH] fix(files): show legacy file warning banner for trusted-access users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trusted-access users (Pres Mgmt admins) were getting file_list_status='ready' when selecting .ppt/.doc/.xls files, so the prominent warning banner never rendered — only the small per-row warning in the file table was visible. - element_input_files_tbl: introduce 'warn_legacy' status for trusted users; show a yellow warning banner (vs red blocked banner for non-trusted users) - ae_comp__event_files_upload: change button disabled check from != 'ready' to === 'blocked_legacy' so 'warn_legacy' does not accidentally block upload Co-Authored-By: Claude Sonnet 4.6 --- src/lib/elements/element_input_files_tbl.svelte | 17 ++++++++++++++++- .../events/ae_comp__event_files_upload.svelte | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/lib/elements/element_input_files_tbl.svelte b/src/lib/elements/element_input_files_tbl.svelte index 83b873f2..22e9d5e6 100644 --- a/src/lib/elements/element_input_files_tbl.svelte +++ b/src/lib/elements/element_input_files_tbl.svelte @@ -280,7 +280,15 @@ async function process_file_list(file_list: FileList) { } const has_blocked = processed_file_list.some((f) => f.block_upload); - file_list_status = has_blocked && !$ae_loc.trusted_access ? 'blocked_legacy' : 'ready'; + // WHY: trusted_access users (Pres Mgmt admins) see a prominent warning but are + // not blocked from uploading — they may intentionally handle legacy formats. + // Non-trusted users are fully blocked. Both cases get a visible banner; only + // the color and button state differ. + if (has_blocked) { + file_list_status = $ae_loc.trusted_access ? 'warn_legacy' : 'blocked_legacy'; + } else { + file_list_status = 'ready'; + } console.log(processed_file_list); // return JSON.parse(JSON.stringify(processed_file_list)); @@ -376,6 +384,13 @@ run(() => { {/if} + {#if file_list_status == 'warn_legacy'} +
+ ⚠ Warning — legacy file format detected. + This Microsoft file type has not been supported in more than 10 years and may not work well. You can still upload, but it is strongly recommended to re-save in the modern format first. See details below. +
+ {/if} + {#if use_selected_file_table && processed_file_list && processed_file_list.length} diff --git a/src/routes/events/ae_comp__event_files_upload.svelte b/src/routes/events/ae_comp__event_files_upload.svelte index 1c5563a9..55a1f2c2 100644 --- a/src/routes/events/ae_comp__event_files_upload.svelte +++ b/src/routes/events/ae_comp__event_files_upload.svelte @@ -279,7 +279,7 @@ async function handle_input_upload_files({ transition-all " disabled={$events_sess.files.disable_submit__event_file_obj || - $events_sess.files.status__file_list != 'ready'}> + $events_sess.files.status__file_list === 'blocked_legacy'}> {#await ae_promises.upload__hosted_file_obj}