[GEN-2187]: notify in UI about expiring/expired token #2208
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.
This pull request introduces several changes to enhance the token tracking system, improve connection status handling, and refactor the notification system. The most important changes include adding a new hook for token tracking, updating the connection store, and modifying the status component to handle different notification types.
Token Tracking Enhancements:
useTokenTracker
hook to monitor token expiration and trigger notifications (frontend/webapp/hooks/tokens/useTokenTracker.ts
).useTokenCRUD
import to includeuseTokenTracker
(frontend/webapp/hooks/tokens/index.ts
).Connection Store Updates:
useConnectionStore
to include new state values and setters for SSE and token statuses (frontend/webapp/store/useConnectionStore.ts
).useSSE
hook to use the newsetSseStatus
method for updating connection status (frontend/webapp/hooks/notification/useSSE.ts
) [1] [2] [3].Notification System Improvements:
Status
component to handle different notification types and statuses (frontend/webapp/reuseable-components/status/index.tsx
) [1] [2] [3] [4].frontend/webapp/utils/constants/numbers.ts
,frontend/webapp/utils/functions/resolvers/is-over-time/index.ts
,frontend/webapp/utils/functions/resolvers/is-within-time/index.ts
) [1] [2] [3].Miscellaneous Changes:
useTokenTracker
toMainPage
component to initialize token tracking (frontend/webapp/app/(overview)/overview/page.tsx
) [1] [2].frontend/webapp/components/main/header/index.tsx
,frontend/webapp/components/overview/all-drawers/cli-drawer.tsx
) [1] [2] [3] [4] [5].These changes collectively improve the robustness of the token management system and enhance the user experience by providing timely notifications about token statuses.
In header and in notification manager:
In CLI drawer: