-
Notifications
You must be signed in to change notification settings - Fork 112
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-ons: Add Variations Attributes row #4350
Conversation
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! Tests well with various cases:
- New variable product
- Existing variable product with no variations or attributes
- Existing variable product with attributes but no existing variations
- Existing variable product with one or more variations/attributes
let icon = UIImage.customizeImage | ||
let title = Localization.productVariationAttributesTitle | ||
|
||
let format = NSLocalizedString("%1$@ (%2$ld options)", comment: "Format for each Product attribute") |
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: Maybe add this string to the Localization
enum.
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.
Since we're working on this section now, it might also be worth updating this string to fix #3702? We could check for when options.count
is 1 and use a different string in that case.
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.
Oh, I wasn't aware of that issue.
Fixed in 85ac157
}() | ||
|
||
return String.localizedStringWithFormat(format, count) | ||
} |
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 is a really clear way to handle the singular/plural cases! ⭐ I wish we could properly handle plurals for languages (like Russian) that have different plural forms (not just 1 or many), but until we can do that this is great. (We don't have an open issue for supporting different plural forms, but it's the same issue described in wordpress-mobile/WordPress-iOS#6327.)
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.
Stringdict would be the tool to help us with that but I think it is not supported by Glotpress yet :-(
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can trigger an installable build for these changes by visiting CircleCI here. |
closes #4312
fixes #3702
Why
As part of the Variations changes, we are trying to make the variation flow simpler. This PR takes out the "Product Variation Attributes" section that was inside the "Variations List" screen and makes it accessible from the "Product Form" screen.
How
Update
ProductAttribute
to conform toGeneratedCopiable
Update
ProductFormActionsFactory
to include the.attributes
actions for the variable products when the product has at least one attribute.Update
DefaultProductFormTableViewModel
to properly render the.attributes
row and update the.variations
row to show the variations count.Update
ProductFormViewController
to navigate to the "Edit Attributes" screen after the new "Variation Attributes" row is tapped.Update
ProductVariationsViewController
to remove the ability to edit product attributes for that screen.Demo
attributes-demo.mov
Testing Steps
Launch the app and navigate to a product with variations
See that there is a "Variations" row stating how many variations the product has.
See that there is a "Variations Attributes" row.
Tap on the "Variations Attributes" row and see that it navigates to the "Edit Attributes" screen.
Edit/Add/Delete an attribute
Go back the to the main product screen, see that the "Variations Attribute" row is updated.
Update release notes:
RELEASE-NOTES.txt
if necessary.