-
Notifications
You must be signed in to change notification settings - Fork 48
Update cohort management module to use info banners #3546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Baalmart
merged 10 commits into
airqo-platform:staging
from
BwanikaRobert:Update-Cohort-Management-Module-to-use-InfoBanners
May 28, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e0a366a
Update-Cohort-Management-Module-to-use-InfoBanners
BwanikaRobert 7c6556d
Merge branch 'staging' into Update-Cohort-Management-Module-to-use-In…
BwanikaRobert 5438f78
refactor(cohorts): replace raw setTimeout banner pattern with useDefe…
BwanikaRobert cb35fcc
Update changelog.md to match changes in the cohort files
BwanikaRobert 2a25994
Merge branch 'staging' into Update-Cohort-Management-Module-to-use-In…
BwanikaRobert 47b00d8
fix(cohorts): correct invalidateQueries key shape in 3 mutation hooks
BwanikaRobert 488300a
refactor(cohorts): adopt useDeferredBanner
BwanikaRobert 799327c
refactor: rename useDeferredBanner useBannerWithDelay across all cons…
BwanikaRobert 3975f01
refactor(devices): migrate raw setTimeout banners to useBannerWithDelay
BwanikaRobert 97e1744
Update changelog.md
Codebmk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have asked this in the previous PR. What prompted you to create
showDeferredBanneryetshowBannercovered both global and "local" ie within the dialog, banner instances? @BwanikaRobertThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is a 100 ms delay wait for the dialog to fully unmount, then show the banner. Without that delay, the success message silently disappears on every action that closes a dialog.
useDeferredBannerjust encapsulates that pattern theuseRefto hold the timer, theuseEffectto cancel it on unmount, and the 100 ms delay so we don't copy and paste the same bannerTimerRef + setTimeout + cleanup block into every component that needs post-dialog feedback. showBanner alone can't express this.It was one of the changes @copilot requested in the prevoius PR @Codebmk
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that was a great change! Let's rename it to
showBannerWithDelayanduseBannerWithDelaywhere it is much easier to remember what they are forThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly replace all parts in the codebase that use the new banner but apply the timer approach manually, they are few. @BwanikaRobert