-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update validation settings templates to be consistent with the tutorial #134
Conversation
Converting this to a draft as we refactor some of the code examples |
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
return ( | ||
<FunctionSettings onSave={onSave} onError={onError}> | ||
<ErrorBanner errors={errors} /> | ||
<BlockStack gap="large"> |
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.
Will remove this wrapper BlockStack
in a follow-up once we close https://github.com/Shopify/web/issues/124573. Applies to all other flavours
api.data.validation?.metafields?.[0]?.value ?? "{}", | ||
); | ||
|
||
if (!api.data.validation?.metafields) { |
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.
could this be inferred by the const configruation
up above?
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.
No, configuration
would never be null
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.
right, but configuration.whatever
would be
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.
Up to taste, my thinking is this is more generalizable, but you could also switch this to !configuration[firstId]
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.
I extracted shared data access to a var 😄
Background
Related #103
Corresponds to https://github.com/Shopify/shopify-dev/issues/43285
Changing to a more detailed extension in all 4 flavors to be in line with the tutorial on shopify.dev.
Solution
Added a full solution making use of metafields and
FunctionSettings
andSection
components.Checklist