Feat/pocd 355 add instruction component - #202
Merged
edwin-joseph-cko merged 29 commits intoJul 18, 2025
Merged
Conversation
- Add StateManager class with singleton pattern for global state management - Implement useComponentState hook for React-like state management - Add component lifecycle management and automatic cleanup - Include comprehensive documentation and migration guide - Support IE 11 compatibility with batched updates - Add TypeScript support with generic state types
- Add CancelButton element for payment cancellation - Add StatusTick element for displaying payment status - Add CancelRequest view for payment cancellation confirmation - Support cancel event emission and navigation - Integrate with existing APM event system
- Simplify FormFieldResult type using conditional types - Add Prettify helper type for better IntelliSense - Improve type safety with TransformFormField utility - Clean up type definitions for better maintainability - Remove duplicate type definitions
- Add POLLING_CANCELLED flag for proper polling control - Implement polling cancellation in API methods - Add hasReturnedFirstPending flag for better state tracking - Improve getCurrentStep method with flow-specific logic - Add pending state persistence in storage - Clean up pending state on success - Improve type safety in Context configuration
- Migrate all APM elements to use new StateManager system - Replace manual DOM manipulation with declarative state management - Add useComponentState hooks to all interactive elements - Improve element lifecycle management and cleanup - Enhance type safety across all element components - Standardize element state management patterns
- Update all APM views to work with new StateManager system - Improve view rendering with declarative component patterns - Add support for new cancel functionality in views - Update form utilities to work with new state management - Enhance render-elements utility for better component integration - Update Main layout to support new UI components - Improve view lifecycle management and state persistence
- Update Page class to support new StateManager integration - Enhance Theme system for better component styling - Improve utility functions for new state management patterns - Update references to include new components and types - Enhance event listener system for better state synchronization - Update main APM index to export new functionality - Improve core infrastructure for better component lifecycle management
- Update APM UI system documentation to reflect new StateManager - Enhance migration guide with new component patterns - Update example to demonstrate new state management - Document new cancel functionality and UI components - Improve developer experience with better examples and guides
… management - Add flexbox layout to the container in Theme for better spacing - Update NextStepProps to support multiple config types and refactor state management functions - Remove unused button in Success view for cleaner UI - Eliminate OTP state clearing in form submission for better state handling
edwin-joseph-cko
force-pushed
the
feat/POCD-355-add-instruction-component
branch
from
July 14, 2025 13:15
733629c to
0cb952f
Compare
- Replace interface definitions with type aliases for Authorization and Tokenization response types - Enhance type definitions for better readability and maintainability - Minor formatting fix in Components.ts for consistency
…ps view - Update setFormState function to return null for improved type safety - Capture form state in a local variable for better readability during submission - Refactor error handling in render method for clearer logic
edwin-joseph-cko
force-pushed
the
feat/POCD-355-add-instruction-component
branch
from
July 14, 2025 13:52
43e5aa7 to
fa24b2c
Compare
edwin-joseph-cko
marked this pull request as ready for review
July 16, 2025 14:22
…erience - Update APM index to include new Forage authorization and tokenization options - Refactor API response types to support redirect state handling - Improve error handling and state management in API methods - Enhance theme system for better color scheme support and dynamic styling - Update form utilities to prevent unnecessary re-renders and improve performance - Refactor layout components to support new responsive design patterns - Add support for new HTML elements in APM views for better accessibility
…direct - Emit events for redirect initiation and completion to enhance tracking - Implement error handling for redirect failures with detailed error information - Simplify cancel button logic in the render method for better clarity
Base automatically changed from
feat/POCD-363-add-select
to
epic/POCD-348-apm-sdk
July 17, 2025 13:15
adam-kazmierczak-cko
approved these changes
Jul 18, 2025
adam-kazmierczak-cko
left a comment
There was a problem hiding this comment.
After reviewing about 20%, I feel I am done 🙈
I would rather test this as there's so much code, it would take me more time to review than it took you to write it
I think its way too much in one go
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.
Description
This PR enhances the existing APM system by introducing a comprehensive StateManager and improving the overall architecture. Building upon the foundation established in previous PRs, this update adds centralised state management and enhances the developer experience.
The changes address specific limitations in the current APM implementation:
Solution
🏗️ StateManager System
useComponentState)🎨 New UI Components
🔄 API & Polling Improvements
POLLING_CANCELLEDflaggetCurrentStepmethod for different payment flows📚 Documentation & Examples
Demo
Sequence.01.mp4
Checklist
yarn bump-versionNotes
Breaking Changes
This PR introduces architectural improvements that enhance the existing APM system:
Migration Path
A comprehensive migration guide is provided in
docs/migration-guide-native-apm-to-apm.mdthat covers:Performance Improvements
Browser Compatibility
Jira Issue
POCD-355 - Add instruction components and improve APM architecture