-
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
FEC-39: Fix models related to Batch 2 (Part 1) #650
Changes from all commits
a7e01f2
9fd53a3
41b0a55
f3e250e
fbdcc4a
ebebcaf
a821784
a660857
40ea8ce
69dba8b
69950ab
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@commercetools-test-data/product-type': minor | ||
'@commercetools-test-data/commons': minor | ||
'@commercetools-test-data/inventory-entry': patch | ||
--- | ||
|
||
### Common Model (`common`) | ||
|
||
- Introduced a new model called `discounted-price`. | ||
|
||
### Inventory Entry Model (`inventory-entry`) | ||
|
||
- Updated the transformer file to conditionally send the supply channel, making it optional. | ||
|
||
### Product Type (`product-type`) | ||
|
||
- Added new presets for enum and localized enum types. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
const presets = {}; | ||
import { LocalizedString } from '@commercetools-test-data/commons'; | ||
import { | ||
AttributeEnumType, | ||
AttributeNumberType, | ||
AttributeTextType, | ||
} from '../..'; | ||
import AttributeDefinition from '../builder'; | ||
|
||
const presets = { | ||
number: () => | ||
AttributeDefinition() | ||
.type(AttributeNumberType.random()) | ||
.name('Number Attribute Definition') | ||
.label( | ||
LocalizedString.presets | ||
.empty() | ||
.en(`Number Attribute Definition's Label`) | ||
) | ||
.inputTip( | ||
LocalizedString.presets | ||
.empty() | ||
.en(`Number Attribute Definition's Input Tip`) | ||
), | ||
|
||
countryOfOrigin: () => | ||
AttributeDefinition() | ||
.attributeConstraint('None') | ||
.name('country-of-origin') | ||
.label(LocalizedString.presets.empty().en('Country of Origin')) | ||
.isRequired(true) | ||
.type(AttributeTextType.random()), | ||
|
||
size: () => | ||
AttributeDefinition() | ||
.attributeConstraint('None') | ||
.name('size') | ||
.label(LocalizedString.presets.empty().en('Size')) | ||
.inputTip(LocalizedString.presets.empty().en('Size of a product')) | ||
.inputHint('SingleLine') | ||
.isRequired(true) | ||
.isSearchable(true) | ||
.type(AttributeEnumType.presets.allSizesEnum()), | ||
}; | ||
|
||
export default presets; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
const presets = {}; | ||
import { AttributePlainEnumValue } from '../..'; | ||
import AttributeEnumType from '../builder'; | ||
|
||
const presets = { | ||
allSizesEnum: () => | ||
AttributeEnumType().values([ | ||
AttributePlainEnumValue.presets.s(), | ||
AttributePlainEnumValue.presets.m(), | ||
AttributePlainEnumValue.presets.l(), | ||
AttributePlainEnumValue.presets.xl(), | ||
]), | ||
smallSizesEnum: () => | ||
AttributeEnumType().values([ | ||
AttributePlainEnumValue.presets.s(), | ||
AttributePlainEnumValue.presets.m(), | ||
]), | ||
|
||
bigSizesEnum: () => | ||
AttributeEnumType().values([ | ||
AttributePlainEnumValue.presets.l(), | ||
AttributePlainEnumValue.presets.xl(), | ||
]), | ||
}; | ||
|
||
export default presets; |
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.
We just populate required attributes and this one is optional.