-
Notifications
You must be signed in to change notification settings - Fork 2
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 new model for Merchant Center CustomView
entity
#384
Conversation
🦋 Changeset detectedLatest commit: 6055940 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Building is currently failing but I don't understand how I can fix it:
|
labelAllLocales: [ | ||
LocalizedField.random().build(), | ||
LocalizedField.random().build(), | ||
], |
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'm not sure how should I implement these fields. I know we have the buildFields
available in the transformers file, but I can't make it work.
Some help would be much appreciated.
80dff9c
to
5fa3801
Compare
5fa3801
to
7582606
Compare
const resourceAccesses = entryPointUriPathToResourceAccesses( | ||
CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH, | ||
[additionalPermission] | ||
); |
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 requires the change in App Kit to be released: commercetools/merchant-center-application-kit#3272
const generator = Generator<TCustomViewTypeSettingsForCustomPanel>({ | ||
fields: { | ||
// Assumes that the type is `CustomPanel`. | ||
size: fake((f) => f.helpers.arrayElement(['SMALL', '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.
This model is specific to CustomPanel
type. When we support more types, we'll define separate models for each type settings.
This helps simplifying the setup and the usage (we already do this for other models as well).
795e06e
to
39462a7
Compare
ownerId: fake((f) => f.string.uuid()), | ||
url: fake((f) => f.internet.url()), | ||
defaultLabel: fake((f) => f.commerce.department()), | ||
labelAllLocales: fake(() => [LocalizedField.random()]), |
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.
The wrapping of fake()
was missing, otherwise models cannot be built.
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 PR adds a new model for the
CustomView
new entity we're developing for the Merchant Center.Also, I included another one (
LocalizedField
) in the commons package as I believe it can be used from other upcoming models.