-
Notifications
You must be signed in to change notification settings - Fork 350
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 error message on attempt to create circular references #744
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.
A couple initial code comments, I'll be finding time to test this locally and do a more though code review soon
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 can't really comment on the UI changes, but think this is really great and elegantly done - nice work.
As for the error message timeout, I think forcing the user to dismiss is correct, but will also defer to the UX experts on that. Is the reason we don't just pop up a dialog because that isn't the "canvas way" in this particular scenario?
@marthacryan i like this, a couple comments:
|
Allows for using different types of message 'severity', i.e. error, warning, success, info. Also adds behavior of dismissing the message when a new node is created on the canvas.
Co-authored-by: Karla Spuldaro <karla.spuldaro@ibm.com>
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 checked this out and tried it and it works great. I made a couple code comments below including one refactor idea.
I did notice in my testing that canvas prevents connecting a node to itself by default, but this doesn't show our error. Do we want to try to tie our new error messaging into that behavior as well for consistency?
Also a larger question: why did you use material-ui for this? I ran a quick check and it's not currently used in lab, lumino, or canvas.
@ajbozarth Someone in a jupyterlab community meeting mentioned using material-ui when jupyterlab doesn't have a feature already implemented, and I thought this sort of alert would be better than a dialog for what the error was, so I thought I'd give material-ui a try. It looked good and was relatively simple to add, so I went with it! |
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.
Tested locally and everything looks good. A couple minor comments, once those are addressed this should be good to go.
Last commit moves the link validation code into |
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.
Still looks good with the latest changes
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.
Very nice add-on :)
looks good to me! there is an edge case which i am not sure if it is worth addressing. if i have a saved pipeline which already has a circular reference when i open/load this pipeline the circular reference is not detected. if this scenario is valid then perhaps an initial check should be done when opening a pipeline? |
@vabarbosa Good point! That kind of error might be better as a decoration though (it might be confusing if we go in and delete links then show an error right when users open the pipeline) - I could include it in #752 as part of the validation that I'm adding for nodes, but the one issue that comes to mind is that there isn't an existing tooltip for links, so I'm not sure how we'd indicate what the issue is with the link. Thoughts? |
yeah, i don't believe deleting the link would be the way to go either. maybe showing the notification and also changing the link to red dashed line. for example |
@vabarbosa I like that! I'll add that to #752 because it already has validation code that runs on startup. |
Fixes #256 and #660. Adds an error message that appears when users try to create circular references. The error message is structured to provide flexibility for future validation needs - from
PipelineEditor
, usethis.setState({ showValidationError: true, errorMessage: 'YOUR ERROR MESSAGE' })
to open the error message.Notes
Developer's Certificate of Origin 1.1