Fix test connection with codemirror and extra #35122
Merged
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.
closes: #32890
This fixes an issue where the addition of CodeMirror on the extra text field in #28583 causes the Test button to no longer send the extra field. This fix was previously attempted in #32893 but was later reverted due to inadvertent issues with other connections in #33032.
The reason for the revert was because non-applicable fields were being shown in connections. Instead of moving the instantiation of CodeMirror on textArea, we can declare a global editor variable that is populated if the extra field exists on the connection. If it does exist and a user wants to test a connection with extras, we will call
editor.save
to save the value to textArea which will make it accessible ingetSerializedFormData
.Test Plan
Check other connections and make sure they look okay
Create a new connection of type HTTP, set a host, and add an extra json field
Ensure extra is passed through the test
Ensure the connection is persisted properly:
Please let me know if there's anything else I can test.
cc @pankajkoti @genehynson @eladkal