Standardize Exhibit Leads module: Rich text support and naming alignment
- Integrated TipTap rich text editor for Booth Descriptions and Exhibitor Notes. - Implemented strip_html utility for clean search/preview of rich text fields. - Renamed exhibit loading functions to follow load_ae_obj_id__event_exhibit* pattern. - Hardened property processors with 'undefined' string guards and automatic reload triggers. - Resolved type mismatches and naming inconsistencies across the Leads module. - Verified zero-error state via svelte-check.
This commit is contained in:
@@ -48,11 +48,11 @@ Represents a single lead captured by an exhibitor. It links an exhibitor to an a
|
||||
|
||||
- `/events/[event_id]/(leads)`: The main entry point for the Leads module within a specific event, typically displays a list of available exhibits.
|
||||
- `+page.svelte`: Renders the list of exhibits.
|
||||
- `+page.ts`: Loads the data for available exhibits using `events_func.load_ae_obj_li__exhibit`.
|
||||
- `+page.ts`: Loads the data for available exhibits using `events_func.load_ae_obj_li__event_exhibit`.
|
||||
- `+layout.svelte`/`+layout.ts`: Provides a common layout and data for the module, including a submenu.
|
||||
- `/events/[event_id]/(leads)/exhibit/[slug]`: Dynamic route for managing leads for a specific exhibitor within an event. The `[slug]` corresponds to `event_exhibit_id`.
|
||||
- `+page.svelte`: The primary interface for an exhibitor, orchestrating lead capture and management components.
|
||||
- `+page.ts`: Loads specific `Exhibit` data and associated `Exhibit_tracking` (leads) using `events_func.load_ae_obj_id__exhibit` and `events_func.load_ae_obj_li__exhibit_tracking`.
|
||||
- `+page.ts`: Loads specific `Exhibit` data and associated `Exhibit_tracking` (leads) using `events_func.load_ae_obj_id__event_exhibit` and `events_func.load_ae_obj_li__event_exhibit_tracking`.
|
||||
|
||||
### Core Components (within `src/routes/events/[event_id]/(leads)/exhibit/[slug]/`)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function load({ params, parent }) {
|
||||
const event_id = params.event_id;
|
||||
|
||||
if (browser && event_id) {
|
||||
events_func.load_ae_obj_li__exhibit({
|
||||
events_func.load_ae_obj_li__event_exhibit({
|
||||
api_cfg: ae_acct.api,
|
||||
event_id: event_id,
|
||||
limit: 100,
|
||||
|
||||
@@ -19,13 +19,13 @@ export async function load({ params, parent }) {
|
||||
});
|
||||
|
||||
if (browser && exhibit_id) {
|
||||
events_func.load_ae_obj_id__exhibit({
|
||||
events_func.load_ae_obj_id__event_exhibit({
|
||||
api_cfg: ae_acct.api,
|
||||
exhibit_id: exhibit_id,
|
||||
log_lvl: 0
|
||||
});
|
||||
|
||||
events_func.load_ae_obj_li__exhibit_tracking({
|
||||
events_func.load_ae_obj_li__event_exhibit_tracking({
|
||||
api_cfg: ae_acct.api,
|
||||
exhibit_id: exhibit_id,
|
||||
limit: 250,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import { ae_api, ae_loc } from '$lib/stores/ae_stores';
|
||||
import { page } from '$app/state';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import {
|
||||
LoaderCircle,
|
||||
UserPlus,
|
||||
@@ -228,9 +229,11 @@
|
||||
const email = (
|
||||
tracking.event_badge_email ?? ''
|
||||
).toLowerCase();
|
||||
const notes = (
|
||||
tracking.exhibitor_notes ?? ''
|
||||
).toLowerCase();
|
||||
const notes = ae_util.strip_html(tracking.exhibitor_notes ?? '').toLowerCase();
|
||||
// Guard: Prevent "undefined" from being searched
|
||||
if (tracking.exhibitor_notes === 'undefined') {
|
||||
tracking.exhibitor_notes = '';
|
||||
}
|
||||
const qry_string = (
|
||||
tracking.default_qry_str ?? ''
|
||||
).toLowerCase();
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
>
|
||||
<FileText size="1em" class="inline mr-1" />
|
||||
{ae_util.shorten_string({
|
||||
string: event_tracking_obj.exhibitor_notes,
|
||||
string: ae_util.strip_html(event_tracking_obj.exhibitor_notes),
|
||||
max_length: 100
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
field_name="priority"
|
||||
field_type="boolean"
|
||||
current_field_value={$lq__exhibit_obj?.priority}
|
||||
object_reload={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -81,6 +82,7 @@
|
||||
field_name="license_max"
|
||||
field_type="number"
|
||||
current_field_value={$lq__exhibit_obj?.license_max}
|
||||
object_reload={true}
|
||||
class_li="w-16 font-mono text-right"
|
||||
/>
|
||||
</div>
|
||||
@@ -97,6 +99,7 @@
|
||||
field_name="leads_device_sm_qty"
|
||||
field_type="number"
|
||||
current_field_value={$lq__exhibit_obj?.leads_device_sm_qty}
|
||||
object_reload={true}
|
||||
class_li="w-16 font-mono text-right"
|
||||
/>
|
||||
</div>
|
||||
@@ -113,6 +116,7 @@
|
||||
field_name="leads_device_lg_qty"
|
||||
field_type="number"
|
||||
current_field_value={$lq__exhibit_obj?.leads_device_lg_qty}
|
||||
object_reload={true}
|
||||
class_li="w-16 font-mono text-right"
|
||||
/>
|
||||
</div>
|
||||
@@ -140,6 +144,7 @@
|
||||
field_name="name"
|
||||
field_type="text"
|
||||
current_field_value={$lq__exhibit_obj?.name}
|
||||
object_reload={true}
|
||||
hide_element={false}
|
||||
display_block={true}
|
||||
class_li="font-bold text-xl"
|
||||
@@ -157,9 +162,9 @@
|
||||
object_type="event_exhibit"
|
||||
object_id={exhibit_id}
|
||||
field_name="description"
|
||||
field_type="textarea"
|
||||
field_type="tiptap"
|
||||
current_field_value={$lq__exhibit_obj?.description}
|
||||
textarea_rows={4}
|
||||
object_reload={true}
|
||||
hide_element={false}
|
||||
display_block={true}
|
||||
class_li="text-sm"
|
||||
@@ -181,6 +186,14 @@
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex-1">
|
||||
<div class="text-[10px] uppercase font-black opacity-40 tracking-widest mb-1">Staff Passcode</div>
|
||||
|
||||
<!-- Add a clear read-only display for admins to see the code at a glance -->
|
||||
{#if $ae_loc.administrator_access}
|
||||
<div class="font-mono text-xl tracking-widest font-bold text-primary-500 mb-2">
|
||||
{$lq__exhibit_obj?.staff_passcode || '----'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<Element_ae_crud_v2
|
||||
api_cfg={$ae_api}
|
||||
object_type="event_exhibit"
|
||||
@@ -188,6 +201,7 @@
|
||||
field_name="staff_passcode"
|
||||
field_type="text"
|
||||
current_field_value={$lq__exhibit_obj?.staff_passcode}
|
||||
object_reload={true}
|
||||
class_li="font-mono text-xl tracking-widest font-bold"
|
||||
hide_element={false}
|
||||
display_block={true}
|
||||
|
||||
@@ -193,13 +193,15 @@
|
||||
object_type="event_exhibit_tracking"
|
||||
object_id={exhibit_tracking_id ?? ''}
|
||||
field_name="exhibitor_notes"
|
||||
field_type="textarea"
|
||||
field_type="tiptap"
|
||||
current_field_value={$lq__lead_obj.exhibitor_notes}
|
||||
textarea_rows={6}
|
||||
object_reload={true}
|
||||
display_block={true}
|
||||
/>
|
||||
{:else if $lq__lead_obj.exhibitor_notes}
|
||||
<p class="whitespace-pre-wrap leading-relaxed">{$lq__lead_obj.exhibitor_notes}</p>
|
||||
<div class="prose dark:prose-invert max-w-none leading-relaxed">
|
||||
{@html $lq__lead_obj.exhibitor_notes}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="h-full flex items-center justify-center italic opacity-30 text-sm">
|
||||
No notes have been added for this lead yet.
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function load({ params, parent }) {
|
||||
|
||||
if (browser && exhibit_tracking_id) {
|
||||
// Refresh the specific Lead (Tracking) object
|
||||
events_func.load_ae_obj_id__exhibit_tracking({
|
||||
events_func.load_ae_obj_id__event_exhibit_tracking({
|
||||
api_cfg: ae_acct.api,
|
||||
exhibit_tracking_id: exhibit_tracking_id,
|
||||
log_lvl: 0
|
||||
|
||||
Reference in New Issue
Block a user