@europeana/portal
Version:
Europeana Portal
2 lines • 12.6 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{1083:function(t,e,r){"use strict";r.r(e);var n=r(6),o=(r(21),r(42),r(22),r(43),r(250),r(14),r(144)),l=r.n(o),c=r(141),h=r.n(c),d=r(829),y=r(657),m=r(734),v=r(160),f=r(251),$=r(24);function O(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function E(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?O(Object(source),!0).forEach((function(e){Object(n.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):O(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var w={name:"CollectionPage",components:{AlertMessage:()=>r.e(11).then(r.bind(null,658)),BrowseSections:()=>r.e(103).then(r.bind(null,671)),ClientOnly:h.a,EntityHeader:()=>r.e(85).then(r.bind(null,1095)),EntityRelatedCollections:()=>r.e(98).then(r.bind(null,1096)),RelatedEditorial:()=>r.e(20).then(r.bind(null,1091)),SearchInterface:d.a},mixins:[y.a,m.a],beforeRouteLeave(t,e,r){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",[]),r()},middleware:"sanitisePageQuery",data:()=>({page:null,proxy:null,showRelated:!1,themes:v.a.map((t=>t.id))}),fetch(){this.$store.commit("search/disableCollectionFacet");var t=Object(f.f)(this.collectionType,this.$route.params.pathMatch);t!==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",t);var e=!this.$store.state.entity.curatedEntities||this.$store.state.entity.curatedEntities.some((e=>e.identifier===t)),r=!this.$store.state.entity.curatedEntities,n={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",n):()=>null,e?this.$contentful.query("collectionPage",E(E({},n),{},{identifier:t})):()=>null]).then((t=>{if(this.$store.commit("entity/setEntity",l()(t[0].entity,["id","logo","note","description","homepage","prefLabel","isShownBy","hasAddress","acronym","type"])),r){var n=t[1].data.data;this.$store.commit("entity/setCuratedEntities",n.curatedEntities.items)}if(e){var o=t[t.length-1].data.data;this.page=o.entityPage.items[0]}this.$store.commit("search/setCollectionLabel",this.title.values[0]);var c=this.page?this.page.nameEN:this.entity.prefLabel.en;return this.redirectToPrefPath("collections-type-all",this.entity.id,c,{type:this.collectionType})}))},head(){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(){return this.$store.state.entity.entity},recordsPerPage(){return this.$store.state.entity.recordsPerPage},pageTitle(){return this.$fetchState.error?this.$t("error"):this.title.values[0]},searchOverrides(){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 r=Object(f.c)(this.entity.id);t.qf.push(r),this.$route.query.query||(t.query=r)}}return t},entityId(){return Object(f.i)(this.$route.params.pathMatch)},contextLabel(){var t=this.collectionType;return"topic"===this.collectionType&&this.themes.includes(this.entityId)&&(t="theme"),this.$t("cardLabels.".concat(t))},collectionType(){return this.$route.params.type},logo(){var t;return"organisation"===this.collectionType&&null!==(t=this.entity)&&void 0!==t&&t.logo?this.entity.logo.id:null},description(){var t,e,r=null;return this.editorialDescription?r={values:[this.editorialDescription],code:null}:null!==(t=this.entity)&&void 0!==t&&t.note?r=Object($.h)(this.entity.note,this.$i18n.locale):null!==(e=this.entity)&&void 0!==e&&e.description&&(r=Object($.h)(this.entity.description,this.$i18n.locale)),r},descriptionText(){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(){return this.page.primaryImageOfPage.url},editorialDescription(){return this.hasEditorialDescription?this.page.description:null},hasEditorialDescription(){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(){var t;return"organisation"===this.collectionType&&null!==(t=this.entity)&&void 0!==t&&t.homepage&&$.l.test(this.entity.homepage)?this.entity.homepage:null},editorialTitle(){var t;return(null===(t=this.page)||void 0===t?void 0:t.name)||null},editorialImage(){var t,e;return(null===(t=this.page)||void 0===t||null===(e=t.primaryImageOfPage)||void 0===e?void 0:e.image)||null},editorialOverrides(){return{title:this.editorialTitle,image:this.editorialImage}},relatedCollectionCards(){var t,e,r;return((null===(t=this.page)||void 0===t||null===(e=t.relatedLinksCollection)||void 0===e||null===(r=e.items)||void 0===r?void 0:r.length)||0)>0?this.page.relatedLinksCollection.items.map((t=>{var e={[this.$i18n.locale]:t.name,en:t.nameEN};return{id:t.identifier,prefLabel:e,image:t.image}})):null},editable(){return this.$features.entityManagement&&this.entity&&this.userIsEntitiesEditor&&["topic","organisation"].includes(this.collectionType)},userIsEntitiesEditor(){var t,e,r,n;return(null===(t=this.$auth)||void 0===t||null===(e=t.user)||void 0===e||null===(r=e.resource_access)||void 0===r||null===(n=r.entities)||void 0===n?void 0:n.roles.includes("editor"))||!1},userIsSetsEditor(){var t,e,r,n;return(null===(t=this.$auth)||void 0===t||null===(e=t.user)||void 0===e||null===(r=e.resource_access)||void 0===r||null===(n=r.usersets)||void 0===n?void 0:n.roles.includes("editor"))||!1},route(){return{name:"collections-type-all",params:{type:this.collectionType,pathMatch:this.$route.params.pathMatch}}},title(){return this.entity?this.editorialTitle?this.titleFallback(this.editorialTitle):this.organisationNativeName?Object($.h)(this.organisationNativeName,this.$i18n.locale):Object($.h)(this.entity.prefLabel,this.$i18n.locale):this.titleFallback()},subTitle(){return this.organisationNonNativeEnglishName?Object($.h)(this.organisationNonNativeEnglishName,this.$i18n.locale):null},hasUserQuery(){return this.$route.query.query&&""!==this.$route.query.query},thumbnail(){return this.$apis.entity.imageUrl(this.entity)},organisationNativeName(){return this.organizationEntityNativeName(this.entity)},organisationNonNativeEnglishName(){return this.organizationEntityNonNativeEnglishName(this.entity)},moreInfo(){var t,e,r,n,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($.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!==(r=e.hasAddress)&&void 0!==r&&r.countryName&&l.push({label:this.$t("organisation.country"),value:this.entity.hasAddress.countryName}),null!==(n=this.entity)&&void 0!==n&&null!==(o=n.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(){this.storeSearchOverrides(),this.userIsEntitiesEditor&&this.$store.dispatch("entity/getFeatured")},methods:{storeSearchOverrides(){this.$store.commit("search/set",["overrideParams",this.searchOverrides])},titleFallback:title=>({values:[title],code:null}),showRelatedCollections(){this.showRelated=!0},hideRelatedCollections(){this.showRelated=!1},proxyUpdated(){this.$fetch()}}},N=(r(889),r(40)),component=Object(N.a)(w,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"entity-page",attrs:{"data-qa":"entity page"}},[t.$fetchState.error?r("b-container",[r("b-row",{staticClass:"flex-md-row py-4"},[r("b-col",{attrs:{cols:"12"}},[r("AlertMessage",{attrs:{error:t.$fetchState.error.message}})],1)],1)],1):r("client-only",[t.$fetchState.pending?t._e():r("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[r("client-only",[r("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[r("client-only",[r("b-container",{staticClass:"px-0"},[t.entity?r("RelatedEditorial",{attrs:{"entity-uri":t.entity.id,query:t.$route.query.query}}):t._e(),t._v(" "),t.page?r("BrowseSections",{attrs:{sections:t.page.hasPartCollection.items}}):t._e()],1)],1)]},proxy:!0}],null,!0)},[t.entity?r("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},657:function(t,e,r){"use strict";var n="en";e.a={methods:{isNamedOrganizationEntity:t=>"Organization"===(null==t?void 0:t.type)&&!!t.prefLabel,organizationEntityNativeName(t){if(!this.isNamedOrganizationEntity(t))return null;var e=Object.keys(t.prefLabel).find((t=>t!==n))||n;return{[e]:t.prefLabel[e]}},organizationEntityNonNativeEnglishName(t){return!this.isNamedOrganizationEntity(t)||Object.keys(t.prefLabel).length<2?null:{[n]:t.prefLabel.en}}}}},734:function(t,e,r){"use strict";var n=r(6),o=(r(14),r(28),r(24));function l(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}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(n.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(t,e,label){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=Object(o.f)(e,label);if(this.$route.params.pathMatch!==n){var l=this.$path({name:t,params:c(c({},r),{},{pathMatch:n})});this.$nuxt.context.app.router.replace(l)}}}}},784:function(t,e,r){var content=r(890);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(106).default)("6c32d2e4",content,!0,{sourceMap:!1})},889:function(t,e,r){"use strict";r(784)},890:function(t,e,r){var n=r(105)(!1);n.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=n}}]);
//# sourceMappingURL=fd3b012.modern.js.map