-
Notifications
You must be signed in to change notification settings - Fork 191
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
Add model validation in method modeling panel #2936
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, with a couple of questions.
We'll likely end up displaying this info in the model editor and method modeling panels. Do we want to perform the validation once in each location, or do it in a shared location and pass the errors into each view?
I think what you have here where we do the validation in the view is likely fine. It will mean we do the validation twice, but the validation should be fast enough and consistent, so doing it twice is safe. At least this way the validation errors will definitely match the data being displayed.
result.push({ | ||
title: "Duplicated classification", | ||
message: | ||
"This method has two identical or conflicting classifications.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the extreme case of more than two duplicate modelings, do we want to avoid adding multiple errors? I'm unsure. I'd say it's a very unlikely case, so perhaps not worth putting in the implementation effort to give a nice user experience in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure either, but I don't think it's worth handling this case for a very rare case.
I think this is a lot easier to manage. If we were to store the validation errors in the modeling store, we would need to run the validation for every method, even if it's not shown in the model editor (for example if the group it's in is collapsed). The validation should always result in the same result, so keeping it in the view shouldn't really make a big difference. If we start experiencing performance problems because of this, we can always consider moving it to the extension host where the user will probably notice it less. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
This adds validation of the modeled methods to the method modeling panel. It implements the following two validations:
Multiple neutral classifications will be validated by the second validation rather than the first one.
Testing is only really possible in Storybook right now, without any interactivity.
Checklist
ready-for-doc-review
label there.