@burdenoff/microfe-eventfullymanaged 2026.1124.2 → 2026.1124.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eventfullymanaged/pages/certificates/CertificateEmailControls.d.ts +6 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateEmailControls.js +141 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateEmailControls.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.js +121 -100
- package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.js.map +1 -1
- package/dist/eventfullymanaged/pages/certificates/CertificateReceiptSearch.d.ts +8 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateReceiptSearch.js +43 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateReceiptSearch.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateScheduleDialog.js +20 -10
- package/dist/eventfullymanaged/pages/certificates/CertificateScheduleDialog.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +155 -0
- package/dist/generated/wspace-operations.js +102 -37
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +396 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +23 -0
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -0
- package/dist/node_modules/@apollo/client/errors/utils.js +15 -0
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CertificateIssuance.js","names":["selectClass","cardClass","CertificateIssueForm","tr","useTr","id","useId","paging","usePagination","registrations","useEventCertificateRegistrationsQuery","registrationPage","registrationId","setRegistrationId","useState","templateId","setTemplateId","checked","setChecked","receipt","setReceipt","readEligibility","checking","useEventCertificateEligibilityLazyQuery","issueCertificate","issuing","useIssueEventCertificateMutation","template","templates","item","registration","checkKey","eligibility","busy","issueError","check","result","event","issued","mutationSucceeded","Label","Button","Pagination","AttendanceOutcome","CertificateReceiptDetails","CertificateReceiptLookup","findReceipt","finding","useEventCertificateReceiptLazyQuery","receiptId","Input","formatDateTime","CertificatePdfDownload","CertificateIssuance","props"],"sources":["../../../../src/eventfullymanaged/pages/certificates/CertificateIssuance.tsx"],"sourcesContent":["import { useId, useState, type FormEvent } from 'react';\nimport { Button, Input, Label } from '@burdenoff/fe-libs/ui';\nimport {\n useEventCertificateEligibilityLazyQuery,\n useEventCertificateReceiptLazyQuery,\n useEventCertificateRegistrationsQuery,\n useIssueEventCertificateMutation,\n type EventCertificateEligibilityQuery,\n type EventCertificateReceiptFieldsFragment,\n type EventCertificateRegistrationsQuery,\n type EventCertificateTemplateFieldsFragment,\n} from '../../../generated/wspace-operations';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\nimport { formatDateTime } from '../events/eventFormUtils';\nimport { CertificatePdfDownload } from './CertificatePdfDownload';\n\nconst selectClass =\n 'min-h-10 w-full rounded-input border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus';\nconst cardClass = 'space-y-4 rounded-card border border-border-seam bg-bg-surface p-4';\n\ntype Eligibility = EventCertificateEligibilityQuery['eventfullyManagedCertificateEligibility'];\ntype Receipt = EventCertificateReceiptFieldsFragment;\n\ntype IssuanceProps = {\n eventId: string;\n templates: EventCertificateTemplateFieldsFragment[];\n};\n\nfunction CertificateIssueForm({ eventId, templates }: IssuanceProps) {\n const tr = useTr();\n const id = useId();\n const paging = usePagination();\n const registrations = useEventCertificateRegistrationsQuery({\n variables: { eventId, limit: paging.limit, offset: paging.offset },\n fetchPolicy: 'no-cache',\n });\n const registrationPage: EventCertificateRegistrationsQuery['eventfullyManagedRegistrations'] | undefined =\n registrations.data?.eventfullyManagedRegistrations;\n const [registrationId, setRegistrationId] = useState('');\n const [templateId, setTemplateId] = useState('');\n const [checked, setChecked] = useState<{ key: string; result: Eligibility } | null>(null);\n const [receipt, setReceipt] = useState<Receipt | null>(null);\n const [readEligibility, { loading: checking }] = useEventCertificateEligibilityLazyQuery({ fetchPolicy: 'no-cache' });\n const [issueCertificate, { loading: issuing }] = useIssueEventCertificateMutation();\n const template = templates.find((item) => item.id === templateId);\n const registration = registrationPage?.items.find((item) => item.id === registrationId);\n const checkKey = JSON.stringify([registration?.id, template?.id, template?.revision, template?.requiredSessionIds]);\n const eligibility = checked?.key === checkKey ? checked.result : undefined;\n const busy = checking || issuing;\n const issueError = tr('eventfullymanaged.certificates.issuanceError', 'Could not confirm certificate issuance');\n\n const check = async () => {\n if (!template || !registration || busy) return;\n setChecked(null);\n try {\n const result = await readEligibility({\n variables: { eventId, registrationId: registration.id, requiredSessionIds: template.requiredSessionIds },\n });\n if (result.error || !result.data?.eventfullyManagedCertificateEligibility)\n throw new Error('Eligibility not confirmed');\n setChecked({ key: checkKey, result: result.data.eventfullyManagedCertificateEligibility });\n } catch {\n notify.error(tr('eventfullymanaged.certificates.eligibilityError', 'Could not confirm attendance eligibility'));\n }\n };\n\n const issue = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!template || !registration || !eligibility?.eligible || busy) return;\n try {\n const result = await issueCertificate({\n variables: { eventId, registrationId: registration.id, templateId: template.id },\n });\n const issued = result.data?.eventfullyManagedIssueCertificate;\n if (!mutationSucceeded(result, issued?.id, issueError) || !issued) return;\n setReceipt(issued);\n } catch {\n notify.error(issueError);\n }\n };\n\n return (\n <form className={cardClass} onSubmit={issue}>\n <fieldset disabled={busy} className=\"space-y-4\">\n <legend className=\"mb-3 text-lg font-semibold\">\n {tr('eventfullymanaged.certificates.manualIssue', 'Issue a certificate')}\n </legend>\n <div className=\"space-y-1.5\">\n <Label id={id + 'templateLabel'} htmlFor={id + 'template'}>\n {tr('eventfullymanaged.certificates.template', 'Certificate template')}\n </Label>\n <select\n id={id + 'template'}\n aria-labelledby={id + 'templateLabel'}\n className={selectClass}\n value={template?.id ?? ''}\n onChange={(event) => {\n setTemplateId(event.target.value);\n setChecked(null);\n }}\n >\n <option value=\"\">{tr('eventfullymanaged.certificates.chooseTemplate', 'Choose a template')}</option>\n {templates.map((item) => (\n <option key={item.id} value={item.id}>\n {item.title}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-1.5\">\n <Label id={id + 'registrationLabel'} htmlFor={id + 'registration'}>\n {tr('eventfullymanaged.certificates.registration', 'Attendee registration')}\n </Label>\n <select\n id={id + 'registration'}\n aria-labelledby={id + 'registrationLabel'}\n className={selectClass}\n value={registration?.id ?? ''}\n onChange={(event) => {\n setRegistrationId(event.target.value);\n setChecked(null);\n }}\n >\n <option value=\"\">{tr('eventfullymanaged.certificates.chooseRegistration', 'Choose a registration')}</option>\n {registrationPage?.items.map((item) => (\n <option key={item.id} value={item.id}>\n {item.attendeeName || item.id} · {item.status}\n </option>\n ))}\n </select>\n </div>\n {registrations.error ? (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {tr('eventfullymanaged.certificates.registrationsError', 'Could not load registrations.')}{' '}\n <Button type=\"button\" variant=\"outline\" onClick={() => void registrations.refetch().catch(() => undefined)}>\n {tr('eventfullymanaged.certificates.retry', 'Retry')}\n </Button>\n </p>\n ) : null}\n {registrationPage ? (\n <Pagination\n offset={paging.offset}\n limit={paging.limit}\n total={registrationPage.total}\n loadedCount={registrationPage.items.length}\n onPrev={paging.prevPage}\n onNext={paging.nextPage}\n loading={registrations.loading}\n itemLabel=\"registrations\"\n />\n ) : null}\n <div className=\"flex flex-wrap gap-2\">\n <Button type=\"button\" variant=\"outline\" disabled={!template || !registration} onClick={() => void check()}>\n {checking\n ? tr('eventfullymanaged.certificates.checking', 'Checking…')\n : tr('eventfullymanaged.certificates.checkEligibility', 'Check eligibility')}\n </Button>\n <Button type=\"submit\" disabled={!eligibility?.eligible}>\n {issuing\n ? tr('eventfullymanaged.certificates.issuing', 'Issuing…')\n : tr('eventfullymanaged.certificates.issue', 'Issue certificate')}\n </Button>\n </div>\n <AttendanceOutcome eligibility={eligibility} />\n <CertificateReceiptDetails eventId={eventId} receipt={receipt} />\n </fieldset>\n </form>\n );\n}\n\nfunction AttendanceOutcome({ eligibility }: { eligibility?: Eligibility }) {\n const tr = useTr();\n if (!eligibility) return null;\n if (eligibility.eligible) {\n return (\n <p className=\"text-sm\" aria-live=\"polite\">\n {tr('eventfullymanaged.certificates.eligible', 'Eligible for this certificate.')}\n </p>\n );\n }\n return (\n <p className=\"text-sm\" aria-live=\"polite\">\n {!eligibility.registrationEligible\n ? tr(\n 'eventfullymanaged.certificates.registrationIneligible',\n 'The registration must be confirmed or checked in.'\n )\n : tr(\n 'eventfullymanaged.certificates.sessionsIneligible',\n 'Required sessions without completed attendance: {{count}}.',\n {\n count: eligibility.missingSessionIds.length,\n }\n )}\n </p>\n );\n}\n\nfunction CertificateReceiptLookup({ eventId }: { eventId: string }) {\n const tr = useTr();\n const id = useId();\n const [receipt, setReceipt] = useState<Receipt | null>(null);\n const [findReceipt, { loading: finding }] = useEventCertificateReceiptLazyQuery({ fetchPolicy: 'no-cache' });\n\n const lookup = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const receiptId = String(new FormData(event.currentTarget).get('receiptId') ?? '').trim();\n if (!receiptId || finding) return;\n setReceipt(null);\n try {\n const result = await findReceipt({ variables: { eventId, id: receiptId } });\n if (result.error || !result.data?.eventfullyManagedCertificate) throw new Error('Receipt not confirmed');\n setReceipt(result.data.eventfullyManagedCertificate);\n } catch {\n notify.error(tr('eventfullymanaged.certificates.receiptError', 'Could not find that receipt for this event'));\n }\n };\n\n return (\n <section className={cardClass} aria-labelledby={id + 'receiptHeading'}>\n <h2 id={id + 'receiptHeading'} className=\"text-lg font-semibold\">\n {tr('eventfullymanaged.certificates.issuedReceipt', 'Issuance receipt')}\n </h2>\n <form className=\"space-y-2\" onSubmit={lookup}>\n <Label htmlFor={id + 'receipt'}>{tr('eventfullymanaged.certificates.receiptId', 'Receipt ID')}</Label>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Input id={id + 'receipt'} name=\"receiptId\" className=\"flex-1\" maxLength={128} required />\n <Button type=\"submit\" variant=\"outline\" disabled={finding}>\n {finding\n ? tr('eventfullymanaged.certificates.finding', 'Looking up…')\n : tr('eventfullymanaged.certificates.find', 'Find receipt')}\n </Button>\n </div>\n </form>\n <CertificateReceiptDetails eventId={eventId} receipt={receipt} />\n </section>\n );\n}\n\nfunction CertificateReceiptDetails({ eventId, receipt }: { eventId: string; receipt: Receipt | null }) {\n const tr = useTr();\n if (!receipt) return null;\n return (\n <div aria-live=\"polite\" className=\"space-y-2 rounded-card border border-border-seam p-3 text-sm\">\n <h3 className=\"font-medium break-words\">{receipt.title}</h3>\n <p>\n {tr('eventfullymanaged.certificates.receiptIssuedAt', 'Issued {{date}}', {\n date: formatDateTime(receipt.issuedAt),\n })}\n </p>\n <p>\n {tr('eventfullymanaged.certificates.receiptTemplateRevision', 'Template revision {{revision}}', {\n revision: receipt.templateRevision,\n })}\n </p>\n <p className=\"break-all text-text-secondary\">{receipt.id}</p>\n <CertificatePdfDownload eventId={eventId} receiptId={receipt.id} />\n </div>\n );\n}\n\nexport function CertificateIssuance(props: IssuanceProps) {\n return (\n <div className=\"grid gap-4 lg:grid-cols-2\">\n <CertificateIssueForm {...props} />\n <CertificateReceiptLookup eventId={props.eventId} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAMA,IACJ,gMACIC,IAAY;AAUlB,SAASC,EAAqB,EAAE,YAAS,gBAA4B;CACnE,IAAMC,IAAKC,EAAM,GACXC,IAAKC,EAAM,GACXC,IAASC,EAAc,GACvBC,IAAgBC,EAAsC;EAC1D,WAAW;GAAE;GAAS,OAAOH,EAAO;GAAO,QAAQA,EAAO;EAAO;EACjE,aAAa;CACf,CAAC,GACKI,IACJF,EAAc,MAAM,gCAChB,CAACG,GAAgB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Issuance.js","names":["selectClass","cardClass","CertificateIssueForm","tr","useTr","id","useId","paging","usePagination","registrations","useEventCertificateRegistrationsQuery","registrationPage","registrationId","setRegistrationId","useState","templateId","setTemplateId","checked","setChecked","issuedReceipt","setIssuedReceipt","readEligibility","checking","useEventCertificateEligibilityLazyQuery","issueCertificate","issuing","useIssueEventCertificateMutation","template","templates","item","registration","checkKey","eligibility","receipt","busy","issueError","check","result","event","issued","mutationSucceeded","Label","Button","Pagination","AttendanceOutcome","CertificateReceiptSearch","CertificateReceiptDetails","CertificateReceiptLookup","setReceipt","findReceipt","finding","useEventCertificateReceiptLazyQuery","receiptId","Input","formatDateTime","CertificatePdfDownload","CertificateEmailControls","CertificateIssuance","props"],"sources":["../../../../src/eventfullymanaged/pages/certificates/CertificateIssuance.tsx"],"sourcesContent":["import { useId, useState, type FormEvent } from 'react';\nimport { Button, Input, Label } from '@burdenoff/fe-libs/ui';\nimport {\n useEventCertificateEligibilityLazyQuery,\n useEventCertificateReceiptLazyQuery,\n useEventCertificateRegistrationsQuery,\n useIssueEventCertificateMutation,\n type EventCertificateEligibilityQuery,\n type EventCertificateReceiptFieldsFragment,\n type EventCertificateRegistrationsQuery,\n type EventCertificateTemplateFieldsFragment,\n} from '../../../generated/wspace-operations';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\nimport { formatDateTime } from '../events/eventFormUtils';\nimport { CertificatePdfDownload } from './CertificatePdfDownload';\nimport { CertificateEmailControls } from './CertificateEmailControls';\nimport { CertificateReceiptSearch } from './CertificateReceiptSearch';\n\nconst selectClass =\n 'min-h-10 w-full rounded-input border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus';\nconst cardClass = 'space-y-4 rounded-card border border-border-seam bg-bg-surface p-4';\n\ntype Eligibility = EventCertificateEligibilityQuery['eventfullyManagedCertificateEligibility'];\ntype Receipt = EventCertificateReceiptFieldsFragment;\n\ntype IssuanceProps = {\n eventId: string;\n templates: EventCertificateTemplateFieldsFragment[];\n};\n\nfunction CertificateIssueForm({ eventId, templates }: IssuanceProps) {\n const tr = useTr();\n const id = useId();\n const paging = usePagination();\n const registrations = useEventCertificateRegistrationsQuery({\n variables: { eventId, limit: paging.limit, offset: paging.offset },\n fetchPolicy: 'no-cache',\n });\n const registrationPage: EventCertificateRegistrationsQuery['eventfullyManagedRegistrations'] | undefined =\n registrations.data?.eventfullyManagedRegistrations;\n const [registrationId, setRegistrationId] = useState('');\n const [templateId, setTemplateId] = useState('');\n const [checked, setChecked] = useState<{ key: string; result: Eligibility } | null>(null);\n const [issuedReceipt, setIssuedReceipt] = useState<{ key: string; value: Receipt } | null>(null);\n const [readEligibility, { loading: checking }] = useEventCertificateEligibilityLazyQuery({ fetchPolicy: 'no-cache' });\n const [issueCertificate, { loading: issuing }] = useIssueEventCertificateMutation();\n const template = templates.find((item) => item.id === templateId);\n const registration = registrationPage?.items.find((item) => item.id === registrationId);\n const checkKey = JSON.stringify([registration?.id, template?.id, template?.revision, template?.requiredSessionIds]);\n const eligibility = checked?.key === checkKey ? checked.result : undefined;\n const receipt = issuedReceipt?.key === checkKey ? issuedReceipt.value : null;\n const busy = checking || issuing;\n const issueError = tr('eventfullymanaged.certificates.issuanceError', 'Could not confirm certificate issuance');\n\n const check = async () => {\n if (!template || !registration || busy) return;\n setChecked(null);\n try {\n const result = await readEligibility({\n variables: { eventId, registrationId: registration.id, requiredSessionIds: template.requiredSessionIds },\n });\n if (result.error || !result.data?.eventfullyManagedCertificateEligibility)\n throw new Error('Eligibility not confirmed');\n setChecked({ key: checkKey, result: result.data.eventfullyManagedCertificateEligibility });\n } catch {\n notify.error(tr('eventfullymanaged.certificates.eligibilityError', 'Could not confirm attendance eligibility'));\n }\n };\n\n const issue = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!template || !registration || !eligibility?.eligible || busy) return;\n try {\n const result = await issueCertificate({\n variables: { eventId, registrationId: registration.id, templateId: template.id },\n });\n const issued = result.data?.eventfullyManagedIssueCertificate;\n if (!mutationSucceeded(result, issued?.id, issueError) || !issued) return;\n setIssuedReceipt({ key: checkKey, value: issued });\n } catch {\n notify.error(issueError);\n }\n };\n\n return (\n <form className={cardClass} onSubmit={issue}>\n <fieldset disabled={busy} className=\"space-y-4\">\n <legend className=\"mb-3 text-lg font-semibold\">\n {tr('eventfullymanaged.certificates.manualIssue', 'Issue a certificate')}\n </legend>\n <div className=\"space-y-1.5\">\n <Label id={id + 'templateLabel'} htmlFor={id + 'template'}>\n {tr('eventfullymanaged.certificates.template', 'Certificate template')}\n </Label>\n <select\n id={id + 'template'}\n aria-labelledby={id + 'templateLabel'}\n className={selectClass}\n value={template?.id ?? ''}\n onChange={(event) => {\n setTemplateId(event.target.value);\n setChecked(null);\n }}\n >\n <option value=\"\">{tr('eventfullymanaged.certificates.chooseTemplate', 'Choose a template')}</option>\n {templates.map((item) => (\n <option key={item.id} value={item.id}>\n {item.title}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-1.5\">\n <Label id={id + 'registrationLabel'} htmlFor={id + 'registration'}>\n {tr('eventfullymanaged.certificates.registration', 'Attendee registration')}\n </Label>\n <select\n id={id + 'registration'}\n aria-labelledby={id + 'registrationLabel'}\n className={selectClass}\n value={registration?.id ?? ''}\n onChange={(event) => {\n setRegistrationId(event.target.value);\n setChecked(null);\n }}\n >\n <option value=\"\">{tr('eventfullymanaged.certificates.chooseRegistration', 'Choose a registration')}</option>\n {registrationPage?.items.map((item) => (\n <option key={item.id} value={item.id}>\n {item.attendeeName || item.id} · {item.status}\n </option>\n ))}\n </select>\n </div>\n {registrations.error ? (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {tr('eventfullymanaged.certificates.registrationsError', 'Could not load registrations.')}{' '}\n <Button type=\"button\" variant=\"outline\" onClick={() => void registrations.refetch().catch(() => undefined)}>\n {tr('eventfullymanaged.certificates.retry', 'Retry')}\n </Button>\n </p>\n ) : null}\n {registrationPage ? (\n <Pagination\n offset={paging.offset}\n limit={paging.limit}\n total={registrationPage.total}\n loadedCount={registrationPage.items.length}\n onPrev={paging.prevPage}\n onNext={paging.nextPage}\n loading={registrations.loading}\n itemLabel=\"registrations\"\n />\n ) : null}\n <div className=\"flex flex-wrap gap-2\">\n <Button type=\"button\" variant=\"outline\" disabled={!template || !registration} onClick={() => void check()}>\n {checking\n ? tr('eventfullymanaged.certificates.checking', 'Checking…')\n : tr('eventfullymanaged.certificates.checkEligibility', 'Check eligibility')}\n </Button>\n <Button type=\"submit\" disabled={!eligibility?.eligible}>\n {issuing\n ? tr('eventfullymanaged.certificates.issuing', 'Issuing…')\n : tr('eventfullymanaged.certificates.issue', 'Issue certificate')}\n </Button>\n </div>\n <AttendanceOutcome eligibility={eligibility} />\n <CertificateReceiptSearch\n key={checkKey}\n eventId={eventId}\n registrationId={registration?.id}\n templateId={template?.id}\n disabled={busy}\n onFound={(receipt) => setIssuedReceipt(receipt ? { key: checkKey, value: receipt } : null)}\n />\n <CertificateReceiptDetails eventId={eventId} receipt={receipt} />\n </fieldset>\n </form>\n );\n}\n\nfunction AttendanceOutcome({ eligibility }: { eligibility?: Eligibility }) {\n const tr = useTr();\n if (!eligibility) return null;\n if (eligibility.eligible) {\n return (\n <p className=\"text-sm\" aria-live=\"polite\">\n {tr('eventfullymanaged.certificates.eligible', 'Eligible for this certificate.')}\n </p>\n );\n }\n return (\n <p className=\"text-sm\" aria-live=\"polite\">\n {!eligibility.registrationEligible\n ? tr(\n 'eventfullymanaged.certificates.registrationIneligible',\n 'The registration must be confirmed or checked in.'\n )\n : tr(\n 'eventfullymanaged.certificates.sessionsIneligible',\n 'Required sessions without completed attendance: {{count}}.',\n {\n count: eligibility.missingSessionIds.length,\n }\n )}\n </p>\n );\n}\n\nfunction CertificateReceiptLookup({ eventId }: { eventId: string }) {\n const tr = useTr();\n const id = useId();\n const [receipt, setReceipt] = useState<Receipt | null>(null);\n const [findReceipt, { loading: finding }] = useEventCertificateReceiptLazyQuery({ fetchPolicy: 'no-cache' });\n\n const lookup = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const receiptId = String(new FormData(event.currentTarget).get('receiptId') ?? '').trim();\n if (!receiptId || finding) return;\n setReceipt(null);\n try {\n const result = await findReceipt({ variables: { eventId, id: receiptId } });\n if (result.error || !result.data?.eventfullyManagedCertificate) throw new Error('Receipt not confirmed');\n setReceipt(result.data.eventfullyManagedCertificate);\n } catch {\n notify.error(tr('eventfullymanaged.certificates.receiptError', 'Could not find that receipt for this event'));\n }\n };\n\n return (\n <section className={cardClass} aria-labelledby={id + 'receiptHeading'}>\n <h2 id={id + 'receiptHeading'} className=\"text-lg font-semibold\">\n {tr('eventfullymanaged.certificates.issuedReceipt', 'Issuance receipt')}\n </h2>\n <form className=\"space-y-2\" onSubmit={lookup}>\n <Label htmlFor={id + 'receipt'}>{tr('eventfullymanaged.certificates.receiptId', 'Receipt ID')}</Label>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Input\n id={id + 'receipt'}\n name=\"receiptId\"\n className=\"flex-1\"\n maxLength={128}\n disabled={finding}\n onChange={() => setReceipt(null)}\n required\n />\n <Button type=\"submit\" variant=\"outline\" disabled={finding}>\n {finding\n ? tr('eventfullymanaged.certificates.finding', 'Looking up…')\n : tr('eventfullymanaged.certificates.find', 'Find receipt')}\n </Button>\n </div>\n </form>\n <CertificateReceiptDetails eventId={eventId} receipt={receipt} />\n </section>\n );\n}\n\nfunction CertificateReceiptDetails({ eventId, receipt }: { eventId: string; receipt: Receipt | null }) {\n const tr = useTr();\n if (!receipt) return null;\n return (\n <div aria-live=\"polite\" className=\"space-y-2 rounded-card border border-border-seam p-3 text-sm\">\n <h3 className=\"font-medium break-words\">{receipt.title}</h3>\n <p>\n {tr('eventfullymanaged.certificates.receiptIssuedAt', 'Issued {{date}}', {\n date: formatDateTime(receipt.issuedAt),\n })}\n </p>\n <p>\n {tr('eventfullymanaged.certificates.receiptTemplateRevision', 'Template revision {{revision}}', {\n revision: receipt.templateRevision,\n })}\n </p>\n <p className=\"break-all text-text-secondary\">{receipt.id}</p>\n <CertificatePdfDownload eventId={eventId} receiptId={receipt.id} />\n <CertificateEmailControls key={receipt.id} eventId={eventId} certificateId={receipt.id} />\n </div>\n );\n}\n\nexport function CertificateIssuance(props: IssuanceProps) {\n return (\n <div className=\"grid gap-4 lg:grid-cols-2\">\n <CertificateIssueForm {...props} />\n <CertificateReceiptLookup eventId={props.eventId} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAMA,IACJ,gMACIC,IAAY;AAUlB,SAASC,EAAqB,EAAE,YAAS,gBAA4B;CACnE,IAAMC,IAAKC,EAAM,GACXC,IAAKC,EAAM,GACXC,IAASC,EAAc,GACvBC,IAAgBC,EAAsC;EAC1D,WAAW;GAAE;GAAS,OAAOH,EAAO;GAAO,QAAQA,EAAO;EAAO;EACjE,aAAa;CACf,CAAC,GACKI,IACJF,EAAc,MAAM,gCAChB,CAACG,GAAgBC,KAAqBC,EAAS,EAAE,GACjD,CAACC,GAAYC,KAAiBF,EAAS,EAAE,GACzC,CAACG,GAASC,KAAcJ,EAAsD,IAAI,GAClF,CAACK,GAAeC,KAAoBN,EAAiD,IAAI,GACzF,CAACO,GAAiB,EAAE,SAASC,OAAcC,EAAwC,EAAE,aAAa,WAAW,CAAC,GAC9G,CAACC,GAAkB,EAAE,SAASC,OAAaC,EAAiC,GAC5EC,IAAWC,EAAU,MAAM,MAASC,EAAK,OAAOd,CAAU,GAC1De,IAAenB,GAAkB,MAAM,MAAM,MAASkB,EAAK,OAAOjB,CAAc,GAChFmB,IAAW,KAAK,UAAU;EAACD,GAAc;EAAIH,GAAU;EAAIA,GAAU;EAAUA,GAAU;CAAkB,CAAC,GAC5GK,IAAcf,GAAS,QAAQc,IAAWd,EAAQ,SAAS,KAAA,GAC3DgB,IAAUd,GAAe,QAAQY,I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SAAQ;MAAU,UAAUQ;MAC/C,UAAAA,IACG/C,EAAG,0CAA0C,aAAa,IAC1DA,EAAG,uCAAuC,cAAc;KACtD,CAAA,CACL;IACD,CAAA,CAAA;;GACN,kBAAC2C,GAAD;IAAoC;IAAkB;GAAU,CAAA;EACzD;;AAEb;AAEA,SAASA,EAA0B,EAAE,YAAS,cAAyD;CACrG,IAAM3C,IAAKC,EAAM;CAEjB,OADK6B,IAEH,kBAAC,OAAD;EAAK,aAAU;EAAS,WAAU;EAAlC,UAAA;GACE,kBAAC,MAAD;IAAI,WAAU;IAA2B,UAAAA,EAAQ;GAAU,CAAA;GAC3D,kBAAC,KAAD,EAAA,UACG9B,EAAG,kDAAkD,mBAAmB,EACvE,MAAMmD,EAAerB,EAAQ,QAAQ,EACvC,CAAC,EACA,CAAA;GACH,kBAAC,KAAD,EAAA,UACG9B,EAAG,0DAA0D,kCAAkC,EAC9F,UAAU8B,EAAQ,iBACpB,CAAC,EACA,CAAA;GACH,kBAAC,KAAD;IAAG,WAAU;IAAiC,UAAAA,EAAQ;GAAM,CAAA;GAC5D,kBAACsB,GAAD;IAAiC;IAAS,WAAWtB,EAAQ;GAAK,CAAA;GAClE,kBAACuB,GAAD;IAAoD;IAAS,eAAevB,EAAQ;GAAK,GAA1DA,EAAQ,EAAkD;EACtF;C,KAjBc;AAmBvB;AAEA,SAAgBwB,EAAoB,GAAsB;CACxD,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACvD,GAAD,EAAsB,GAAIwD,EAAQ,CAAA,GAClC,kBAACX,GAAD,EAA0B,SAASW,EAAM,QAAU,CAAA,CAChD;;AAET"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EventCertificateReceiptFieldsFragment } from '../../../generated/wspace-operations';
|
|
2
|
+
export declare function CertificateReceiptSearch({ disabled, eventId, registrationId, templateId, onFound, }: {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
eventId: string;
|
|
5
|
+
registrationId?: string;
|
|
6
|
+
templateId?: string;
|
|
7
|
+
onFound: (receipt: EventCertificateReceiptFieldsFragment | null) => void;
|
|
8
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEventIssuedCertificateLazyQuery as e } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { useTr as t } from "../../../shared/hooks/useTr.js";
|
|
3
|
+
import { notify as n } from "../../lib/toast.js";
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Button as o } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
// src/eventfullymanaged/pages/certificates/CertificateReceiptSearch.tsx
|
|
8
|
+
function s({ disabled: s, eventId: c, registrationId: l, templateId: u, onFound: d }) {
|
|
9
|
+
let f = t(), [p, m] = r(!1), [h, { loading: g }] = e({ fetchPolicy: "no-cache" }), _ = async () => {
|
|
10
|
+
if (l && u && !g && !s) {
|
|
11
|
+
m(!1), d(null);
|
|
12
|
+
try {
|
|
13
|
+
let e = await h({ variables: {
|
|
14
|
+
eventId: c,
|
|
15
|
+
registrationId: l,
|
|
16
|
+
templateId: u
|
|
17
|
+
} });
|
|
18
|
+
if (e.error || !e.data) throw Error("Certificate lookup was not confirmed.");
|
|
19
|
+
let t = e.data.eventfullyManagedIssuedCertificate;
|
|
20
|
+
t ? d(t) : m(!0);
|
|
21
|
+
} catch {
|
|
22
|
+
n.error(f("eventfullymanaged.certificates.selectedReceiptError", "Could not look up an issued certificate."));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ a("div", {
|
|
27
|
+
className: "space-y-2",
|
|
28
|
+
children: [/* @__PURE__ */ i(o, {
|
|
29
|
+
type: "button",
|
|
30
|
+
variant: "outline",
|
|
31
|
+
disabled: s || g || !l || !u,
|
|
32
|
+
onClick: () => void _(),
|
|
33
|
+
children: g ? f("eventfullymanaged.certificates.finding", "Looking up…") : f("eventfullymanaged.certificates.findIssued", "Find issued certificate")
|
|
34
|
+
}), p ? /* @__PURE__ */ i("p", {
|
|
35
|
+
role: "status",
|
|
36
|
+
className: "text-sm text-text-secondary",
|
|
37
|
+
children: f("eventfullymanaged.certificates.noIssuedCertificate", "No certificate has been issued for this registration and template.")
|
|
38
|
+
}) : null]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { s as CertificateReceiptSearch };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=CertificateReceiptSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CertificateReceiptSearch.js","names":["CertificateReceiptSearch","tr","useTr","missing","setMissing","useState","find","useEventIssuedCertificateLazyQuery","search","registrationId","templateId","onFound","result","receipt","Button","disabled","loading"],"sources":["../../../../src/eventfullymanaged/pages/certificates/CertificateReceiptSearch.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport {\n useEventIssuedCertificateLazyQuery,\n type EventCertificateReceiptFieldsFragment,\n} from '../../../generated/wspace-operations';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { notify } from '../../lib/toast';\n\nexport function CertificateReceiptSearch({\n disabled,\n eventId,\n registrationId,\n templateId,\n onFound,\n}: {\n disabled?: boolean;\n eventId: string;\n registrationId?: string;\n templateId?: string;\n onFound: (receipt: EventCertificateReceiptFieldsFragment | null) => void;\n}) {\n const tr = useTr();\n const [missing, setMissing] = useState(false);\n const [find, { loading }] = useEventIssuedCertificateLazyQuery({ fetchPolicy: 'no-cache' });\n\n const search = async () => {\n if (!registrationId || !templateId || loading || disabled) return;\n setMissing(false);\n onFound(null);\n try {\n const result = await find({ variables: { eventId, registrationId, templateId } });\n if (result.error || !result.data) throw new Error('Certificate lookup was not confirmed.');\n const receipt = result.data.eventfullyManagedIssuedCertificate;\n if (receipt) onFound(receipt);\n else setMissing(true);\n } catch {\n notify.error(\n tr('eventfullymanaged.certificates.selectedReceiptError', 'Could not look up an issued certificate.')\n );\n }\n };\n\n return (\n <div className=\"space-y-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled || loading || !registrationId || !templateId}\n onClick={() => void search()}\n >\n {loading\n ? tr('eventfullymanaged.certificates.finding', 'Looking up…')\n : tr('eventfullymanaged.certificates.findIssued', 'Find issued certificate')}\n </Button>\n {missing ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n {tr(\n 'eventfullymanaged.certificates.noIssuedCertificate',\n 'No certificate has been issued for this registration and template.'\n )}\n </p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;AASA,SAAgBA,EAAyB,EACvC,aACA,YACA,mBACA,eACA,cAOC;CACD,IAAMC,IAAKC,EAAM,GACX,CAACC,GAASC,KAAcC,EAAS,EAAK,GACtC,CAACC,GAAM,EAAE,gBAAaC,EAAmC,EAAE,aAAa,WAAW,CAAC,GAEpFC,IAAS,YAAY;EACzB,IAAKC,KAAmBC,KAAc,MAAW,IACjD;GACA,AADAN,EAAW,EAAK,GAChBO,EAAQ,IAAI;GACZ,IAAI;IACF,IAAMC,IAAS,MAAMN,EAAK,EAAE,WAAW;KAAE;KAAS;KAAgB;IAAW,EAAE,CAAC;IAChF,IAAIM,EAAO,SAAS,CAACA,EAAO,MAAM,MAAU,MAAM,uCAAuC;IACzF,IAAMC,IAAUD,EAAO,KAAK;IAC5B,AAAIC,IAASF,EAAQE,CAAO,IACvBT,EAAW,EAAI;GACtB,QAAQ;IACN,EAAO,MACLH,EAAG,uDAAuD,0CAA0C,CACtG;GACF;EAZgB;CAalB;CAEA,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACa,GAAD;GACE,MAAK;GACL,SAAQ;GACR,UAAUC,KAAYC,KAAW,CAACP,KAAkB,CAACC;GACrD,eAAe,KAAKF,EAAO;GAE1B,UAAAQ,IACGf,EAAG,0CAA0C,aAAa,IAC1DA,EAAG,6CAA6C,yBAAyB;EACvE,CAAA,GACPE,IACC,kBAAC,KAAD;GAAG,MAAK;GAAS,WAAU;GACxB,UAAAF,EACC,sDACA,oEACF;EACC,CAAA,IACD,IACD;;AAET"}
|
|
@@ -8,16 +8,17 @@ import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
|
8
8
|
import { Button as c, Dialog as l, DialogContent as u, DialogDescription as d, DialogHeader as f, DialogTitle as p } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
// src/eventfullymanaged/pages/certificates/CertificateScheduleDialog.tsx
|
|
10
10
|
function m({ eventId: i, template: m, onClose: g }) {
|
|
11
|
-
let _ = t(), [v, { loading: y }] = e(), [b, x] = a(
|
|
12
|
-
if (!(y ||
|
|
11
|
+
let _ = t(), [v, { loading: y }] = e(), [b, x] = a(!1), [S, C] = a(null), w = _("eventfullymanaged.certificates.scheduleError", "Could not schedule certificate issuance"), T = async () => {
|
|
12
|
+
if (!(y || S)) try {
|
|
13
13
|
let e = await v({ variables: {
|
|
14
14
|
eventId: i,
|
|
15
15
|
templateId: m.id,
|
|
16
|
-
templateRevision: m.revision
|
|
16
|
+
templateRevision: m.revision,
|
|
17
|
+
sendEmail: b
|
|
17
18
|
} }), t = e.data?.eventfullyManagedScheduleCertificateIssuance;
|
|
18
|
-
n(e, t?.id,
|
|
19
|
+
n(e, t?.id, w) && t && C(t);
|
|
19
20
|
} catch {
|
|
20
|
-
r.error(
|
|
21
|
+
r.error(w);
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
24
|
return /* @__PURE__ */ o(l, {
|
|
@@ -26,7 +27,7 @@ function m({ eventId: i, template: m, onClose: g }) {
|
|
|
26
27
|
!e && !y && g();
|
|
27
28
|
},
|
|
28
29
|
children: /* @__PURE__ */ s(u, { children: [
|
|
29
|
-
/* @__PURE__ */ s(f, { children: [/* @__PURE__ */ o(p, { children: _("eventfullymanaged.certificates.schedule", "Schedule automatic issuance") }), /* @__PURE__ */ o(d, { children: _("eventfullymanaged.certificates.scheduleHelp", "Schedule
|
|
30
|
+
/* @__PURE__ */ s(f, { children: [/* @__PURE__ */ o(p, { children: _("eventfullymanaged.certificates.schedule", "Schedule automatic issuance") }), /* @__PURE__ */ o(d, { children: _("eventfullymanaged.certificates.scheduleHelp", "Schedule issuance after the last required session ends. Scheduling the same revision opens its existing run.") })] }),
|
|
30
31
|
/* @__PURE__ */ s("p", {
|
|
31
32
|
className: "break-words font-medium",
|
|
32
33
|
children: [
|
|
@@ -36,7 +37,15 @@ function m({ eventId: i, template: m, onClose: g }) {
|
|
|
36
37
|
_("eventfullymanaged.certificates.revision", "Revision {{revision}}", { revision: m.revision })
|
|
37
38
|
]
|
|
38
39
|
}),
|
|
39
|
-
|
|
40
|
+
S ? /* @__PURE__ */ o(h, { run: S }) : /* @__PURE__ */ s("label", {
|
|
41
|
+
className: "flex min-h-10 items-center gap-2 text-sm",
|
|
42
|
+
children: [/* @__PURE__ */ o("input", {
|
|
43
|
+
type: "checkbox",
|
|
44
|
+
checked: b,
|
|
45
|
+
disabled: y,
|
|
46
|
+
onChange: (e) => x(e.target.checked)
|
|
47
|
+
}), _("eventfullymanaged.certificates.scheduleEmail", "Email the PDFs to eligible attendees")]
|
|
48
|
+
}),
|
|
40
49
|
/* @__PURE__ */ s("div", {
|
|
41
50
|
className: "flex flex-wrap justify-end gap-2",
|
|
42
51
|
children: [/* @__PURE__ */ o(c, {
|
|
@@ -44,11 +53,11 @@ function m({ eventId: i, template: m, onClose: g }) {
|
|
|
44
53
|
variant: "outline",
|
|
45
54
|
disabled: y,
|
|
46
55
|
onClick: g,
|
|
47
|
-
children:
|
|
48
|
-
}),
|
|
56
|
+
children: S ? _("eventfullymanaged.certificates.done", "Done") : _("eventfullymanaged.certificates.cancel", "Cancel")
|
|
57
|
+
}), S ? null : /* @__PURE__ */ o(c, {
|
|
49
58
|
type: "button",
|
|
50
59
|
disabled: y,
|
|
51
|
-
onClick: () => void
|
|
60
|
+
onClick: () => void T(),
|
|
52
61
|
children: y ? _("eventfullymanaged.certificates.scheduling", "Scheduling…") : _("eventfullymanaged.certificates.scheduleConfirm", "Schedule issuance")
|
|
53
62
|
})]
|
|
54
63
|
})
|
|
@@ -62,6 +71,7 @@ function h({ run: e }) {
|
|
|
62
71
|
role: "status",
|
|
63
72
|
children: [
|
|
64
73
|
/* @__PURE__ */ o("p", { children: n("eventfullymanaged.certificates.scheduleStatus", "Run status: {{status}}", { status: e.status }) }),
|
|
74
|
+
/* @__PURE__ */ o("p", { children: e.sendEmail ? n("eventfullymanaged.certificates.scheduleEmailOn", "Automatic email: On") : n("eventfullymanaged.certificates.scheduleEmailOff", "Automatic email: Off") }),
|
|
65
75
|
e.status === "pending" ? /* @__PURE__ */ o("p", { children: n("eventfullymanaged.certificates.nextAttempt", "Next attempt: {{date}}", { date: i(e.nextAttemptAt) }) }) : null,
|
|
66
76
|
e.completedAt ? /* @__PURE__ */ o("p", { children: n("eventfullymanaged.certificates.runFinished", "Finished: {{date}}", { date: i(e.completedAt) }) }) : null,
|
|
67
77
|
/* @__PURE__ */ o("p", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CertificateScheduleDialog.js","names":["CertificateScheduleDialog","tr","useTr","schedule","useScheduleEventCertificateIssuanceMutation","
|
|
1
|
+
{"version":3,"file":"CertificateScheduleDialog.js","names":["CertificateScheduleDialog","tr","useTr","schedule","useScheduleEventCertificateIssuanceMutation","sendEmail","setSendEmail","useState","run","setRun","scheduleError","submit","result","template","scheduled","mutationSucceeded","Dialog","open","loading","onClose","DialogContent","DialogHeader","DialogTitle","DialogDescription","ScheduleReceipt","event","Button","formatDateTime"],"sources":["../../../../src/eventfullymanaged/pages/certificates/CertificateScheduleDialog.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@burdenoff/fe-libs/ui';\nimport {\n useScheduleEventCertificateIssuanceMutation,\n type EventCertificateTemplateFieldsFragment,\n type ScheduleEventCertificateIssuanceMutation,\n} from '../../../generated/wspace-operations';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\nimport { formatDateTime } from '../events/eventFormUtils';\n\ntype ScheduleRun = ScheduleEventCertificateIssuanceMutation['eventfullyManagedScheduleCertificateIssuance'];\n\nexport function CertificateScheduleDialog({\n eventId,\n template,\n onClose,\n}: {\n eventId: string;\n template: EventCertificateTemplateFieldsFragment;\n onClose: () => void;\n}) {\n const tr = useTr();\n const [schedule, { loading }] = useScheduleEventCertificateIssuanceMutation();\n const [sendEmail, setSendEmail] = useState(false);\n const [run, setRun] = useState<ScheduleRun | null>(null);\n const scheduleError = tr('eventfullymanaged.certificates.scheduleError', 'Could not schedule certificate issuance');\n\n const submit = async () => {\n if (loading || run) return;\n try {\n const result = await schedule({\n variables: { eventId, templateId: template.id, templateRevision: template.revision, sendEmail },\n });\n const scheduled = result.data?.eventfullyManagedScheduleCertificateIssuance;\n if (mutationSucceeded(result, scheduled?.id, scheduleError) && scheduled) setRun(scheduled);\n } catch {\n notify.error(scheduleError);\n }\n };\n\n return (\n <Dialog\n open\n onOpenChange={(open) => {\n if (!open && !loading) onClose();\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{tr('eventfullymanaged.certificates.schedule', 'Schedule automatic issuance')}</DialogTitle>\n <DialogDescription>\n {tr(\n 'eventfullymanaged.certificates.scheduleHelp',\n 'Schedule issuance after the last required session ends. Scheduling the same revision opens its existing run.'\n )}\n </DialogDescription>\n </DialogHeader>\n <p className=\"break-words font-medium\">\n {template.title} ·{' '}\n {tr('eventfullymanaged.certificates.revision', 'Revision {{revision}}', {\n revision: template.revision,\n })}\n </p>\n {run ? (\n <ScheduleReceipt run={run} />\n ) : (\n <label className=\"flex min-h-10 items-center gap-2 text-sm\">\n <input\n type=\"checkbox\"\n checked={sendEmail}\n disabled={loading}\n onChange={(event) => setSendEmail(event.target.checked)}\n />\n {tr('eventfullymanaged.certificates.scheduleEmail', 'Email the PDFs to eligible attendees')}\n </label>\n )}\n <div className=\"flex flex-wrap justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" disabled={loading} onClick={onClose}>\n {run\n ? tr('eventfullymanaged.certificates.done', 'Done')\n : tr('eventfullymanaged.certificates.cancel', 'Cancel')}\n </Button>\n {run ? null : (\n <Button type=\"button\" disabled={loading} onClick={() => void submit()}>\n {loading\n ? tr('eventfullymanaged.certificates.scheduling', 'Scheduling…')\n : tr('eventfullymanaged.certificates.scheduleConfirm', 'Schedule issuance')}\n </Button>\n )}\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction ScheduleReceipt({ run }: { run: ScheduleRun }) {\n const tr = useTr();\n return (\n <div className=\"space-y-1 rounded-card border border-border-seam p-3 text-sm\" role=\"status\">\n <p>{tr('eventfullymanaged.certificates.scheduleStatus', 'Run status: {{status}}', { status: run.status })}</p>\n <p>\n {run.sendEmail\n ? tr('eventfullymanaged.certificates.scheduleEmailOn', 'Automatic email: On')\n : tr('eventfullymanaged.certificates.scheduleEmailOff', 'Automatic email: Off')}\n </p>\n {run.status === 'pending' ? (\n <p>\n {tr('eventfullymanaged.certificates.nextAttempt', 'Next attempt: {{date}}', {\n date: formatDateTime(run.nextAttemptAt),\n })}\n </p>\n ) : null}\n {run.completedAt ? (\n <p>\n {tr('eventfullymanaged.certificates.runFinished', 'Finished: {{date}}', {\n date: formatDateTime(run.completedAt),\n })}\n </p>\n ) : null}\n <p className=\"break-all text-text-secondary\">{run.id}</p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgBA,EAA0B,EACxC,YACA,aACA,cAKC;CACD,IAAMC,IAAKC,EAAM,GACX,CAACC,GAAU,EAAE,gBAAaC,EAA4C,GACtE,CAACC,GAAWC,KAAgBC,EAAS,EAAK,GAC1C,CAACC,GAAKC,KAAUF,EAA6B,IAAI,GACjDG,IAAgBT,EAAG,gDAAgD,yCAAyC,GAE5GU,IAAS,YAAY;EACzB,IAAI,OAAWH,IACf,IAAI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AAO;KACjE,UAAAO,IACGjB,EAAG,6CAA6C,aAAa,IAC7DA,EAAG,kDAAkD,mBAAmB;IACtE,CAAA,CAEP;;EACQ,EAAA,CAAA;CACT,CAAA;AAEZ;AAEA,SAASuB,EAAgB,EAAE,UAA6B;CACtD,IAAMvB,IAAKC,EAAM;CACjB,OACE,kBAAC,OAAD;EAAK,WAAU;EAA+D,MAAK;EAAnF,UAAA;GACE,kBAAC,KAAD,EAAA,UAAID,EAAG,iDAAiD,0BAA0B,EAAE,QAAQO,EAAI,OAAO,CAAC,EAAK,CAAA;GAC7G,kBAAC,KAAD,EAAA,UACGA,EAAI,YACDP,EAAG,kDAAkD,qBAAqB,IAC1EA,EAAG,mDAAmD,sBAAsB,EAC/E,CAAA;GACFO,EAAI,WAAW,YACd,kBAAC,KAAD,EAAA,UACGP,EAAG,8CAA8C,0BAA0B,EAC1E,MAAM0B,EAAenB,EAAI,aAAa,EACxC,CAAC,EACA,CAAA,IACD;GACHA,EAAI,cACH,kBAAC,KAAD,EAAA,UACGP,EAAG,8CAA8C,sBAAsB,EACtE,MAAM0B,EAAenB,EAAI,WAAW,EACtC,CAAC,EACA,CAAA,IACD;GACJ,kBAAC,KAAD;IAAG,WAAU;IAAiC,UAAAA,EAAI;GAAM,CAAA;EACrD;;AAET"}
|
|
@@ -209,6 +209,7 @@ export type ScheduleEventCertificateIssuanceMutationVariables = Types.Exact<{
|
|
|
209
209
|
eventId: Types.Scalars['ID']['input'];
|
|
210
210
|
templateId: Types.Scalars['ID']['input'];
|
|
211
211
|
templateRevision: Types.Scalars['Int']['input'];
|
|
212
|
+
sendEmail: Types.Scalars['Boolean']['input'];
|
|
212
213
|
}>;
|
|
213
214
|
export type ScheduleEventCertificateIssuanceMutation = {
|
|
214
215
|
__typename?: 'Mutation';
|
|
@@ -219,10 +220,75 @@ export type ScheduleEventCertificateIssuanceMutation = {
|
|
|
219
220
|
status: string;
|
|
220
221
|
nextAttemptAt: string;
|
|
221
222
|
completedAt?: string | null;
|
|
223
|
+
sendEmail: boolean;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
export type EventIssuedCertificateQueryVariables = Types.Exact<{
|
|
227
|
+
eventId: Types.Scalars['ID']['input'];
|
|
228
|
+
registrationId: Types.Scalars['ID']['input'];
|
|
229
|
+
templateId: Types.Scalars['ID']['input'];
|
|
230
|
+
}>;
|
|
231
|
+
export type EventIssuedCertificateQuery = {
|
|
232
|
+
__typename?: 'Query';
|
|
233
|
+
eventfullyManagedIssuedCertificate?: {
|
|
234
|
+
__typename?: 'EventfullyManagedCertificate';
|
|
235
|
+
id: string;
|
|
236
|
+
eventId: string;
|
|
237
|
+
title: string;
|
|
238
|
+
issuedAt: string;
|
|
239
|
+
registrationId: string;
|
|
240
|
+
templateId: string;
|
|
241
|
+
templateRevision: number;
|
|
242
|
+
} | null;
|
|
243
|
+
};
|
|
244
|
+
export type EventCertificateEmailFieldsFragment = {
|
|
245
|
+
__typename?: 'EventfullyManagedCertificateEmailDelivery';
|
|
246
|
+
id: string;
|
|
247
|
+
eventId: string;
|
|
248
|
+
certificateId: string;
|
|
249
|
+
status: string;
|
|
250
|
+
channelStatus?: string | null;
|
|
251
|
+
createdAt: string;
|
|
252
|
+
submittedAt?: string | null;
|
|
253
|
+
};
|
|
254
|
+
export type EventLatestCertificateEmailQueryVariables = Types.Exact<{
|
|
255
|
+
eventId: Types.Scalars['ID']['input'];
|
|
256
|
+
certificateId: Types.Scalars['ID']['input'];
|
|
257
|
+
}>;
|
|
258
|
+
export type EventLatestCertificateEmailQuery = {
|
|
259
|
+
__typename?: 'Query';
|
|
260
|
+
eventfullyManagedLatestCertificateEmailDelivery?: {
|
|
261
|
+
__typename?: 'EventfullyManagedCertificateEmailDelivery';
|
|
262
|
+
id: string;
|
|
263
|
+
eventId: string;
|
|
264
|
+
certificateId: string;
|
|
265
|
+
status: string;
|
|
266
|
+
channelStatus?: string | null;
|
|
267
|
+
createdAt: string;
|
|
268
|
+
submittedAt?: string | null;
|
|
269
|
+
} | null;
|
|
270
|
+
};
|
|
271
|
+
export type QueueEventCertificateEmailMutationVariables = Types.Exact<{
|
|
272
|
+
eventId: Types.Scalars['ID']['input'];
|
|
273
|
+
certificateId: Types.Scalars['ID']['input'];
|
|
274
|
+
requestId: Types.Scalars['ID']['input'];
|
|
275
|
+
}>;
|
|
276
|
+
export type QueueEventCertificateEmailMutation = {
|
|
277
|
+
__typename?: 'Mutation';
|
|
278
|
+
eventfullyManagedQueueCertificateEmail: {
|
|
279
|
+
__typename?: 'EventfullyManagedCertificateEmailDelivery';
|
|
280
|
+
id: string;
|
|
281
|
+
eventId: string;
|
|
282
|
+
certificateId: string;
|
|
283
|
+
status: string;
|
|
284
|
+
channelStatus?: string | null;
|
|
285
|
+
createdAt: string;
|
|
286
|
+
submittedAt?: string | null;
|
|
222
287
|
};
|
|
223
288
|
};
|
|
224
289
|
export declare const EventCertificateTemplateFieldsFragmentDoc: Apollo.DocumentNode;
|
|
225
290
|
export declare const EventCertificateReceiptFieldsFragmentDoc: Apollo.DocumentNode;
|
|
291
|
+
export declare const EventCertificateEmailFieldsFragmentDoc: Apollo.DocumentNode;
|
|
226
292
|
export declare const EventfullymanagedSavedAttendanceForecastDocument: Apollo.DocumentNode;
|
|
227
293
|
/**
|
|
228
294
|
* __useEventfullymanagedSavedAttendanceForecastQuery__
|
|
@@ -552,6 +618,7 @@ export type ScheduleEventCertificateIssuanceMutationFn = Apollo.MutationFunction
|
|
|
552
618
|
* eventId: // value for 'eventId'
|
|
553
619
|
* templateId: // value for 'templateId'
|
|
554
620
|
* templateRevision: // value for 'templateRevision'
|
|
621
|
+
* sendEmail: // value for 'sendEmail'
|
|
555
622
|
* },
|
|
556
623
|
* });
|
|
557
624
|
*/
|
|
@@ -559,3 +626,91 @@ export declare function useScheduleEventCertificateIssuanceMutation(baseOptions?
|
|
|
559
626
|
export type ScheduleEventCertificateIssuanceMutationHookResult = ReturnType<typeof useScheduleEventCertificateIssuanceMutation>;
|
|
560
627
|
export type ScheduleEventCertificateIssuanceMutationResult = Apollo.MutationResult<Types.ScheduleEventCertificateIssuanceMutation>;
|
|
561
628
|
export type ScheduleEventCertificateIssuanceMutationOptions = Apollo.BaseMutationOptions<Types.ScheduleEventCertificateIssuanceMutation, Types.ScheduleEventCertificateIssuanceMutationVariables>;
|
|
629
|
+
export declare const EventIssuedCertificateDocument: Apollo.DocumentNode;
|
|
630
|
+
/**
|
|
631
|
+
* __useEventIssuedCertificateQuery__
|
|
632
|
+
*
|
|
633
|
+
* To run a query within a React component, call `useEventIssuedCertificateQuery` and pass it any options that fit your needs.
|
|
634
|
+
* When your component renders, `useEventIssuedCertificateQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
635
|
+
* you can use to render your UI.
|
|
636
|
+
*
|
|
637
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
638
|
+
*
|
|
639
|
+
* @example
|
|
640
|
+
* const { data, loading, error } = useEventIssuedCertificateQuery({
|
|
641
|
+
* variables: {
|
|
642
|
+
* eventId: // value for 'eventId'
|
|
643
|
+
* registrationId: // value for 'registrationId'
|
|
644
|
+
* templateId: // value for 'templateId'
|
|
645
|
+
* },
|
|
646
|
+
* });
|
|
647
|
+
*/
|
|
648
|
+
export declare function useEventIssuedCertificateQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables> & ({
|
|
649
|
+
variables: Types.EventIssuedCertificateQueryVariables;
|
|
650
|
+
skip?: boolean;
|
|
651
|
+
} | {
|
|
652
|
+
skip: boolean;
|
|
653
|
+
})): ApolloReactHooks.useQuery.Result<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables, "empty" | "complete" | "streaming", Types.EventIssuedCertificateQueryVariables, undefined>;
|
|
654
|
+
export declare function useEventIssuedCertificateLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables, "empty" | "complete" | "streaming", undefined>;
|
|
655
|
+
export declare function useEventIssuedCertificateSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables>;
|
|
656
|
+
export declare function useEventIssuedCertificateSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.EventIssuedCertificateQuery | undefined, Types.EventIssuedCertificateQueryVariables>;
|
|
657
|
+
export type EventIssuedCertificateQueryHookResult = ReturnType<typeof useEventIssuedCertificateQuery>;
|
|
658
|
+
export type EventIssuedCertificateLazyQueryHookResult = ReturnType<typeof useEventIssuedCertificateLazyQuery>;
|
|
659
|
+
export type EventIssuedCertificateSuspenseQueryHookResult = ReturnType<typeof useEventIssuedCertificateSuspenseQuery>;
|
|
660
|
+
export type EventIssuedCertificateQueryResult = Apollo.QueryResult<Types.EventIssuedCertificateQuery, Types.EventIssuedCertificateQueryVariables>;
|
|
661
|
+
export declare const EventLatestCertificateEmailDocument: Apollo.DocumentNode;
|
|
662
|
+
/**
|
|
663
|
+
* __useEventLatestCertificateEmailQuery__
|
|
664
|
+
*
|
|
665
|
+
* To run a query within a React component, call `useEventLatestCertificateEmailQuery` and pass it any options that fit your needs.
|
|
666
|
+
* When your component renders, `useEventLatestCertificateEmailQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
667
|
+
* you can use to render your UI.
|
|
668
|
+
*
|
|
669
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
670
|
+
*
|
|
671
|
+
* @example
|
|
672
|
+
* const { data, loading, error } = useEventLatestCertificateEmailQuery({
|
|
673
|
+
* variables: {
|
|
674
|
+
* eventId: // value for 'eventId'
|
|
675
|
+
* certificateId: // value for 'certificateId'
|
|
676
|
+
* },
|
|
677
|
+
* });
|
|
678
|
+
*/
|
|
679
|
+
export declare function useEventLatestCertificateEmailQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables> & ({
|
|
680
|
+
variables: Types.EventLatestCertificateEmailQueryVariables;
|
|
681
|
+
skip?: boolean;
|
|
682
|
+
} | {
|
|
683
|
+
skip: boolean;
|
|
684
|
+
})): ApolloReactHooks.useQuery.Result<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables, "empty" | "complete" | "streaming", Types.EventLatestCertificateEmailQueryVariables, undefined>;
|
|
685
|
+
export declare function useEventLatestCertificateEmailLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables, "empty" | "complete" | "streaming", undefined>;
|
|
686
|
+
export declare function useEventLatestCertificateEmailSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables>;
|
|
687
|
+
export declare function useEventLatestCertificateEmailSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.EventLatestCertificateEmailQuery | undefined, Types.EventLatestCertificateEmailQueryVariables>;
|
|
688
|
+
export type EventLatestCertificateEmailQueryHookResult = ReturnType<typeof useEventLatestCertificateEmailQuery>;
|
|
689
|
+
export type EventLatestCertificateEmailLazyQueryHookResult = ReturnType<typeof useEventLatestCertificateEmailLazyQuery>;
|
|
690
|
+
export type EventLatestCertificateEmailSuspenseQueryHookResult = ReturnType<typeof useEventLatestCertificateEmailSuspenseQuery>;
|
|
691
|
+
export type EventLatestCertificateEmailQueryResult = Apollo.QueryResult<Types.EventLatestCertificateEmailQuery, Types.EventLatestCertificateEmailQueryVariables>;
|
|
692
|
+
export declare const QueueEventCertificateEmailDocument: Apollo.DocumentNode;
|
|
693
|
+
export type QueueEventCertificateEmailMutationFn = Apollo.MutationFunction<Types.QueueEventCertificateEmailMutation, Types.QueueEventCertificateEmailMutationVariables>;
|
|
694
|
+
/**
|
|
695
|
+
* __useQueueEventCertificateEmailMutation__
|
|
696
|
+
*
|
|
697
|
+
* To run a mutation, you first call `useQueueEventCertificateEmailMutation` within a React component and pass it any options that fit your needs.
|
|
698
|
+
* When your component renders, `useQueueEventCertificateEmailMutation` returns a tuple that includes:
|
|
699
|
+
* - A mutate function that you can call at any time to execute the mutation
|
|
700
|
+
* - An object with fields that represent the current status of the mutation's execution
|
|
701
|
+
*
|
|
702
|
+
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
|
|
703
|
+
*
|
|
704
|
+
* @example
|
|
705
|
+
* const [queueEventCertificateEmailMutation, { data, loading, error }] = useQueueEventCertificateEmailMutation({
|
|
706
|
+
* variables: {
|
|
707
|
+
* eventId: // value for 'eventId'
|
|
708
|
+
* certificateId: // value for 'certificateId'
|
|
709
|
+
* requestId: // value for 'requestId'
|
|
710
|
+
* },
|
|
711
|
+
* });
|
|
712
|
+
*/
|
|
713
|
+
export declare function useQueueEventCertificateEmailMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.QueueEventCertificateEmailMutation, Types.QueueEventCertificateEmailMutationVariables>): ApolloReactHooks.useMutation.ResultTuple<Types.QueueEventCertificateEmailMutation, any, Apollo.ApolloCache, undefined>;
|
|
714
|
+
export type QueueEventCertificateEmailMutationHookResult = ReturnType<typeof useQueueEventCertificateEmailMutation>;
|
|
715
|
+
export type QueueEventCertificateEmailMutationResult = Apollo.MutationResult<Types.QueueEventCertificateEmailMutation>;
|
|
716
|
+
export type QueueEventCertificateEmailMutationOptions = Apollo.BaseMutationOptions<Types.QueueEventCertificateEmailMutation, Types.QueueEventCertificateEmailMutationVariables>;
|