[ENG-36476] fix: connectors not displaying data from API#3231
Open
[ENG-36476] fix: connectors not displaying data from API#3231
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug fix
What was the problem?
Edge Connectors was not displaying data that comes from the API correctly. Two main issues were identified:
Load Balancer Configuration: When editing an existing connector, the watch on
loadBalancerEnabledwas resetting the configuration values (maxRetries, connectionTimeout, readWriteTimeout) to defaults, overwriting the values loaded from the API.Conditional rendering with v-if: Components using
v-ifwere being destroyed and recreated, losing their form field bindings and values when toggling visibility.Expected behavior
How was it solved
Load Balancer Configuration: Added a
hasInitialConfigcomputed property that checks if configuration values already exist. The watch now only sets default values whenloadBalancerEnabledbecomes true AND there's no initial configuration (!hasInitialConfig.value).Replaced v-if with hidden class: Changed from
v-ifto:class="{ hidden: !condition }"forLoadBalancerConfigurationandAddresscomponents. This approach was chosen because:v-showaddsdisplay: noneinline style, which wasn't being applied with!importantand could be overriddenhiddenCSS class provides a more reliable way to hide components while keeping them mounted and preserving their form field bindingsHow to test