feat(strapi): Add mobile promo w/new 'default' content type, add SetPassword RP customizations#20405
feat(strapi): Add mobile promo w/new 'default' content type, add SetPassword RP customizations#20405
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Strapi-backed CMS content for (1) the desktop “Promo QR” image on web-integration routes and (2) text/button overrides for the post-verify “Set Password” page via the RelyingParty CMS config.
Changes:
- Introduces a new
/v1/cms/web-contentendpoint + shared CMS manager/query to fetch web-scoped CMS content (promo QR image URL). - Threads the new web-content payload into
PromoQrMobileso the QR image can be overridden by CMS. - Adds
PostVerifySetPasswordPagefields to relying-party CMS and applies CMS overrides (headline/description/button/title) on the Set Password page, with tests.
Reviewed changes
Copilot reviewed 19 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-settings/src/pages/PostVerify/SetPassword/mocks.tsx | Updates mocks to support the narrowed integration type and CMS info injection. |
| packages/fxa-settings/src/pages/PostVerify/SetPassword/interfaces.ts | Narrows the integration surface needed by SetPassword and updates prop typing. |
| packages/fxa-settings/src/pages/PostVerify/SetPassword/index.tsx | Applies CMS overrides for headline/description/button/title on SetPassword. |
| packages/fxa-settings/src/pages/PostVerify/SetPassword/index.test.tsx | Adds coverage for PostVerifySetPasswordPage CMS overrides. |
| packages/fxa-settings/src/models/integrations/relier-interfaces.ts | Adds PostVerifySetPasswordPage to RelierCmsInfo and defines WebIntegrationCmsContent. |
| packages/fxa-settings/src/models/hooks.ts | Adds useWebContentState to fetch /v1/cms/web-content. |
| packages/fxa-settings/src/components/PromoQrMobile/index.tsx | Allows overriding the promo QR image URL via prop. |
| packages/fxa-settings/src/components/PromoQrMobile/index.test.tsx | Tests CMS-provided QR URL override behavior. |
| packages/fxa-settings/src/components/App/index.tsx | Fetches web-content and passes promoQrImageUrl into PromoQrMobile. |
| packages/fxa-auth-server/lib/routes/cms.ts | Adds GET /cms/web-content route + cache invalidation for web-content model. |
| packages/fxa-auth-server/lib/routes/cms.spec.ts | Adds route tests/mocks for /cms/web-content. |
| packages/fxa-auth-server/bin/key_server.js | Registers WebContentConfigurationManager in DI container. |
| libs/shared/cms/src/lib/web-content-configuration.manager.ts | Adds shared CMS manager for querying/invalidation of web-content. |
| libs/shared/cms/src/lib/queries/web-content/types.ts | Defines result typing for the new web-content query. |
| libs/shared/cms/src/lib/queries/web-content/query.ts | Adds GraphQL query for webContent { promoQrImageUrl }. |
| libs/shared/cms/src/lib/queries/web-content/index.ts | Exports the new web-content query/types. |
| libs/shared/cms/src/lib/queries/relying-party/types.ts | Extends relying-party result type with PostVerifySetPasswordPage. |
| libs/shared/cms/src/lib/queries/relying-party/query.ts | Adds PostVerifySetPasswordPage selection to relying-party query. |
| libs/shared/cms/src/lib/queries/relying-party/factories.ts | Updates factory to generate PostVerifySetPasswordPage test data. |
| libs/shared/cms/src/index.ts | Exposes web-content manager and query exports from shared cms package. |
| libs/shared/cms/src/generated/graphql.ts | Updates generated schema/types for WebContent + new relying-party page field. |
| libs/shared/cms/src/generated/gql.ts | Updates generated document mapping to include WebContent + new relying-party query shape. |
Files not reviewed (2)
- libs/shared/cms/src/generated/gql.ts: Language not supported
- libs/shared/cms/src/generated/graphql.ts: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
55053ae to
770ef7a
Compare
… customizations Because: * We want to swap out the Kit QR code image and put it in our CMS, where Strapi is our tried and tested path * We want to customize text on the "Set password for Sync" screen when users are coming in through a sync service but Send Tab entrypoint This commit: * Adds a new 'default' type in Strapi that doesn't rely on any query params, adds the qr code url as a field option and references this instead * Adds PostVerifySetPassword page to the RelyingParty content-type with necessary fields, for customization via entrypoint closes FXA-13476 closes FXA-12939
| </Router> | ||
| {/* This must be placed after the routes so it's rendered at the bottom of the DOM. */} | ||
| <PromoQrMobile {...{ integration }} /> | ||
| <PromoQrMobile |
There was a problem hiding this comment.
Should promo render be conditional on whether or not there is a url?
There was a problem hiding this comment.
Oh, maybe not, I see there is a fallback image imported in the component. No chance that QR code may become invalid?
There was a problem hiding this comment.
That's possible, but I also wanted to provide the image as a fallback in case we push to stage / prod and Product does not immediately update the image. Since this promo has header text / a description also, we'd want to not render the entire thing if something's not provided, since that text is always rendered.
| expect(isValidCmsUrl(value)).toBe(true); | ||
| }); | ||
|
|
||
| it.each([ |
Because:
This commit:
closes FXA-13476
closes FXA-12939
Strapi side @ mozilla/fxa-strapi#210