CMS-55279 Add forms to stride - #506
Merged
Merged
Conversation
TRomesh
commented
Aug 25, 2026
Member
- Add Forms support in content areas.
- Refactor Forms docs.
- Add form in Stride template
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Optimizely CMS JS SDK and included templates to better support Optimizely Forms—particularly when forms are placed in content areas (not only experience compositions)—and improves submission ergonomics via an optional submitHandler. It also updates the Stride and Alloy templates to render forms with consistent styling and improves the Forms documentation.
Changes:
- Add SDK support to detect and resolve form container steps when forms are referenced via content properties/content areas (including additional Graph fetching where needed).
- Add
submitHandlersupport toFormWrapper, and expose a safeerrorMessagefor templates to render on handler failures. - Add Forms components + initialization wiring to the Stride template, update Alloy template previews/alerts, and refactor
docs/15-forms.md.
Reviewed changes
Copilot reviewed 30 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/stride/lib/initialization.ts | Registers Forms components via initForms and passes host for Graph filtering. |
| templates/stride/components/forms/Grid.tsx | Adds row/column wrappers used by the form layout with preview attributes. |
| templates/stride/components/forms/FormTextarea.tsx | Adds Stride textarea field renderer with validation + preview attributes. |
| templates/stride/components/forms/FormSubmit.tsx | Adds Stride submit/step button renderer using useFormButton. |
| templates/stride/components/forms/formStyles.ts | Adds shared Tailwind class utilities for consistent form styling. |
| templates/stride/components/forms/FormStepTracker.tsx | Adds a client-side multi-step progress indicator. |
| templates/stride/components/forms/FormSelection.tsx | Adds Stride selection/radio-group renderer with validation + preview attributes. |
| templates/stride/components/forms/FormInput.tsx | Adds Stride textbox renderer with HTML validation attributes. |
| templates/stride/components/forms/FormContainer.tsx | Adds Stride form container renderer using FormWrapper + step/button partitioning. |
| templates/stride/components/forms/FormAlerts.tsx | Adds success/error alert rendering using useFormSubmission state. |
| templates/stride/app/api/forms/submit/route.ts | Adds a sample Next.js route handler for form submission. |
| templates/stride/.env.example | Documents APPLICATION_HOST for multi-site host filtering. |
| templates/alloy/src/components/forms/FormTextarea.tsx | Adds preview attributes for placeholder/tooltip. |
| templates/alloy/src/components/forms/FormSelection.tsx | Adds preview attributes for tooltip. |
| templates/alloy/src/components/forms/FormInput.tsx | Adds preview attributes for tooltip. |
| templates/alloy/src/components/forms/FormErrorAlert.tsx | Allows displaying a handler-provided error message. |
| templates/alloy/src/components/forms/FormContainer.tsx | Simplifies dev warning copy for empty nodes. |
| templates/alloy/src/components/forms/FormAlerts.tsx | Wires errorMessage from useFormSubmission into the error alert. |
| packages/optimizely-cms-sdk/src/util/queryUtils.ts | Adds content-model-based detection for types that can hold form containers. |
| packages/optimizely-cms-sdk/src/react/server.tsx | Minor formatting change. |
| packages/optimizely-cms-sdk/src/react/forms/index.ts | Exports FormSubmitHandler type. |
| packages/optimizely-cms-sdk/src/react/forms/FormWrapper.tsx | Adds submitHandler support and adjusts submission/error handling. |
| packages/optimizely-cms-sdk/src/react/forms/FormSubmissionProvider.tsx | Stores submit error + exposes errorMessage for templates. |
| packages/optimizely-cms-sdk/src/react/test/forms.test.tsx | Adds tests for submitHandler and error-message behavior. |
| packages/optimizely-cms-sdk/src/graph/index.ts | Resolves unresolved form nodes via extra fetches and content-model detection. |
| packages/optimizely-cms-sdk/src/graph/createQuery.ts | Prevents composition fetching when inside a composition; adjusts section handling. |
| packages/optimizely-cms-sdk/src/graph/test/sectionRoot.test.ts | Adds coverage for section-enabled component in content-area path. |
| packages/optimizely-cms-sdk/src/graph/test/formsOnPage.test.ts | Adds coverage for forms in content areas and model-based detection. |
| packages/optimizely-cms-sdk/src/graph/test/contentAreaForms.test.ts | New test ensuring content-area forms have steps resolved via extra fetch. |
| docs/15-forms.md | Refactors/expands Forms docs, including submission-from-code guidance. |
| .changeset/olive-moons-repeat.md | Declares a minor release with content-area forms + submitHandler changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TRomesh
enabled auto-merge
August 28, 2026 12:26
…prove performance
TRomesh
force-pushed
the
feature/CMS-55279-add-forms-to-stride
branch
from
September 1, 2026 13:33
073c65a to
bbb51b8
Compare
TRomesh
disabled auto-merge
September 1, 2026 13:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.