-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
19 additions
and
13 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
File renamed without changes.
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,14 +1,15 @@ | ||
import { appKey } from '../enonic-connection-config'; | ||
|
||
// Example: | ||
// EXAMPLE: | ||
// import MyPage from '../components/pagetypes/MyPage; | ||
|
||
// Content types mapped to top-level react components that render that content type. | ||
// XP content types ('type' from the second data response in fetchContent.ts) mapped to top-level react components that render that content type. | ||
// If content type is not found here, falls back to the default page renderer in pages/Default.tsx | ||
export const pageSelector = { | ||
|
||
// Examples: | ||
//'my-hardcoded-appname:my-content-type': MyPage, | ||
//[`${appKey}:my-content-type`]: MyPage, | ||
// EXAMPLES: | ||
// 'my-hardcoded-appname:my-content-type': MyPage, | ||
// [`${appKey}:my-content-type`]: MyPage, | ||
// 'base:folder': MyFolderPage | ||
// ...etc | ||
}; | ||
|
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,24 +1,29 @@ | ||
import { appKey } from '../enonic-connection-config'; | ||
|
||
// Example: | ||
// EXAMPLE: | ||
// import MY_IMPORTED_QUERY from '../shared/data/queries/getMyContentType'; | ||
|
||
// Content types mapped to full guillotine query strings. | ||
// XP content types ('type' from the first meta response in fetchContent.ts) mapped to full guillotine query strings. | ||
// If type is not found here, a LOW-PERFORMING default query is selected from _getDefaultData.ts! | ||
export const querySelector = { | ||
|
||
// Examples: | ||
// EXAMPLES: | ||
// 'my.harcoded.appname:my-content-type': '{ guillotine { get { hardcoded custom query string etc } } }' | ||
// [`${appKey}:my-content-type`]: MY_IMPORTED_QUERY, | ||
// 'base:folder`: MY_FOLDER_QUERY | ||
// ...etc | ||
}; | ||
|
||
|
||
|
||
// Content types mapped to a getVariables function, that will return appropriate variables for the placeholders in the corresponding query: idOrPath => variablesObject | ||
// XP content types ('type' from the first meta response in fetchContent.ts) mapped to a getVariables function, | ||
// which will return appropriate variables for the placeholders in the corresponding query: idOrPath => variablesObject | ||
// idOrPath (the _id or _path of a target content item) is usually used in queries, so that's the argument the function will be called with. | ||
// Whenever the selected query only uses the idOrPath placeholder (including the default query), nothing needs to be added here since the default function is enough: idOrPath => ({idOrPath: idOrPath}) | ||
export const variablesGetterSelector = { | ||
|
||
// EXAMPLE: | ||
// 'my.example.app:data-type': (idOrPath) => ({ idOrPath: idOrPath, otherPlaceHolder: otherValue }) | ||
// EXAMPLES: | ||
// 'my.harcoded.appname:content-type': (idOrPath) => ({ idOrPath: idOrPath, otherParameter: otherValue }), // If MY_IMPORTED_QUERY uses a $otherParameter parameter | ||
//'base:folder': (idOrPath) => ({ idOrPath: idOrPath, maxChildren: 1000 }) // If MY_FOLDER_QUERY uses a $maxChildren parameter | ||
// ...etc | ||
}; |