-
Notifications
You must be signed in to change notification settings - Fork 295
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
Erase unsaved Dashboard Sharing settings #5407
Erase unsaved Dashboard Sharing settings #5407
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.
Thanks, @nfmohit. The code changes looks good. However there are a couple of concerns to be addressed:
- This is not mentioned in the IB; however, can we add a test case to cover this scenario in
assets/js/components/dashboard-sharing/DashboardSharingSettings/index.test.js
? - This is not working when I click outside of the modal. Could you please investigate on this? Perhaps @asvinb could help on this.
Size Change: +127 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Thank you for the review @hussain-t!
I'll circle around once I'm done with the test case. Thanks! |
@nfmohit, The expected scenario tests are supposed to be done in the We can proceed without adding the test. |
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.
Thanks, @nfmohit. I don't think we need to have a param in the closeDialog
callback. Otherwise it's good to go.
assets/js/components/dashboard-sharing/DashboardSharingSettingsButton.js
Outdated
Show resolved
Hide resolved
assets/js/components/dashboard-sharing/DashboardSharingSettingsButton.js
Outdated
Show resolved
Hide resolved
assets/js/components/dashboard-sharing/DashboardSharingSettingsButton.js
Outdated
Show resolved
Hide resolved
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.
Thanks, @nfmohit. FYI, the closeDialog
callback is being used in the onApply
callback. We are waiting for await saveSharingSettings()
before we call the closeDialog
. So by that point of time the new savedSharingSettings
will be fetched and set in the state. Anyways this is not a big problem. I will leave it to the merge reviewer to take a call 👍
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.
Thanks @nfmohit, this is a great start just a few small things to address then this should be good to go 👍
assets/js/components/dashboard-sharing/DashboardSharingSettingsButton.js
Outdated
Show resolved
Hide resolved
assets/js/components/dashboard-sharing/DashboardSharingSettingsButton.js
Outdated
Show resolved
Hide resolved
assets/js/googlesitekit/modules/datastore/sharing-settings.test.js
Outdated
Show resolved
Hide resolved
assets/js/googlesitekit/modules/datastore/sharing-settings.test.js
Outdated
Show resolved
Hide resolved
Thank you so much for the detailed and kind review @aaemnnosttv! I'm working on it and will circle back once done. |
e836e4d
to
ebaf019
Compare
@nfmohit would you please resolve the merge conflict? |
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.
Great, thanks @nfmohit !
Thank you so much @aaemnnosttv! 🙏 |
Summary
Addresses issue:
Relevant technical choices
This PR erases the Dashboard Sharing settings which haven't been saved yet upon closing the Dashboard Sharing settings modal. This:
rollbackSharingSettings
.sharingSettings
tosavedSharingSettings
.haveSharingSettingsChanged
and if so, dispatches the newrollbackSharingSettings
action.rollbackSharingSettings
action.PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist