diff --git a/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php b/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php index 4513935..77fe5f9 100644 --- a/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php +++ b/web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php @@ -1298,6 +1298,7 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('type', $builder->fromValue('commerce_product')) // ->map('bundles', $builder->fromValue(['materiau'])) ->map('id', $builder->fromArgument('id')) + ->map('language', $builder->fromArgument('lang')) ); $registry->addFieldResolver('Query', 'products', @@ -1305,6 +1306,7 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('type', $builder->fromValue('commerce_product')) // ->map('bundles', $builder->fromValue(['materiau'])) ->map('ids', $builder->fromArgument('ids')) + ->map('language', $builder->fromArgument('lang')) ); $registry->addFieldResolver('Product', 'id', diff --git a/web/themes/custom/materiotheme/assets/dist/main.js b/web/themes/custom/materiotheme/assets/dist/main.js index aa09d2c..6c0a2e6 100644 --- a/web/themes/custom/materiotheme/assets/dist/main.js +++ b/web/themes/custom/materiotheme/assets/dist/main.js @@ -18,7 +18,7 @@ } ${_()} `;s.E.post("",{query:(0,c.S)(i)}).then((t=>{e("updateItem",t.data.data.searchresult)})).catch((e=>{console.warn("Issue with refreshItem",e),Promise.reject(e)}))}}},k={namespaced:!0,state:{contenttype:null,items:[],page:0,infiniteLoadingState:null},getters:{},mutations:{setItems(e,t){e.items=e.items.concat(t)},incrementPage(e){e.page+=1},setInfiniteState(e,t){e.infiniteLoadingState=t}},actions:{getItems:({dispatch:e,commit:t,state:n})=>f.Z.get(`/blabla_rest?_format=json&page=${n.page}`,{}).then((({data:e})=>{e.length?(t("setItems",e),n.infiniteLoadingState&&n.infiniteLoadingState.loaded()):n.infiniteLoadingState&&n.infiniteLoadingState.complete()})).catch((e=>{console.warn("Issue with blabla getitems",e),Promise.reject(e)})),nextPage({dispatch:e,commit:t,state:n},i){t("incrementPage"),t("setInfiniteState",i),e("getItems")},getItemIndex:({dispatch:e,commit:t,state:n},i)=>n.items.findIndex((e=>e.nid===i)),getPrevNextItems:({dispatch:e,commit:t,state:n},i)=>({prev:n.items[i-1],next:n.items[i+1]})}},S={namespaced:!0,state:{items:[],showrooms_by_tid:{}},getters:{},mutations:{setItems(e,t){e.items=e.items.concat(t),t.forEach(((t,n)=>{e.showrooms_by_tid[t.tid]=t}))}},actions:{getItems({dispatch:e,commit:t,state:n}){f.Z.get("/showrooms_rest?_format=json",{}).then((({data:e})=>{t("setItems",e)})).catch((e=>{console.warn("Issue with showrooms",e),Promise.reject(e)}))}}};var x=n(5277),T=n.n(x);const O={namespaced:!0,state:{products_ids:[],products:[]},getters:{},mutations:{setProductsIds(e,t){e.products_ids=t},setProducts(e,t){e.products=t}},actions:{getProducts({dispatch:e,commit:t,state:n}){e("loadProductsIds")},loadProductsIds({dispatch:e,commit:t,state:n}){f.Z.get("/pricing_rest?_format=json",{}).then((({data:n})=>{const i=[];for(let e=0;e{console.warn("Issue with pricing",e),Promise.reject(e)}))},loadProducts({dispatch:e,commit:t,state:n}){const i=u()`{ - products(ids: [${n.products_ids}]) { + products(ids: [${n.products_ids}], lang: "${drupalDecoupled.lang_code}") { ...ProductsFields } } diff --git a/web/themes/custom/materiotheme/assets/dist/main.js.gz b/web/themes/custom/materiotheme/assets/dist/main.js.gz index fbd1d53..c06381b 100644 Binary files a/web/themes/custom/materiotheme/assets/dist/main.js.gz and b/web/themes/custom/materiotheme/assets/dist/main.js.gz differ diff --git a/web/themes/custom/materiotheme/assets/dist/report.html b/web/themes/custom/materiotheme/assets/dist/report.html index 8d23bec..695ccab 100644 --- a/web/themes/custom/materiotheme/assets/dist/report.html +++ b/web/themes/custom/materiotheme/assets/dist/report.html @@ -3,7 +3,7 @@ - materio.com [2 Jun 2021 at 09:54] + materio.com [2 Jun 2021 at 10:40] diff --git a/web/themes/custom/materiotheme/vuejs/store/modules/pages.js b/web/themes/custom/materiotheme/vuejs/store/modules/pages.js index da19e52..1e720fb 100644 --- a/web/themes/custom/materiotheme/vuejs/store/modules/pages.js +++ b/web/themes/custom/materiotheme/vuejs/store/modules/pages.js @@ -50,7 +50,7 @@ export default { }, loadProducts ({ dispatch, commit, state }) { const ast = gql`{ - products(ids: [${state.products_ids}]) { + products(ids: [${state.products_ids}], lang: "${drupalDecoupled.lang_code}") { ...ProductsFields } }