-
Notifications
You must be signed in to change notification settings - Fork 121
Products Onboarding: Enable product previews for all stores #8058
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,4 +180,11 @@ extension ProductFormViewModelProtocol { | |
| } | ||
| } | ||
| } | ||
|
|
||
| /// Whether the Preview button should be enabled, when it's available in the navigation bar. | ||
| /// Returns `false` when it's a new blank product without any changes. | ||
| /// | ||
| func shouldEnablePreviewButton() -> Bool { | ||
| !(formType == .add && !hasUnsavedChanges()) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea about toggling the button state instead of hiding it!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may want to change this condition due to the template experiment, as a new template product would be considered as a new product without any changes. I think we need to add a check for the "blank" state.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree, but I haven't come up with a good solution for it yet. This PR doesn't change whether you can preview new template products (it just makes the preview button visible but disabled, instead of not appearing at all), so I'm going to go ahead and merge it. I've opened a new issue #8071 so we can follow up with a fix for new template products. |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.