fix(badges): correct default field lists in review page
default_authenticated_fields was missing: pronouns_override, phone_override, allow_tracking, agree_to_tc — so attendees couldn't edit those fields even though the form rendered inputs for them. default_trusted_fields had 'email' and 'badge_type_code' instead of 'email_override' and 'badge_type_code_override', causing the can_edit() check in handle_save() to silently drop those changes. Also added the full trusted field set: registration_type, other_1-8_code, ticket_1-8_code, hide, priority, notes. Also removed unused lucide imports (ShieldCheck, User, UserCheck) left over from the removed access level indicator block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,17 +27,7 @@
|
||||
import { db_events } from '$lib/ae_events/db_events';
|
||||
import { events_loc } from '$lib/stores/ae_events_stores';
|
||||
import { page } from '$app/state';
|
||||
import {
|
||||
ArrowLeft,
|
||||
Check,
|
||||
Link,
|
||||
LoaderCircle,
|
||||
Mail,
|
||||
Printer,
|
||||
ShieldCheck,
|
||||
User,
|
||||
UserCheck
|
||||
} from 'lucide-svelte';
|
||||
import { ArrowLeft, Check, Link, LoaderCircle, Mail, Printer } from 'lucide-svelte';
|
||||
|
||||
import Comp_badge_review_form from '../ae_comp__badge_review_form.svelte';
|
||||
|
||||
@@ -63,18 +53,34 @@
|
||||
// TODO: Load event.mod_badges_json.edit_permissions for per-event field config.
|
||||
// Hardcoded defaults for now — revisit after basic flow is working.
|
||||
const default_authenticated_fields = [
|
||||
'pronouns_override',
|
||||
'full_name_override',
|
||||
'professional_title_override',
|
||||
'affiliations_override',
|
||||
'location_override'
|
||||
'phone_override',
|
||||
'location_override',
|
||||
'allow_tracking', // Exhibitor Leads opt-in
|
||||
'agree_to_tc' // Terms & Conditions
|
||||
];
|
||||
const default_trusted_fields = [
|
||||
'pronouns_override',
|
||||
'full_name_override',
|
||||
'professional_title_override',
|
||||
'affiliations_override',
|
||||
'email_override',
|
||||
'phone_override',
|
||||
'location_override',
|
||||
'email',
|
||||
'badge_type_code'
|
||||
'badge_type_code_override',
|
||||
'registration_type_code_override',
|
||||
'other_1_code', 'other_2_code', 'other_3_code', 'other_4_code',
|
||||
'other_5_code', 'other_6_code', 'other_7_code', 'other_8_code',
|
||||
'ticket_1_code', 'ticket_2_code', 'ticket_3_code', 'ticket_4_code',
|
||||
'ticket_5_code', 'ticket_6_code', 'ticket_7_code', 'ticket_8_code',
|
||||
'allow_tracking',
|
||||
'agree_to_tc',
|
||||
'hide',
|
||||
'priority',
|
||||
'notes'
|
||||
];
|
||||
|
||||
// *** Passcode logic
|
||||
@@ -265,24 +271,6 @@
|
||||
{#if has_any_access}
|
||||
<div class="space-y-4">
|
||||
|
||||
<!-- Access level indicator -->
|
||||
{#if is_administrator}
|
||||
<p class="text-xs text-gray-400 flex items-center gap-1">
|
||||
<ShieldCheck size="1em" class="text-purple-500" />
|
||||
Administrator access — all fields editable
|
||||
</p>
|
||||
{:else if is_trusted}
|
||||
<p class="text-xs text-gray-400 flex items-center gap-1">
|
||||
<UserCheck size="1em" class="text-blue-500" />
|
||||
Staff access — extended fields editable
|
||||
</p>
|
||||
{:else if has_attendee_access}
|
||||
<p class="text-xs text-gray-400 flex items-center gap-1">
|
||||
<User size="1em" class="text-green-500" />
|
||||
Reviewing your badge information
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<Comp_badge_review_form
|
||||
event_id={event_id as string}
|
||||
event_badge_id={event_badge_id as string}
|
||||
|
||||
Reference in New Issue
Block a user