Skip to content
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

Disable toolbar buttons on empty pipeline editor #741

Merged

Conversation

karlaspuldaro
Copy link
Member

@karlaspuldaro karlaspuldaro commented Jul 9, 2020

Fixes #691

  • Handles enable/disable of toolbar buttons on empty pipeline editor
  • Add integration tests

Toolbar buttons enabled on a populated pipeline
image

Toolbar buttons enabled on empty pipeline
image

We are also handling cases of pipeline with no nodes but comments are left (user can still clear pipeline and arrange items)
image

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@karlaspuldaro karlaspuldaro added the status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. label Jul 10, 2020
Comment on lines +254 to +284
{ action: 'undo', label: 'Undo' },
{ action: 'redo', label: 'Redo' },
{ action: 'cut', label: 'Cut' },
{ action: 'copy', label: 'Copy' },
{ action: 'paste', label: 'Paste' },
{ action: 'addComment', label: 'Add Comment', enable: true },
{ action: 'delete', label: 'Delete', enable: true },
{ action: 'delete', label: 'Delete' },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to set the enable property on these commands, they're handled by context on canvas already

*
* @param pipelineDefinition
*/
static isEmptyCanvas(pipelineDefinition: any): boolean {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be cases we want to check if canvas is completely clean of nodes and comments in order to enable/disable action buttons (eg. we only disable clean pipeline button if canvas is empty and there is nothing else left to clean)

Copy link
Contributor

@vabarbosa vabarbosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karlaspuldaro not sure if this is a known issue.

when adding/removing nodes/links the Undo/Redo buttons are enabled/disabled accordingly and work as expected. now when you clear the pipeline you get a confirmation dialog with the message (You can not undo this.) which is good. after accepting the confirmation and the pipeline is cleared the Undo button is enabled (i would expect it disabled since you cannot undo the clearing). you can click on the Undo but it doesn't do anything (as expected). however, at that point the Redo becomes enabled and clicking on it doesn't do anything either. in the end you get to a point where Undo/Redo buttons are enabled and you can click on them although you cannot really undo/redo any action.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Listen to undo/redo/delete/addComment commands

Handle empty canvas case (no nodes or comments)

Update enable parameters of toolbarConfig
@karlaspuldaro
Copy link
Member Author

@vabarbosa the undo/redo issue when clearing a pipeline is existing, looks like we never noticed it, or never properly handled it. I opened #756 where we can investigate as a separate PR, as discussed today.

Copy link
Member

@ajbozarth ajbozarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still playing with this locally but here's my code review for now

@ajbozarth
Copy link
Member

I tested locally things seem to work great, I did open #757 with separate issues I found while testing this. I also ran the ui tests locally and they passed. I also check and this looks good in dark mode as well (except of course my previously mentioned issue).

So once my previous code comments are address this LGTM

Simplify behaviour of arrangeHorizontally-Vertically buttons

Rename isNewPipeline() to isEmptyPipeline()
@lresende
Copy link
Member

@karlaspuldaro I see approvals coming in for this pr. Are we ready to remove the work in progress tag and merge?

@karlaspuldaro
Copy link
Member Author

@lresende I wanted to add more tests for this but that can be done later, we already have basic tests up and a note for extra ones

@karlaspuldaro karlaspuldaro removed the status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. label Jul 15, 2020
@lresende lresende merged commit 175ba4e into elyra-ai:master Jul 15, 2020
@karlaspuldaro karlaspuldaro deleted the kspuldaro-empty-pipeline-validation branch January 13, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Usability] A user should not be able to run, export or otherwise process an empty pipeline
4 participants