diff --git a/config/sync/field.field.node.thematique.field_visuel.yml b/config/sync/field.field.node.thematique.field_visuel.yml index b5e6c32..b9e27e7 100644 --- a/config/sync/field.field.node.thematique.field_visuel.yml +++ b/config/sync/field.field.node.thematique.field_visuel.yml @@ -31,8 +31,8 @@ settings: max_resolution: '' min_resolution: '' alt_field: true - alt_field_required: true - title_field: false + alt_field_required: false + title_field: true title_field_required: false default_image: uuid: '' 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 43c3b70..b8f148e 100644 --- a/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls +++ b/web/modules/custom/materio_graphql/graphql/materio_extension.base.graphqls @@ -40,6 +40,17 @@ type Article { memo: String } +type SearchResult { + id: Int! + uuid: String! + title: String! + bundle: String + short_description: String + images: [Image] + visuels: [Image] + reference: String +} + type Sample { showroom: Showroom location: String diff --git a/web/modules/custom/materio_graphql/graphql/materio_extension.extension.graphqls b/web/modules/custom/materio_graphql/graphql/materio_extension.extension.graphqls index 8339b3a..4cc081d 100644 --- a/web/modules/custom/materio_graphql/graphql/materio_extension.extension.graphqls +++ b/web/modules/custom/materio_graphql/graphql/materio_extension.extension.graphqls @@ -6,6 +6,10 @@ extend type Query { materiaux(ids: [Int]): [Materiau] } +extend type Query { + searchresults(ids: [Int]): [SearchResult] +} + extend type Query { article(id: Int!): Article } 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 2e7f19e..661bd77 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 @@ -26,6 +26,8 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { $this->addMateriau($registry, $builder); + $this->addSearchResult($registry, $builder); + $this->addSample($registry, $builder); $this->addArticle($registry, $builder); @@ -213,11 +215,72 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase { ); } - // ___ _ - // / __| __ _ _ __ _ __| |___ - // \__ \/ _` | ' \| '_ \ / -_) - // |___/\__,_|_|_|_| .__/_\___| - // |_| + // ___ _ ___ _ _ + // / __| ___ __ _ _ _ __| |_ | _ \___ ____ _| | |_ + // \__ \/ -_) _` | '_/ _| ' \| / -_|_-< || | | _| + // |___/\___\__,_|_| \__|_||_|_|_\___/__/\_,_|_|\__| + protected function addSearchResult(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + + $registry->addFieldResolver('Query', 'searchresults', + $builder->produce('entity_load_multiple') + ->map('type', $builder->fromValue('node')) + ->map('ids', $builder->fromArgument('ids')) + ); + + $registry->addFieldResolver('SearchResult', 'id', + $builder->produce('entity_id') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('SearchResult', 'bundle', + $builder->produce('entity_bundle') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('SearchResult', 'uuid', + $builder->produce('entity_uuid') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('SearchResult', 'title', + $builder->compose( + $builder->produce('entity_label') + ->map('entity', $builder->fromParent()) + )); + + $registry->addFieldResolver('SearchResult', 'short_description', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_short_description.value')) + ); + + $registry->addFieldResolver('SearchResult', 'images', + $builder->produce('entity_reference') + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_materiau_images')) + ); + + $registry->addFieldResolver('SearchResult', 'visuels', + $builder->produce('entity_reference') + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_visuel')) + ); + + $registry->addFieldResolver('SearchResult', 'reference', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_reference.value')) + ); + + } + + // ___ _ + // / __| __ _ _ __ _ __| |___ + // \__ \/ _` | ' \| '_ \ / -_) + // |___/\__,_|_|_|_| .__/_\___| + // |_| protected function addSample(ResolverRegistryInterface $registry, ResolverBuilder $builder) { $registry->addFieldResolver('Sample', 'showroom', $builder->callback(function($parent, $args){ diff --git a/web/themes/custom/materiotheme/assets/dist/main.css b/web/themes/custom/materiotheme/assets/dist/main.css index 827f691..2b90456 100644 --- a/web/themes/custom/materiotheme/assets/dist/main.css +++ b/web/themes/custom/materiotheme/assets/dist/main.css @@ -1688,6 +1688,8 @@ article.card { font-size: 0.693em; font-weight: 300; line-height: 1; } + article.card.card-thematique header { + background-color: rgba(105, 205, 207, 0.9); } article.card nav.tools { position: absolute; top: 0; diff --git a/web/themes/custom/materiotheme/assets/dist/main.js b/web/themes/custom/materiotheme/assets/dist/main.js index ac8d4f9..9b324c1 100644 --- a/web/themes/custom/materiotheme/assets/dist/main.js +++ b/web/themes/custom/materiotheme/assets/dist/main.js @@ -925,6 +925,22 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), +/***/ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js&": +/*!*****************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js& ***! + \*****************************************************************************************************************************************************************************************************************/ +/*! flagged exports */ +/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_exports__, __webpack_require__ */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nvar _cardMixins = _interopRequireDefault(__webpack_require__(/*! vuejs/components/cardMixins */ \"./web/themes/custom/materiotheme/vuejs/components/cardMixins.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n// import ModalCard from 'vuejs/components/Content/ModalCard'\nvar _default = {\n name: \"Card\",\n props: ['item'],\n mixins: [_cardMixins.default],\n // components: {\n // ModalCard\n // },\n data: function data() {\n return {\n blanksrc: \"\".concat(drupalSettings.path.themePath, \"/assets/img/blank.gif\"),\n // loadingFlag: false,\n lightbox_index: null\n };\n },\n // computed: {\n // ...mapState({\n // flagcolls: state => state.User.flagcolls\n // })\n // },\n methods: {\n // ...mapActions({\n // flagUnflag: 'User/flagUnflag'\n // }),\n // flagIsActive(collid) {\n // // console.log(\"Card flagIsActive\",\n // // this.item.id,\n // // this.flagcolls[collid].items,\n // // this.flagcolls[collid].items.indexOf(this.item.id)\n // // );\n // // console.log(this.flagcolls[collid].items_uuids);\n // // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;\n // return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;\n // },\n // flagIsLoading(collid) {\n // // console.log(this.item.uuid);\n // // console.log(this.flagcolls[collid].items_uuids);\n // return collid === this.loadingFlag;\n // },\n // onFlagActionCard (e) {\n // console.log(\"Card onFlagActionCard\", e, this.item);\n // if (!this.loadingFlag) {\n // let collid = e.target.getAttribute('collid');\n // let isActive = this.flagIsActive(collid);\n // let action = isActive ? 'unflag' : 'flag';\n // // console.log('collid', collid);\n // // console.log(\"this.item\", this.item);\n // this.loadingFlag = collid;\n // this.flagUnflag({ action: action, id: this.item.id, collid: collid})\n // .then(data => {\n // console.log(\"onFlagActionCard then\", data);\n // this.loadingFlag = false;\n // })\n // }\n // },\n openThematique: function openThematique(e) {\n console.log('openThematique', e); // this.$modal.show(\n // ModalCard,\n // { item: this.item },\n // {\n // draggable: true,\n // width: '850px',\n // height: '610px'\n // }\n // )\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); + +/***/ }), + /***/ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=script&lang=js&": /*!**************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=script&lang=js& ***! @@ -1129,7 +1145,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _Card = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/Card */ \"./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Base\",\n data: function data() {\n return {\n pagetitle: \"Base\" // searchinfos: null\n\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n items: function items(state) {\n return state.Search.items;\n },\n searchinfos: function searchinfos(state) {\n return state.Search.infos;\n },\n count: function count(state) {\n return state.Search.count;\n },\n noresults: function noresults(state) {\n return state.Search.noresults;\n },\n limit: function limit(state) {\n return state.Search.limit;\n }\n })),\n methods: _objectSpread({}, (0, _vuex.mapActions)({\n newSearch: 'Search/newSearch',\n nextPage: 'Search/nextPage'\n })),\n created: function created() {\n // at first page load or first route entering launch a search if params exists in url query\n console.log('Base created() location', window.location);\n var params = new URLSearchParams(window.location.search);\n\n if (params.has('keys') || params.has('term')) {\n this.$store.commit('Search/setKeys', params.get('keys'));\n this.$store.commit('Search/setTerm', params.get('term'));\n this.pagetitle = params.get('keys');\n this.newSearch();\n }\n },\n beforeRouteUpdate: function beforeRouteUpdate(to, from, next) {\n // when query change launch a new search\n console.log('Base beforeRouteUpdate', to, from, next);\n this.$store.commit('Search/setKeys', to.query.keys);\n this.$store.commit('Search/setTerm', to.query.term);\n this.pagetitle = to.query.keys;\n this.newSearch();\n next();\n },\n components: {\n Card: _Card.default\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _Card = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/Card */ \"./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue\"));\n\nvar _CardThematique = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/CardThematique */ \"./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Base\",\n data: function data() {\n return {\n pagetitle: \"Base\" // searchinfos: null\n\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n items: function items(state) {\n return state.Search.items;\n },\n searchinfos: function searchinfos(state) {\n return state.Search.infos;\n },\n count: function count(state) {\n return state.Search.count;\n },\n noresults: function noresults(state) {\n return state.Search.noresults;\n },\n limit: function limit(state) {\n return state.Search.limit;\n }\n })),\n methods: _objectSpread({}, (0, _vuex.mapActions)({\n newSearch: 'Search/newSearch',\n nextPage: 'Search/nextPage'\n })),\n created: function created() {\n // at first page load or first route entering launch a search if params exists in url query\n console.log('Base created() location', window.location);\n var params = new URLSearchParams(window.location.search);\n\n if (params.has('keys') || params.has('term')) {\n this.$store.commit('Search/setKeys', params.get('keys'));\n this.$store.commit('Search/setTerm', params.get('term'));\n this.pagetitle = params.get('keys');\n this.newSearch();\n }\n },\n beforeRouteUpdate: function beforeRouteUpdate(to, from, next) {\n // when query change launch a new search\n console.log('Base beforeRouteUpdate', to, from, next);\n this.$store.commit('Search/setKeys', to.query.keys);\n this.$store.commit('Search/setTerm', to.query.term);\n this.pagetitle = to.query.keys;\n this.newSearch();\n next();\n },\n components: {\n Card: _Card.default,\n CardThematique: _CardThematique.default\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -1491,7 +1507,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _maAxios = __webpack_require__(/*! vuejs/api/ma-axios */ \"./web/themes/custom/materiotheme/vuejs/api/ma-axios.js\");\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.js\"));\n\nvar _materiausearchFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/materiausearch.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/materiausearch.fragment.gql\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// import { REST } from 'vuejs/api/rest-axios'\n// import { JSONAPI } from 'vuejs/api/json-axios'\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n keys: '',\n term: '',\n uuids: [],\n items: [],\n offset: 0,\n limit: 15,\n infos: null,\n count: 0,\n noresults: false,\n // infinteState will come from vue-infinite-loading plugin\n // implemented in vuejs/components/Content/Base.vue\n infiniteLoadingState: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setUuids: function setUuids(state, uuids) {\n state.uuids = state.uuids.concat(uuids);\n },\n resetUuids: function resetUuids(state) {\n state.uuids = [];\n },\n setMaterials: function setMaterials(state, items) {\n state.items = state.items.concat(items);\n },\n resetItems: function resetItems(state) {\n state.items = [];\n },\n setKeys: function setKeys(state, keys) {\n state.keys = keys;\n },\n setTerm: function setTerm(state, term) {\n state.term = term;\n },\n setInfos: function setInfos(state, infos) {\n state.infos = infos;\n },\n setCount: function setCount(state, count) {\n state.count = count;\n },\n resetCount: function resetCount(state, count) {\n state.count = false;\n },\n setNoresults: function setNoresults(state) {\n state.noresults = true;\n },\n resetNoresults: function resetNoresults(state) {\n state.noresults = false;\n },\n resetOffset: function resetOffset(state) {\n state.offset = 0;\n },\n incrementOffset: function incrementOffset(state) {\n state.offset += state.limit;\n },\n setInfiniteState: function setInfiniteState(state, infiniteLoadingstate) {\n state.infiniteLoadingState = infiniteLoadingstate;\n }\n },\n // actions\n actions: {\n newSearch: function newSearch(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n console.log('Search newSearch');\n commit('resetUuids');\n commit('resetItems');\n commit('resetCount');\n commit('resetNoresults');\n commit('resetOffset');\n this.commit('Common/setPagetitle', state.keys);\n dispatch('getResults');\n },\n nextPage: function nextPage(_ref2, $infiniteLoadingstate) {\n var dispatch = _ref2.dispatch,\n commit = _ref2.commit,\n state = _ref2.state;\n console.log('Search nextPage', $infiniteLoadingstate);\n commit('incrementOffset');\n commit('setInfiniteState', $infiniteLoadingstate);\n dispatch('getResults');\n },\n getResults: function getResults(_ref3) {\n var dispatch = _ref3.dispatch,\n commit = _ref3.commit,\n state = _ref3.state;\n var params = {\n keys: state.keys,\n term: state.term,\n offset: state.offset,\n limit: state.limit\n }; // console.log('Search getResults params', params);\n\n var q = _querystringEs.default.stringify(params);\n\n return _maAxios.MA.get('/materio_sapi/getresults?' + q).then(function (_ref4) {\n var data = _ref4.data;\n console.log('search MA getresults data', data); // commit('setItems', data.items)\n\n commit('setInfos', data.infos);\n commit('setCount', data.count);\n\n if (data.count) {\n commit('setUuids', data.uuids); // loadMaterials is on mixins\n // https://github.com/huybuidac/vuex-extensions\n\n dispatch('loadMaterialsGQL', {\n ids: data.nids,\n gqlfragment: _materiausearchFragment.default,\n callBack: 'loadMaterialsCallBack'\n }); // dispatch('loadMaterials', {\n // uuids: data.uuids,\n // imgStyle: ['card_medium', 'card_full'],\n // callBack: 'loadMaterialsCallBack'\n // })\n } else {\n commit('setNoresults');\n }\n }).catch(function (error) {\n console.warn('Issue with getResults', error);\n Promise.reject(error);\n });\n },\n loadMaterialsCallBack: function loadMaterialsCallBack(_ref5, _ref6) {\n var commit = _ref5.commit,\n state = _ref5.state;\n var items = _ref6.items,\n callBackArgs = _ref6.callBackArgs;\n console.log('search loadMaterialsCallBack', items);\n commit('setMaterials', items);\n\n if (state.infiniteLoadingState) {\n if (state.offset + state.limit > state.count) {\n console.log('Search infinite completed'); // tell to vue-infinite-loading plugin that there si no new page\n\n state.infiniteLoadingState.complete();\n } else {\n console.log('Search infinite loaded'); // tell to vue-infinite-loading plugin that newpage is loaded\n\n state.infiniteLoadingState.loaded();\n }\n }\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/search.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _maAxios = __webpack_require__(/*! vuejs/api/ma-axios */ \"./web/themes/custom/materiotheme/vuejs/api/ma-axios.js\");\n\nvar _querystringEs = _interopRequireDefault(__webpack_require__(/*! querystring-es3 */ \"./node_modules/querystring-es3/index.js\"));\n\nvar _graphqlAxios = __webpack_require__(/*! vuejs/api/graphql-axios */ \"./web/themes/custom/materiotheme/vuejs/api/graphql-axios.js\");\n\nvar _printer = __webpack_require__(/*! graphql/language/printer */ \"./node_modules/graphql/language/printer.js\");\n\nvar _graphqlTag = _interopRequireDefault(__webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\"));\n\nvar _searchresultsFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/searchresults.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n searchresults(ids: [\", \"]) {\\n ...SearchResultFields\\n }\\n }\\n \", \"\\n \"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n keys: '',\n term: '',\n uuids: [],\n items: [],\n offset: 0,\n limit: 15,\n infos: null,\n count: 0,\n noresults: false,\n // infinteState will come from vue-infinite-loading plugin\n // implemented in vuejs/components/Content/Base.vue\n infiniteLoadingState: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setUuids: function setUuids(state, uuids) {\n state.uuids = state.uuids.concat(uuids);\n },\n resetUuids: function resetUuids(state) {\n state.uuids = [];\n },\n setResults: function setResults(state, items) {\n state.items = state.items.concat(items);\n },\n resetItems: function resetItems(state) {\n state.items = [];\n },\n setKeys: function setKeys(state, keys) {\n state.keys = keys;\n },\n setTerm: function setTerm(state, term) {\n state.term = term;\n },\n setInfos: function setInfos(state, infos) {\n state.infos = infos;\n },\n setCount: function setCount(state, count) {\n state.count = count;\n },\n resetCount: function resetCount(state, count) {\n state.count = false;\n },\n setNoresults: function setNoresults(state) {\n state.noresults = true;\n },\n resetNoresults: function resetNoresults(state) {\n state.noresults = false;\n },\n resetOffset: function resetOffset(state) {\n state.offset = 0;\n },\n incrementOffset: function incrementOffset(state) {\n state.offset += state.limit;\n },\n setInfiniteState: function setInfiniteState(state, infiniteLoadingstate) {\n state.infiniteLoadingState = infiniteLoadingstate;\n }\n },\n // actions\n actions: {\n newSearch: function newSearch(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n console.log('Search newSearch');\n commit('resetUuids');\n commit('resetItems');\n commit('resetCount');\n commit('resetNoresults');\n commit('resetOffset');\n this.commit('Common/setPagetitle', state.keys);\n dispatch('getResults');\n },\n nextPage: function nextPage(_ref2, $infiniteLoadingstate) {\n var dispatch = _ref2.dispatch,\n commit = _ref2.commit,\n state = _ref2.state;\n console.log('Search nextPage', $infiniteLoadingstate);\n commit('incrementOffset');\n commit('setInfiniteState', $infiniteLoadingstate);\n dispatch('getResults');\n },\n getResults: function getResults(_ref3) {\n var dispatch = _ref3.dispatch,\n commit = _ref3.commit,\n state = _ref3.state;\n var params = {\n keys: state.keys,\n term: state.term,\n offset: state.offset,\n limit: state.limit\n }; // console.log('Search getResults params', params);\n\n var q = _querystringEs.default.stringify(params);\n\n return _maAxios.MA.get('/materio_sapi/getresults?' + q).then(function (_ref4) {\n var data = _ref4.data;\n console.log('search MA getresults data', data); // commit('setItems', data.items)\n\n commit('setInfos', data.infos);\n commit('setCount', data.count);\n\n if (data.count) {\n commit('setUuids', data.uuids); // loadMaterials is on mixins\n // https://github.com/huybuidac/vuex-extensions\n // dispatch('loadMaterialsGQL', {\n // ids: data.nids,\n // gqlfragment: materiauGQL,\n // callBack: 'loadSearchResultsCallBack'\n // })\n\n var ast = (0, _graphqlTag.default)(_templateObject(), data.nids, _searchresultsFragment.default);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (resp) {\n console.log('loadSearchResultsGQL resp', resp);\n dispatch(\"loadSearchResultsCallBack\", {\n items: resp.data.data.searchresults\n });\n }).catch(function (error) {\n console.warn('Issue with loadSearchResults', error);\n Promise.reject(error);\n });\n } else {\n commit('setNoresults');\n }\n }).catch(function (error) {\n console.warn('Issue with getResults', error);\n Promise.reject(error);\n });\n },\n loadSearchResultsCallBack: function loadSearchResultsCallBack(_ref5, _ref6) {\n var commit = _ref5.commit,\n state = _ref5.state;\n var items = _ref6.items,\n callBackArgs = _ref6.callBackArgs;\n console.log('search loadSearchResultsCallBack', items);\n commit('setResults', items);\n\n if (state.infiniteLoadingState) {\n if (state.offset + state.limit > state.count) {\n console.log('Search infinite completed'); // tell to vue-infinite-loading plugin that there si no new page\n\n state.infiniteLoadingState.complete();\n } else {\n console.log('Search infinite loaded'); // tell to vue-infinite-loading plugin that newpage is loaded\n\n state.infiniteLoadingState.loaded();\n }\n }\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/search.js?"); /***/ }), @@ -1563,15 +1579,15 @@ eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"Fragme /***/ }), -/***/ "./web/themes/custom/materiotheme/vuejs/api/gql/materiausearch.fragment.gql": -/*!**********************************************************************************!*\ - !*** ./web/themes/custom/materiotheme/vuejs/api/gql/materiausearch.fragment.gql ***! - \**********************************************************************************/ +/***/ "./web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql": +/*!*********************************************************************************!*\ + !*** ./web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql ***! + \*********************************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /***/ ((module) => { -eval("\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"MateriauFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Materiau\"}},\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"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\":\"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\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":153}};\n doc.loc.source = {\"body\":\"fragment MateriauFields on Materiau {\\n id\\n title\\n short_description\\n reference\\n images{\\n url\\n alt\\n style_cardmedium{\\n url\\n }\\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/materiausearch.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\":\"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\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"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\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"url\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":239}};\n doc.loc.source = {\"body\":\"fragment SearchResultFields on SearchResult {\\n id\\n bundle\\n title\\n short_description\\n reference\\n images{\\n url\\n alt\\n style_cardmedium{\\n url\\n }\\n }\\n visuels{\\n url\\n alt\\n style_cardmedium{\\n url\\n }\\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?"); /***/ }), @@ -1767,6 +1783,22 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue": +/*!************************************************************************************!*\ + !*** ./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue ***! + \************************************************************************************/ +/*! namespace exports */ +/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js& .__esModule */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ +/***/ ((__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 */ \"__esModule\": () => /* reexport safe */ _CardThematique_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__.__esModule,\n/* harmony export */ \"default\": () => __WEBPACK_DEFAULT_EXPORT__\n/* harmony export */ });\n/* harmony import */ var _CardThematique_vue_vue_type_template_id_6a3bc2e2_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true& */ \"./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true&\");\n/* harmony import */ var _CardThematique_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CardThematique.vue?vue&type=script&lang=js& */ \"./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js&\");\n/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n;\nvar component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__.default)(\n _CardThematique_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__.default,\n _CardThematique_vue_vue_type_template_id_6a3bc2e2_scoped_true___WEBPACK_IMPORTED_MODULE_0__.render,\n _CardThematique_vue_vue_type_template_id_6a3bc2e2_scoped_true___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,\n false,\n null,\n \"6a3bc2e2\",\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue\"\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports);\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?"); + +/***/ }), + /***/ "./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue": /*!*********************************************************************************!*\ !*** ./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue ***! @@ -2167,6 +2199,22 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js&": +/*!*************************************************************************************************************!*\ + !*** ./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js& ***! + \*************************************************************************************************************/ +/*! namespace exports */ +/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js& .__esModule */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ +/***/ ((__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 */ \"default\": () => __WEBPACK_DEFAULT_EXPORT__,\n/* harmony export */ \"__esModule\": () => /* reexport safe */ _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_CardThematique_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__.__esModule\n/* harmony export */ });\n/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_CardThematique_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CardThematique.vue?vue&type=script&lang=js& */ \"./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=script&lang=js&\");\n /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_CardThematique_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__.default); \n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?"); + +/***/ }), + /***/ "./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=script&lang=js&": /*!**********************************************************************************************************!*\ !*** ./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=script&lang=js& ***! @@ -2635,6 +2683,22 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true&": +/*!*******************************************************************************************************************************!*\ + !*** ./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true& ***! + \*******************************************************************************************************************************/ +/*! namespace exports */ +/*! export render [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true& .render */ +/*! export staticRenderFns [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true& .staticRenderFns */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ +/***/ ((__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\": () => /* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CardThematique_vue_vue_type_template_id_6a3bc2e2_scoped_true___WEBPACK_IMPORTED_MODULE_0__.render,\n/* harmony export */ \"staticRenderFns\": () => /* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CardThematique_vue_vue_type_template_id_6a3bc2e2_scoped_true___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns\n/* harmony export */ });\n/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CardThematique_vue_vue_type_template_id_6a3bc2e2_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true& */ \"./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true&\");\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?"); + +/***/ }), + /***/ "./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=template&id=466ebd6c&scoped=true&lang=html&": /*!**************************************************************************************************************************************!*\ !*** ./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=template&id=466ebd6c&scoped=true&lang=html& ***! @@ -2955,6 +3019,22 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true&": +/*!**********************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue?vue&type=template&id=6a3bc2e2&scoped=true& ***! + \**********************************************************************************************************************************************************************************************************************************************************************/ +/*! namespace exports */ +/*! export render [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export staticRenderFns [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__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(\n \"article\",\n { staticClass: \"card card-thematique search-card\" },\n [\n _c(\"header\", { on: { click: _vm.openThematique } }, [\n _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.short_description))])\n ]),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.visuels, 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 _vm.lightbox_index = index\n }\n }\n })\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.item.visuels,\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/CardThematique.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); + +/***/ }), + /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=template&id=466ebd6c&scoped=true&lang=html&": /*!*****************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue?vue&type=template&id=466ebd6c&scoped=true&lang=html& ***! @@ -3111,7 +3191,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(\"div\", { attrs: { id: \"Base\" } }, [\n !_vm.searchinfos\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"div\",\n { staticClass: \"cards-list\" },\n [\n _c(\"aside\", { staticClass: \"search-info\" }, [\n _vm._v(\"\\n \" + _vm._s(_vm.searchinfos) + \"\\n \")\n ]),\n _vm._v(\" \"),\n !_vm.items.length & !_vm.noresults\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"ul\",\n _vm._l(_vm.items, function(item) {\n return _c(\n \"li\",\n { key: item.uuid },\n [_c(\"Card\", { attrs: { item: item } })],\n 1\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _vm.count > _vm.limit\n ? _c(\"infinite-loading\", { on: { infinite: _vm.nextPage } }, [\n _c(\"div\", { attrs: { slot: \"no-more\" }, slot: \"no-more\" }, [\n _vm._v(\"No more results\")\n ])\n ])\n : _vm._e()\n ],\n 1\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Base.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(\"div\", { attrs: { id: \"Base\" } }, [\n !_vm.searchinfos\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"div\",\n { staticClass: \"cards-list\" },\n [\n _c(\"aside\", { staticClass: \"search-info\" }, [\n _vm._v(\"\\n \" + _vm._s(_vm.searchinfos) + \"\\n \")\n ]),\n _vm._v(\" \"),\n !_vm.items.length & !_vm.noresults\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\n \"ul\",\n _vm._l(_vm.items, function(item) {\n return _c(\n \"li\",\n { key: item.uuid },\n [\n item.bundle == \"materiau\"\n ? _c(\"Card\", { attrs: { item: item } })\n : _vm._e(),\n _vm._v(\" \"),\n item.bundle == \"thematique\"\n ? _c(\"CardThematique\", { attrs: { item: item } })\n : _vm._e()\n ],\n 1\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _vm.count > _vm.limit\n ? _c(\"infinite-loading\", { on: { infinite: _vm.nextPage } }, [\n _c(\"div\", { attrs: { slot: \"no-more\" }, slot: \"no-more\" }, [\n _vm._v(\"No more results\")\n ])\n ])\n : _vm._e()\n ],\n 1\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Base.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/assets/styles/base/_colors.scss b/web/themes/custom/materiotheme/assets/styles/base/_colors.scss index 725c5b1..fc64c0e 100644 --- a/web/themes/custom/materiotheme/assets/styles/base/_colors.scss +++ b/web/themes/custom/materiotheme/assets/styles/base/_colors.scss @@ -1,6 +1,10 @@ $transparent-bg: rgba(255,255,255, 0.95); $transparent-bg-blk: rgba(0,0,0, 0.75); +$alpha: 0.90; $color-base:#69cdcf; +$color-base-transparent: change-color($color-base, $alpha: $alpha); $color-showrooms:#50aa3c; +$color-showrooms-transparent: change-color($color-showrooms, $alpha: $alpha); $color-blabla:#9458aa; +$color-blabla-transparent: change-color($color-blabla, $alpha: $alpha); diff --git a/web/themes/custom/materiotheme/assets/styles/main.scss b/web/themes/custom/materiotheme/assets/styles/main.scss index ee7b01d..e99a84b 100644 --- a/web/themes/custom/materiotheme/assets/styles/main.scss +++ b/web/themes/custom/materiotheme/assets/styles/main.scss @@ -756,6 +756,9 @@ article.card{ line-height: 1; } } + &.card-thematique header{ + background-color: $color-base-transparent; + } nav.tools{ position: absolute; top: 0; diff --git a/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql b/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql new file mode 100644 index 0000000..e4ce0f8 --- /dev/null +++ b/web/themes/custom/materiotheme/vuejs/api/gql/searchresults.fragment.gql @@ -0,0 +1,21 @@ +fragment SearchResultFields on SearchResult { + id + bundle + title + short_description + reference + images{ + url + alt + style_cardmedium{ + url + } + } + visuels{ + url + alt + style_cardmedium{ + url + } + } +} diff --git a/web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue b/web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue new file mode 100644 index 0000000..69a6c9e --- /dev/null +++ b/web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue b/web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue index 8925b52..d46ff4c 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue @@ -12,7 +12,8 @@ import Card from 'vuejs/components/Content/Card' +import CardThematique from 'vuejs/components/Content/CardThematique' import { mapState, mapActions } from 'vuex' @@ -80,7 +82,8 @@ export default { next() }, components: { - Card + Card, + CardThematique } } diff --git a/web/themes/custom/materiotheme/vuejs/store/modules/search.js b/web/themes/custom/materiotheme/vuejs/store/modules/search.js index 43466a5..f2a573b 100644 --- a/web/themes/custom/materiotheme/vuejs/store/modules/search.js +++ b/web/themes/custom/materiotheme/vuejs/store/modules/search.js @@ -3,7 +3,11 @@ import { MA } from 'vuejs/api/ma-axios' import qs from 'querystring-es3' -import materiauGQL from 'vuejs/api/gql/materiausearch.fragment.gql' + +import { MGQ } from 'vuejs/api/graphql-axios' +import { print } from 'graphql/language/printer' +import gql from 'graphql-tag' +import searchresultGQL from 'vuejs/api/gql/searchresults.fragment.gql' export default { namespaced: true, @@ -35,7 +39,7 @@ export default { resetUuids (state) { state.uuids = [] }, - setMaterials (state, items) { + setResults (state, items) { state.items = state.items.concat(items) }, resetItems (state) { @@ -110,18 +114,27 @@ export default { commit('setUuids', data.uuids) // loadMaterials is on mixins // https://github.com/huybuidac/vuex-extensions - - dispatch('loadMaterialsGQL', { - ids: data.nids, - gqlfragment: materiauGQL, - callBack: 'loadMaterialsCallBack' - }) - - // dispatch('loadMaterials', { - // uuids: data.uuids, - // imgStyle: ['card_medium', 'card_full'], - // callBack: 'loadMaterialsCallBack' + // dispatch('loadMaterialsGQL', { + // ids: data.nids, + // gqlfragment: materiauGQL, + // callBack: 'loadSearchResultsCallBack' // }) + let ast = gql`{ + searchresults(ids: [${data.nids}]) { + ...SearchResultFields + } + } + ${ searchresultGQL } + ` + MGQ.post('', { query: print(ast) }) + .then(( resp ) => { + console.log('loadSearchResultsGQL resp', resp ) + dispatch("loadSearchResultsCallBack", { items: resp.data.data.searchresults}) + }) + .catch(error => { + console.warn('Issue with loadSearchResults', error) + Promise.reject(error) + }) } else { commit('setNoresults') } @@ -131,9 +144,9 @@ export default { Promise.reject(error) }) }, - loadMaterialsCallBack ({ commit, state }, { items, callBackArgs }) { - console.log('search loadMaterialsCallBack', items) - commit('setMaterials', items) + loadSearchResultsCallBack ({ commit, state }, { items, callBackArgs }) { + console.log('search loadSearchResultsCallBack', items) + commit('setResults', items) if (state.infiniteLoadingState) { if (state.offset + state.limit > state.count) { console.log('Search infinite completed')