@europeana/portal
Version:
Europeana Portal
2 lines • 13.4 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{1154:function(t,e,n){"use strict";n.r(e);n(13),n(19),n(14),n(20);var r=n(2),o=(n(10),n(43),n(46),n(47),n(30),n(58),n(62),n(15),n(64),n(21),n(34),n(319),n(16),n(181)),l=n.n(o),c=n(176),h=n.n(c),d=n(902),y=n(726),f=n(801),m=n(204),v=n(314),O=n(31);function $(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function E(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?$(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):$(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var w={name:"CollectionPage",components:{AlertMessage:function(){return n.e(12).then(n.bind(null,727))},BrowseSections:function(){return n.e(102).then(n.bind(null,739))},ClientOnly:h.a,EntityHeader:function(){return n.e(86).then(n.bind(null,1166))},EntityRelatedCollections:function(){return n.e(97).then(n.bind(null,1167))},RelatedEditorial:function(){return n.e(21).then(n.bind(null,1162))},SearchInterface:d.a},mixins:[y.a,f.a],beforeRouteLeave:function(t,e,n){t.matched[0].path!=="/".concat(this.$i18n.locale,"/search")&&this.$store.commit("search/setShowSearchBar",!1),this.$store.commit("entity/setId",null),this.$store.commit("entity/setEntity",null),this.$store.commit("entity/setFeaturedSetId",null),this.$store.commit("entity/setPinned",[]),n()},middleware:"sanitisePageQuery",data:function(){return{page:null,proxy:null,showRelated:!1,themes:m.a.map((function(t){return t.id}))}},fetch:function(){var t=this;this.$store.commit("search/disableCollectionFacet");var e=Object(v.f)(this.collectionType,this.$route.params.pathMatch);e!==this.$store.state.entity.id&&(this.$store.commit("entity/setId",null),this.$store.commit("entity/setEntity",null),this.$store.commit("entity/setFeaturedSetId",null),this.$store.commit("entity/setPinned",null),this.$store.commit("entity/setEditable",!1),this.page=null),this.$store.commit("entity/setId",e);var n=!this.$store.state.entity.curatedEntities||this.$store.state.entity.curatedEntities.some((function(t){return t.identifier===e})),r=!this.$store.state.entity.curatedEntities,o={locale:this.$i18n.isoLocale(),preview:"preview"===this.$route.query.mode};return Promise.all([this.$apis.entity.get(this.collectionType,this.$route.params.pathMatch),r?this.$contentful.query("curatedEntities",o):function(){return null},n?this.$contentful.query("collectionPage",E(E({},o),{},{identifier:e})):function(){return null}]).then((function(e){if(t.$store.commit("entity/setEntity",l()(e[0].entity,["id","logo","note","description","homepage","prefLabel","isShownBy","hasAddress","acronym","type"])),r){var o=e[1].data.data;t.$store.commit("entity/setCuratedEntities",o.curatedEntities.items)}if(n){var c=e[e.length-1].data.data;t.page=c.entityPage.items[0]}t.$store.commit("search/setCollectionLabel",t.title.values[0]);var h=t.page?t.page.nameEN:t.entity.prefLabel.en;return t.redirectToPrefPath("collections-type-all",t.entity.id,h,{type:t.collectionType})}))},head:function(){return{title:this.$pageHeadTitle(this.pageTitle),meta:[{hid:"og:type",property:"og:type",content:"article"},{hid:"title",name:"title",content:this.pageTitle},{hid:"og:title",property:"og:title",content:this.pageTitle}].concat(this.descriptionText?[{hid:"description",name:"description",content:this.descriptionText},{hid:"og:description",property:"og:description",content:this.descriptionText}]:[])}},computed:{entity:function(){return this.$store.state.entity.entity},recordsPerPage:function(){return this.$store.state.entity.recordsPerPage},pageTitle:function(){return this.$fetchState.error?this.$t("error"):this.title.values[0]},searchOverrides:function(){var t={qf:[],rows:this.recordsPerPage};if(this.entity){var e=this.$store.getters["entity/curatedEntity"](this.entity.id);if(e&&e.genre)t.qf.push("collection:".concat(e.genre));else{var n=Object(v.c)(this.entity.id);t.qf.push(n),this.$route.query.query||(t.query=n)}}return t},entityId:function(){return Object(v.i)(this.$route.params.pathMatch)},contextLabel:function(){var t=this.collectionType;return"topic"===this.collectionType&&this.themes.includes(this.entityId)&&(t="theme"),this.$t("cardLabels.".concat(t))},collectionType:function(){return this.$route.params.type},logo:function(){var t;return"organisation"===this.collectionType&&null!==(t=this.entity)&&void 0!==t&&t.logo?this.entity.logo.id:null},description:function(){var t,e,n=null;return this.editorialDescription?n={values:[this.editorialDescription],code:null}:null!==(t=this.entity)&&void 0!==t&&t.note?n=Object(O.h)(this.entity.note,this.$i18n.locale):null!==(e=this.entity)&&void 0!==e&&e.description&&(n=Object(O.h)(this.entity.description,this.$i18n.locale)),n},descriptionText:function(){var t,e;return((null===(t=this.description)||void 0===t||null===(e=t.values)||void 0===e?void 0:e.length)||0)>=1?this.description.values[0]:null},editorialAttribution:function(){return this.page.primaryImageOfPage.url},editorialDescription:function(){return this.hasEditorialDescription?this.page.description:null},hasEditorialDescription:function(){var t,e;return((null===(t=this.page)||void 0===t||null===(e=t.description)||void 0===e?void 0:e.length)||0)>=1},homepage:function(){var t;return"organisation"===this.collectionType&&null!==(t=this.entity)&&void 0!==t&&t.homepage&&O.l.test(this.entity.homepage)?this.entity.homepage:null},editorialTitle:function(){var t;return(null===(t=this.page)||void 0===t?void 0:t.name)||null},editorialImage:function(){var t,e;return(null===(t=this.page)||void 0===t||null===(e=t.primaryImageOfPage)||void 0===e?void 0:e.image)||null},editorialOverrides:function(){return{title:this.editorialTitle,image:this.editorialImage}},relatedCollectionCards:function(){var t,e,n,o=this;return((null===(t=this.page)||void 0===t||null===(e=t.relatedLinksCollection)||void 0===e||null===(n=e.items)||void 0===n?void 0:n.length)||0)>0?this.page.relatedLinksCollection.items.map((function(t){var e,n=(e={},Object(r.a)(e,o.$i18n.locale,t.name),Object(r.a)(e,"en",t.nameEN),e);return{id:t.identifier,prefLabel:n,image:t.image}})):null},editable:function(){return this.$features.entityManagement&&this.entity&&this.userIsEntitiesEditor&&["topic","organisation"].includes(this.collectionType)},userIsEntitiesEditor:function(){var t,e,n,r;return(null===(t=this.$auth)||void 0===t||null===(e=t.user)||void 0===e||null===(n=e.resource_access)||void 0===n||null===(r=n.entities)||void 0===r?void 0:r.roles.includes("editor"))||!1},userIsSetsEditor:function(){var t,e,n,r;return(null===(t=this.$auth)||void 0===t||null===(e=t.user)||void 0===e||null===(n=e.resource_access)||void 0===n||null===(r=n.usersets)||void 0===r?void 0:r.roles.includes("editor"))||!1},route:function(){return{name:"collections-type-all",params:{type:this.collectionType,pathMatch:this.$route.params.pathMatch}}},title:function(){var title;return title=this.entity?this.editorialTitle?this.titleFallback(this.editorialTitle):this.organisationNativeName?Object(O.h)(this.organisationNativeName,this.$i18n.locale):Object(O.h)(this.entity.prefLabel,this.$i18n.locale):this.titleFallback(),title},subTitle:function(){return this.organisationNonNativeEnglishName?Object(O.h)(this.organisationNonNativeEnglishName,this.$i18n.locale):null},hasUserQuery:function(){return this.$route.query.query&&""!==this.$route.query.query},thumbnail:function(){return this.$apis.entity.imageUrl(this.entity)},organisationNativeName:function(){return this.organizationEntityNativeName(this.entity)},organisationNonNativeEnglishName:function(){return this.organizationEntityNonNativeEnglishName(this.entity)},moreInfo:function(){var t,e,n,r,o;if(!this.entity||"organisation"!==this.collectionType)return null;var l=[];if(this.organisationNonNativeEnglishName&&l.push({label:this.$t("organisation.englishName"),value:Object.values(this.organisationNonNativeEnglishName)[0],lang:Object.keys(this.organisationNonNativeEnglishName)[0]}),null!==(t=this.entity)&&void 0!==t&&t.acronym){var c=Object(O.h)(this.entity.acronym,this.$i18n.locale);l.push({label:this.$t("organisation.nameAcronym"),value:c.values[0],lang:c.code})}return null!==(e=this.entity)&&void 0!==e&&null!==(n=e.hasAddress)&&void 0!==n&&n.countryName&&l.push({label:this.$t("organisation.country"),value:this.entity.hasAddress.countryName}),null!==(r=this.entity)&&void 0!==r&&null!==(o=r.hasAddress)&&void 0!==o&&o.locality&&l.push({label:this.$t("organisation.city"),value:this.entity.hasAddress.locality}),this.homepage&&l.push({label:this.$t("website"),value:this.homepage}),l}},watch:{searchOverrides:"storeSearchOverrides"},mounted:function(){this.storeSearchOverrides(),this.userIsEntitiesEditor&&this.$store.dispatch("entity/getFeatured")},methods:{storeSearchOverrides:function(){this.$store.commit("search/set",["overrideParams",this.searchOverrides])},titleFallback:function(title){return{values:[title],code:null}},showRelatedCollections:function(){this.showRelated=!0},hideRelatedCollections:function(){this.showRelated=!1},proxyUpdated:function(){this.$fetch()}}},j=(n(962),n(59)),component=Object(j.a)(w,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"entity-page",attrs:{"data-qa":"entity page"}},[t.$fetchState.error?n("b-container",[n("b-row",{staticClass:"flex-md-row py-4"},[n("b-col",{attrs:{cols:"12"}},[n("AlertMessage",{attrs:{error:t.$fetchState.error.message}})],1)],1)],1):n("client-only",[t.$fetchState.pending?t._e():n("SearchInterface",{attrs:{"per-page":t.recordsPerPage,route:t.route,"show-content-tier-toggle":!1,"show-pins":t.userIsEntitiesEditor&&t.userIsSetsEditor,"editorial-overrides":t.editorialOverrides,"show-related":t.showRelated},scopedSlots:t._u(["organisation"!==t.collectionType?{key:"related",fn:function(){return[n("client-only",[n("EntityRelatedCollections",{attrs:{type:t.$route.params.type,identifier:t.$route.params.pathMatch,overrides:t.relatedCollectionCards,"data-qa":"related entities"},on:{show:t.showRelatedCollections,hide:t.hideRelatedCollections}})],1)]},proxy:!0}:null,{key:"after-results",fn:function(){return[n("client-only",[n("b-container",{staticClass:"px-0"},[t.entity?n("RelatedEditorial",{attrs:{"entity-uri":t.entity.id,query:t.$route.query.query}}):t._e(),t._v(" "),t.page?n("BrowseSections",{attrs:{sections:t.page.hasPartCollection.items}}):t._e()],1)],1)]},proxy:!0}],null,!0)},[t.entity?n("EntityHeader",{directives:[{name:"show",rawName:"v-show",value:!t.hasUserQuery,expression:"!hasUserQuery"}],attrs:{id:t.entity&&t.entity.id,description:t.description,title:t.title,"sub-title":t.subTitle,logo:t.logo,image:t.thumbnail,editable:t.editable,"external-link":t.homepage,proxy:t.proxy,"more-info":t.moreInfo},on:{updated:t.proxyUpdated}}):t._e()],1)],1)],1)}),[],!1,null,"ce8aca86",null);e.default=component.exports},726:function(t,e,n){"use strict";var r=n(2),o=(n(80),n(10),n(16),"en");e.a={methods:{isNamedOrganizationEntity:function(t){return"Organization"===(null==t?void 0:t.type)&&!!t.prefLabel},organizationEntityNativeName:function(t){if(!this.isNamedOrganizationEntity(t))return null;var e=Object.keys(t.prefLabel).find((function(t){return t!==o}))||o;return Object(r.a)({},e,t.prefLabel[e])},organizationEntityNonNativeEnglishName:function(t){return!this.isNamedOrganizationEntity(t)||Object.keys(t.prefLabel).length<2?null:Object(r.a)({},o,t.prefLabel.en)}}}},801:function(t,e,n){"use strict";n(16),n(15),n(13),n(10),n(19),n(14),n(20);var r=n(2),o=(n(21),n(37),n(31));function l(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function c(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}e.a={methods:{redirectToPrefPath:function(t,e,label){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=Object(o.f)(e,label);if(this.$route.params.pathMatch!==r){var l=this.$path({name:t,params:c(c({},n),{},{pathMatch:r})});this.$nuxt.context.app.router.replace(l)}}}}},858:function(t,e,n){var content=n(963);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(138).default)("6c32d2e4",content,!0,{sourceMap:!1})},962:function(t,e,n){"use strict";n(858)},963:function(t,e,n){var r=n(137)(!1);r.push([t.i,".entity-page.top-header[data-v-ce8aca86]{margin-top:-1rem}.entity-page .related-collections[data-v-ce8aca86]{padding:0}.entity-page[data-v-ce8aca86] .related-collections .badge{margin-top:.25rem;margin-right:.5rem}.page-container[data-v-ce8aca86]{max-width:none}",""]),t.exports=r}}]);
//# sourceMappingURL=85367b8.js.map