-
Notifications
You must be signed in to change notification settings - Fork 121
Variations: Ask for user confirmation before creating variations #8565
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
You can test the changes from this Pull Request by:
|
ealeksandrov
left a comment
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.
LGTM!
| let format = NSLocalizedString("This will create a variation for each and every possible combination of variation attributes (%d variations).", | ||
| comment: "Alert description to allow the user confirm if they want to generate all variations") | ||
| return String.localizedStringWithFormat(format, variationCount) | ||
| } |
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.
Nice wrapper!
|
|
||
| self.createVariationsRemotely(for: product, variations: variationsToGenerate, onCompletion: onCompletion) | ||
| // Confirm generation with merchant | ||
| onStateChanged(.confirmation(variationsToGenerate.count, { confirmed in |
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.
This one is hard to read and understand, but I don't have easy improvement suggestions 🤔
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.
Yeah, not a fan either. will keep it in the back of my head for improvements!
Closes: #8492
Why
This PR asks the merchant for confirmation before generating multiple variations remotely.
How
Refactor
ViewModel.generateAllVariationsmethod to provide anonStateChangedclosure that will inform the consumer what is happening in the generation process.Update View controller to listen to those state changes.
Presents confirmation alert when the state change indicates.
Demo
demo.mov
Testing Step
RELEASE-NOTES.txtif necessary.