update to agility/next

This commit is contained in:
Joel Varty
2021-06-09 23:17:19 -04:00
parent 17f458b45b
commit e836a5950f
26 changed files with 26612 additions and 6639 deletions

View File

@@ -5,7 +5,7 @@ import rangeMap from '@lib/range-map'
const nonNullable = (v: any) => v
const BestsellingProductsInit = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
const getCustomInitialProps = async function ({ }):Promise<{bestSelling:any}> {
//TODO: pass the locale and preview mode as props...
@@ -52,4 +52,4 @@ const BestsellingProductsInit = async function ({ item, agility, languageCode, c
}
export default BestsellingProductsInit
export default {getCustomInitialProps}

View File

@@ -7,7 +7,7 @@ import rangeMap from '@lib/range-map'
const nonNullable = (v: any) => v
const FeaturedProductsInit = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
const getCustomInitialProps = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
//TODO: pass the locale and preview mode as props...
@@ -31,4 +31,4 @@ const FeaturedProductsInit = async function ({ item, agility, languageCode, chan
}
export default FeaturedProductsInit
export default { getCustomInitialProps }

View File

@@ -8,7 +8,7 @@ import rangeMap from '@lib/range-map'
const nonNullable = (v: any) => v
const HomeAllProductsGridData = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
const getCustomInitialProps = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
//TODO: pass the locale and preview mode as props...
const locale = "en-US"
@@ -35,4 +35,4 @@ const HomeAllProductsGridData = async function ({ item, agility, languageCode, c
}
export default HomeAllProductsGridData
export default { getCustomInitialProps }

View File

@@ -1,7 +1,8 @@
import { getConfig } from '@framework/api'
import getSiteInfo from '@framework/api/operations/get-site-info'
const ProductSearchData = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
const getCustomInitialProps = async ({ agility, channelName, languageCode }:any) => {
//TODO: pass the locale and preview mode as props...
const locale = "en-US"
@@ -18,4 +19,6 @@ const ProductSearchData = async function ({ item, agility, languageCode, channel
}
export default ProductSearchData
export default {
getCustomInitialProps
}

View File

@@ -14,10 +14,8 @@ const allModules:any =[
* Find the data method for a module by module reference name.
* @param moduleName
*/
const getInitMethod = (moduleName:string):any => {
export const getModuleData = (moduleName:string):any => {
const obj = allModules.find((m: { name: string }) => m.name.toLowerCase() === moduleName.toLowerCase())
if (!obj) return null
return obj.init
}
export default getInitMethod