-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some minor issues with different models (#627)
* refactor: address several issues related to product models * refactor(product): adjust product-data typescript type * chore: changesets added * refactor(product): remove unnecesary type property
- Loading branch information
1 parent
5e4d863
commit 29ab14e
Showing
13 changed files
with
77 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@commercetools-test-data/store': patch | ||
--- | ||
|
||
Fix the `Store` model generator as it was populating the `countries` attribute with an invalid value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'@commercetools-test-data/product': patch | ||
--- | ||
|
||
Fixed `ProductVariant` model presets as they were using invalid values to populate the `attributes` property. | ||
|
||
Fixed a couple of issues with the `Product` model: | ||
|
||
- `searchKeywords` attribute was initialized as `null` where it needs to be an empty array. | ||
- `masterVariant` attribute was not set as _buildable_ in the graphql transformer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@commercetools-test-data/category': patch | ||
--- | ||
|
||
Fixed the `Category` graphql transformer as it was not building the `name` and `description` properties which both are nested models of type `LocalizedString`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
models/product/src/product-variant/presets/boring-generic-milk-master-variant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
import * as Attribute from '../../attribute'; | ||
import ProductVariant from '../builder'; | ||
import { TProductVariantBuilder } from '../types'; | ||
|
||
const boringGenericMilkMasterVariant = (): TProductVariantBuilder => | ||
ProductVariant() | ||
.key('boring-generic-milk-master-variant-key') | ||
.sku('boring-generic-milk-master-variant-sku') | ||
.attributes([ | ||
{ | ||
name: 'cow-name', | ||
value: 'unknown', | ||
}, | ||
]) | ||
.attributes([Attribute.random().name('cow-name').value('unknown')]) | ||
.id(1); | ||
|
||
export default boringGenericMilkMasterVariant; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters