Skip to content

Vertex:(Migration)Update Network Management Module to use InfoBanners#3558

Merged
Baalmart merged 6 commits into
airqo-platform:stagingfrom
BwanikaRobert:Update-Network-Management-Module-to-use-InfoBanners
May 31, 2026
Merged

Vertex:(Migration)Update Network Management Module to use InfoBanners#3558
Baalmart merged 6 commits into
airqo-platform:stagingfrom
BwanikaRobert:Update-Network-Management-Module-to-use-InfoBanners

Conversation

@BwanikaRobert

@BwanikaRobert BwanikaRobert commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes (What does this PR do?)

  • Migrates the notification system in the network management feature from the toast-based component (ReusableToast) to the banner-based system (useBanner context and the useBannerWithDelay hook).
  • Updated the following components to dispatch banners instead of toasts:
    • NetworkRequestsClient.tsx – approve / deny / review status updates now show success and error banners (scoped: false).
    • client-paginated-networks-table.tsx – the "copy Sensor Manufacturer ID" action now shows success/error banners (scoped: false).
    • create-network-form.tsx – success path uses showBannerWithDelay (so the banner appears after the dialog closes, scoped: false); error path uses showBanner (scoped: true).
    • network-request-dialog.tsxonSuccess uses showBannerWithDelay (scoped: true); onError uses showBanner (scoped: true).

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included issue number in the "Closes [Vertex: Migration] Update Network Management Module to use InfoBanners #3495"
  • I've updated corresponding documentation for the changes in this PR.
  • I have written unit and/or e2e tests for my change(s).

How should this be manually tested?

  1. Pull this branch and run the Vertex app locally.
  2. Navigate to the Admin → Networks area.
  3. Create network form: Open the "Create Sensor Manufacturer" form, submit valid data, and confirm a success banner appears after the dialog closes. Submit invalid/duplicate data and confirm an error banner appears within the dialog.
  4. Network request dialog: Submit a new Sensor Manufacturer request and confirm a success banner appears; trigger a failing request and confirm an error banner appears.
  5. Networks table: Click the copy icon for a Sensor Manufacturer ID and confirm the "Sensor Manufacturer ID copied" success banner shows; simulate a clipboard failure and confirm the error banner shows.
  6. Network requests client: Approve, deny, and review a request and confirm the success banner appears on success and the error banner appears on failure.
  7. Confirm no ReusableToast notifications appear anywhere in these flows.

What are the relevant tickets?

Screenshots

net1 net2 net3

Summary by CodeRabbit

  • Refactor
    • Network management now uses a centralized banner system for user feedback; banners support scoped and delayed displays for consistent notifications.
  • Documentation
    • Added changelog entry for Version 1.23.56 (May 29, 2026).
  • UI
    • Banner content alignment adjusted to left-aligned for improved readability.

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BwanikaRobert, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0fcefeb8-2dbe-4eab-a319-75ce93c8b928

📥 Commits

Reviewing files that changed from the base of the PR and between 0163fe5 and cd0f1ad.

📒 Files selected for processing (5)
  • src/vertex/app/(authenticated)/admin/networks/requests/NetworkRequestsClient.tsx
  • src/vertex/app/changelog.md
  • src/vertex/components/features/networks/client-paginated-networks-table.tsx
  • src/vertex/components/features/networks/create-network-form.tsx
  • src/vertex/components/features/networks/network-request-dialog.tsx
📝 Walkthrough

Walkthrough

Network-management components switch notification delivery from ReusableToast to the centralized banner system via useBanner/useBannerWithDelay; admin actions emit global banners, table copy actions emit global banners, dialog forms emit scoped/delayed banners, and banner text is left-aligned with a changelog entry added.

Changes

Network Management Toast-to-Banner Migration

Layer / File(s) Summary
Admin Request Action Confirmations
src/vertex/app/(authenticated)/admin/networks/requests/NetworkRequestsClient.tsx
confirmAction replaces ReusableToast with showBanner calls and imports useBanner/getApiErrorMessage; success and error branches dispatch global banners.
Table Copy-to-Clipboard Notifications
src/vertex/components/features/networks/client-paginated-networks-table.tsx
handleCopy replaces ReusableToast with showBanner on copy success/failure; imports and initializes useBanner in the component.
Dialog Form Submission Banners
src/vertex/components/features/networks/create-network-form.tsx, src/vertex/components/features/networks/network-request-dialog.tsx
Both components integrate useBanner and useBannerWithDelay; success paths use showBannerWithDelay (post-dialog) and error paths use showBanner with getApiErrorMessage-derived messages scoped to dialogs.
Changelog & Banner styling
src/vertex/app/changelog.md, src/vertex/components/ui/banner.tsx
Adds Version 1.23.56 changelog entry describing the migration; Banner root container receives text-left utility to left-align banner text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

ready for review

Suggested reviewers

  • Baalmart
  • OchiengPaul442
  • Codebmk

Poem

Banners rise where toasts once played,
Clicks confirm and copies made.
Dialogs pause, then banners sing,
Scoped and timed for everything. 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #3495: it replaces ReusableToast with useBanner in four components and updates the changelog, but critically omits BannerSlot integration in modals as explicitly required. Add BannerSlot components inside ReusableDialog containers in create-network-form.tsx and network-request-dialog.tsx, and ensure scoped banner configuration aligns with requirements (modal-scoped vs global).
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main change: migrating the Network Management module from toast notifications to InfoBanners.
Out of Scope Changes check ✅ Passed The banner.tsx text-left alignment change is a minor UI polish supporting the banner system and is reasonably scoped; changelog documentation is appropriate for the migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/vertex/app/`(authenticated)/admin/networks/requests/NetworkRequestsClient.tsx:
- Around line 79-84: The error path currently calls showBanner({... scoped:
false ...}) while the confirmation dialog (selectedRequest) remains open so the
global banner is visually hidden; change the error handling in the catch block
of the function that manipulates selectedRequest to show a scoped/in-dialog
banner instead: render the banner via the dialog's BannerSlot (or set scoped:
true) so the error message is visible inside the modal, or alternatively clear
selectedRequest before calling showBanner so the global banner is visible;
update the catch to either call showBanner with scoped: true or trigger the
dialog's BannerSlot component to display getApiErrorMessage(error) while keeping
selectedRequest unchanged.

In `@src/vertex/components/features/networks/network-request-dialog.tsx`:
- Around line 43-49: The success banner called via showBannerWithDelay in the
onSuccess handler should use scoped:false (not scoped:true) because it fires
after handleClose and must go through the global path; update the
showBannerWithDelay call accordingly, and for the onError handler either mount a
<BannerSlot /> inside this dialog (e.g., under the header in
network-request-dialog) if you want scoped errors, or change showBanner({...,
scoped: true}) to scoped:false so errors are visible via
GlobalBannerContainer—pick one approach and make both handlers consistent with
that decision (reference showBannerWithDelay, showBanner, BannerSlot,
handleClose, and GlobalBannerContainer).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dd8e13cd-c77f-4db2-bbcd-5c43372da51e

📥 Commits

Reviewing files that changed from the base of the PR and between 600683c and abf573d.

📒 Files selected for processing (4)
  • src/vertex/app/(authenticated)/admin/networks/requests/NetworkRequestsClient.tsx
  • src/vertex/components/features/networks/client-paginated-networks-table.tsx
  • src/vertex/components/features/networks/create-network-form.tsx
  • src/vertex/components/features/networks/network-request-dialog.tsx

Comment on lines +43 to 49
onSuccess: (resp) => {
queryClient.invalidateQueries({ queryKey: ["network-requests"] });
showBannerWithDelay({severity:'success',message:resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",scoped:true});
},
onError: (error) => {
ReusableToast({ message: getApiErrorMessage(error), type: "ERROR" });
onError: (error) => {
showBanner({severity:'error',message:getApiErrorMessage(error),scoped:true})
},

@coderabbitai coderabbitai Bot May 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Both banners are currently unreachable as wired.

Two separate problems here, mirroring (and partly contradicting) create-network-form.tsx:

  1. Delayed success (line 45) uses scoped: true. The success banner fires after the dialog closes (handleClose on line 90), at which point any in-dialog BannerSlot is unmounted — and GlobalBannerContainer ignores scoped banners. So it never shows. This should be scoped: false (the after-close global path), matching create-network-form.tsx.

  2. Error (line 48) uses scoped: true but there's no <BannerSlot /> mounted in this dialog, so submission errors are invisible. Either mount a BannerSlot below the header for the error case, or fall back to scoped: false.

🛠️ Suggested fix
-    const {showBanner}=useBanner();
+    const { showBanner, BannerSlot } = useBanner();
@@
-        onSuccess: (resp) => {            
-            queryClient.invalidateQueries({ queryKey: ["network-requests"] });
-            showBannerWithDelay({severity:'success',message:resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",scoped:true});
-        },
-        onError: (error) => {            
-            showBanner({severity:'error',message:getApiErrorMessage(error),scoped:true})
-        },
+        onSuccess: (resp) => {
+            queryClient.invalidateQueries({ queryKey: ["network-requests"] });
+            showBannerWithDelay({ severity: 'success', message: resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!", scoped: false });
+        },
+        onError: (error) => {
+            showBanner({ severity: 'error', message: getApiErrorMessage(error), scoped: true });
+        },

And mount the slot inside the form for the scoped error:

             <Form {...form}>
+                <BannerSlot />
                 <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onSuccess: (resp) => {
queryClient.invalidateQueries({ queryKey: ["network-requests"] });
showBannerWithDelay({severity:'success',message:resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",scoped:true});
},
onError: (error) => {
ReusableToast({ message: getApiErrorMessage(error), type: "ERROR" });
onError: (error) => {
showBanner({severity:'error',message:getApiErrorMessage(error),scoped:true})
},
onSuccess: (resp) => {
queryClient.invalidateQueries({ queryKey: ["network-requests"] });
showBannerWithDelay({ severity: 'success', message: resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!", scoped: false });
},
onError: (error) => {
showBanner({ severity: 'error', message: getApiErrorMessage(error), scoped: true });
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/vertex/components/features/networks/network-request-dialog.tsx` around
lines 43 - 49, The success banner called via showBannerWithDelay in the
onSuccess handler should use scoped:false (not scoped:true) because it fires
after handleClose and must go through the global path; update the
showBannerWithDelay call accordingly, and for the onError handler either mount a
<BannerSlot /> inside this dialog (e.g., under the header in
network-request-dialog) if you want scoped errors, or change showBanner({...,
scoped: true}) to scoped:false so errors are visible via
GlobalBannerContainer—pick one approach and make both handlers consistent with
that decision (reference showBannerWithDelay, showBanner, BannerSlot,
handleClose, and GlobalBannerContainer).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The success banner has to be scoped true because here we have two modals open the banner displays in the second open modal setting it to false the banner will display in the global scope yet we still have an open modal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description images show three scenarios: (1) net1 — "Create A New Sensor Manufacturer" modal with a scoped error banner rendered inside it; (2) net2 — "Request New Sensor Manufacturer" modal with a scoped error banner ("Network request timed out") visible inside the modal; (3) net3 — "Import External Device" modal displaying a green success banner ("sensor manufacturer creation request submitted successfully") after the Request dialog has already closed.


@BwanikaRobert, that context clears it up — net3 confirms it perfectly. The NetworkRequestDialog is opened from within the Import External Device modal, which has its own BannerSlot still mounted. After the child dialog closes, showBannerWithDelay with scoped: true correctly targets that parent modal's slot, so the success message surfaces inside the still-open workflow rather than leaking to the global scope. That's actually a cleaner UX than scoped: false would produce here.

Similarly, the error banner in net2 appearing inside the dialog makes sense for the same reason — the parent modal's BannerSlot is the active scoped receiver.

My original concern was based on a single-modal assumption; the stacked-modal context makes scoped: true the right call. Thanks for walking through it — withdrawing that suggestion.

(◕‿◕)🐇


✏️ Learnings added
Learnt from: BwanikaRobert
Repo: airqo-platform/AirQo-frontend PR: 3558
File: src/vertex/components/features/networks/network-request-dialog.tsx:43-49
Timestamp: 2026-05-29T16:31:51.091Z
Learning: In `src/vertex/components/features/networks/network-request-dialog.tsx`, `NetworkRequestDialog` is opened from within a parent modal (e.g., "Import External Device"). Because the parent modal has its own `BannerSlot` that stays mounted after the child dialog closes, both success and error banners are intentionally set to `scoped: true`. The success banner uses `showBannerWithDelay({ scoped: true })` so it appears in the parent modal's BannerSlot after the child closes; the error banner uses `showBanner({ scoped: true })` to render inside the active dialog context. Using `scoped: false` would send banners to the global container, which is incorrect when a parent modal is still visible.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: Codebmk
Repo: airqo-platform/AirQo-frontend PR: 3092
File: src/vertex/components/features/networks/network-detail-card.tsx:34-36
Timestamp: 2025-12-12T05:22:05.515Z
Learning: In the networks feature, when deriving display names for network entities, do not append ' Network' if the name already includes 'Network'. This prevents duplication like 'XYZ Network Network'. Apply this check in network-detail-card.tsx and similar components under this folder; add a conditional formatting guard and ensure tests cover both names containing and not containing 'Network'.

Learnt from: Codebmk
Repo: airqo-platform/AirQo-frontend PR: 3092
File: src/vertex/components/features/networks/network-detail-card.tsx:34-36
Timestamp: 2025-12-12T05:22:05.515Z
Learning: In the Vertex project, ensure network names shown in NetworkDetailsCard are styled with the Tailwind 'uppercase' class to render uppercase text. Apply the 'uppercase' class to the element that displays the network name in src/vertex/components/features/networks/network-detail-card.tsx, ensuring the change covers all similar render paths in that component. Avoid duplicating styles, preserve accessibility attributes, and verify no regressions in theming by testing in both light/dark modes.

@Codebmk Codebmk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly investigate why some banners have centered text. The text is expected to be left-aligned. Identify root cause and fix this @BwanikaRobert

Image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates user feedback in the Vertex Network Management (Sensor Manufacturers) module from the legacy ReusableToast to the new banner system (useBanner + useBannerWithDelay). Scoped banners are used inside dialogs (rendered through ReusableDialog's built-in BannerSlot), and global/unscoped banners are used for in-page actions (approve/deny/review, copy-to-clipboard, post-close success).

Changes:

  • Replace toast calls with banner calls across NetworkRequestsClient, client-paginated-networks-table, create-network-form, and network-request-dialog.
  • Use showBannerWithDelay for success messages that follow a dialog close (so the dialog's banner-clearing effect doesn't swallow them).
  • Add changelog entry for version 1.23.56.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/vertex/app/(authenticated)/admin/networks/requests/NetworkRequestsClient.tsx Approve/deny/review success and error now dispatched as global banners (scoped: false).
src/vertex/components/features/networks/client-paginated-networks-table.tsx Copy-ID success/error switched from toasts to global banners.
src/vertex/components/features/networks/create-network-form.tsx Success uses delayed global banner after handleClose(); errors use scoped in-dialog banner.
src/vertex/components/features/networks/network-request-dialog.tsx Success uses showBannerWithDelay, errors use scoped showBanner. Note: success uses scoped: true despite dialog being closed first — see inline comment.
src/vertex/app/changelog.md Adds 1.23.56 changelog entry describing the migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

});
onSuccess: (resp) => {
queryClient.invalidateQueries({ queryKey: ["network-requests"] });
showBannerWithDelay({severity:'success',message:resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",scoped:true});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The success banner has to be scoped true because here we have two modals open the banner displays in the second open modal setting it to false the banner will display in the global scope yet we still have an open modal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what happens when we scope it to false.

net5

Comment on lines +21 to +25
export function NetworkRequestDialog({ open,onOpenChange }: NetworkRequestDialogProps) {
const userDetails = useAppSelector((state) => state.user.userDetails);
const queryClient = useQueryClient();
const {showBanner}=useBanner();
const {showBannerWithDelay}=useBannerWithDelay();
Comment on lines +23 to +24
const {showBanner}=useBanner();
const {showBannerWithDelay}=useBannerWithDelay();
Comment on lines 44 to 46
showBanner({ message: "Failed to copy ID", severity: "error", scoped:false });

}
@BwanikaRobert
BwanikaRobert requested review from Codebmk and Copilot May 30, 2026 13:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

}

export function NetworkRequestDialog({ open, onOpenChange }: NetworkRequestDialogProps) {
export function NetworkRequestDialog({ open,onOpenChange }: NetworkRequestDialogProps) {
Comment on lines +24 to +25
const {showBanner}=useBanner();
const {showBannerWithDelay}=useBannerWithDelay();
Comment on lines +47 to 49
onError: (error) => {
showBanner({severity:'error',message:getApiErrorMessage(error),scoped:true})
},
Comment on lines 43 to 46
} catch {
ReusableToast({ message: "Failed to copy ID", type: "ERROR" });
showBanner({ message: "Failed to copy ID", severity: "error", scoped:false });

}
Comment on lines +57 to +58
const errorMessage = getApiErrorMessage(error);
showBanner({severity:'error',message:errorMessage,scoped:true})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The banner only closes after a successful request after closing it we display the message using showBannerWithDelay in the global scope.

Comment on lines +6 to +7
## Version 1.23.56
**Released:** May 29, 2026
@BwanikaRobert
BwanikaRobert requested a review from Copilot May 31, 2026 09:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment on lines +57 to +58
const errorMessage = getApiErrorMessage(error);
showBanner({severity:'error',message:errorMessage,scoped:true})
Comment on lines +43 to +45
onSuccess: (resp) => {
queryClient.invalidateQueries({ queryKey: ["network-requests"] });
showBannerWithDelay({severity:'success',message:resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",scoped:true});
Migrated user feedback in the network management feature from toast notifications to the banner system. This standardizes notifications across the networks admin area for a consistent feedback experience.

<details>
<summary><strong>Changes (5)</strong></summary>
}
},
[handleClose, queryClient]
[handleClose,queryClient,showBanner,showBannerWithDelay]
@BwanikaRobert
BwanikaRobert requested a review from Copilot May 31, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comment on lines +57 to +58
const errorMessage = getApiErrorMessage(error);
showBanner({ severity: 'error', message: errorMessage, scoped: true });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Bannerslot is form ReusableDialog and the dialog only closes after success.

const [activeTab, setActiveTab] = useState<TabStatus>("pending");
const [isUpdating, setIsUpdating] = useState(false);

const {showBanner} = useBanner();
Comment on lines +42 to +44
showBanner({ message: "Sensor Manufacturer ID copied", severity:"success",scoped: false });
} catch {
ReusableToast({ message: "Failed to copy ID", type: "ERROR" });
showBanner({ message: "Failed to copy ID", severity: "error", scoped:false });
message: resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",
type: "SUCCESS",
});
onSuccess: (resp) => {
},
onError: (error) => {
ReusableToast({ message: getApiErrorMessage(error), type: "ERROR" });
onError: (error) => {
});
onSuccess: (resp) => {
queryClient.invalidateQueries({ queryKey: ["network-requests"] });
showBannerWithDelay({ severity: 'success', message: resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!", scoped: true });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already explained

@BwanikaRobert
BwanikaRobert requested a review from Copilot May 31, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment on lines +55 to +58
showBannerWithDelay({ severity: 'success', message: 'Sensor Manufacturer created successfully!', scoped: false });
} catch (error: unknown) {
const errorMessage = getApiErrorMessage(error);
ReusableToast({ message: errorMessage, type: 'ERROR' });
const errorMessage = getApiErrorMessage(error);
showBanner({ severity: 'error', message: errorMessage, scoped: true });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot ReusableDialog already includes internally no changes needed.

message: resp.message || "Your request for a new Sensor Manufacturer has been submitted successfully!",
type: "SUCCESS",
});
onSuccess: (resp) => {
Comment on lines +83 to 84
scoped: false
});
Migrated user feedback in the network management feature from toast notifications to the banner system. This standardizes notifications across the networks admin area for a consistent feedback experience.

<details>
<summary><strong>Changes (5)</strong></summary>

@Codebmk Codebmk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much thanks @BwanikaRobert

@Baalmart
Baalmart merged commit f0f3c29 into airqo-platform:staging May 31, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Vertex: Migration] Update Network Management Module to use InfoBanners

4 participants