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.
Description
This PR fixes #9341
Motivation and Context
The pipeline rule context and source code editor didn't play well together. In some instances the source code of pipeline rules was not loaded into the source code editor.
Because of the nature of how the context and source code editor were implemented it sometimes didn't work correctly.
It problem lies in the way the rule values are set on the source code editor. After debugging I came to the conclusion that the source code editor was not loaded, but the rule source had and thus wanted to update a non-existing source code editor.
This fix will trigger the context to apply the rule source on the source code editor should it load after the rule has been loaded.
I am using
useState
to get the desired effect. It's a bit weird, but it retriggers the effects inside the Context correctly. If we were to fix the way source code editor and the context work we'd have to refactor them to be controlled inputs instead of uncontrolled.How Has This Been Tested?
Was tested using the reproduction steps of #9341
Types of changes
Checklist: