feat(website): Support HS merchant themes in embed workspace - #458
raunak23427 wants to merge 4 commits into
Conversation
This commit implements the theme handshake for the embedded Decision Engine workspace, resolving Issue juspay#455. Changes include: 1. embedBridge.ts: Created a setupEmbedBridge function to listen for de:theme-update messages from the parent window. It verifies the frame ID and forwards validated theme tokens. 2. theme.ts: Added an applyThemeTokens function that securely validates and maps incoming tokens as CSS Custom Properties to the document root (e.g., --color-brand-500). It strictly filters for expected prefixes and rejects dangerous values like URLs or JS execution. 3. main.tsx: Initialized the setupEmbedBridge listener on application mount to ensure themes are received early. 4. index.css: Predefined the default fallback hex values for --color-brand-* variables. 5. tailwind.config.ts: Updated the Tailwind theme configuration to consume the dynamic CSS variables instead of hard-coded hex colors.
This extends the GSM decision model to correctly represent RETRY_SAME_GATEWAY, RETRY_DIFFERENT_GATEWAY, and DO_NOT_RETRY based on the underlying rule. It safely centralizes the decision mapping while preserving existing gsm_info compatibility, and updates the OpenAPI specification appropriately.
|
Implementation Notes for Reviewers: While reviewing Issue #236, I noticed that PR #284 recently migrated the GSM architecture to a high-performance in-memory CSV/S3 model. To respect this new architecture, I intentionally avoided introducing the PostgreSQL override layer originally suggested in the issue description. Instead, I implemented the smallest, cleanest API extension possible: Extended the internal GsmDecision enum with a Requeue state (mapped to RETRY_DIFFERENT_GATEWAY). |
|
"Hi @prajjwalkumar17 and @GauravRawat369! This PR finishes up the GSM retry mapping (Issue #236) on top of the new CSV architecture. It is fully green and passing all CI checks. I would really appreciate a review when you have a moment!" |
This commit implements the theme handshake for the embedded Decision Engine workspace, resolving Issue #455.
Changes include: