fix(pres_mgmt): richer titles + obscured email on presenter Email Access Link buttons

Both the presenter list and detail page now show name + email in button
title and confirm dialog, matching the POC pattern. Non-trusted users
see joh***@example.com; trusted staff see the full address.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-24 13:49:42 -04:00
parent 64b4bce185
commit 7ab5ffe224
2 changed files with 13 additions and 3 deletions

View File

@@ -366,7 +366,7 @@ function obscure_email(email: string | null | undefined): string {
}); });
}} }}
class="btn btn-sm preset-tonal-secondary border-secondary-500 hover:preset-filled-secondary-500 m-0.25 border" class="btn btn-sm preset-tonal-secondary border-secondary-500 hover:preset-filled-secondary-500 m-0.25 border"
title="Email the access link to the presenter"> title="Email the access link to {$lq__event_presenter_obj?.full_name ?? 'presenter'} ({$ae_loc.trusted_access ? ($lq__event_presenter_obj?.person_primary_email ?? $lq__event_presenter_obj?.email ?? 'no email on file') : obscure_email($lq__event_presenter_obj?.person_primary_email ?? $lq__event_presenter_obj?.email)})">
<Mail size="1em" class="" /> <Mail size="1em" class="" />
<Link size="1em" class="" /> <Link size="1em" class="" />
Email Access Link Email Access Link

View File

@@ -67,6 +67,13 @@ let ae_tmp: key_val = $state({});
// let ae_triggers: key_val = {}; // let ae_triggers: key_val = {};
// *** Functions and Logic // *** Functions and Logic
function obscure_email(email: string | null | undefined): string {
if (!email) return '';
const at = email.indexOf('@');
if (at < 0) return email;
return `${email.slice(0, Math.min(3, at))}***${email.slice(at)}`;
}
</script> </script>
<div class="float-right flex flex-row items-center"> <div class="float-right flex flex-row items-center">
@@ -201,7 +208,10 @@ let ae_tmp: key_val = $state({});
alert('No email address found for this presenter.'); alert('No email address found for this presenter.');
return; return;
} }
if (!confirm(`This will send the sign in email to ${use_email}`)) { const display_email = $ae_loc.trusted_access
? use_email
: obscure_email(use_email);
if (!confirm(`This will send the access link email to ${event_presenter_obj.full_name ?? 'this presenter'} (${display_email})?`)) {
return; return;
} }
@@ -231,7 +241,7 @@ let ae_tmp: key_val = $state({});
}} }}
class="btn preset-tonal-secondary border-secondary-500 hover:preset-filled-secondary-500 my-0.5 border transition-all hover:transition-all" class="btn preset-tonal-secondary border-secondary-500 hover:preset-filled-secondary-500 my-0.5 border transition-all hover:transition-all"
class:btn-sm={display_mode != 'default'} class:btn-sm={display_mode != 'default'}
title="Email the access link to the presenter"> title="Email the access link to {event_presenter_obj.full_name ?? 'presenter'} ({$ae_loc.trusted_access ? (event_presenter_obj.person_primary_email ?? event_presenter_obj.email ?? 'no email on file') : obscure_email(event_presenter_obj.person_primary_email ?? event_presenter_obj.email)})">
<Mail size="1em" class="mr-1" /> <Mail size="1em" class="mr-1" />
Email Access Link Email Access Link
</button> </button>