diff --git a/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls b/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls index 6e8ab04a..e626faa3 100644 --- a/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls +++ b/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls @@ -70,6 +70,7 @@ type SearchResult { images: [Image] visuels: [Image] reference: String + samples: [Sample] } type Product { 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 5b43a766..02c39d65 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 @@ -342,6 +342,12 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('path', $builder->fromValue('field_reference.value')) ); + $registry->addFieldResolver('SearchResult', 'samples', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_samples')) + ); } // ___ _ diff --git a/web/themes/custom/materiotheme/assets/dist/main.js b/web/themes/custom/materiotheme/assets/dist/main.js index d54fc280..f10feced 100644 --- a/web/themes/custom/materiotheme/assets/dist/main.js +++ b/web/themes/custom/materiotheme/assets/dist/main.js @@ -1696,7 +1696,7 @@ eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"Fragme /*! runtime requirements: module */ /***/ ((module) => { -eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"SearchResultFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SearchResult\"}},\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"bundle\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"short_description\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reference\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"path\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardmedium_url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_hd_url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"visuels\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardmedium_url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_hd_url\"},\"arguments\":[],\"directives\":[]}]}}]}}],\"loc\":{\"start\":0,\"end\":254}};\n doc.loc.source = {\"body\":\"fragment SearchResultFields on SearchResult {\\n id\\n bundle\\n title\\n short_description\\n reference\\n path\\n images{\\n url\\n alt\\n style_cardmedium_url\\n style_hd_url\\n }\\n visuels{\\n url\\n alt\\n style_cardmedium_url\\n style_hd_url\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n module.exports = doc;\n \n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql?"); +eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"SearchResultFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SearchResult\"}},\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"bundle\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"short_description\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reference\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"path\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"images\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardmedium_url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_hd_url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"visuels\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alt\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_cardmedium_url\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"style_hd_url\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"samples\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"showroom\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"location\"},\"arguments\":[],\"directives\":[]}]}}]}}],\"loc\":{\"start\":0,\"end\":321}};\n doc.loc.source = {\"body\":\"fragment SearchResultFields on SearchResult {\\n id\\n bundle\\n title\\n short_description\\n reference\\n path\\n images{\\n url\\n alt\\n style_cardmedium_url\\n style_hd_url\\n }\\n visuels{\\n url\\n alt\\n style_cardmedium_url\\n style_hd_url\\n }\\n\\tsamples{\\n showroom{\\n name\\n id\\n }\\n location\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n module.exports = doc;\n \n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql?"); /***/ }), @@ -3246,7 +3246,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"article\", { staticClass: \"card search-card\" }, [\n _c(\n \"header\",\n {\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.openModalCard($event)\n }\n }\n },\n [\n _vm.isloggedin ? _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]) : _vm._e(),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.short_description))]),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.item.reference))\n ])\n : _vm._e()\n ]\n ),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: { \"data-src\": img.style_cardmedium_url, title: img.title }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.openModalCard($event)\n }\n }\n })\n ])\n }),\n 0\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"article\", { staticClass: \"card search-card\" }, [\n _c(\n \"header\",\n {\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.openModalCard($event)\n }\n }\n },\n [\n _vm.isloggedin ? _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]) : _vm._e(),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.short_description))]),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.item.reference))\n ])\n : _vm._e()\n ]\n ),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _vm.item.samples && _vm.item.samples.length\n ? _c(\"section\", { staticClass: \"tool samples\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-beaker-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Samples\")))\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.item.samples, function(sample) {\n return _c(\"li\", { key: sample.showroom.id }, [\n _c(\"span\", { staticClass: \"showroom\" }, [\n _vm._v(_vm._s(sample.showroom.name))\n ]),\n _vm._v(\": \" + _vm._s(sample.location) + \"\\n \")\n ])\n }),\n 0\n )\n ])\n ])\n : _vm._e()\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: { \"data-src\": img.style_cardmedium_url, title: img.title }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.openModalCard($event)\n }\n }\n })\n ])\n }),\n 0\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -3342,7 +3342,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.material || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"article\",\n { staticClass: \"card modal-card\" },\n [\n _c(\n \"section\",\n { staticClass: \"col col-right\" },\n [\n _c(\"header\", [\n _c(\"h1\", [_vm._v(_vm._s(_vm.material.title))]),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.material.short_description))]),\n _vm._v(\" \"),\n _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.material.reference))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool close\" }, [\n _c(\"span\", {\n staticClass: \"btn mdi mdi-close\",\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onCloseModalCard($event)\n }\n }\n })\n ]),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.My folders\")))\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"tool samples\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-beaker-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Samples\")))\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.material.samples, function(sample) {\n return _c(\"li\", { key: sample.showroom.id }, [\n _c(\"span\", { staticClass: \"showroom\" }, [\n _vm._v(_vm._s(sample.showroom.name))\n ]),\n _vm._v(\n \": \" + _vm._s(sample.location) + \"\\n \"\n )\n ])\n }),\n 0\n )\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.material.body) }\n }),\n _vm._v(\" \"),\n _c(\n \"vsa-list\",\n [\n _vm.material.linked_materials\n ? _c(\n \"vsa-item\",\n [\n _c(\"vsa-heading\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Linked materials\")))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"vsa-content\", [\n _c(\"section\", { staticClass: \"linked-materials\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.material.linked_materials, function(\n m\n ) {\n return _c(\n \"li\",\n { key: m.id },\n [\n _c(\"LinkedMaterialCard\", {\n attrs: { item: m }\n })\n ],\n 1\n )\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.material.manufacturer || _vm.material.distributor\n ? _c(\n \"vsa-item\",\n [\n _c(\"vsa-heading\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"default.Contact\")))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"vsa-content\", [\n _c(\"section\", { staticClass: \"industriels\" }, [\n _vm.material.distributor\n ? _c(\"section\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(\n _vm._s(_vm.$t(\"materio.Distributor\"))\n )\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.material.distributor, function(\n distrib\n ) {\n return _c(\"li\", { key: distrib.id }, [\n _c(\"h2\", [\n _vm._v(_vm._s(distrib.name))\n ]),\n _vm._v(\" \"),\n distrib.website\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n target: \"_blank\",\n href: distrib.website.url\n }\n },\n [\n _vm._v(\n _vm._s(\n distrib.website.url\n )\n )\n ]\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n distrib.email\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n href:\n \"mailto:\" +\n distrib.email\n }\n },\n [\n _vm._v(\n _vm._s(distrib.email)\n )\n ]\n )\n ])\n : _vm._e()\n ])\n }),\n 0\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _vm.material.manufacturer\n ? _c(\"section\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(\n _vm._s(_vm.$t(\"materio.Manufacturer\"))\n )\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(\n _vm.material.manufacturer,\n function(manu) {\n return _c(\"li\", { key: manu.id }, [\n _c(\"h2\", [\n _vm._v(_vm._s(manu.name))\n ]),\n _vm._v(\" \"),\n manu.website\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n target: \"_blank\",\n href: manu.website.url\n }\n },\n [\n _vm._v(\n _vm._s(manu.website.url)\n )\n ]\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n manu.email\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n href:\n \"mailto:\" + manu.email\n }\n },\n [_vm._v(_vm._s(manu.email))]\n )\n ])\n : _vm._e()\n ])\n }\n ),\n 0\n )\n ])\n : _vm._e()\n ])\n ])\n ],\n 1\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.material.attachments && _vm.material.attachments.length\n ? _c(\n \"vsa-item\",\n [\n _c(\"vsa-heading\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Attachments\")))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"vsa-content\", [\n _c(\"section\", { staticClass: \"attachments\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.material.attachments, function(\n attachmt\n ) {\n return _c(\"li\", { key: attachmt.file.fid }, [\n _c(\n \"a\",\n {\n attrs: {\n target: \"_blank\",\n href: attachmt.file.url\n }\n },\n [\n _vm._v(\n _vm._s(attachmt.file.filename) + \" \"\n ),\n _c(\"span\", [\n _vm._v(\n \"(\" +\n _vm._s(\n _vm.prettyFileSize(\n attachmt.file.filesize\n )\n ) +\n \")\"\n )\n ])\n ]\n ),\n _vm._v(\" \"),\n attachmt.description\n ? _c(\"p\", {\n staticClass: \"description\",\n domProps: {\n innerHTML: _vm._s(\n attachmt.description\n )\n }\n })\n : _vm._e()\n ])\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n : _vm._e()\n ],\n 1\n )\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"col col-left images\"\n },\n _vm._l(_vm.material.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: {\n \"data-src\": img.style_cardfull.url,\n title: img.title\n }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n _vm.lightbox_index = index\n }\n }\n })\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.material.images,\n index: _vm.lightbox_index,\n srcName: \"url\",\n loop: true\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n })\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.material || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"article\",\n { staticClass: \"card modal-card\" },\n [\n _c(\n \"section\",\n { staticClass: \"col col-right\" },\n [\n _c(\"header\", [\n _c(\"h1\", [_vm._v(_vm._s(_vm.material.title))]),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.material.short_description))]),\n _vm._v(\" \"),\n _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.material.reference))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool close\" }, [\n _c(\"span\", {\n staticClass: \"btn mdi mdi-close\",\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onCloseModalCard($event)\n }\n }\n })\n ]),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.My folders\")))\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _vm.item.samples && _vm.item.samples.length\n ? _c(\"section\", { staticClass: \"tool samples\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-beaker-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Samples\")))\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.material.samples, function(sample) {\n return _c(\"li\", { key: sample.showroom.id }, [\n _c(\"span\", { staticClass: \"showroom\" }, [\n _vm._v(_vm._s(sample.showroom.name))\n ]),\n _vm._v(\n \": \" +\n _vm._s(sample.location) +\n \"\\n \"\n )\n ])\n }),\n 0\n )\n ])\n ])\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.material.body) }\n }),\n _vm._v(\" \"),\n _c(\n \"vsa-list\",\n [\n _vm.material.linked_materials\n ? _c(\n \"vsa-item\",\n [\n _c(\"vsa-heading\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Linked materials\")))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"vsa-content\", [\n _c(\"section\", { staticClass: \"linked-materials\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.material.linked_materials, function(\n m\n ) {\n return _c(\n \"li\",\n { key: m.id },\n [\n _c(\"LinkedMaterialCard\", {\n attrs: { item: m }\n })\n ],\n 1\n )\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.material.manufacturer || _vm.material.distributor\n ? _c(\n \"vsa-item\",\n [\n _c(\"vsa-heading\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"default.Contact\")))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"vsa-content\", [\n _c(\"section\", { staticClass: \"industriels\" }, [\n _vm.material.distributor\n ? _c(\"section\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(\n _vm._s(_vm.$t(\"materio.Distributor\"))\n )\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(_vm.material.distributor, function(\n distrib\n ) {\n return _c(\"li\", { key: distrib.id }, [\n _c(\"h2\", [\n _vm._v(_vm._s(distrib.name))\n ]),\n _vm._v(\" \"),\n distrib.website\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n target: \"_blank\",\n href: distrib.website.url\n }\n },\n [\n _vm._v(\n _vm._s(\n distrib.website.url\n )\n )\n ]\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n distrib.email\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n href:\n \"mailto:\" +\n distrib.email\n }\n },\n [\n _vm._v(\n _vm._s(distrib.email)\n )\n ]\n )\n ])\n : _vm._e()\n ])\n }),\n 0\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _vm.material.manufacturer\n ? _c(\"section\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(\n _vm._s(_vm.$t(\"materio.Manufacturer\"))\n )\n ]),\n _vm._v(\" \"),\n _c(\n \"ul\",\n _vm._l(\n _vm.material.manufacturer,\n function(manu) {\n return _c(\"li\", { key: manu.id }, [\n _c(\"h2\", [\n _vm._v(_vm._s(manu.name))\n ]),\n _vm._v(\" \"),\n manu.website\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n target: \"_blank\",\n href: manu.website.url\n }\n },\n [\n _vm._v(\n _vm._s(manu.website.url)\n )\n ]\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n manu.email\n ? _c(\"p\", [\n _c(\n \"a\",\n {\n attrs: {\n href:\n \"mailto:\" + manu.email\n }\n },\n [_vm._v(_vm._s(manu.email))]\n )\n ])\n : _vm._e()\n ])\n }\n ),\n 0\n )\n ])\n : _vm._e()\n ])\n ])\n ],\n 1\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.material.attachments && _vm.material.attachments.length\n ? _c(\n \"vsa-item\",\n [\n _c(\"vsa-heading\", [\n _c(\"span\", { staticClass: \"label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Attachments\")))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"vsa-content\", [\n _c(\"section\", { staticClass: \"attachments\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.material.attachments, function(\n attachmt\n ) {\n return _c(\"li\", { key: attachmt.file.fid }, [\n _c(\n \"a\",\n {\n attrs: {\n target: \"_blank\",\n href: attachmt.file.url\n }\n },\n [\n _vm._v(\n _vm._s(attachmt.file.filename) + \" \"\n ),\n _c(\"span\", [\n _vm._v(\n \"(\" +\n _vm._s(\n _vm.prettyFileSize(\n attachmt.file.filesize\n )\n ) +\n \")\"\n )\n ])\n ]\n ),\n _vm._v(\" \"),\n attachmt.description\n ? _c(\"p\", {\n staticClass: \"description\",\n domProps: {\n innerHTML: _vm._s(\n attachmt.description\n )\n }\n })\n : _vm._e()\n ])\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n : _vm._e()\n ],\n 1\n )\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"col col-left images\"\n },\n _vm._l(_vm.material.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: {\n \"data-src\": img.style_cardfull.url,\n title: img.title\n }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n _vm.lightbox_index = index\n }\n }\n })\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.material.images,\n index: _vm.lightbox_index,\n srcName: \"url\",\n loop: true\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n })\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), diff --git a/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql b/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql index 57c3e67b..d5b52a29 100644 --- a/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql +++ b/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql @@ -16,5 +16,12 @@ fragment SearchResultFields on SearchResult { alt style_cardmedium_url style_hd_url + } + samples{ + showroom{ + name + id + } + location } } diff --git a/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue b/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue index 5acbccab..3c58f208 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Content/Card.vue @@ -27,6 +27,20 @@ + + + + {{ $t("materio.Samples") }} + + + {{ sample.showroom.name }}: {{ sample.location }} + + + + - + {{ $t("materio.Samples") }}