Skip to content
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

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

molly-moen
Copy link
Contributor

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:
Screenshot 2023-10-24 at 3 25 06 PM

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:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@molly-moen molly-moen requested a review from a team October 24, 2023 22:30
@molly-moen molly-moen requested a review from a team as a code owner October 24, 2023 22:30
isDangerCancel: true,
confirmText: msg.keep(),
onConfirm: null,
onCancel: this.onDeleteConfirmed.bind(this),
Copy link
Contributor

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?

Copy link
Contributor

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@ebeastlake ebeastlake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@ebeastlake
Copy link
Contributor

@molly-moen I checked with Mark and confirmed the buttons are how we want them. No follow-up.

@molly-moen molly-moen merged commit 2b5b942 into staging Oct 25, 2023
2 checks passed
@molly-moen molly-moen deleted the molly/delete-modal branch October 25, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants