feat: converted notification redux structure to context API #598
+2,134
−10
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.
https://2u-internal.atlassian.net/browse/INF-1603
Purpose
The purpose of converting the notification architecture from Redux to the Context API is to eliminate duplicated providers and stores, streamlining the structure and improving efficiency in managing state across the application.
Description
We have refactored the state management of the notification tray, transitioning from Redux to the Context API as the central store. This involved replacing all dispatch calls in the reducer with direct API calls, and managing server data through the Context provider. This change centralizes state management and resolves the issue of duplicate providers.
We have introduced a new waffle flag, “notifications.enable_new_notification_view,” in the backend as part of PR #35569.
All changes related to the Context API have been organized in a new folder named “new-notifications,” while the existing Redux architecture remains intact in the “Notifications” folder. This approach allows us to test the Context API structure by enabling the waffle flag on the staging environment. Once testing is complete, we plan to remove the Redux-related notifications folder and exclusively utilize the new notifications folder that incorporates the Context API changes.
Test
I conducted testing on the local machine by enabling these waffle flags and following the instructions outlined in the document found here:
Note: I have made updates specifically for the Learning Header for now. Since the Discussion MFE uses the Learning Header, I tested the notification tray locally on that implementation.