-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Global Pins] Shows a confirmation dialog when disabling the global pin feature #6843
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
e6343e2
to
6b28c50
Compare
6b28c50
to
6ba778e
Compare
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.
Not much to say here as both the code and the feature are very high quality. Thank you for your efforts!
import {SavingPinsDialogModule} from './saving_pins_dialog_module'; | ||
import {SavingPinsDialogComponent} from './saving_pins_dialog_component'; | ||
|
||
describe('saving_pins_dialog', () => { |
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.
nit: Using underscores doesn't match the selector (or anything else) and can make the code harder to search for. Suggest: saving-pins-dialog
or saving pins dialog
.
(I know some other tests use underscores, but it doesn't seem to be consistent and I think we can adopt a better policy)
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.
Applied! Thanks!
…in feature (tensorflow#6843) ## Motivation for features / changes Regarding tensorflow#6831 , this PR adds confirmation dialog" that appears when the user clears the checkbox to make the user aware that local storage is disappearing. ## Technical description of changes 0e63b07 created a `saving pins dialog` component 05e06f5 Created a `saving pins checkbox` component * The Save Pin checkbox prevents the default click and must be done after confirmation in the modal. So I added `MAT_CHECKBOX_DEFAULT_OPTIONS` (https://v15.material.angular.io/comComponents/checkbox/overview#click-action-config) to prevent the default click event. However, if I add this directly to the `settings view component`, all checkboxes will be disabled, including other unwanted ones. So, I created a separate checkbox for the Save Pin checkbox. Please let me know is there any other good way to do this. 6ba778e Make the dialog shows up when user clears the checkbox * Passes to `onEnableSavingPinsToggled` whether the checkbox is selected. * If the checkbox is selected and user clicks it, it means that the user disables the global pin, so a dialog box is displayed. * If the checkbox is not checked but is clicked, it means the user is trying to enable a global pin and no dialog box will be displayed. * `onEnableSavingPinsToggled` and `isSavingPinsEnabled` is passed to `saving-pins-checkbox` component. ## Screenshots of UI changes (or N/A)  ## Detailed steps to verify changes work correctly (as executed by you) unit test passes + TAP presubmit passes ## Alternate designs / implementations considered (or N/A)
Motivation for features / changes
Regarding #6831 , this PR adds confirmation dialog" that appears when the user clears the checkbox to make the user aware that local storage is disappearing.
Technical description of changes
0e63b07 created a
saving pins dialog
component05e06f5 Created a
saving pins checkbox
componentMAT_CHECKBOX_DEFAULT_OPTIONS
(https://v15.material.angular.io/comComponents/checkbox/overview#click-action-config) to prevent the default click event. However, if I add this directly to thesettings view component
, all checkboxes will be disabled, including other unwanted ones. So, I created a separate checkbox for the Save Pin checkbox. Please let me know is there any other good way to do this.6ba778e Make the dialog shows up when user clears the checkbox
onEnableSavingPinsToggled
whether the checkbox is selected.onEnableSavingPinsToggled
andisSavingPinsEnabled
is passed tosaving-pins-checkbox
component.Screenshots of UI changes (or N/A)
Detailed steps to verify changes work correctly (as executed by you)
unit test passes + TAP presubmit passes
Alternate designs / implementations considered (or N/A)