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:
@@ -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"
|
||||
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="" />
|
||||
<Link size="1em" class="" />
|
||||
Email Access Link
|
||||
|
||||
@@ -67,6 +67,13 @@ let ae_tmp: key_val = $state({});
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
// *** 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>
|
||||
|
||||
<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.');
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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-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" />
|
||||
Email Access Link
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user