fix(pres_mgmt): decouple email access link buttons from require_agree flags
Presenter email button: removed dependency on require__presenter_agree, fixed auth gate that blocked trusted staff (presenter_is_authed includes trusted_access, so !presenter_is_authed always hid the button from staff). New condition: show when email feature is on AND person has email AND (staff OR presenter not yet authed). Session POC email button: removed dependency on require__session_agree. Staff need to send sign-in links regardless of whether an agreement form is in use. Added confirm dialog and descriptive title attribute. Updated copy-link btn_title for consistency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -262,7 +262,7 @@ let presenter_is_authed = $derived(
|
||||
></MyClipboard>
|
||||
{/if}
|
||||
|
||||
{#if pres_mgmt_loc.current.require__presenter_agree && pres_mgmt_loc.current.show__email_access_link && $lq__event_presenter_obj?.person_primary_email && ($ae_loc.public_access || !events_auth_loc.current.auth__person?.id)}
|
||||
{#if pres_mgmt_loc.current.show__email_access_link && $lq__event_presenter_obj?.person_primary_email && ($ae_loc.trusted_access || !presenter_is_authed)}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
|
||||
@@ -196,6 +196,7 @@ $effect(() => {
|
||||
async function send_poc_email_link() {
|
||||
const sess = $lq__event_session_obj;
|
||||
if (!sess?.poc_person_primary_email || !sess?.poc_person_id || !sess?.poc_person_passcode) return;
|
||||
if (!confirm(`Send sign-in link to ${sess.poc_person_full_name} (${sess.poc_person_primary_email})?`)) return;
|
||||
poc_email_status = 'sending';
|
||||
try {
|
||||
await events_func.email_sign_in__event_session({
|
||||
@@ -463,26 +464,30 @@ async function send_poc_email_link() {
|
||||
<MyClipboard
|
||||
value={poc_sign_in_url}
|
||||
btn_class="btn btn-sm preset-tonal-surface text-xs"
|
||||
btn_title="Copy the {pres_mgmt_loc.current.label__session_poc_name} sign-in link to the clipboard"
|
||||
hide_icon={false}
|
||||
hide_text={false}>
|
||||
<Link size="1em" class="mr-1" />
|
||||
<Link size="1em" class="" />
|
||||
Copy Link
|
||||
</MyClipboard>
|
||||
{/if}
|
||||
|
||||
<!-- Email POC sign-in link — shown when session agreement is required,
|
||||
email feature is enabled, and the POC has an email on file. -->
|
||||
{#if pres_mgmt_loc.current.require__session_agree && pres_mgmt_loc.current.show__email_access_link && $lq__event_session_obj?.poc_person_primary_email}
|
||||
<!-- Email POC sign-in link — shown when email feature is enabled and
|
||||
the POC has an email on file. Decoupled from require__session_agree:
|
||||
staff need to send sign-in links whether or not an agreement form is
|
||||
required. -->
|
||||
{#if pres_mgmt_loc.current.show__email_access_link && $lq__event_session_obj?.poc_person_primary_email}
|
||||
<button
|
||||
type="button"
|
||||
disabled={poc_email_status === 'sending'}
|
||||
onclick={send_poc_email_link}
|
||||
class="btn btn-sm transition-colors duration-200"
|
||||
class:preset-tonal-surface={poc_email_status === 'idle'}
|
||||
title="Email the sign-in link to {pres_mgmt_loc.current.label__session_poc_name}: {$lq__event_session_obj?.poc_person_full_name} ({$lq__event_session_obj?.poc_person_primary_email})"
|
||||
class="btn btn-sm preset-outlined-secondary-300-700 transition-all duration-200"
|
||||
class:preset-tonal-secondary={poc_email_status === 'idle'}
|
||||
class:preset-tonal-warning={poc_email_status === 'sending'}
|
||||
class:preset-tonal-success={poc_email_status === 'sent'}
|
||||
class:preset-tonal-error={poc_email_status === 'error'}>
|
||||
<Mail size="1em" class="mr-1" />
|
||||
<Mail size="1em" class="" />
|
||||
{#if poc_email_status === 'sending'}
|
||||
Sending…
|
||||
{:else if poc_email_status === 'sent'}
|
||||
|
||||
Reference in New Issue
Block a user