This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(composables): handle the includes parameter within the page reso…
- Loading branch information
Showing
8 changed files
with
226 additions
and
38 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
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
59 changes: 59 additions & 0 deletions
59
packages/composables/src/internalHelpers/includesParameter.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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* A collection of performance set of includes parameters | ||
*/ | ||
|
||
const PRODUCT = [ | ||
"name", | ||
"ratingAverage", | ||
"calculatedPrice", | ||
"calculatedPrices", | ||
"cover", | ||
"id", | ||
"translated", | ||
"options", | ||
]; | ||
const PRODUCT_MEDIA = ["media"]; | ||
const PRODUCT_GROUP = ["id", "name", "options", "translated"]; | ||
const PRODUCT_GROUP_OPTION = ["name", "id", "group", "translated"]; | ||
const PRODUCT_CALCULATED_PRICE = ["unitPrice"]; | ||
const MEDIA = ["url"]; | ||
const CMS_PAGE = ["id", "name", "sections", "type", "config"]; | ||
const CMS_PAGE_SECTION = [ | ||
"id", | ||
"backgroundMedia", | ||
"blocks", | ||
"type", | ||
"sizingMode", | ||
]; | ||
const CMS_PAGE_BLOCK = [ | ||
"slots", | ||
"type", | ||
"id", | ||
"backgroundMedia", | ||
"sectionPosition", | ||
]; | ||
const CMS_PAGE_SLOT = [ | ||
"id", | ||
"type", | ||
"slot", | ||
"blockId", | ||
"data", | ||
"backgroundMediaMode", | ||
"backgroundMedia", | ||
]; | ||
|
||
/** | ||
* Parameters for page resolver - aligned with getPage method of @shopware-pwa/shopware-6-client | ||
*/ | ||
export const getPageIncludes = () => ({ | ||
cms_page_slot: CMS_PAGE_SLOT, | ||
cms_page_block: CMS_PAGE_BLOCK, | ||
cms_page_section: CMS_PAGE_SECTION, | ||
cms_page: CMS_PAGE, | ||
product: PRODUCT, | ||
product_media: PRODUCT_MEDIA, | ||
media: MEDIA, | ||
calculated_price: PRODUCT_CALCULATED_PRICE, | ||
product_group_option: PRODUCT_GROUP_OPTION, | ||
product_group: PRODUCT_GROUP, | ||
}); |
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
9eed262
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.
Successfully deployed to following URLs: