Repository navigation
ui: fix SourceNat error when adding a network offering - #14576
Conversation
buildServiceCapabilityParams is a standalone function, so `this` is undefined and `this.selectedServiceProviderMap` threw a TypeError whenever SourceNat was selected, leaving the Add Network Offering form stuck on OK. Use the selectedServiceProviderMap parameter instead.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to read the SourceNat provider from the helper’s argument.
No open issues 🎉
What changed in this PR
Fixes the Add Network Offering form failing when SourceNat is selected by removing an invalid this reference in a standalone helper.
Changes:
- Uses the
selectedServiceProviderMapargument to identify the Netris SourceNat provider, avoiding the TypeError that blocked form submission.
| File | Description |
|---|---|
ui/src/composables/useServiceCapabilityParams.js |
Reads the SourceNat provider from the function argument instead of this. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14576 +/- ##
=========================================
Coverage 20.77% 20.77%
- Complexity 21913 21915 +2
=========================================
Files 6496 6496
Lines 591629 591629
Branches 72590 72590
=========================================
+ Hits 122912 122916 +4
+ Misses 455378 455374 -4
Partials 13339 13339
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@sudo87 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
RosiKyu
left a comment
There was a problem hiding this comment.
LGTM
Tested on the PR UI build (backend 4.21.0.0) via Add Network Offering: an isolated offering with only SourceNat (VirtualRouter) is now created with no console error, a full isolated offering (Dhcp, Dns, Firewall, SourceNat, StaticNat, PortForwarding, redundant router) is created with all services listed, a shared offering without SourceNat still works, and Per Zone source NAT on VirtualRouter now reaches the server and is rejected with a clear validation error instead of the form hanging.
Description
This PR fixes undefined error coming while Adding Network offering with only SourceNat. buildServiceCapabilityParams is a standalone function, so
thisis undefined andthis.selectedServiceProviderMapthrew a TypeError whenever SourceNat was selected, leaving the Add Network Offering form stuck on OK.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?