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

Add confirmation to modal before updating #3038

Merged
merged 4 commits into from
Jan 4, 2021
Merged

Add confirmation to modal before updating #3038

merged 4 commits into from
Jan 4, 2021

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Dec 19, 2020

This pull request adds a confirmation modal to the Statamic updater before the site begins to update. Closes #884.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. A couple of things:

This component is used on the Statamic updater as well as for any addons. So as you have it now, when you try to upgrade an addon, it'll say "Are you sure you want to update Statamic?", but it's not Statamic.

Second, even when you're about to downgrade, the confirmation still asks if you want to update.

I think you can resolve both issues by making the message a bit more generic.

Are you sure you want to {update/downgrade} to {version}?

One way you could do that is to change confirmationOpen from a boolean to an object, and when you click a button, set the release to that. Then the confirmation can read the type and version.

@duncanmcclean
Copy link
Member Author

Agreed. Those sound like some good changes. I'll try and make them tonight.

Rather than being specific to statamic/cms
Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

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

I've slightly tweaked it so that the confirmation dialog is closed when you click confirm, instead of it sitting in the background. Otherwise, 👍

@duncanmcclean
Copy link
Member Author

I've slightly tweaked it so that the confirmation dialog is closed when you click confirm, instead of it sitting in the background. Otherwise, 👍

Awesomeee!

@jasonvarga jasonvarga merged commit a3505b7 into statamic:3.0 Jan 4, 2021
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.

Updater should ask for confirmation before performing an update
2 participants