-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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/undo redo action #15704
Feat/undo redo action #15704
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.
I found some problems, but in general it works well!
When I add an aggregation, I need to click undo twice to undo the widget creation (but redo only once afterwards).
When I create a widget, focus it (or open edit mode) and click on undo (which reverts the widget creation), I see an error: Cannot read properties of undefined (reading 'toArray’)
.
When I create a dashboard tab and click undo, I get the error Cannot read properties of undefined (reading 'widgets')
.
title={title} | ||
sidebarIsPinned={sidebarIsPinned} /> | ||
); | ||
})} |
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.
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.
Beside the sections
array, we could also have an actions
array.
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.
We talked about removing the arrow in the sidebar, because you can open and close the sidebar by clicking in the section icon, but we can implement this in a different PR.
position: relative; | ||
z-index: 4; /* to render over SidebarNav::before */ | ||
width: 100%; | ||
height: 40px; | ||
text-align: center; | ||
cursor: pointer; | ||
cursor: ${disabled ? 'not-allowed' : 'pointer'}; | ||
opacity: ${disabled ? 0.65 : 1}; |
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.
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.
Works fine, thanks! I added some suggestions for improvement of the code structure.
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 some cases I still need two clicks to undo / redo a change, but in general the functionality seems to work well and all other comments have been addressed.
Description
This PR adds 2 buttons to the sidebar with undo/redo actions. These actions change the view state in the proper direction.
The buffer size is 10. It can be changed if it wouldn't be enough.
Motivation and Context
#15713
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: