VisitorInfoModal, Inline PDF, & Analytics #224
Labels
Frontend
Frontend Related Issue
⚡Important
High-impact issue that needs to be resolved before the next release
New Feature
New feature to be implemented
Milestone
Goal
Implement dynamic forms from minimal
visitorFields
(keys only), an inline PDF viewer forapplication/pdf
, and a consistent analytics approach to track downloads/views.Detailed Guidelines
VisitorInfoModal
visitorFields
fromlinkData
. For each key (e.g.,"name","email"
), look upvisitorFieldsConfig
to figure out labels/types.passwordProtected
, show a password field.useVisitorSubmission
with{ visitorData, password? }
. The server logs them inDocumentLinkVisitor.visitorData
.FileDisplay & PDFViewer
fileType === 'application/pdf'
, show a “View” button that toggles<PDFViewer />
.POST /api/public_links/[linkId]/events?type=DOWNLOAD
.PDFViewer.tsx
, ensuring all downloads go through our tracked button.Analytics
trackDownload(linkId)
ortrackView(linkId)
from hooks (useDocumentAccess
) or components (FileDisplay
).Styling:
sx
or small local components.<LoadingButton>
or<FormInput>
) if suitable.<FormInput>
or other global components for generating each field fromvisitorFieldsConfig
. Tweak<FormInput>
if needed to make it work.Example (generating multiple fields):
Tasks
visitorFields
.passwordProtected
.signedUrl
) back toAccessPage
.<PDFViewer />
.useDocumentAnalytics
hook if multiple analytics calls exist.The text was updated successfully, but these errors were encountered: