-
Notifications
You must be signed in to change notification settings - Fork 27
Batch tree deletion actions when deleting a group #4312
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
Conversation
@@ -285,22 +286,22 @@ class TreeHierarchyView extends React.PureComponent<Props, State> { | |||
const hasSubgroup = anySatisfyDeep(node.children, child => child.type === TYPE_GROUP); | |||
const menu = ( | |||
<Menu onClick={this.handleDropdownClick}> | |||
<Menu.Item key="create" groupId={id}> | |||
<Menu.Item key="create" data-group-id={id}> |
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.
Fix for a React warning that I encountered a lot. React complained about the custom prop groupId
that was not removed before adding the element to the DOM.
@philippotto I implemented this as discussed and updated the PR description. Should be ready for review :) |
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.
Awesome! The changes look very good and testing went well, too. One thing which I noticed is that the merger mode uses api.utils.registerOverwrite("DELETE_TREE" ...)
and that this should probably be adapted to the new batched action. Shouldn't be much work, I assume? Otherwise, deleting multiple trees will probably break the merger mode.
Very good call, I pushed a fix :) |
Awesome, looks good 👍 |
I batched the group-with-subtree deletion, mulitple tree deletion and multiple tree move user actions. The confirm group/tree/node-with-id-1 deletion code is pretty messy and should be consolidated, but I'll probably not do that as part of this PR. My changes should not make it much worse.
I also found a (minor) bug in the undo functionality where when only a single action was triggered, for example,
SET_TREE_GROUP
, and that was then undone, the save_saga wouldtake
theUNDO
action and diff the tracing state, although the "undone" tracing state was not set in the store yet. We didn't notice this before, because usually there's a couple more flycam actions or so that follow, which trigger the differ again. To fix this, I changed the save_saga code totake
theSET_TRACING
action instead which is what undo/redo dispatch to set the new tracing state.URL of deployed dev instance (used for testing):
Steps to test:
Issues:
Outdated, but for reference: