-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(canvas): Validate nodes upon rendering #711
feat(canvas): Validate nodes upon rendering #711
Conversation
31991a8
to
bba452a
Compare
It seems this change disabled the validation update for form change event, it needs to close and reopen the node to update the validation status. |
Yes, it's working like the |
bba452a
to
0651e8c
Compare
@igarashitm can we use the validator for Pipes as well? |
The reason I added the listen-notify was to update the validation status as soon as user input the required field. I'd prefer that behavior. |
One thing to consider: If we have updates while typing from source to graph, users would rightfully expect also the opposite direction to work. I am not a big fan of this tbh. For me it would be enough, if we update on Save. |
Do you mean to wait updating the status until vscode |
Another option is to introduce a refresh button somewhere, maybe start with clicking the node status icon, but I'd prefer more explicit one eventually. What I don't like is that, in order to update the node status, I need to close and reopen which is indirect actions for the node status update.
UpdateI quickly tried |
For clarification: There are a few Update events: |
Also in the future, we will do inline validation in the config form itself I assume. The node status would be better in sync with the form validations. If we do the form validations with user action like a |
It seems I was not clear enough in my statement. What I meant is that when typing something in the source code (like the Below video hopefully shows in a better way what I mean. Here I change the description in the code and the node label changes while I type. If on the other hand I go to the canvas config form and change the description there, then it is not changing in the source while typing and also not after I am done and closing the form. It needs a SAVE to persist the changes to the source. This is not consistent and behaving the same in both directions and thats why I say we should only update canvas elements from source changes, once the source changes are saved. This btw. also leads to not so nice behaviors / issues like the one below... |
Currently, we're validating the canvas' nodes when editing the Form, using the original model. This casuses that in some cases, we get a false positive result since a parameter might have been defined using the URI field. This commit aims to validate each node upon rendering, meaning that the node will be validated whenever the node is rendered, which happens the first time when a route is presented or when the node is selected or deselected. In addition to that, we're parsing the node definition so we could account for the URI field when applicable. fix: KaotoIO#697
As discussed, we're moving forward with this PR behavior so we can close the |
0651e8c
to
19c3cda
Compare
Context
Currently, we're validating the canvas' nodes when editing the Form, using the original model. This causes that in some cases, we get a false positive result since a parameter might have been defined using the URI field.
Changes
This commit aims to validate each node upon rendering, meaning that the node will be validated whenever the node is rendered, which happens the first time a route is presented or when the node is selected or deselected.
In addition to that, we're parsing the node definition so we can account for the URI field when applicable.
How to test
Using the following
YAML
, you should see that only the missing-parameters nodes are highlighted aswarning
fix: #697
fix: #674