Repository navigation
Closed
Copy link
Description
Blocked by: sydevs/SahajCloud#813 — reportIssueForm does not exist on sy-atlas-config, and pnpm types:cms cannot pull it, until sydevs/SahajCloud#823 merges to main (was: Proposed)
Summary
Report-an-issue fails in production. sendReport posts a contact row that names no form, and SahajCloud refuses it with a 400 on form. #213 moved the call onto POST /api/user-submissions but could not fix this, because the CMS rule was still undecided. sydevs/SahajCloud#823 decides it the other way: the form-less row stays refused. The CMS now names an authored contact form on sy-atlas-config.reportIssueForm. The widget must read that form, render its fields, and post a contact row that names it.
Approach
- Types. Once feat(sy-atlas-config): name the atlas report-issue form on the config global SahajCloud#823 is on
main, runpnpm types:cms.SyAtlasConfiggainsreportIssueForm?: (number | null) | Form. - Read the form id.
getAtlasConfig(src/config/api/fetch.ts:720) selects onlyavailableLocales. AddreportIssueForm: trueto theselect. Keepdepth: 0so the value stays a bare id, and extendAtlasConfigSchemato acceptnumber | null. - Fetch the form. Add a
formsread by id, with an explicitselect, because an API-client read must send one. Select only what the renderer needs:fields,submitButtonLabel,confirmationType/confirmationMessage. Never selectrecipientorclient. feat(sy-atlas-config): name the atlas report-issue form on the config global SahajCloud#823 locks both to managers, but the widget must not rely on that lock. Theformsread is already open to the atlas key, so no CMS role change is needed. - Render the authored fields.
ReportIssueForm(src/components/organisms/ReportIssueForm/ReportIssueForm.tsx) hard-codes an optional email, a message, andReportSchema. Replace these with fields and validation derived from the form'sfields. Support the form-builder block types a contact form can hold, at leasttext,email,textarea,select,checkbox,message. KeepREFUSAL_MESSAGE_KEYS, Turnstile, the honest thank-you screen, andnetworkModeexactly as they are. - Post against the form.
sendReport(src/config/api/mutate.ts:309) addsform: <id>and sends each authored field as a{ field: <name>, value }pair. The CMS allows the authored names plus the base andcontactkeys (allowedSubmissionKeysin SahajCloudsrc/collections/UserSubmissions/submissionData.ts). Sosubjectand the auto-attached context (path,hostUrl,locale,userAgent,error) can ride along unchanged. An unknown key is a 400submission_data_invalid. Keep leaving outcontext.client. - Unset form. The CMS field says an empty value hides the report-issue path entirely. Gate every entry point on it:
Fallbacks.tsx,SettingsMenu.tsx,CompactEmbedView.tsx, and the modal mount inApp.tsx:245. - Docs. Update the
sendReportbullet indocs/rules/data-layer.md:215, and remove the SahajCloud#813 blocker breadcrumbs that feat(api): migrate widget intakes to unified form-submissions #213 left inmutate.tsanddata-layer.md.
Acceptance criteria
- With
reportIssueFormset, the modal renders that form's authored fields and labels, not hard-coded ones. - A submit creates a
contactrow whoseformis the configured id. The message reaches that form'srecipient, orCONTACT_EMAILif the form has none. - Every refusal code still maps to its specific copy, and the thank-you screen still appears only on a resolved mutation.
- With
reportIssueFormempty, the widget shows no "Report an issue" affordance anywhere, and nothing throws. - No request from the widget selects or receives
recipientorclientoffforms. - If the form cannot be fetched, the widget degrades and does not crash, per the "atlas reads must degrade" rule.
-
pnpm lint && pnpm typecheck && pnpm test:runpass.
Verification checklist
-
pnpm types:cms, thengrep -n reportIssueForm src/types/payload/payload-types.tsshows the field. - Set up a contact form with a recipient on SahajCloud (the PR preview or staging), and name it on
/admin/globals/sy-atlas-config. - Open "Report an issue" on the branch preview and submit. The network tab shows
POST /api/user-submissions→ 201 withformin the body. The row appears in/admin/collections/user-submissions, and the email reaches the recipient. - Clear
reportIssueForm, reload, and confirm that the Settings menu and the error fallbacks show no report affordance. - Check the
GET /api/forms/<id>response in the network tab. It contains norecipientorclientkey. -
ReportIssueForm.submit.test.tsxasserts thatformis in the posted body, and fails when it is removed.
Open questions
- Fetch timing. The form is mostly reached from error fallbacks, which appear after something already failed, often the network. Should it be prefetched at boot with the config, or fetched on open, with a fallback if that fails? Prefetching is recommended, so a network failure does not also take out the only way to report it.
- Hiding when unset. Should an unset form hide the affordance inside the error fallbacks too, or should those keep a
mailto:to the contact address? The CMS description says "hide … entirely". - Sender address. Which authored field is the sender's address? Should the first
email-type field be mapped tosenderEmail, or should a field name be fixed by convention? - Copy. Are the form-builder
labels localized on SahajCloud? If not, a non-English viewer sees English labels while the rest of the modal is translated.
Notes
- Supersedes the report-issue part of feat(api): migrate widget intakes to unified form-submissions #195. Its "Report-an-issue … lands as a
contactrow" criterion was written against the rejected form-less contract ("No form reference — recipient falls back to the CMS contact address"). feat(api): migrate widget intakes to unified form-submissions #195's other criteria are unaffected. - feat(sy-atlas-config): name the atlas report-issue form on the config global SahajCloud#823's manual step 3 ("Submit the widget's report-issue form…") depends on this ticket.
- The embed contract (
docs/embedding.md) is unaffected: the change is CMS-driven and adds no host-visible parameter.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
High
Hold Until
None yet
Projects
- StatusShow more project fieldsDone
Activity
formsto the atlas scope SahajCloud#813sydevs-bot commentedon Sep 18, 2026
@Ardnived unblocked: every blocker is closed. Say
@sydevs-bot implementto start.🤖 sydevs dispatcher
Ardnived commentedon Sep 21, 2026
@sydevs-bot implement
sydevs-bot commentedon Sep 21, 2026
🤖 no session running
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
fix(report): deliver the authored prose as message
Merge branch 'main' into claude/feat-216-report-form
fix(changelog): drop a mechanism #216 replaced