chore(angular-react): Migrate UsersComponent and UsersServices to React #38
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.
chore(angular-react): Migrate UsersComponent and UsersServices to React
Summary
This PR migrates the UsersComponent and UsersServices from Angular to React as part of an incremental migration effort. The Angular components remain in place (not removed per migration guidelines).
Key changes:
useUsershook to replace the AngularUsersServicesinjectable, converting Observable-based HTTP calls to async/await with the fetch APIUsersComponent.tsxfunctional component with loading and error state handling (improvements over the original Angular version)tsconfig.jsonwithjsx: "react-jsx"andesModuleInterop: truefor React supportMigration mapping:
UsersServices.getUsers(): Observable<any>useUsers().fetchUsers(): Promise<void>@Injectableservice*ngFor.map()(click)onClickngOnInitReview & Testing Checklist for Human
tsconfig.jsonchanges (jsx,esModuleInterop) don't break existing Angular compilation by runningnpm run buildnpm run test:reactto confirm all 13 React tests passuseUsers.tsmatches the JSONPlaceholder API response structureUsersComponent.tsxis acceptable (uses inline styles to approximate Angular Material's warn button)Recommended test plan: Since the React components are not yet integrated into the app routing, you can verify functionality by:
npm run test:reactto execute the unit testsUsersComponentand verify it fetches/displays users from the JSONPlaceholder APINotes
test:reactnpm script to run Jest tests separately from Angular's Karma testsLink to Devin run: https://app.devin.ai/sessions/946df38f8be447979fcde1ec43276630
Requested by: @milind-cognition