-
Notifications
You must be signed in to change notification settings - Fork 481
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
[Google Blockly] Add delete confirmation modal to the modal function editor #54461
Conversation
isDangerCancel: true, | ||
confirmText: msg.keep(), | ||
onConfirm: null, | ||
onCancel: this.onDeleteConfirmed.bind(this), |
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.
Is this backward? I'd expect confirmText
and onConfirm
to handle the deletion and cancelText
and onCancel
to handle bailing out of the deletion.
Also, why is there no handler for onConfirm
?
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.
It looks like you had to swap them to retain the order of the buttons relative to CDO. I think it's worth, at least, leaving a comment about why it's the opposite of what one would expect. I also wonder if it's worth asking Mark whether the OG button ordering is best (this could be done in a follow-up PR).
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.
The reason for this is it allows us to have a red delete button and a purple keep button. I'll add a comment explaining this. The reason there is no onConfirm
handler is we do nothing if they want to keep the function.
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.
Added comments. We can follow-up on if we should switch up the order/color, but I don't think that's blocking given no one has complained about the existing modal.
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 think the thing I was missing re: the handler was that the modal closes regardless of which button you push -- this is hidden in the modal code, presumably.
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.
🎉
@molly-moen I checked with Mark and confirmed the buttons are how we want them. No follow-up. |
Add a delete confirmation modal to the new modal function editor. We can reuse the same modal that we use in cdo blockly, as we were already passing it through the Google Blockly Wrapper. It is set here and passed through here.
The dialog looks identical to the old dialog:
Links
Testing story
Tested locally that now when you click delete you get the dialog, and only on delete confirmation do you actually delete the function.
PR Checklist: