diff --git a/web/dd-react/datasets/static/js/main.a349ae92.chunk.js b/web/dd-react/datasets/static/js/main.a349ae92.chunk.js deleted file mode 100644 index a5e86716..00000000 --- a/web/dd-react/datasets/static/js/main.a349ae92.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpdnb-filter"]=this["webpackJsonpdnb-filter"]||[]).push([[0],{60:function(e,t,n){"use strict";n.r(t);var s=n(0),a=n(3),c=n.n(a),r=n(22),i=n.n(r),l=n(1),o=n.n(l),u=n(6),d=n(2),p=n(7),h=n(8),j=n(10),f=n(9),b=n(23),m=n.n(b),v=n(5),O=n.n(v),x="";function g(){for(var e=window.location.pathname.split("/"),t="de";e.length>0;)if(t=e.pop(),["de","en","fr"].includes(t))return t;return t}function y(e){return w.apply(this,arguments)}function w(){return(w=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/objecttypes"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return T.apply(this,arguments)}function T(){return(T=Object(d.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g(),e.next=3,O.a.get("".concat(x,"/").concat(t,"/dd_views/subobjecttypes"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e){return S.apply(this,arguments)}function S(){return(S=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/licenses"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e){return C.apply(this,arguments)}function C(){return(C=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/theme"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return E.apply(this,arguments)}function E(){return(E=Object(d.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g(),e.next=3,O.a.get("".concat(x,"/").concat(t,"/dd_views/institutions"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e){return I.apply(this,arguments)}function I(){return(I=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/events"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(e){return z.apply(this,arguments)}function z(){return(z=Object(d.a)(o.a.mark((function e(t){var n,s,a,c,r,i,l,u,d,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:"",s=p.length>2&&void 0!==p[2]?p[2]:"",a=p.length>3&&void 0!==p[3]?p[3]:"",c=p.length>4&&void 0!==p[4]?p[4]:"",r=p.length>5&&void 0!==p[5]?p[5]:"",i=p.length>6&&void 0!==p[6]?p[6]:"",l=p.length>7&&void 0!==p[7]?p[7]:"",u=g(),e.next=10,O.a.get("".concat(x,"/").concat(u,"/dd_views/datasets?offset=").concat(t,"&objecttypes=").concat(s,"&subobjecttypes=").concat(a,"&events=").concat(n,"&licenses=").concat(c,"&theme=").concat(r,"&institution=").concat(i,"&q=").concat(l),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 10:return d=e.sent,e.abrupt("return",d.data);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var P=function(e){Object(j.a)(n,e);var t=Object(f.a)(n);function n(e){var a;return Object(p.a)(this,n),(a=t.call(this,e)).selectObjectType=function(e){var t=a.state.selectedObjectTypes;if(a.state.selectedObjectTypes.includes(e)){t=t.filter((function(t){return t!==e}));var n=a.state.selectedSubObjectTypes;a.state.subObjectTypes[e]&&n.length&&(a.state.subObjectTypes[e].map((function(e){return n.includes(e.tid)&&(n=n.filter((function(t){return t!==e.tid}))),null})),a.setState({selectedSubObjectTypes:n},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateSubObjectTypes(n);case 1:case"end":return e.stop()}}),e)})))))}else t.push(e);a.setState({selectedObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateObjectTypes(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectSubObjectType=function(e){var t=a.state.selectedSubObjectTypes;a.state.selectedSubObjectTypes.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedSubObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateSubObjectTypes(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectLicense=function(e){var t=a.state.selectedLicenses;a.state.selectedLicenses.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedLicenses:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateLicenses(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectTheme=function(e){var t=a.state.selectedTheme;a.state.selectedTheme.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedTheme:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateTheme(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectEvent=function(e){var t=a.state.selectedEvents;a.state.selectedEvents.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedEvents:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateEvents(t);case 1:case"end":return e.stop()}}),e)}))))},a.onChange=function(e){a.setState({searchTerm:e.target.value})},a.onChangeInstitution=function(e,t){var n=t.newValue;t.method;a.setState({selectedInstitution:n})},a.getSuggestions=function(e){var t=e.trim().toLowerCase(),n=t.length,s=a.state.institutions;return 0===n?[]:s.filter((function(e){return e.name.toLowerCase().indexOf(t)>-1}))},a.onSuggestionsFetchRequested=function(e){var t=e.value;a.setState({institutionSuggestions:a.getSuggestions(t)})},a.onSuggestionsClearRequested=function(){a.setState({institutionSuggestions:[]})},a.doSearch=function(e){e.preventDefault(),(a.state.searchTerm||""!==a.state.selectedInstitution)&&a.props.doSearch(a.state.searchTerm,a.state.selectedInstitution)},a.doReset=function(e){e.preventDefault(),a.setState({selectedObjectTypes:[],selectedSubObjectTypes:[],selectedEvents:[],selectedTheme:[],selectedLicenses:[],selectedInstitution:"",searchTerm:""},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateObjectTypes([]),a.props.updateSubObjectTypes([]),a.props.updateEvents([]),a.props.updateLicenses([]),a.props.updateTheme([]),a.props.doSearch("","");case 6:case"end":return e.stop()}}),e)}))))},a.renderObjectTypes=function(e,t){var n="bef-link badge";return a.state.selectedObjectTypes.includes(e.tid)&&(n="bef-link bef-link--selected badge",a.state.subObjectTypes[e.tid])?([].push(),Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("li",{children:[Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectObjectType(e.tid)},children:e.title})}),Object(s.jsx)("ul",{style:{display:"block"},children:a.state.subObjectTypes[e.tid].map((function(e){var t=a.state.selectedSubObjectTypes.includes(e.tid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge ",children:Object(s.jsx)("a",{href:"#",className:t,onClick:function(){return a.selectSubObjectType(e.tid)},children:e.title})})})}))})]},t)})):Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectObjectType(e.tid)},children:e.title})})},t)},a.renderLicenses=function(e,t){var n=a.state.selectedLicenses.includes(e.tid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectLicense(e.tid)},children:e.title})})},t)},a.renderEvent=function(e,t){var n=a.state.selectedEvents.includes(e.nid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectEvent(e.nid)},children:e.title})})},t)},a.renderTheme=function(e,t){var n=a.state.selectedTheme.includes(e.tid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectTheme(e.tid)},children:e.title})})},t)},a.state={loading:!0,searchTerm:"",selectedInstitution:"",institutionSuggestions:[],objectTypes:[],events:[],licenses:[],theme:[],selectedObjectTypes:[],selectedSubObjectTypes:[],selectedEvents:[],selectedTheme:[],selectedLicenses:[],institutions:[]},a}return Object(h.a)(n,[{key:"renderSuggestion",value:function(e){return Object(s.jsx)("span",{children:e.name})}},{key:"getSuggestionValue",value:function(e){return e.name}},{key:"componentDidMount",value:function(){var e=Object(d.a)(o.a.mark((function e(){var t,n,s,a,c,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y();case 2:return t=e.sent,e.next=5,k();case 5:return n=e.sent,e.next=8,D();case 8:return s=e.sent,e.next=11,N();case 11:return a=e.sent,e.next=14,_();case 14:return c=e.sent,e.next=17,L();case 17:r=e.sent,this.setState(Object(u.a)(Object(u.a)({},this.state),{},{objectTypes:t,subObjectTypes:n,events:s,licenses:a,theme:c,institutions:r,loading:!1}),Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return this.state.loading?"....":Object(s.jsx)("div",{className:"view-filters col-lg-3",children:Object(s.jsx)("form",{className:"views-exposed-form bef-exposed-form",children:Object(s.jsxs)("div",{className:"form--inline clearfix row",children:[Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-project-type form-item-project-type",children:[Object(s.jsx)("label",{htmlFor:"edit-project-type",children:"Event"}),Object(s.jsx)("div",{"data-drupal-selector":"edit-project-type",multiple:"multiple",name:"project_type",id:"edit-project-type",size:"9",className:"form-select bef-links",children:Object(s.jsx)("ul",{children:this.state.events.map((function(t,n){return e.renderEvent(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(s.jsx)("label",{htmlFor:"edit-object-types",children:"Objekttyp"}),Object(s.jsx)("div",{multiple:"multiple",name:"event",id:"edit-object-types",size:"8",className:"form-select bef-links bef-nested",children:Object(s.jsx)("ul",{children:this.state.objectTypes.map((function(t,n){return e.renderObjectTypes(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(s.jsx)("label",{htmlFor:"edit-license",children:"Lizenz Mediendateien"}),Object(s.jsx)("div",{multiple:"multiple",name:"event",id:"edit-license",size:"8",className:"form-select bef-links",children:Object(s.jsx)("ul",{children:this.state.licenses.map((function(t,n){return e.renderLicenses(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(s.jsx)("label",{htmlFor:"edit-theme",children:"Thema"}),Object(s.jsx)("div",{multiple:"multiple",name:"event",id:"edit-theme",size:"8",className:"form-select bef-links",children:Object(s.jsx)("ul",{children:this.state.theme.map((function(t,n){return e.renderTheme(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-search form-item-search",children:[Object(s.jsx)("label",{htmlFor:"edit-search",children:"Institution"}),Object(s.jsx)(m.a,{suggestions:this.state.institutionSuggestions,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderSuggestion,inputProps:{placeholder:"",value:this.state.selectedInstitution,onChange:this.onChangeInstitution}})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-search form-item-search",children:[Object(s.jsx)("label",{htmlFor:"edit-search",children:"Volltextsuche"}),Object(s.jsx)("input",{type:"text",id:"edit-search",name:"search",value:this.state.searchTerm,size:"30",maxLength:"128",className:"form-text",onChange:this.onChange})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{"data-drupal-selector":"edit-actions",className:"form-actions js-form-wrapper form-wrapper",id:"edit-actions",children:[Object(s.jsx)("input",{type:"submit",value:"Filter anwenden",className:"button js-form-submit form-submit",onClick:this.doSearch}),Object(s.jsx)("input",{type:"submit",value:"Zur\xfccksetzen",className:"button js-form-submit form-submit",onClick:this.doReset})]})})]})})})}}]),n}(c.a.Component);var R=function(e){return e.cards.length?Object(s.jsx)("div",{className:"view-content col-lg-9",children:Object(s.jsx)("div",{className:"card-columns",children:e.cards.map((function(e,t){return Object(s.jsx)("div",{className:"views-row card",children:Object(s.jsxs)("article",{className:"node node--type-data-set node--view-mode-teaser",children:[Object(s.jsx)("div",{className:"card-img card-img-top",children:Object(s.jsx)("a",{href:e.url,children:Object(s.jsx)("div",{className:"field field--name-field-attributed-image field--type-entity-reference-revisions field--label-hidden field__item",children:Object(s.jsxs)("div",{className:"paragraph paragraph--type--attributed-image paragraph--view-mode--teaser",children:[Object(s.jsx)("div",{className:"field field--name-field-inline-image field--type-image field--label-hidden field__item",children:Object(s.jsx)("img",{src:e.image_url,width:"480",height:"256",alt:"",className:"image-style-large"})}),Object(s.jsx)("div",{className:"paragraph--type--attributed-image--attribution"})]})})})}),Object(s.jsxs)("div",{className:"card-body",children:[Object(s.jsx)("h2",{className:"card-title",children:Object(s.jsx)("a",{href:e.url,rel:"bookmark",children:Object(s.jsx)("span",{className:"field field--name-title field--type-string field--label-hidden",children:e.title})})}),Object(s.jsxs)("div",{className:"node__content",children:[Object(s.jsx)("div",{className:"field field__items field--institution-name",children:Object(s.jsx)("div",{className:"field__item",children:e.author_name})}),Object(s.jsx)("div",{className:"field field--name-field-events field--type-entity-reference-revisions field--label-hidden field__items",children:Object(s.jsx)("div",{className:"field__item",children:Object(s.jsx)("div",{className:"paragraph paragraph--type--data-set-event paragraph--view-mode--preview",children:Object(s.jsxs)("div",{className:"field field--name-field-event field--type-entity-reference field--label-visually_hidden",children:[Object(s.jsx)("div",{className:"field__label visually-hidden",children:"Veranstaltung"}),e.event_titles.map((function(e,t){return Object(s.jsx)("div",{className:"field__item",children:Object(s.jsx)("a",{href:e.url,children:e.title})},t)}))]})})})}),Object(s.jsx)("div",{className:"field field--name-field-object-type field--type-entity-reference field--label-hidden field__items",children:e.objecttypes_titles.map((function(e,t){return Object(s.jsx)("div",{className:"badge field__item",children:Object(s.jsx)("span",{children:e})},t)}))})]})]})]})},t)}))})}):Object(s.jsx)("div",{className:"col-lg-9",children:Object(s.jsx)("div",{className:"",children:"Es sind keine den Filtereinstellungen entsprechenden Datensets vorhanden."})})},q=function(e){Object(j.a)(n,e);var t=Object(f.a)(n);function n(){return Object(p.a)(this,n),t.apply(this,arguments)}return Object(h.a)(n,[{key:"pagination",value:function(e,t){var n=this,a=[],c=this.props.current+1,r=Boolean(c>1&&e!==this.props.total),i=Boolean(t>=c&&t!==this.props.total),l=i;r&&a.push(Object(s.jsx)("li",{className:"pager__item pager__item--next",children:Object(s.jsxs)("a",{href:"#",title:"Zur ersten Seite",rel:"next",onClick:function(e){return n.props.onChange(e,0)},children:[Object(s.jsx)("span",{className:"visually-hidden",children:"Erste Seite"}),Object(s.jsx)("span",{"aria-hidden":"true",children:"\xab"})]})})),r&&a.push(Object(s.jsx)("li",{className:"pager__item pager__item--previous",children:Object(s.jsxs)("a",{href:"#",title:"Zur vorherigen Seite",rel:"prev",onClick:function(t){return n.props.onChange(t,e)},children:[Object(s.jsx)("span",{className:"visually-hidden",children:"Vorherige Seite"}),Object(s.jsx)("span",{"aria-hidden":"true",children:"\u2039"})]})}));for(var o=function(e){if(e<3||e>n.props.total-2||e===c){var t=e===c?"pager__item is-active":"pager__item";a.push(Object(s.jsx)("li",{className:t,children:Object(s.jsx)("a",{href:"#",onClick:function(t){return n.props.onChange(t,e-1)},children:e})},e))}else if(n.props.total>4&&e!==c&&3===e){var r=5===n.props.total?"3":"...";a.push(Object(s.jsx)("li",{className:"pager__item disabled",children:Object(s.jsx)("a",{href:"#",children:r})},e))}else n.props.total>4&&e!==c&&e===n.props.total-2&&!(c<3||c>n.props.total-2)&&a.push(Object(s.jsx)("li",{className:"pager__item disabled",children:Object(s.jsx)("a",{href:"#",children:"..."})},e))},u=1;u=0?this.props.current-1:0,t=this.props.current+1<=this.props.total?this.props.current+1:this.props.total;return Object(s.jsx)("div",{className:"col-lg-9 offset-lg-3",children:Object(s.jsxs)("nav",{className:"pager",role:"navigation","aria-labelledby":"pagination-heading",children:[Object(s.jsx)("h4",{id:"pagination-heading",className:"visually-hidden",children:"Seitennummerierung"}),Object(s.jsx)("ul",{className:"pager__items js-pager__items",children:this.pagination(e,t)})]})})}}]),n}(c.a.Component),V=function(e){Object(j.a)(n,e);var t=Object(f.a)(n);function n(e){var s;return Object(p.a)(this,n),(s=t.call(this,e)).handlePaginationClick=function(){var e=Object(d.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState(Object(u.a)(Object(u.a)({},s.state),{},{currentPage:n}),Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.updateObjectTypes=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateSubObjectTypes=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedSubObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateLicenses=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedLicenses:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateTheme=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedTheme:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateEvents=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedEvents:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.doSearch=function(){var e=Object(d.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({searchTerm:t,selectedInstitution:n,currentPage:0},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.loadData=Object(d.a)(o.a.mark((function e(){var t,n,a,c,r,i,l,p,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.state.limit,n=s.state.currentPage*t,a=s.state.selectedObjectTypes.join(","),c=s.state.selectedSubObjectTypes.join(","),r=s.state.selectedEvents.join(","),i=s.state.selectedLicenses.join(","),l=s.state.selectedTheme.join(","),p=s.state.selectedInstitution,e.next=10,F(n,r,a,c,i,l,p,s.state.searchTerm);case 10:h=e.sent,s.setState(Object(u.a)(Object(u.a)({},s.state),{},{cards:h.data,pages:Math.ceil(h.count/t),loading:!1}),Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 12:case"end":return e.stop()}}),e)}))),s.state={loading:!0,searchTerm:"",count:0,pages:0,currentPage:0,limit:24,cards:[],selectedObjectTypes:[],selectedSubObjectTypes:[],selectedLicenses:[],selectedTheme:[],selectedEvents:[],selectedInstitution:""},s}return Object(h.a)(n,[{key:"componentDidMount",value:function(){var e=Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadData();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return this.state.loading?"....":Object(s.jsx)("div",{className:"view view-data-sets view-id-data-sets view-display-id-page_1 container",children:Object(s.jsxs)("div",{className:"row",children:[Object(s.jsx)(P,{updateObjectTypes:this.updateObjectTypes,updateSubObjectTypes:this.updateSubObjectTypes,updateLicenses:this.updateLicenses,updateTheme:this.updateTheme,updateEvents:this.updateEvents,doSearch:this.doSearch}),Object(s.jsx)(R,{cards:this.state.cards}),Object(s.jsx)(q,{total:this.state.pages,current:this.state.currentPage,onChange:this.handlePaginationClick,limit:this.state.limit})]})})}}]),n}(c.a.Component);var M=function(){return Object(s.jsx)(V,{})};i.a.render(Object(s.jsx)(c.a.StrictMode,{children:Object(s.jsx)(M,{})}),document.getElementById("root"))}},[[60,1,2]]]); -//# sourceMappingURL=main.a349ae92.chunk.js.map \ No newline at end of file diff --git a/web/dd-react/datasets/static/js/main.a349ae92.chunk.js.map b/web/dd-react/datasets/static/js/main.a349ae92.chunk.js.map deleted file mode 100644 index b5375bb4..00000000 --- a/web/dd-react/datasets/static/js/main.a349ae92.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["api.js","components/DataFilters.js","components/Datasets.js","components/Pagination.js","Data.js","App.js","index.js"],"names":["API_HOST","process","getLangCodeOfPath","pathArray","window","location","pathname","split","langCode","length","pop","includes","loadObjectTypes","id","a","axios","get","headers","catch","error","response","data","loadSubObjectTypes","loadLicenses","loadTheme","loadInstitutions","loadEvents","loadDatasets","offset","events","objecttypes","subobjecttypes","licenses","theme","institution","q","DataFilters","props","selectObjectType","tid","selectedObjectTypes","state","filter","item","selectedSubObjectTypes","subObjectTypes","map","subterm","setState","updateSubObjectTypes","push","updateObjectTypes","selectSubObjectType","selectLicense","selectedLicenses","updateLicenses","selectTheme","selectedTheme","updateTheme","selectEvent","nid","selectedEvents","updateEvents","onChange","event","searchTerm","target","value","onChangeInstitution","newValue","method","selectedInstitution","getSuggestions","inputValue","trim","toLowerCase","inputLength","institutions","name","indexOf","onSuggestionsFetchRequested","institutionSuggestions","onSuggestionsClearRequested","doSearch","e","preventDefault","doReset","renderObjectTypes","term","key","className","href","onClick","title","style","display","subClassName","renderLicenses","renderEvent","renderTheme","loading","objectTypes","suggestion","this","htmlFor","data-drupal-selector","multiple","size","suggestions","getSuggestionValue","renderSuggestion","inputProps","placeholder","type","maxLength","React","Component","Datasets","cards","card","url","src","image_url","width","height","alt","rel","author_name","event_titles","index","objecttypes_titles","project_type","Pagination","prevPage","nextPage","out","currentPage","current","hasPreviousLink","Boolean","total","hasNextLink","hasLastLink","aria-hidden","i","classNameLi","role","aria-labelledby","pagination","Data","handlePaginationClick","page","loadData","ins","limit","join","pages","Math","ceil","count","App","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"8PAEaA,EAAWC,GAIxB,SAASC,IAGP,IAFA,IAAMC,EAAYC,OAAOC,SAASC,SAASC,MAAM,KAC7CC,EAAW,KACRL,EAAUM,OAAS,GAExB,GADAD,EAAWL,EAAUO,MACjB,CAAC,KAAM,KAAM,MAAMC,SAASH,GAC9B,OAAOA,EAGX,OAAOA,EAoBF,SAAeI,EAAtB,kC,4CAAO,WAA+BC,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AkB,GAClBG,cAAe,GACfI,eAAgB,GAChBU,oBAAqB,IAfN,E,0KAsGjBgC,KAAKiD,W,qIAIL,OAAIjD,KAAK9D,MAAM2D,QACN,OAIP,qBAAKV,UAAU,yEAAf,SACE,sBAAKA,UAAU,MAAf,UACE,cAAC,EAAD,CACEvC,kBAAmBoD,KAAKpD,kBACxBF,qBAAsBsD,KAAKtD,qBAC3BM,eAAgBgD,KAAKhD,eACrBG,YAAa6C,KAAK7C,YAClBI,aAAcyC,KAAKzC,aACnBqB,SAAUoB,KAAKpB,WAEjB,cAAC,EAAD,CAAUmC,MAAOf,KAAK9D,MAAM6E,QAC5B,cAAC,EAAD,CACEsB,MAAOrC,KAAK9D,MAAMmH,MAClBnB,QAASlC,KAAK9D,MAAM+F,YACpBzE,SAAUwC,KAAK+C,sBACfI,MAAOnD,KAAK9D,MAAMiH,iB,GAjIXvC,IAAMC,WCIV4C,MAPf,WACE,OAEE,aADA,CACC,EAAD,KCNJC,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.a349ae92.chunk.js","sourcesContent":["import axios from 'axios'\n\nexport const API_HOST = process.env.REACT_APP_API_HOST\n// export const API_HOST = process.env.REACT_APP_API_HOST || \"https://\" + window.location.host\n\n\nfunction getLangCodeOfPath() {\n const pathArray = window.location.pathname.split('/');\n let langCode = \"de\"\n while (pathArray.length > 0 ) {\n langCode = pathArray.pop();\n if (['de', 'en', 'fr'].includes(langCode)) {\n return langCode\n }\n }\n return langCode\n}\n\n\nexport async function loadProjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/projecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadObjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/objecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\n\nexport async function loadSubObjectTypes() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/subobjecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n return response.data\n}\n\n\nexport async function loadLicenses(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/licenses`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadTheme(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/theme`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadInstitutions() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/institutions`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadEvents(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/events`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadCards(offset, projects = \"\", events = \"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/cards?offset=${offset}&projects=${projects}&events=${events}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadDatasets(offset, events = \"\", objecttypes = \"\", subobjecttypes = \"\", licenses = \"\", theme = \"\", institution=\"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/datasets?offset=${offset}&objecttypes=${objecttypes}&subobjecttypes=${subobjecttypes}&events=${events}&licenses=${licenses}&theme=${theme}&institution=${institution}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}","import React from \"react\";\nimport Autosuggest from 'react-autosuggest';\n\nimport { loadObjectTypes, loadSubObjectTypes, loadEvents, loadLicenses, loadTheme, loadInstitutions } from \"../api\"\n\nclass DataFilters extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n selectedInstitution: \"\",\n institutionSuggestions: [],\n objectTypes: [],\n events: [],\n licenses: [],\n theme: [],\n selectedObjectTypes: [],\n selectedSubObjectTypes: [],\n selectedEvents: [],\n selectedTheme: [],\n selectedLicenses: [],\n institutions: [],\n }\n }\n\n renderSuggestion(suggestion) {\n return (\n {suggestion.name}\n );\n }\n\n getSuggestionValue(suggestion) {\n return suggestion.name;\n }\n\n selectObjectType = (tid) => {\n let selectedObjectTypes = this.state.selectedObjectTypes\n\n if (this.state.selectedObjectTypes.includes(tid)) {\n selectedObjectTypes = selectedObjectTypes.filter(item => item !== tid)\n // deselect childs if parent is not selected\n let selectedSubObjectTypes = this.state.selectedSubObjectTypes\n if (this.state.subObjectTypes[tid] && selectedSubObjectTypes.length) {\n this.state.subObjectTypes[tid].map(subterm => {\n if (selectedSubObjectTypes.includes(subterm.tid))\n selectedSubObjectTypes = selectedSubObjectTypes.filter(item => item !== subterm.tid)\n return null\n })\n this.setState({ selectedSubObjectTypes }, async () => {\n this.props.updateSubObjectTypes(selectedSubObjectTypes)\n })\n }\n } else {\n selectedObjectTypes.push(tid)\n }\n\n this.setState({ selectedObjectTypes }, async () => {\n this.props.updateObjectTypes(selectedObjectTypes)\n })\n }\n\n selectSubObjectType = (tid) => {\n let selectedSubObjectTypes = this.state.selectedSubObjectTypes\n\n if (this.state.selectedSubObjectTypes.includes(tid)) {\n selectedSubObjectTypes = selectedSubObjectTypes.filter(item => item !== tid)\n } else {\n selectedSubObjectTypes.push(tid)\n }\n this.setState({ selectedSubObjectTypes }, async () => {\n this.props.updateSubObjectTypes(selectedSubObjectTypes)\n })\n }\n\n selectLicense = (tid) => {\n let selectedLicenses = this.state.selectedLicenses\n\n if (this.state.selectedLicenses.includes(tid)) {\n selectedLicenses = selectedLicenses.filter(item => item !== tid)\n } else {\n selectedLicenses.push(tid)\n }\n\n this.setState({ selectedLicenses }, async () => {\n this.props.updateLicenses(selectedLicenses)\n })\n }\n\n selectTheme = (tid) => {\n let selectedTheme = this.state.selectedTheme\n\n if (this.state.selectedTheme.includes(tid)) {\n selectedTheme = selectedTheme.filter(item => item !== tid)\n } else {\n selectedTheme.push(tid)\n }\n\n this.setState({ selectedTheme }, async () => {\n this.props.updateTheme(selectedTheme)\n })\n }\n\n selectEvent = (nid) => {\n let selectedEvents = this.state.selectedEvents\n\n if (this.state.selectedEvents.includes(nid)) {\n selectedEvents = selectedEvents.filter(item => item !== nid)\n } else {\n selectedEvents.push(nid)\n }\n\n this.setState({ selectedEvents }, async () => {\n this.props.updateEvents(selectedEvents)\n })\n }\n\n onChange = (event) => {\n this.setState({ searchTerm: event.target.value })\n }\n\n onChangeInstitution = (event, { newValue, method }) => {\n this.setState({\n selectedInstitution: newValue\n });\n };\n\n getSuggestions = value => {\n const inputValue = value.trim().toLowerCase();\n const inputLength = inputValue.length;\n\n let institutions = this.state.institutions\n\n return inputLength === 0 ? [] : institutions.filter(institution =>\n // Find from Begin to String:\n // institution.name.toLowerCase().slice(0, inputLength) === inputValue\n // Find string in string:\n institution.name.toLowerCase().indexOf(inputValue)>-1\n );\n };\n\n onSuggestionsFetchRequested = ({ value }) => {\n // Autosuggest will call this function every time you need to update suggestions.\n this.setState({\n institutionSuggestions: this.getSuggestions(value)\n });\n };\n\n onSuggestionsClearRequested = () => {\n // Autosuggest will call this function every time you need to clear suggestions.\n this.setState({\n institutionSuggestions: []\n });\n };\n\n doSearch = (e) => {\n e.preventDefault()\n\n if (this.state.searchTerm || this.state.selectedInstitution !== \"\") {\n this.props.doSearch(this.state.searchTerm, this.state.selectedInstitution)\n }\n }\n\n doReset = (e) => {\n e.preventDefault()\n this.setState({ selectedObjectTypes: [], selectedSubObjectTypes: [], selectedEvents: [], selectedTheme: [], selectedLicenses: [], selectedInstitution: \"\", searchTerm: \"\" }, async () => {\n this.props.updateObjectTypes([])\n this.props.updateSubObjectTypes([])\n this.props.updateEvents([])\n this.props.updateLicenses([])\n this.props.updateTheme([])\n this.props.doSearch(\"\", \"\")\n })\n }\n\n async componentDidMount() {\n // try catch\n const objectTypes = await loadObjectTypes()\n // objectTypes: [{tid: \"9\", title: \"Bild\"},..]\n // const subObjectTypes = { \"9\": [{tid: \"162\", title: \"Scan eines Fotos\"}]}\n const subObjectTypes = await loadSubObjectTypes()\n\n const events = await loadEvents()\n const licenses = await loadLicenses()\n const theme = await loadTheme()\n const institutions = await loadInstitutions()\n\n this.setState({\n ...this.state,\n objectTypes,\n subObjectTypes,\n events,\n licenses,\n theme,\n institutions,\n loading: false,\n }, async () => {\n\n })\n }\n\n renderObjectTypes = (term, key) => {\n let out = []\n let className = \"bef-link badge\"\n if (this.state.selectedObjectTypes.includes(term.tid)) {\n className = \"bef-link bef-link--selected badge\"\n // subtypes?\n if (this.state.subObjectTypes[term.tid]) {\n out.push()\n return (<>
  • this.selectObjectType(term.tid)}>{term.title}
    \n \n
  • \n )\n }\n }\n return (
  • this.selectObjectType(term.tid)}>{term.title}
  • )\n }\n\n renderLicenses = (term, key) => {\n const className = (this.state.selectedLicenses.includes(term.tid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
  • this.selectLicense(term.tid)}>{term.title}
  • )\n }\n\n renderEvent = (event, key) => {\n const className = (this.state.selectedEvents.includes(event.nid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
  • this.selectEvent(event.nid)}>{event.title}
  • )\n }\n\n renderTheme = (event, key) => {\n const className = (this.state.selectedTheme.includes(event.tid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
  • this.selectTheme(event.tid)}>{event.title}
  • )\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.events.map((term, key) => {\n return (this.renderEvent(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.objectTypes.map((term, key) => {\n return (this.renderObjectTypes(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.licenses.map((term, key) => {\n return (this.renderLicenses(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.theme.map((term, key) => {\n return (this.renderTheme(term, key))\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\nexport default DataFilters;","\nfunction Datasets(props) {\n\n if (!props.cards.length) {\n return
    \n
    \n Es sind keine den Filtereinstellungen entsprechenden Datensets vorhanden.\n
    \n
    \n }\n\n return (\n
    \n
    \n {props.cards.map((card, key)=>{\n return (
    \n
    \n \n
    \n

    \n \n {card.title}\n \n

    \n
    \n
    \n
    {card.author_name}
    \n
    \n
    \n
    \n
    \n
    \n
    Veranstaltung
    \n {card.event_titles.map((event, index) => {\n return \n })}\n
    \n
    \n
    \n
    \n
    \n {card.objecttypes_titles.map((project_type, index) => {\n return (
    {project_type}
    )\n })}\n
    \n
    \n
    \n
    \n
    \n )})}\n
    \n
    \n )\n}\n\nexport default Datasets;","import React from \"react\";\n\n\n\nclass Pagination extends React.Component {\n\n pagination(prevPage, nextPage) {\n const out = []\n\n const currentPage = this.props.current + 1\n const hasPreviousLink = Boolean(currentPage > 1 && prevPage !== this.props.total)\n const hasNextLink = Boolean(nextPage >= currentPage && nextPage !== this.props.total)\n\n const hasFirstLink = hasPreviousLink\n const hasLastLink = hasNextLink\n\n if (hasFirstLink) { // «\n out.push(
  • \n this.props.onChange(e, 0)}>\n Erste Seite\n «\n \n
  • )\n }\n\n if (hasPreviousLink) {\n out.push(\n
  • \n this.props.onChange(e, prevPage)}>\n Vorherige Seite\n \n \n
  • \n )\n }\n\n for (let i = 1; i < (this.props.total + 1); i++) {\n\n const pushPage = ((i < 3) || (i > (this.props.total - 2)) || (i === currentPage)) ? true : false\n\n if (pushPage) {\n const classNameLi = (i === currentPage) ? \"pager__item is-active\" : \"pager__item\"\n out.push(
  • \n this.props.onChange(e, (i - 1))}>\n {i}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === 3)\n ) {\n const display = (this.props.total === 5) ? '3' : '...'\n out.push(
  • \n \n {display}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === (this.props.total - 2))\n && !(\n (currentPage < 3)\n || (currentPage > (this.props.total - 2))\n )\n ) {\n out.push(
  • \n \n ...\n \n
  • )\n }\n }\n\n if (hasNextLink) {\n out.push(
  • \n this.props.onChange(e, nextPage)}>\n Nächste Seite\n \n \n
  • )\n }\n\n if (hasLastLink) { // »\n out.push(
  • \n this.props.onChange(e, this.props.total-1)}>\n Letzte Seite\n »\n \n
  • )\n }\n\n return out;\n }\n\n render() {\n\n const prevPage = ((this.props.current - 1) >= 0) ? this.props.current - 1 : 0\n const nextPage = ((this.props.current + 1) <= this.props.total) ? this.props.current + 1 : this.props.total\n\n return (\n
    \n \n
    \n );\n }\n}\nexport default Pagination;","import React from \"react\";\n\n\nimport DataFilters from \"./components/DataFilters\"\nimport Datasets from \"./components/Datasets\"\nimport Pagination from \"./components/Pagination\"\n\n\nimport { loadDatasets } from \"./api\"\n\n\nclass Data extends React.Component {\n\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n count: 0,\n pages: 0,\n currentPage: 0,\n limit: 24,\n cards: [],\n selectedObjectTypes: [],\n selectedSubObjectTypes: [],\n selectedLicenses: [],\n selectedTheme: [],\n selectedEvents: [],\n selectedInstitution: \"\",\n }\n }\n\n handlePaginationClick = async (e, page) => {\n this.setState({\n ...this.state,\n currentPage: page\n }, async () => {\n await this.loadData()\n })\n }\n\n updateObjectTypes = async (data) => {\n this.setState({\n selectedObjectTypes: data,\n }, async () => {\n await this.loadData()\n })\n }\n\n updateSubObjectTypes = async (data) => {\n this.setState({\n selectedSubObjectTypes: data,\n }, async () => {\n await this.loadData()\n })\n }\n\n updateLicenses = async (data) => {\n this.setState({\n selectedLicenses: data\n }, async () => {\n await this.loadData()\n })\n }\n\n updateTheme = async (data) => {\n this.setState({\n selectedTheme: data\n }, async () => {\n await this.loadData()\n })\n }\n\n updateEvents = async (data) => {\n this.setState({\n selectedEvents: data\n }, async () => {\n await this.loadData()\n })\n }\n\n doSearch = async (q, ins) => {\n this.setState({\n searchTerm: q,\n selectedInstitution: ins,\n currentPage: 0,\n }, async () => {\n await this.loadData()\n })\n }\n\n loadData = async () => {\n const limit = this.state.limit\n const offset = this.state.currentPage * limit\n\n const objecttypes = this.state.selectedObjectTypes.join(\",\")\n const subObjectTypes = this.state.selectedSubObjectTypes.join(\",\")\n const events = this.state.selectedEvents.join(\",\")\n const licenses = this.state.selectedLicenses.join(\",\")\n const theme = this.state.selectedTheme.join(\",\")\n const institution = this.state.selectedInstitution\n\n const cards = await loadDatasets(offset, events, objecttypes, subObjectTypes, licenses, theme, institution, this.state.searchTerm)\n\n this.setState({\n ...this.state,\n cards: cards.data,\n pages: Math.ceil(cards.count / limit),\n loading: false,\n }, async () => {\n\n })\n }\n\n async componentDidMount() {\n this.loadData()\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n \n \n \n
    \n
    \n )\n }\n}\n\nexport default Data","\n// import Projects from \"./Projects\"\nimport Data from \"./Data\"\n\n// import \"./app.css\"\n\n\n// \nfunction App() {\n return (\n // \n \n );\n}\n\nexport default App;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/web/dd-react/datasets/static/js/main.b4b987bc.chunk.js b/web/dd-react/datasets/static/js/main.b4b987bc.chunk.js new file mode 100644 index 00000000..cf5a1aa0 --- /dev/null +++ b/web/dd-react/datasets/static/js/main.b4b987bc.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonpdnb-filter"]=this["webpackJsonpdnb-filter"]||[]).push([[0],{60:function(e,t,n){"use strict";n.r(t);var s=n(0),a=n(3),c=n.n(a),r=n(22),i=n.n(r),l=n(1),o=n.n(l),u=n(6),d=n(2),p=n(7),h=n(8),j=n(10),f=n(9),b=n(23),m=n.n(b),v=n(5),O=n.n(v),x="";function g(){for(var e=window.location.pathname.split("/"),t="de";e.length>0;)if(t=e.pop(),["de","en","fr"].includes(t))return t;return t}function y(e){return w.apply(this,arguments)}function w(){return(w=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/objecttypes"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return T.apply(this,arguments)}function T(){return(T=Object(d.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g(),e.next=3,O.a.get("".concat(x,"/").concat(t,"/dd_views/subobjecttypes"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e){return S.apply(this,arguments)}function S(){return(S=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/licenses"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e){return C.apply(this,arguments)}function C(){return(C=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/theme"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return E.apply(this,arguments)}function E(){return(E=Object(d.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g(),e.next=3,O.a.get("".concat(x,"/").concat(t,"/dd_views/institutions"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e){return I.apply(this,arguments)}function I(){return(I=Object(d.a)(o.a.mark((function e(t){var n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g(),e.next=3,O.a.get("".concat(x,"/").concat(n,"/dd_views/events"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return s=e.sent,e.abrupt("return",s.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(e){return z.apply(this,arguments)}function z(){return(z=Object(d.a)(o.a.mark((function e(t){var n,s,a,c,r,i,l,u,d,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:"",s=p.length>2&&void 0!==p[2]?p[2]:"",a=p.length>3&&void 0!==p[3]?p[3]:"",c=p.length>4&&void 0!==p[4]?p[4]:"",r=p.length>5&&void 0!==p[5]?p[5]:"",i=p.length>6&&void 0!==p[6]?p[6]:"",l=p.length>7&&void 0!==p[7]?p[7]:"",u=g(),e.next=10,O.a.get("".concat(x,"/").concat(u,"/dd_views/datasets?offset=").concat(t,"&objecttypes=").concat(s,"&subobjecttypes=").concat(a,"&events=").concat(n,"&licenses=").concat(c,"&theme=").concat(r,"&institution=").concat(i,"&q=").concat(l),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 10:return d=e.sent,e.abrupt("return",d.data);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var P=function(e){Object(j.a)(n,e);var t=Object(f.a)(n);function n(e){var a;return Object(p.a)(this,n),(a=t.call(this,e)).selectObjectType=function(e){var t=a.state.selectedObjectTypes;if(a.state.selectedObjectTypes.includes(e)){t=t.filter((function(t){return t!==e}));var n=a.state.selectedSubObjectTypes;a.state.subObjectTypes[e]&&n.length&&(a.state.subObjectTypes[e].map((function(e){return n.includes(e.tid)&&(n=n.filter((function(t){return t!==e.tid}))),null})),a.setState({selectedSubObjectTypes:n},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateSubObjectTypes(n);case 1:case"end":return e.stop()}}),e)})))))}else t.push(e);a.setState({selectedObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateObjectTypes(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectSubObjectType=function(e){var t=a.state.selectedSubObjectTypes;a.state.selectedSubObjectTypes.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedSubObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateSubObjectTypes(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectLicense=function(e){var t=a.state.selectedLicenses;a.state.selectedLicenses.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedLicenses:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateLicenses(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectTheme=function(e){var t=a.state.selectedTheme;a.state.selectedTheme.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedTheme:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateTheme(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectEvent=function(e){var t=a.state.selectedEvents;a.state.selectedEvents.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedEvents:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateEvents(t);case 1:case"end":return e.stop()}}),e)}))))},a.onChange=function(e){a.setState({searchTerm:e.target.value})},a.onChangeInstitution=function(e,t){var n=t.newValue;t.method;a.setState({selectedInstitution:n})},a.getSuggestions=function(e){var t=e.trim().toLowerCase(),n=t.length,s=a.state.institutions;return 0===n?[]:s.filter((function(e){return e.name.toLowerCase().indexOf(t)>-1}))},a.onSuggestionsFetchRequested=function(e){var t=e.value;a.setState({institutionSuggestions:a.getSuggestions(t)})},a.onSuggestionsClearRequested=function(){a.setState({institutionSuggestions:[]})},a.doSearch=function(e){e.preventDefault(),(a.state.searchTerm||""!==a.state.selectedInstitution)&&a.props.doSearch(a.state.searchTerm,a.state.selectedInstitution)},a.doReset=function(e){e.preventDefault(),a.setState({selectedObjectTypes:[],selectedSubObjectTypes:[],selectedEvents:[],selectedTheme:[],selectedLicenses:[],selectedInstitution:"",searchTerm:""},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateObjectTypes([]),a.props.updateSubObjectTypes([]),a.props.updateEvents([]),a.props.updateLicenses([]),a.props.updateTheme([]),a.props.doSearch("","");case 6:case"end":return e.stop()}}),e)}))))},a.renderObjectTypes=function(e,t){var n="bef-link badge";return a.state.selectedObjectTypes.includes(e.tid)&&(n="bef-link bef-link--selected badge",a.state.subObjectTypes[e.tid])?Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("li",{children:[Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectObjectType(e.tid)},children:e.title})}),Object(s.jsx)("ul",{style:{display:"block"},children:a.state.subObjectTypes[e.tid].map((function(e){var t=a.state.selectedSubObjectTypes.includes(e.tid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge ",children:Object(s.jsx)("a",{href:"#",className:t,onClick:function(){return a.selectSubObjectType(e.tid)},children:e.title})})})}))})]},t)}):Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectObjectType(e.tid)},children:e.title})})},t)},a.renderLicenses=function(e,t){var n=a.state.selectedLicenses.includes(e.tid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectLicense(e.tid)},children:e.title})})},t)},a.renderEvent=function(e,t){var n=a.state.selectedEvents.includes(e.nid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectEvent(e.nid)},children:e.title})})},t)},a.renderTheme=function(e,t){var n=a.state.selectedTheme.includes(e.tid)?"bef-link bef-link--selected badge":"bef-link badge";return Object(s.jsx)("li",{children:Object(s.jsx)("div",{className:"badge",children:Object(s.jsx)("a",{href:"#",className:n,onClick:function(){return a.selectTheme(e.tid)},children:e.title})})},t)},a.state={loading:!0,searchTerm:"",selectedInstitution:"",institutionSuggestions:[],objectTypes:[],events:[],licenses:[],theme:[],selectedObjectTypes:[],selectedSubObjectTypes:[],selectedEvents:[],selectedTheme:[],selectedLicenses:[],institutions:[]},a}return Object(h.a)(n,[{key:"renderSuggestion",value:function(e){return Object(s.jsx)("span",{children:e.name})}},{key:"getSuggestionValue",value:function(e){return e.name}},{key:"componentDidMount",value:function(){var e=Object(d.a)(o.a.mark((function e(){var t,n,s,a,c,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y();case 2:return t=e.sent,e.next=5,k();case 5:return n=e.sent,e.next=8,D();case 8:return s=e.sent,e.next=11,N();case 11:return a=e.sent,e.next=14,_();case 14:return c=e.sent,e.next=17,L();case 17:r=e.sent,this.setState(Object(u.a)(Object(u.a)({},this.state),{},{objectTypes:t,subObjectTypes:n,events:s,licenses:a,theme:c,institutions:r,loading:!1}),Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return this.state.loading?"....":Object(s.jsx)("div",{className:"view-filters col-lg-3",children:Object(s.jsx)("form",{className:"views-exposed-form bef-exposed-form",children:Object(s.jsxs)("div",{className:"form--inline clearfix row",children:[Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-project-type form-item-project-type",children:[Object(s.jsx)("label",{htmlFor:"edit-project-type",children:"Event"}),Object(s.jsx)("div",{"data-drupal-selector":"edit-project-type",multiple:"multiple",name:"project_type",id:"edit-project-type",size:"9",className:"form-select bef-links",children:Object(s.jsx)("ul",{children:this.state.events.map((function(t,n){return e.renderEvent(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(s.jsx)("label",{htmlFor:"edit-object-types",children:"Objekttyp"}),Object(s.jsx)("div",{multiple:"multiple",name:"event",id:"edit-object-types",size:"8",className:"form-select bef-links bef-nested",children:Object(s.jsx)("ul",{children:this.state.objectTypes.map((function(t,n){return e.renderObjectTypes(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(s.jsx)("label",{htmlFor:"edit-license",children:"Lizenz Mediendateien"}),Object(s.jsx)("div",{multiple:"multiple",name:"event",id:"edit-license",size:"8",className:"form-select bef-links",children:Object(s.jsx)("ul",{children:this.state.licenses.map((function(t,n){return e.renderLicenses(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(s.jsx)("label",{htmlFor:"edit-theme",children:"Thema"}),Object(s.jsx)("div",{multiple:"multiple",name:"event",id:"edit-theme",size:"8",className:"form-select bef-links",children:Object(s.jsx)("ul",{children:this.state.theme.map((function(t,n){return e.renderTheme(t,n)}))})})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-search form-item-search",children:[Object(s.jsx)("label",{htmlFor:"edit-search",children:"Institution"}),Object(s.jsx)(m.a,{suggestions:this.state.institutionSuggestions,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderSuggestion,inputProps:{placeholder:"",value:this.state.selectedInstitution,onChange:this.onChangeInstitution}})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{className:"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-search form-item-search",children:[Object(s.jsx)("label",{htmlFor:"edit-search",children:"Volltextsuche"}),Object(s.jsx)("input",{type:"text",id:"edit-search",name:"search",value:this.state.searchTerm,size:"30",maxLength:"128",className:"form-text",onChange:this.onChange})]})}),Object(s.jsx)("div",{className:"col-12",children:Object(s.jsxs)("div",{"data-drupal-selector":"edit-actions",className:"form-actions js-form-wrapper form-wrapper",id:"edit-actions",children:[Object(s.jsx)("input",{type:"submit",value:"Filter anwenden",className:"button js-form-submit form-submit",onClick:this.doSearch}),Object(s.jsx)("input",{type:"submit",value:"Zur\xfccksetzen",className:"button js-form-submit form-submit",onClick:this.doReset})]})})]})})})}}]),n}(c.a.Component);var R=function(e){return e.cards.length?Object(s.jsx)("div",{className:"view-content col-lg-9",children:Object(s.jsx)("div",{className:"card-columns",children:e.cards.map((function(e,t){return Object(s.jsx)("div",{className:"views-row card",children:Object(s.jsxs)("article",{className:"node node--type-data-set node--view-mode-teaser",children:[Object(s.jsx)("div",{className:"card-img card-img-top",children:Object(s.jsx)("a",{href:e.url,children:Object(s.jsx)("div",{className:"field field--name-field-attributed-image field--type-entity-reference-revisions field--label-hidden field__item",children:Object(s.jsxs)("div",{className:"paragraph paragraph--type--attributed-image paragraph--view-mode--teaser",children:[Object(s.jsx)("div",{className:"field field--name-field-inline-image field--type-image field--label-hidden field__item",children:Object(s.jsx)("img",{src:e.image_url,width:"480",height:"256",alt:"",className:"image-style-large"})}),Object(s.jsx)("div",{className:"paragraph--type--attributed-image--attribution"})]})})})}),Object(s.jsxs)("div",{className:"card-body",children:[Object(s.jsx)("h2",{className:"card-title",children:Object(s.jsx)("a",{href:e.url,rel:"bookmark",children:Object(s.jsx)("span",{className:"field field--name-title field--type-string field--label-hidden",children:e.title})})}),Object(s.jsxs)("div",{className:"node__content",children:[Object(s.jsx)("div",{className:"field field__items field--institution-name",children:Object(s.jsx)("div",{className:"field__item",children:e.author_name})}),Object(s.jsx)("div",{className:"field field--name-field-events field--type-entity-reference-revisions field--label-hidden field__items",children:Object(s.jsx)("div",{className:"field__item",children:Object(s.jsx)("div",{className:"paragraph paragraph--type--data-set-event paragraph--view-mode--preview",children:Object(s.jsxs)("div",{className:"field field--name-field-event field--type-entity-reference field--label-visually_hidden",children:[Object(s.jsx)("div",{className:"field__label visually-hidden",children:"Veranstaltung"}),e.event_titles.map((function(e,t){return Object(s.jsx)("div",{className:"field__item",children:Object(s.jsx)("a",{href:e.url,children:e.title})},t)}))]})})})}),Object(s.jsx)("div",{className:"field field--name-field-object-type field--type-entity-reference field--label-hidden field__items",children:e.objecttypes_titles.map((function(e,t){return Object(s.jsx)("div",{className:"badge field__item",children:Object(s.jsx)("span",{children:e})},t)}))})]})]})]})},t)}))})}):Object(s.jsx)("div",{className:"col-lg-9",children:Object(s.jsx)("div",{className:"",children:"Es sind keine den Filtereinstellungen entsprechenden Datensets vorhanden."})})},q=function(e){Object(j.a)(n,e);var t=Object(f.a)(n);function n(){return Object(p.a)(this,n),t.apply(this,arguments)}return Object(h.a)(n,[{key:"pagination",value:function(e,t){var n=this,a=[],c=this.props.current+1,r=Boolean(c>1&&e!==this.props.total),i=Boolean(t>=c&&t!==this.props.total),l=i;r&&a.push(Object(s.jsx)("li",{className:"pager__item pager__item--next",children:Object(s.jsxs)("a",{href:"#",title:"Zur ersten Seite",rel:"next",onClick:function(e){return n.props.onChange(e,0)},children:[Object(s.jsx)("span",{className:"visually-hidden",children:"Erste Seite"}),Object(s.jsx)("span",{"aria-hidden":"true",children:"\xab"})]})})),r&&a.push(Object(s.jsx)("li",{className:"pager__item pager__item--previous",children:Object(s.jsxs)("a",{href:"#",title:"Zur vorherigen Seite",rel:"prev",onClick:function(t){return n.props.onChange(t,e)},children:[Object(s.jsx)("span",{className:"visually-hidden",children:"Vorherige Seite"}),Object(s.jsx)("span",{"aria-hidden":"true",children:"\u2039"})]})}));for(var o=function(e){if(e<3||e>n.props.total-2||e===c){var t=e===c?"pager__item is-active":"pager__item";a.push(Object(s.jsx)("li",{className:t,children:Object(s.jsx)("a",{href:"#",onClick:function(t){return n.props.onChange(t,e-1)},children:e})},e))}else if(n.props.total>4&&e!==c&&3===e){var r=5===n.props.total?"3":"...";a.push(Object(s.jsx)("li",{className:"pager__item disabled",children:Object(s.jsx)("a",{href:"#",children:r})},e))}else n.props.total>4&&e!==c&&e===n.props.total-2&&!(c<3||c>n.props.total-2)&&a.push(Object(s.jsx)("li",{className:"pager__item disabled",children:Object(s.jsx)("a",{href:"#",children:"..."})},e))},u=1;u=0?this.props.current-1:0,t=this.props.current+1<=this.props.total?this.props.current+1:this.props.total;return Object(s.jsx)("div",{className:"col-lg-9 offset-lg-3",children:Object(s.jsxs)("nav",{className:"pager",role:"navigation","aria-labelledby":"pagination-heading",children:[Object(s.jsx)("h4",{id:"pagination-heading",className:"visually-hidden",children:"Seitennummerierung"}),Object(s.jsx)("ul",{className:"pager__items js-pager__items",children:this.pagination(e,t)})]})})}}]),n}(c.a.Component),V=function(e){Object(j.a)(n,e);var t=Object(f.a)(n);function n(e){var s;return Object(p.a)(this,n),(s=t.call(this,e)).handlePaginationClick=function(){var e=Object(d.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState(Object(u.a)(Object(u.a)({},s.state),{},{currentPage:n}),Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.updateObjectTypes=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateSubObjectTypes=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedSubObjectTypes:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateLicenses=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedLicenses:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateTheme=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedTheme:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.updateEvents=function(){var e=Object(d.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({selectedEvents:t},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.doSearch=function(){var e=Object(d.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.setState({searchTerm:t,selectedInstitution:n,currentPage:0},Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.loadData=Object(d.a)(o.a.mark((function e(){var t,n,a,c,r,i,l,p,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.state.limit,n=s.state.currentPage*t,a=s.state.selectedObjectTypes.join(","),c=s.state.selectedSubObjectTypes.join(","),r=s.state.selectedEvents.join(","),i=s.state.selectedLicenses.join(","),l=s.state.selectedTheme.join(","),p=s.state.selectedInstitution,e.next=10,F(n,r,a,c,i,l,p,s.state.searchTerm);case 10:h=e.sent,s.setState(Object(u.a)(Object(u.a)({},s.state),{},{cards:h.data,pages:Math.ceil(h.count/t),currentPage:0,loading:!1}),Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 12:case"end":return e.stop()}}),e)}))),s.state={loading:!0,searchTerm:"",count:0,pages:0,currentPage:0,limit:24,cards:[],selectedObjectTypes:[],selectedSubObjectTypes:[],selectedLicenses:[],selectedTheme:[],selectedEvents:[],selectedInstitution:""},s}return Object(h.a)(n,[{key:"componentDidMount",value:function(){var e=Object(d.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadData();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return this.state.loading?"....":Object(s.jsx)("div",{className:"view view-data-sets view-id-data-sets view-display-id-page_1 container",children:Object(s.jsxs)("div",{className:"row",children:[Object(s.jsx)(P,{updateObjectTypes:this.updateObjectTypes,updateSubObjectTypes:this.updateSubObjectTypes,updateLicenses:this.updateLicenses,updateTheme:this.updateTheme,updateEvents:this.updateEvents,doSearch:this.doSearch}),Object(s.jsx)(R,{cards:this.state.cards}),Object(s.jsx)(q,{total:this.state.pages,current:this.state.currentPage,onChange:this.handlePaginationClick,limit:this.state.limit})]})})}}]),n}(c.a.Component);var M=function(){return Object(s.jsx)(V,{})};i.a.render(Object(s.jsx)(c.a.StrictMode,{children:Object(s.jsx)(M,{})}),document.getElementById("root"))}},[[60,1,2]]]); +//# sourceMappingURL=main.b4b987bc.chunk.js.map \ No newline at end of file diff --git a/web/dd-react/datasets/static/js/main.b4b987bc.chunk.js.map b/web/dd-react/datasets/static/js/main.b4b987bc.chunk.js.map new file mode 100644 index 00000000..29a82fb5 --- /dev/null +++ b/web/dd-react/datasets/static/js/main.b4b987bc.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["api.js","components/DataFilters.js","components/Datasets.js","components/Pagination.js","Data.js","App.js","index.js"],"names":["API_HOST","process","getLangCodeOfPath","pathArray","window","location","pathname","split","langCode","length","pop","includes","loadObjectTypes","id","a","axios","get","headers","catch","error","response","data","loadSubObjectTypes","loadLicenses","loadTheme","loadInstitutions","loadEvents","loadDatasets","offset","events","objecttypes","subobjecttypes","licenses","theme","institution","q","DataFilters","props","selectObjectType","tid","selectedObjectTypes","state","filter","item","selectedSubObjectTypes","subObjectTypes","map","subterm","setState","updateSubObjectTypes","push","updateObjectTypes","selectSubObjectType","selectLicense","selectedLicenses","updateLicenses","selectTheme","selectedTheme","updateTheme","selectEvent","nid","selectedEvents","updateEvents","onChange","event","searchTerm","target","value","onChangeInstitution","newValue","method","selectedInstitution","getSuggestions","inputValue","trim","toLowerCase","inputLength","institutions","name","indexOf","onSuggestionsFetchRequested","institutionSuggestions","onSuggestionsClearRequested","doSearch","e","preventDefault","doReset","renderObjectTypes","term","key","className","href","onClick","title","style","display","subClassName","renderLicenses","renderEvent","renderTheme","loading","objectTypes","suggestion","this","htmlFor","data-drupal-selector","multiple","size","suggestions","getSuggestionValue","renderSuggestion","inputProps","placeholder","type","maxLength","React","Component","Datasets","cards","card","url","src","image_url","width","height","alt","rel","author_name","event_titles","index","objecttypes_titles","project_type","Pagination","prevPage","nextPage","out","currentPage","current","hasPreviousLink","Boolean","total","hasNextLink","hasLastLink","aria-hidden","i","classNameLi","role","aria-labelledby","pagination","Data","handlePaginationClick","page","loadData","ins","limit","join","pages","Math","ceil","count","App","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"8PAEaA,EAAWC,GAIxB,SAASC,IAGP,IAFA,IAAMC,EAAYC,OAAOC,SAASC,SAASC,MAAM,KAC7CC,EA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ET,EAAK2B,MAAQ,CACX2D,SAAS,EACTnC,WAAY,GACZ8F,MAAO,EACPH,MAAO,EACPpB,YAAa,EACbkB,MAAO,GACPpC,MAAO,GACP9E,oBAAqB,GACrBI,uBAAwB,GACxBU,iBAAkB,GAClBG,cAAe,GACfI,eAAgB,GAChBU,oBAAqB,IAfN,E,0KAuGjBgC,KAAKiD,W,qIAIL,OAAIjD,KAAK9D,MAAM2D,QACN,OAIP,qBAAKV,UAAU,yEAAf,SACE,sBAAKA,UAAU,MAAf,UACE,cAAC,EAAD,CACEvC,kBAAmBoD,KAAKpD,kBACxBF,qBAAsBsD,KAAKtD,qBAC3BM,eAAgBgD,KAAKhD,eACrBG,YAAa6C,KAAK7C,YAClBI,aAAcyC,KAAKzC,aACnBqB,SAAUoB,KAAKpB,WAEjB,cAAC,EAAD,CAAUmC,MAAOf,KAAK9D,MAAM6E,QAC5B,cAAC,EAAD,CACEsB,MAAOrC,KAAK9D,MAAMmH,MAClBnB,QAASlC,KAAK9D,MAAM+F,YACpBzE,SAAUwC,KAAK+C,sBACfI,MAAOnD,KAAK9D,MAAMiH,iB,GAlIXvC,IAAMC,WCIV4C,MAPf,WACE,OAEE,aADA,CACC,EAAD,KCNJC,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.b4b987bc.chunk.js","sourcesContent":["import axios from 'axios'\n\nexport const API_HOST = process.env.REACT_APP_API_HOST\n// export const API_HOST = process.env.REACT_APP_API_HOST || \"https://\" + window.location.host\n\n\nfunction getLangCodeOfPath() {\n const pathArray = window.location.pathname.split('/');\n let langCode = \"de\"\n while (pathArray.length > 0 ) {\n langCode = pathArray.pop();\n if (['de', 'en', 'fr'].includes(langCode)) {\n return langCode\n }\n }\n return langCode\n}\n\n\nexport async function loadProjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/projecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadObjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/objecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\n\nexport async function loadSubObjectTypes() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/subobjecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n return response.data\n}\n\n\nexport async function loadLicenses(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/licenses`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadTheme(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/theme`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadInstitutions() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/institutions`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadEvents(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/events`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadCards(offset, projects = \"\", events = \"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/cards?offset=${offset}&projects=${projects}&events=${events}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadDatasets(offset, events = \"\", objecttypes = \"\", subobjecttypes = \"\", licenses = \"\", theme = \"\", institution=\"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/datasets?offset=${offset}&objecttypes=${objecttypes}&subobjecttypes=${subobjecttypes}&events=${events}&licenses=${licenses}&theme=${theme}&institution=${institution}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}","import React from \"react\";\nimport Autosuggest from 'react-autosuggest';\n\nimport { loadObjectTypes, loadSubObjectTypes, loadEvents, loadLicenses, loadTheme, loadInstitutions } from \"../api\"\n\nclass DataFilters extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n selectedInstitution: \"\",\n institutionSuggestions: [],\n objectTypes: [],\n events: [],\n licenses: [],\n theme: [],\n selectedObjectTypes: [],\n selectedSubObjectTypes: [],\n selectedEvents: [],\n selectedTheme: [],\n selectedLicenses: [],\n institutions: [],\n }\n }\n\n renderSuggestion(suggestion) {\n return (\n {suggestion.name}\n );\n }\n\n getSuggestionValue(suggestion) {\n return suggestion.name;\n }\n\n selectObjectType = (tid) => {\n let selectedObjectTypes = this.state.selectedObjectTypes\n\n if (this.state.selectedObjectTypes.includes(tid)) {\n selectedObjectTypes = selectedObjectTypes.filter(item => item !== tid)\n // deselect childs if parent is not selected\n let selectedSubObjectTypes = this.state.selectedSubObjectTypes\n if (this.state.subObjectTypes[tid] && selectedSubObjectTypes.length) {\n this.state.subObjectTypes[tid].map(subterm => {\n if (selectedSubObjectTypes.includes(subterm.tid))\n selectedSubObjectTypes = selectedSubObjectTypes.filter(item => item !== subterm.tid)\n return null\n })\n this.setState({ selectedSubObjectTypes }, async () => {\n this.props.updateSubObjectTypes(selectedSubObjectTypes)\n })\n }\n } else {\n selectedObjectTypes.push(tid)\n }\n\n this.setState({ selectedObjectTypes }, async () => {\n this.props.updateObjectTypes(selectedObjectTypes)\n })\n }\n\n selectSubObjectType = (tid) => {\n let selectedSubObjectTypes = this.state.selectedSubObjectTypes\n\n if (this.state.selectedSubObjectTypes.includes(tid)) {\n selectedSubObjectTypes = selectedSubObjectTypes.filter(item => item !== tid)\n } else {\n selectedSubObjectTypes.push(tid)\n }\n this.setState({ selectedSubObjectTypes }, async () => {\n this.props.updateSubObjectTypes(selectedSubObjectTypes)\n })\n }\n\n selectLicense = (tid) => {\n let selectedLicenses = this.state.selectedLicenses\n\n if (this.state.selectedLicenses.includes(tid)) {\n selectedLicenses = selectedLicenses.filter(item => item !== tid)\n } else {\n selectedLicenses.push(tid)\n }\n\n this.setState({ selectedLicenses }, async () => {\n this.props.updateLicenses(selectedLicenses)\n })\n }\n\n selectTheme = (tid) => {\n let selectedTheme = this.state.selectedTheme\n\n if (this.state.selectedTheme.includes(tid)) {\n selectedTheme = selectedTheme.filter(item => item !== tid)\n } else {\n selectedTheme.push(tid)\n }\n\n this.setState({ selectedTheme }, async () => {\n this.props.updateTheme(selectedTheme)\n })\n }\n\n selectEvent = (nid) => {\n let selectedEvents = this.state.selectedEvents\n\n if (this.state.selectedEvents.includes(nid)) {\n selectedEvents = selectedEvents.filter(item => item !== nid)\n } else {\n selectedEvents.push(nid)\n }\n\n this.setState({ selectedEvents }, async () => {\n this.props.updateEvents(selectedEvents)\n })\n }\n\n onChange = (event) => {\n this.setState({ searchTerm: event.target.value })\n }\n\n onChangeInstitution = (event, { newValue, method }) => {\n this.setState({\n selectedInstitution: newValue\n });\n };\n\n getSuggestions = value => {\n const inputValue = value.trim().toLowerCase();\n const inputLength = inputValue.length;\n\n let institutions = this.state.institutions\n\n return inputLength === 0 ? [] : institutions.filter(institution =>\n // Find from Begin to String:\n // institution.name.toLowerCase().slice(0, inputLength) === inputValue\n // Find string in string:\n institution.name.toLowerCase().indexOf(inputValue)>-1\n );\n };\n\n onSuggestionsFetchRequested = ({ value }) => {\n // Autosuggest will call this function every time you need to update suggestions.\n this.setState({\n institutionSuggestions: this.getSuggestions(value)\n });\n };\n\n onSuggestionsClearRequested = () => {\n // Autosuggest will call this function every time you need to clear suggestions.\n this.setState({\n institutionSuggestions: []\n });\n };\n\n doSearch = (e) => {\n e.preventDefault()\n\n if (this.state.searchTerm || this.state.selectedInstitution !== \"\") {\n this.props.doSearch(this.state.searchTerm, this.state.selectedInstitution)\n }\n }\n\n doReset = (e) => {\n e.preventDefault()\n this.setState({ selectedObjectTypes: [], selectedSubObjectTypes: [], selectedEvents: [], selectedTheme: [], selectedLicenses: [], selectedInstitution: \"\", searchTerm: \"\" }, async () => {\n this.props.updateObjectTypes([])\n this.props.updateSubObjectTypes([])\n this.props.updateEvents([])\n this.props.updateLicenses([])\n this.props.updateTheme([])\n this.props.doSearch(\"\", \"\")\n })\n }\n\n async componentDidMount() {\n // try catch\n const objectTypes = await loadObjectTypes()\n // objectTypes: [{tid: \"9\", title: \"Bild\"},..]\n // const subObjectTypes = { \"9\": [{tid: \"162\", title: \"Scan eines Fotos\"}]}\n const subObjectTypes = await loadSubObjectTypes()\n\n const events = await loadEvents()\n const licenses = await loadLicenses()\n const theme = await loadTheme()\n const institutions = await loadInstitutions()\n\n this.setState({\n ...this.state,\n objectTypes,\n subObjectTypes,\n events,\n licenses,\n theme,\n institutions,\n loading: false,\n }, async () => {\n\n })\n }\n\n renderObjectTypes = (term, key) => {\n let className = \"bef-link badge\"\n if (this.state.selectedObjectTypes.includes(term.tid)) {\n className = \"bef-link bef-link--selected badge\"\n // subtypes?\n if (this.state.subObjectTypes[term.tid]) {\n return (<>
  • \n
      \n {this.state.subObjectTypes[term.tid].map(subterm => {\n // selected\n const subClassName = (this.state.selectedSubObjectTypes.includes(subterm.tid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
    • \n \n
    • )\n })}\n
    \n
  • \n )\n }\n }\n return (
  • )\n }\n\n renderLicenses = (term, key) => {\n const className = (this.state.selectedLicenses.includes(term.tid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
  • )\n }\n\n renderEvent = (event, key) => {\n const className = (this.state.selectedEvents.includes(event.nid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
  • )\n }\n\n renderTheme = (event, key) => {\n const className = (this.state.selectedTheme.includes(event.tid)) ? \"bef-link bef-link--selected badge\" : \"bef-link badge\"\n return (
  • )\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.events.map((term, key) => {\n return (this.renderEvent(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.objectTypes.map((term, key) => {\n return (this.renderObjectTypes(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.licenses.map((term, key) => {\n return (this.renderLicenses(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.theme.map((term, key) => {\n return (this.renderTheme(term, key))\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\nexport default DataFilters;","\nfunction Datasets(props) {\n\n if (!props.cards.length) {\n return
    \n
    \n Es sind keine den Filtereinstellungen entsprechenden Datensets vorhanden.\n
    \n
    \n }\n\n return (\n
    \n
    \n {props.cards.map((card, key)=>{\n return (
    \n
    \n \n
    \n

    \n \n {card.title}\n \n

    \n
    \n
    \n
    {card.author_name}
    \n
    \n
    \n
    \n
    \n
    \n
    Veranstaltung
    \n {card.event_titles.map((event, index) => {\n return \n })}\n
    \n
    \n
    \n
    \n
    \n {card.objecttypes_titles.map((project_type, index) => {\n return (
    {project_type}
    )\n })}\n
    \n
    \n
    \n
    \n
    \n )})}\n
    \n
    \n )\n}\n\nexport default Datasets;","import React from \"react\";\n\n\n\nclass Pagination extends React.Component {\n\n pagination(prevPage, nextPage) {\n const out = []\n\n const currentPage = this.props.current + 1\n const hasPreviousLink = Boolean(currentPage > 1 && prevPage !== this.props.total)\n const hasNextLink = Boolean(nextPage >= currentPage && nextPage !== this.props.total)\n\n const hasFirstLink = hasPreviousLink\n const hasLastLink = hasNextLink\n\n if (hasFirstLink) { // «\n out.push(
  • \n this.props.onChange(e, 0)}>\n Erste Seite\n «\n \n
  • )\n }\n\n if (hasPreviousLink) {\n out.push(\n
  • \n this.props.onChange(e, prevPage)}>\n Vorherige Seite\n \n \n
  • \n )\n }\n\n for (let i = 1; i < (this.props.total + 1); i++) {\n\n const pushPage = ((i < 3) || (i > (this.props.total - 2)) || (i === currentPage)) ? true : false\n\n if (pushPage) {\n const classNameLi = (i === currentPage) ? \"pager__item is-active\" : \"pager__item\"\n out.push(
  • \n this.props.onChange(e, (i - 1))}>\n {i}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === 3)\n ) {\n const display = (this.props.total === 5) ? '3' : '...'\n out.push(
  • \n \n {display}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === (this.props.total - 2))\n && !(\n (currentPage < 3)\n || (currentPage > (this.props.total - 2))\n )\n ) {\n out.push(
  • \n \n ...\n \n
  • )\n }\n }\n\n if (hasNextLink) {\n out.push(
  • \n this.props.onChange(e, nextPage)}>\n Nächste Seite\n \n \n
  • )\n }\n\n if (hasLastLink) { // »\n out.push(
  • \n this.props.onChange(e, this.props.total-1)}>\n Letzte Seite\n »\n \n
  • )\n }\n\n return out;\n }\n\n render() {\n\n const prevPage = ((this.props.current - 1) >= 0) ? this.props.current - 1 : 0\n const nextPage = ((this.props.current + 1) <= this.props.total) ? this.props.current + 1 : this.props.total\n\n return (\n
    \n \n
    \n );\n }\n}\nexport default Pagination;","import React from \"react\";\n\n\nimport DataFilters from \"./components/DataFilters\"\nimport Datasets from \"./components/Datasets\"\nimport Pagination from \"./components/Pagination\"\n\n\nimport { loadDatasets } from \"./api\"\n\n\nclass Data extends React.Component {\n\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n count: 0,\n pages: 0,\n currentPage: 0,\n limit: 24,\n cards: [],\n selectedObjectTypes: [],\n selectedSubObjectTypes: [],\n selectedLicenses: [],\n selectedTheme: [],\n selectedEvents: [],\n selectedInstitution: \"\",\n }\n }\n\n handlePaginationClick = async (e, page) => {\n this.setState({\n ...this.state,\n currentPage: page\n }, async () => {\n await this.loadData()\n })\n }\n\n updateObjectTypes = async (data) => {\n this.setState({\n selectedObjectTypes: data,\n }, async () => {\n await this.loadData()\n })\n }\n\n updateSubObjectTypes = async (data) => {\n this.setState({\n selectedSubObjectTypes: data,\n }, async () => {\n await this.loadData()\n })\n }\n\n updateLicenses = async (data) => {\n this.setState({\n selectedLicenses: data\n }, async () => {\n await this.loadData()\n })\n }\n\n updateTheme = async (data) => {\n this.setState({\n selectedTheme: data\n }, async () => {\n await this.loadData()\n })\n }\n\n updateEvents = async (data) => {\n this.setState({\n selectedEvents: data\n }, async () => {\n await this.loadData()\n })\n }\n\n doSearch = async (q, ins) => {\n this.setState({\n searchTerm: q,\n selectedInstitution: ins,\n currentPage: 0,\n }, async () => {\n await this.loadData()\n })\n }\n\n loadData = async () => {\n const limit = this.state.limit\n const offset = this.state.currentPage * limit\n\n const objecttypes = this.state.selectedObjectTypes.join(\",\")\n const subObjectTypes = this.state.selectedSubObjectTypes.join(\",\")\n const events = this.state.selectedEvents.join(\",\")\n const licenses = this.state.selectedLicenses.join(\",\")\n const theme = this.state.selectedTheme.join(\",\")\n const institution = this.state.selectedInstitution\n\n const cards = await loadDatasets(offset, events, objecttypes, subObjectTypes, licenses, theme, institution, this.state.searchTerm)\n\n this.setState({\n ...this.state,\n cards: cards.data,\n pages: Math.ceil(cards.count / limit),\n currentPage: 0,\n loading: false,\n }, async () => {\n\n })\n }\n\n async componentDidMount() {\n this.loadData()\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n \n \n \n
    \n
    \n )\n }\n}\n\nexport default Data","\n// import Projects from \"./Projects\"\nimport Data from \"./Data\"\n\n// import \"./app.css\"\n\n\n// \nfunction App() {\n return (\n // \n \n );\n}\n\nexport default App;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/web/dd-react/projects/static/js/main.ed6edb99.chunk.js b/web/dd-react/projects/static/js/main.381a11aa.chunk.js similarity index 90% rename from web/dd-react/projects/static/js/main.ed6edb99.chunk.js rename to web/dd-react/projects/static/js/main.381a11aa.chunk.js index dea1ade7..792eff6a 100644 --- a/web/dd-react/projects/static/js/main.ed6edb99.chunk.js +++ b/web/dd-react/projects/static/js/main.381a11aa.chunk.js @@ -1,2 +1,2 @@ -(this["webpackJsonpdnb-filter"]=this["webpackJsonpdnb-filter"]||[]).push([[0],{45:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(4),s=n.n(a),c=n(20),i=n.n(c),l=n(1),o=n.n(l),d=n(6),p=n(2),u=n(7),j=n(8),h=n(10),f=n(9),m=n(5),b=n.n(m),v="";function x(){for(var e=window.location.pathname.split("/"),t="de";e.length>0;)if(t=e.pop(),["de","en","fr"].includes(t))return t;return t}function O(e){return g.apply(this,arguments)}function g(){return(g=Object(p.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x(),e.next=3,b.a.get("".concat(v,"/").concat(n,"/dd_views/projecttypes"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return w.apply(this,arguments)}function w(){return(w=Object(p.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x(),e.next=3,b.a.get("".concat(v,"/").concat(n,"/dd_views/events"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e){return _.apply(this,arguments)}function _(){return(_=Object(p.a)(o.a.mark((function e(t){var n,r,a,s,c,i=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:"",r=i.length>2&&void 0!==i[2]?i[2]:"",a=i.length>3&&void 0!==i[3]?i[3]:"",s=x(),e.next=6,b.a.get("".concat(v,"/").concat(s,"/dd_views/cards?offset=").concat(t,"&projects=").concat(n,"&events=").concat(r,"&q=").concat(a),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 6:return c=e.sent,e.abrupt("return",c.data);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).selectProjectType=function(e){var t=a.state.selectedProjectTypes;a.state.selectedProjectTypes.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedProjectTypes:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateProjectTypes(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectEvent=function(e){var t=a.state.selectedEvents;a.state.selectedEvents.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedEvents:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateEvents(t);case 1:case"end":return e.stop()}}),e)}))))},a.onChange=function(e){a.setState({searchTerm:e.target.value})},a.doSearch=function(e){e.preventDefault(),a.state.searchTerm&&a.props.doSearch(a.state.searchTerm)},a.doReset=function(e){e.preventDefault(),a.setState({selectedProjectTypes:[],selectedEvents:[],searchTerm:""},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateProjectTypes([]),a.props.updateEvents([]),a.props.doSearch("");case 3:case"end":return e.stop()}}),e)}))))},a.renderTag=function(e,t){return a.state.selectedProjectTypes.includes(e.tid)?Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link bef-link--selected badge",onClick:function(){return a.selectProjectType(e.tid)},children:e.title})})},t):Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link badge",onClick:function(){return a.selectProjectType(e.tid)},children:e.title})})},t)},a.renderEvent=function(e,t){return a.state.selectedEvents.includes(e.nid)?Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link bef-link--selected badge",onClick:function(){return a.selectEvent(e.nid)},children:e.title})})},t):Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link badge",onClick:function(){return a.selectEvent(e.nid)},children:e.title})})},t)},a.state={loading:!0,searchTerm:"",projectTypes:[],events:[],selectedProjectTypes:[],selectedEvents:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=Object(p.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return t=e.sent,e.next=5,y();case 5:n=e.sent,this.setState(Object(d.a)(Object(d.a)({},this.state),{},{projectTypes:t,events:n,loading:!1}),Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return this.state.loading?"....":Object(r.jsx)("div",{className:"view-filters col-lg-3",children:Object(r.jsx)("form",{className:"views-exposed-form bef-exposed-form",children:Object(r.jsxs)("div",{className:"form--inline clearfix row",children:[Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-project-type form-item-project-type",children:[Object(r.jsx)("label",{htmlFor:"edit-project-type",children:"Typ des Projekts"}),Object(r.jsx)("div",{"data-drupal-selector":"edit-project-type",multiple:"multiple",name:"project_type",id:"edit-project-type",size:"9",className:"form-select bef-links",children:Object(r.jsx)("ul",{children:this.state.projectTypes.map((function(t,n){return e.renderTag(t,n)}))})})]})}),Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(r.jsx)("label",{htmlFor:"edit-event",children:"Event"}),Object(r.jsx)("div",{"data-drupal-selector":"edit-event",multiple:"multiple",name:"event",id:"edit-event",size:"8",className:"form-select bef-links",children:Object(r.jsx)("ul",{children:this.state.events.map((function(t,n){return e.renderEvent(t,n)}))})})]})}),Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{className:"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-search form-item-search",children:[Object(r.jsx)("label",{htmlFor:"edit-search",children:"Volltextsuche"}),Object(r.jsx)("input",{type:"text",id:"edit-search",name:"search",value:this.state.searchTerm,size:"30",maxLength:"128",className:"form-text",onChange:this.onChange})]})}),Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{"data-drupal-selector":"edit-actions",className:"form-actions js-form-wrapper form-wrapper",id:"edit-actions",children:[Object(r.jsx)("input",{type:"submit",value:"Filter anwenden",className:"button js-form-submit form-submit",onClick:this.doSearch}),Object(r.jsx)("input",{type:"submit",value:"Zur\xfccksetzen",className:"button js-form-submit form-submit",onClick:this.doReset})]})})]})})})}}]),n}(s.a.Component);var T=function(e){return e.cards.length?Object(r.jsx)("div",{className:"view-content col-lg-9",children:e.cards.map((function(e,t){return Object(r.jsx)("div",{className:"views-row",children:Object(r.jsxs)("article",{"data-history-node-id":"1846",className:"node node--type-project node--view-mode-teaser card",children:[Object(r.jsxs)("div",{className:"card-img card-img-top",children:[Object(r.jsx)("div",{className:"field field--awards",children:e.winner_title}),Object(r.jsx)("a",{href:e.url,children:Object(r.jsx)("div",{className:"field field--name-field-attributed-image field--type-entity-reference-revisions field--label-hidden field__item",children:Object(r.jsxs)("div",{className:"paragraph paragraph--type--project-image paragraph--view-mode--teaser",children:[Object(r.jsx)("div",{className:"field field--name-field-inline-image field--type-image field--label-hidden field__item",children:Object(r.jsx)("img",{src:e.image_url,width:"480",height:"360",alt:"",className:"image-style-project-preview-cropped"})}),Object(r.jsx)("div",{className:"paragraph--type--project-image--attribution"})]})})})]}),Object(r.jsxs)("div",{className:"card-body",children:[Object(r.jsx)("h2",{className:"card-title",children:Object(r.jsx)("a",{href:e.url,rel:"bookmark",children:Object(r.jsx)("span",{className:"field field--name-title field--type-string field--label-hidden",children:e.title})})}),Object(r.jsxs)("div",{className:"node__content",children:[Object(r.jsx)("div",{className:"field field--name-field-short-description field--type-string field--label-hidden field__item",children:e.description}),Object(r.jsxs)("div",{className:"field field--name-field-tags field--type-entity-reference field--label-visually_hidden",children:[Object(r.jsx)("div",{className:"field__label visually-hidden",children:"Projekttyp"}),Object(r.jsx)("div",{className:"field__items",children:e.project_types.map((function(e,t){return Object(r.jsx)("div",{className:"field__item",children:Object(r.jsx)("span",{children:e})},t)}))})]}),Object(r.jsxs)("div",{className:"field field--name-field-event field--type-entity-reference field--label-visually_hidden",children:[Object(r.jsx)("div",{className:"field__label visually-hidden",children:"Event"}),Object(r.jsx)("div",{className:"field__item",children:Object(r.jsx)("a",{href:e.event_url,children:e.event_title})})]})]})]})]})},t)}))}):Object(r.jsx)("div",{className:"col-lg-9",children:Object(r.jsx)("div",{className:"",children:"Es sind keine den Filtereinstellungen entsprechenden Projekte vorhanden."})})},C=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"pagination",value:function(e,t){var n=this,a=[],s=this.props.current+1,c=Boolean(s>1&&e!==this.props.total),i=Boolean(t>=s&&t!==this.props.total),l=i;c&&a.push(Object(r.jsx)("li",{className:"pager__item pager__item--next",children:Object(r.jsxs)("a",{href:"#",title:"Zur ersten Seite",rel:"next",onClick:function(e){return n.props.onChange(e,0)},children:[Object(r.jsx)("span",{className:"visually-hidden",children:"Erste Seite"}),Object(r.jsx)("span",{"aria-hidden":"true",children:"\xab"})]})})),c&&a.push(Object(r.jsx)("li",{className:"pager__item pager__item--previous",children:Object(r.jsxs)("a",{href:"#",title:"Zur vorherigen Seite",rel:"prev",onClick:function(t){return n.props.onChange(t,e)},children:[Object(r.jsx)("span",{className:"visually-hidden",children:"Vorherige Seite"}),Object(r.jsx)("span",{"aria-hidden":"true",children:"\u2039"})]})}));for(var o=function(e){if(e<3||e>n.props.total-2||e===s){var t=e===s?"pager__item is-active":"pager__item";a.push(Object(r.jsx)("li",{className:t,children:Object(r.jsx)("a",{href:"#",onClick:function(t){return n.props.onChange(t,e-1)},children:e})},e))}else if(n.props.total>4&&e!==s&&3===e){var c=5===n.props.total?"3":"...";a.push(Object(r.jsx)("li",{className:"pager__item disabled",children:Object(r.jsx)("a",{href:"#",children:c})},e))}else n.props.total>4&&e!==s&&e===n.props.total-2&&!(s<3||s>n.props.total-2)&&a.push(Object(r.jsx)("li",{className:"pager__item disabled",children:Object(r.jsx)("a",{href:"#",children:"..."})},e))},d=1;d=0?this.props.current-1:0,t=this.props.current+1<=this.props.total?this.props.current+1:this.props.total;return Object(r.jsx)("div",{className:"col-lg-9 offset-lg-3",children:Object(r.jsxs)("nav",{className:"pager",role:"navigation","aria-labelledby":"pagination-heading",children:[Object(r.jsx)("h4",{id:"pagination-heading",className:"visually-hidden",children:"Seitennummerierung"}),Object(r.jsx)("ul",{className:"pager__items js-pager__items",children:this.pagination(e,t)})]})})}}]),n}(s.a.Component),S=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this,e)).handlePaginationClick=function(){var e=Object(p.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState(Object(d.a)(Object(d.a)({},r.state),{},{currentPage:n}),Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.updateProjectTypes=function(){var e=Object(p.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState({selectedProjectTypes:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.updateEvents=function(){var e=Object(p.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState({selectedEvents:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.doSearch=function(){var e=Object(p.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState({searchTerm:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.loadData=Object(p.a)(o.a.mark((function e(){var t,n,a,s,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.state.limit,n=r.state.currentPage*t,a=r.state.selectedProjectTypes.join(","),s=r.state.selectedEvents.join(","),e.next=6,N(n,a,s,r.state.searchTerm);case 6:c=e.sent,r.setState(Object(d.a)(Object(d.a)({},r.state),{},{cards:c.data,pages:Math.ceil(c.count/t),loading:!1}),Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 8:case"end":return e.stop()}}),e)}))),r.state={loading:!0,searchTerm:"",count:0,pages:0,currentPage:0,limit:24,cards:[],selectedProjectTypes:[],selectedEvents:[]},r}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadData();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return this.state.loading?"....":Object(r.jsx)("div",{className:"view view-projects view-id-projects view-display-id-page_1 container",children:Object(r.jsxs)("div",{className:"row",children:[Object(r.jsx)(k,{updateProjectTypes:this.updateProjectTypes,updateEvents:this.updateEvents,doSearch:this.doSearch}),Object(r.jsx)(T,{cards:this.state.cards}),Object(r.jsx)(C,{total:this.state.pages,current:this.state.currentPage,onChange:this.handlePaginationClick,limit:this.state.limit})]})})}}]),n}(s.a.Component);var P=function(){return Object(r.jsx)(S,{})};i.a.render(Object(r.jsx)(s.a.StrictMode,{children:Object(r.jsx)(P,{})}),document.getElementById("root"))}},[[45,1,2]]]); -//# sourceMappingURL=main.ed6edb99.chunk.js.map \ No newline at end of file +(this["webpackJsonpdnb-filter"]=this["webpackJsonpdnb-filter"]||[]).push([[0],{45:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(4),s=n.n(a),c=n(20),i=n.n(c),l=n(1),o=n.n(l),d=n(6),p=n(2),u=n(7),j=n(8),h=n(10),f=n(9),m=n(5),b=n.n(m),v="";function x(){for(var e=window.location.pathname.split("/"),t="de";e.length>0;)if(t=e.pop(),["de","en","fr"].includes(t))return t;return t}function O(e){return g.apply(this,arguments)}function g(){return(g=Object(p.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x(),e.next=3,b.a.get("".concat(v,"/").concat(n,"/dd_views/projecttypes"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return w.apply(this,arguments)}function w(){return(w=Object(p.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x(),e.next=3,b.a.get("".concat(v,"/").concat(n,"/dd_views/events"),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e){return _.apply(this,arguments)}function _(){return(_=Object(p.a)(o.a.mark((function e(t){var n,r,a,s,c,i=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:"",r=i.length>2&&void 0!==i[2]?i[2]:"",a=i.length>3&&void 0!==i[3]?i[3]:"",s=x(),e.next=6,b.a.get("".concat(v,"/").concat(s,"/dd_views/cards?offset=").concat(t,"&projects=").concat(n,"&events=").concat(r,"&q=").concat(a),{headers:{"Content-Type":"application/json"}}).catch((function(e){throw e.response}));case 6:return c=e.sent,e.abrupt("return",c.data);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).selectProjectType=function(e){var t=a.state.selectedProjectTypes;a.state.selectedProjectTypes.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedProjectTypes:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateProjectTypes(t);case 1:case"end":return e.stop()}}),e)}))))},a.selectEvent=function(e){var t=a.state.selectedEvents;a.state.selectedEvents.includes(e)?t=t.filter((function(t){return t!==e})):t.push(e),a.setState({selectedEvents:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateEvents(t);case 1:case"end":return e.stop()}}),e)}))))},a.onChange=function(e){a.setState({searchTerm:e.target.value})},a.doSearch=function(e){e.preventDefault(),a.state.searchTerm&&a.props.doSearch(a.state.searchTerm)},a.doReset=function(e){e.preventDefault(),a.setState({selectedProjectTypes:[],selectedEvents:[],searchTerm:""},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.props.updateProjectTypes([]),a.props.updateEvents([]),a.props.doSearch("");case 3:case"end":return e.stop()}}),e)}))))},a.renderTag=function(e,t){return a.state.selectedProjectTypes.includes(e.tid)?Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link bef-link--selected badge",onClick:function(){return a.selectProjectType(e.tid)},children:e.title})})},t):Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link badge",onClick:function(){return a.selectProjectType(e.tid)},children:e.title})})},t)},a.renderEvent=function(e,t){return a.state.selectedEvents.includes(e.nid)?Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link bef-link--selected badge",onClick:function(){return a.selectEvent(e.nid)},children:e.title})})},t):Object(r.jsx)("li",{children:Object(r.jsx)("div",{className:"badge",children:Object(r.jsx)("a",{href:"#",className:"bef-link badge",onClick:function(){return a.selectEvent(e.nid)},children:e.title})})},t)},a.state={loading:!0,searchTerm:"",projectTypes:[],events:[],selectedProjectTypes:[],selectedEvents:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=Object(p.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return t=e.sent,e.next=5,y();case 5:n=e.sent,this.setState(Object(d.a)(Object(d.a)({},this.state),{},{projectTypes:t,events:n,loading:!1}),Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return this.state.loading?"....":Object(r.jsx)("div",{className:"view-filters col-lg-3",children:Object(r.jsx)("form",{className:"views-exposed-form bef-exposed-form",children:Object(r.jsxs)("div",{className:"form--inline clearfix row",children:[Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-project-type form-item-project-type",children:[Object(r.jsx)("label",{htmlFor:"edit-project-type",children:"Typ des Projekts"}),Object(r.jsx)("div",{"data-drupal-selector":"edit-project-type",multiple:"multiple",name:"project_type",id:"edit-project-type",size:"9",className:"form-select bef-links",children:Object(r.jsx)("ul",{children:this.state.projectTypes.map((function(t,n){return e.renderTag(t,n)}))})})]})}),Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{className:"js-form-item form-item js-form-type-select form-type-select js-form-item-event form-item-event",children:[Object(r.jsx)("label",{htmlFor:"edit-event",children:"Event"}),Object(r.jsx)("div",{"data-drupal-selector":"edit-event",multiple:"multiple",name:"event",id:"edit-event",size:"8",className:"form-select bef-links",children:Object(r.jsx)("ul",{children:this.state.events.map((function(t,n){return e.renderEvent(t,n)}))})})]})}),Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{className:"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-search form-item-search",children:[Object(r.jsx)("label",{htmlFor:"edit-search",children:"Volltextsuche"}),Object(r.jsx)("input",{type:"text",id:"edit-search",name:"search",value:this.state.searchTerm,size:"30",maxLength:"128",className:"form-text",onChange:this.onChange})]})}),Object(r.jsx)("div",{className:"col-12",children:Object(r.jsxs)("div",{"data-drupal-selector":"edit-actions",className:"form-actions js-form-wrapper form-wrapper",id:"edit-actions",children:[Object(r.jsx)("input",{type:"submit",value:"Filter anwenden",className:"button js-form-submit form-submit",onClick:this.doSearch}),Object(r.jsx)("input",{type:"submit",value:"Zur\xfccksetzen",className:"button js-form-submit form-submit",onClick:this.doReset})]})})]})})})}}]),n}(s.a.Component);var T=function(e){return e.cards.length?Object(r.jsx)("div",{className:"view-content col-lg-9",children:e.cards.map((function(e,t){return Object(r.jsx)("div",{className:"views-row",children:Object(r.jsxs)("article",{"data-history-node-id":"1846",className:"node node--type-project node--view-mode-teaser card",children:[Object(r.jsxs)("div",{className:"card-img card-img-top",children:[Object(r.jsx)("div",{className:"field field--awards",children:e.winner_title}),Object(r.jsx)("a",{href:e.url,children:Object(r.jsx)("div",{className:"field field--name-field-attributed-image field--type-entity-reference-revisions field--label-hidden field__item",children:Object(r.jsxs)("div",{className:"paragraph paragraph--type--project-image paragraph--view-mode--teaser",children:[Object(r.jsx)("div",{className:"field field--name-field-inline-image field--type-image field--label-hidden field__item",children:Object(r.jsx)("img",{src:e.image_url,width:"480",height:"360",alt:"",className:"image-style-project-preview-cropped"})}),Object(r.jsx)("div",{className:"paragraph--type--project-image--attribution"})]})})})]}),Object(r.jsxs)("div",{className:"card-body",children:[Object(r.jsx)("h2",{className:"card-title",children:Object(r.jsx)("a",{href:e.url,rel:"bookmark",children:Object(r.jsx)("span",{className:"field field--name-title field--type-string field--label-hidden",children:e.title})})}),Object(r.jsxs)("div",{className:"node__content",children:[Object(r.jsx)("div",{className:"field field--name-field-short-description field--type-string field--label-hidden field__item",children:e.description}),Object(r.jsxs)("div",{className:"field field--name-field-tags field--type-entity-reference field--label-visually_hidden",children:[Object(r.jsx)("div",{className:"field__label visually-hidden",children:"Projekttyp"}),Object(r.jsx)("div",{className:"field__items",children:e.project_types.map((function(e,t){return Object(r.jsx)("div",{className:"field__item",children:Object(r.jsx)("span",{children:e})},t)}))})]}),Object(r.jsxs)("div",{className:"field field--name-field-event field--type-entity-reference field--label-visually_hidden",children:[Object(r.jsx)("div",{className:"field__label visually-hidden",children:"Event"}),Object(r.jsx)("div",{className:"field__item",children:Object(r.jsx)("a",{href:e.event_url,children:e.event_title})})]})]})]})]})},t)}))}):Object(r.jsx)("div",{className:"col-lg-9",children:Object(r.jsx)("div",{className:"",children:"Es sind keine den Filtereinstellungen entsprechenden Projekte vorhanden."})})},C=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"pagination",value:function(e,t){var n=this,a=[],s=this.props.current+1,c=Boolean(s>1&&e!==this.props.total),i=Boolean(t>=s&&t!==this.props.total),l=i;c&&a.push(Object(r.jsx)("li",{className:"pager__item pager__item--next",children:Object(r.jsxs)("a",{href:"#",title:"Zur ersten Seite",rel:"next",onClick:function(e){return n.props.onChange(e,0)},children:[Object(r.jsx)("span",{className:"visually-hidden",children:"Erste Seite"}),Object(r.jsx)("span",{"aria-hidden":"true",children:"\xab"})]})})),c&&a.push(Object(r.jsx)("li",{className:"pager__item pager__item--previous",children:Object(r.jsxs)("a",{href:"#",title:"Zur vorherigen Seite",rel:"prev",onClick:function(t){return n.props.onChange(t,e)},children:[Object(r.jsx)("span",{className:"visually-hidden",children:"Vorherige Seite"}),Object(r.jsx)("span",{"aria-hidden":"true",children:"\u2039"})]})}));for(var o=function(e){if(e<3||e>n.props.total-2||e===s){var t=e===s?"pager__item is-active":"pager__item";a.push(Object(r.jsx)("li",{className:t,children:Object(r.jsx)("a",{href:"#",onClick:function(t){return n.props.onChange(t,e-1)},children:e})},e))}else if(n.props.total>4&&e!==s&&3===e){var c=5===n.props.total?"3":"...";a.push(Object(r.jsx)("li",{className:"pager__item disabled",children:Object(r.jsx)("a",{href:"#",children:c})},e))}else n.props.total>4&&e!==s&&e===n.props.total-2&&!(s<3||s>n.props.total-2)&&a.push(Object(r.jsx)("li",{className:"pager__item disabled",children:Object(r.jsx)("a",{href:"#",children:"..."})},e))},d=1;d=0?this.props.current-1:0,t=this.props.current+1<=this.props.total?this.props.current+1:this.props.total;return Object(r.jsx)("div",{className:"col-lg-9 offset-lg-3",children:Object(r.jsxs)("nav",{className:"pager",role:"navigation","aria-labelledby":"pagination-heading",children:[Object(r.jsx)("h4",{id:"pagination-heading",className:"visually-hidden",children:"Seitennummerierung"}),Object(r.jsx)("ul",{className:"pager__items js-pager__items",children:this.pagination(e,t)})]})})}}]),n}(s.a.Component),P=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this,e)).handlePaginationClick=function(){var e=Object(p.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState(Object(d.a)(Object(d.a)({},r.state),{},{currentPage:n}),Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.updateProjectTypes=function(){var e=Object(p.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState({selectedProjectTypes:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.updateEvents=function(){var e=Object(p.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState({selectedEvents:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.doSearch=function(){var e=Object(p.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.setState({searchTerm:t},Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadData();case 2:case"end":return e.stop()}}),e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.loadData=Object(p.a)(o.a.mark((function e(){var t,n,a,s,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.state.limit,n=r.state.currentPage*t,a=r.state.selectedProjectTypes.join(","),s=r.state.selectedEvents.join(","),e.next=6,N(n,a,s,r.state.searchTerm);case 6:c=e.sent,r.setState(Object(d.a)(Object(d.a)({},r.state),{},{cards:c.data,pages:Math.ceil(c.count/t),currentPage:0,loading:!1}),Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 8:case"end":return e.stop()}}),e)}))),r.state={loading:!0,searchTerm:"",count:0,pages:0,currentPage:0,limit:24,cards:[],selectedProjectTypes:[],selectedEvents:[]},r}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=Object(p.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadData();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return this.state.loading?"....":Object(r.jsx)("div",{className:"view view-projects view-id-projects view-display-id-page_1 container",children:Object(r.jsxs)("div",{className:"row",children:[Object(r.jsx)(k,{updateProjectTypes:this.updateProjectTypes,updateEvents:this.updateEvents,doSearch:this.doSearch}),Object(r.jsx)(T,{cards:this.state.cards}),Object(r.jsx)(C,{total:this.state.pages,current:this.state.currentPage,onChange:this.handlePaginationClick,limit:this.state.limit})]})})}}]),n}(s.a.Component);var S=function(){return Object(r.jsx)(P,{})};i.a.render(Object(r.jsx)(s.a.StrictMode,{children:Object(r.jsx)(S,{})}),document.getElementById("root"))}},[[45,1,2]]]); +//# sourceMappingURL=main.381a11aa.chunk.js.map \ No newline at end of file diff --git a/web/dd-react/projects/static/js/main.381a11aa.chunk.js.map b/web/dd-react/projects/static/js/main.381a11aa.chunk.js.map new file mode 100644 index 00000000..8f583d80 --- /dev/null +++ b/web/dd-react/projects/static/js/main.381a11aa.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["api.js","components/ProjectFilters.js","components/Cards.js","components/Pagination.js","Projects.js","App.js","index.js"],"names":["API_HOST","process","getLangCodeOfPath","pathArray","window","location","pathname","split","langCode","length","pop","includes","loadProjectTypes","id","a","axios","get","headers","catch","error","response","data","loadEvents","loadCards","offset","projects","events","q","ProjectFilters","props","selectProjectType","tid","selectedProjectTypes","state","filter","item","push","setState","updateProjectTypes","selectEvent","nid","selectedEvents","updateEvents","onChange","event","searchTerm","target","value","doSearch","e","preventDefault","doReset","renderTag","term","key","className","href","onClick","title","renderEvent","loading","projectTypes","this","htmlFor","data-drupal-selector","multiple","name","size","map","type","maxLength","React","Component","Cards","cards","card","data-history-node-id","winner_title","url","src","image_url","width","height","alt","rel","description","project_types","project_type","index","event_url","event_title","Pagination","prevPage","nextPage","out","currentPage","current","hasPreviousLink","Boolean","total","hasNextLink","hasLastLink","aria-hidden","i","classNameLi","display","role","aria-labelledby","pagination","Projects","handlePaginationClick","page","loadData","limit","join","pages","Math","ceil","count","App","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"6OAEaA,EAAWC,GAIxB,SAASC,IAGP,IAFA,IAAMC,EAAYC,OAAOC,SAASC,SAASC,MAAM,KAC7CC,EAAW,KACRL,EAAUM,OAAS,GAExB,GADAD,EAAWL,EAAUO,MACjB,CAAC,KAAM,KAAM,MAAMC,SAASH,GAC9B,OAAOA,EAGX,OAAOA,EAIF,SAAeI,EAAtB,kC,4CAAO,WAAgCC,GAAhC,iBAAAC,EAAA,6DACCN,EAAWN,IADZ,SAEkBa,IAAMC,IAAN,UAClBhB,EADkB,YACNQ,EADM,0BAErB,CACES,QAAS,CAC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,2CA9CT,EAAKmB,MAAQ,CACX2B,SAAS,EACTf,WAAY,GACZyE,MAAO,EACPH,MAAO,EACPpB,YAAa,EACbkB,MAAO,GACPvC,MAAO,GACP1C,qBAAqB,GACrBS,eAAe,IAXA,E,0KAqEjBqB,KAAKkD,W,qIAIL,OAAIlD,KAAK7B,MAAM2B,QACN,OAIP,qBAAKL,UAAU,uEAAf,SACE,sBAAKA,UAAU,MAAf,UACE,cAAC,EAAD,CACEjB,mBAAoBwB,KAAKxB,mBACzBI,aAAcoB,KAAKpB,aACnBM,SAAUc,KAAKd,WAEjB,cAAC,EAAD,CAAO0B,MAAOZ,KAAK7B,MAAMyC,QACzB,cAAC,EAAD,CACEyB,MAAOrC,KAAK7B,MAAMkF,MAClBnB,QAASlC,KAAK7B,MAAM8D,YACpBpD,SAAUmB,KAAKgD,sBACfG,MAAOnD,KAAK7B,MAAMgF,iB,GA7FP1C,IAAMC,WCId+C,MAPf,WACE,OACE,cAAC,EAAD,KCLJC,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.381a11aa.chunk.js","sourcesContent":["import axios from 'axios'\n\nexport const API_HOST = process.env.REACT_APP_API_HOST\n// export const API_HOST = process.env.REACT_APP_API_HOST || \"https://\" + window.location.host\n\n\nfunction getLangCodeOfPath() {\n const pathArray = window.location.pathname.split('/');\n let langCode = \"de\"\n while (pathArray.length > 0 ) {\n langCode = pathArray.pop();\n if (['de', 'en', 'fr'].includes(langCode)) {\n return langCode\n }\n }\n return langCode\n}\n\n\nexport async function loadProjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/projecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadObjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/objecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\n\nexport async function loadSubObjectTypes() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/subobjecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n return response.data\n}\n\n\nexport async function loadLicenses(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/licenses`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadTheme(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/theme`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadInstitutions() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/institutions`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadEvents(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/events`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadCards(offset, projects = \"\", events = \"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/cards?offset=${offset}&projects=${projects}&events=${events}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadDatasets(offset, events = \"\", objecttypes = \"\", subobjecttypes = \"\", licenses = \"\", theme = \"\", institution=\"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/datasets?offset=${offset}&objecttypes=${objecttypes}&subobjecttypes=${subobjecttypes}&events=${events}&licenses=${licenses}&theme=${theme}&institution=${institution}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}","import React from \"react\";\n\nimport { loadProjectTypes, loadEvents } from \"../api\"\n\nclass ProjectFilters extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n projectTypes: [],\n events: [],\n selectedProjectTypes: [],\n selectedEvents: [],\n }\n }\n\n selectProjectType = (tid) => {\n let selectedProjectTypes = this.state.selectedProjectTypes\n\n if (this.state.selectedProjectTypes.includes(tid)) {\n selectedProjectTypes = selectedProjectTypes.filter(item => item !== tid)\n } else {\n selectedProjectTypes.push(tid)\n }\n\n this.setState({ selectedProjectTypes }, async () => {\n this.props.updateProjectTypes(selectedProjectTypes)\n })\n }\n\n selectEvent = (nid) => {\n let selectedEvents = this.state.selectedEvents\n\n if (this.state.selectedEvents.includes(nid)) {\n selectedEvents = selectedEvents.filter(item => item !== nid)\n } else {\n selectedEvents.push(nid)\n }\n\n this.setState({ selectedEvents }, async () => {\n this.props.updateEvents(selectedEvents)\n })\n }\n\n onChange = (event) => {\n this.setState({ searchTerm: event.target.value })\n }\n\n doSearch = (e) => {\n e.preventDefault()\n\n if (this.state.searchTerm) {\n this.props.doSearch(this.state.searchTerm)\n }\n }\n\n doReset = (e) => {\n e.preventDefault()\n this.setState({ selectedProjectTypes: [], selectedEvents: [], searchTerm: \"\" }, async () => {\n this.props.updateProjectTypes([])\n this.props.updateEvents([])\n this.props.doSearch(\"\")\n })\n }\n\n async componentDidMount() {\n const projectTypes = await loadProjectTypes()\n const events = await loadEvents()\n\n this.setState({\n ...this.state,\n projectTypes: projectTypes,\n events: events,\n loading: false,\n }, async () => {\n\n })\n }\n\n renderTag = (term, key) => {\n if (this.state.selectedProjectTypes.includes(term.tid)) {\n return (
  • )\n } else {\n return (
  • )\n }\n }\n\n renderEvent = (event, key) => {\n if (this.state.selectedEvents.includes(event.nid)) {\n return (
  • )\n } else {\n return (
  • )\n }\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.projectTypes.map((term, key) => {\n return (this.renderTag(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.events.map((term, key) => {\n return (this.renderEvent(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n );\n }\n}\n\nexport default ProjectFilters;","function Cards(props) {\n if (!props.cards.length) {\n return
    \n
    \n Es sind keine den Filtereinstellungen entsprechenden Projekte vorhanden.\n
    \n
    \n }\n return (\n
    \n {props.cards.map((card, key)=>{\n return (
    \n \n
    \n )})}\n
    \n )\n}\n\nexport default Cards;","import React from \"react\";\n\n\n\nclass Pagination extends React.Component {\n\n pagination(prevPage, nextPage) {\n const out = []\n\n const currentPage = this.props.current + 1\n const hasPreviousLink = Boolean(currentPage > 1 && prevPage !== this.props.total)\n const hasNextLink = Boolean(nextPage >= currentPage && nextPage !== this.props.total)\n\n const hasFirstLink = hasPreviousLink\n const hasLastLink = hasNextLink\n\n if (hasFirstLink) { // «\n out.push(
  • \n this.props.onChange(e, 0)}>\n Erste Seite\n «\n \n
  • )\n }\n\n if (hasPreviousLink) {\n out.push(\n
  • \n this.props.onChange(e, prevPage)}>\n Vorherige Seite\n \n \n
  • \n )\n }\n\n for (let i = 1; i < (this.props.total + 1); i++) {\n\n const pushPage = ((i < 3) || (i > (this.props.total - 2)) || (i === currentPage)) ? true : false\n\n if (pushPage) {\n const classNameLi = (i === currentPage) ? \"pager__item is-active\" : \"pager__item\"\n out.push(
  • \n this.props.onChange(e, (i - 1))}>\n {i}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === 3)\n ) {\n const display = (this.props.total === 5) ? '3' : '...'\n out.push(
  • \n \n {display}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === (this.props.total - 2))\n && !(\n (currentPage < 3)\n || (currentPage > (this.props.total - 2))\n )\n ) {\n out.push(
  • \n \n ...\n \n
  • )\n }\n }\n\n if (hasNextLink) {\n out.push(
  • \n this.props.onChange(e, nextPage)}>\n Nächste Seite\n \n \n
  • )\n }\n\n if (hasLastLink) { // »\n out.push(
  • \n this.props.onChange(e, this.props.total-1)}>\n Letzte Seite\n »\n \n
  • )\n }\n\n return out;\n }\n\n render() {\n\n const prevPage = ((this.props.current - 1) >= 0) ? this.props.current - 1 : 0\n const nextPage = ((this.props.current + 1) <= this.props.total) ? this.props.current + 1 : this.props.total\n\n return (\n
    \n \n
    \n );\n }\n}\nexport default Pagination;","import React from \"react\";\n\n\nimport ProjectFilters from \"./components/ProjectFilters\"\nimport Cards from \"./components/Cards\"\nimport Pagination from \"./components/Pagination\"\n\n\nimport { loadCards } from \"./api\"\n\n\nclass Projects extends React.Component {\n\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n count: 0,\n pages: 0,\n currentPage: 0,\n limit: 24,\n cards: [],\n selectedProjectTypes:[],\n selectedEvents:[],\n }\n }\n\n handlePaginationClick = async (e, page) => {\n this.setState({\n ...this.state,\n currentPage: page\n }, async () => {\n await this.loadData()\n })\n }\n\n updateProjectTypes = async (data) => {\n this.setState({\n selectedProjectTypes: data\n }, async () => {\n await this.loadData()\n })\n }\n\n updateEvents = async (data) => {\n this.setState({\n selectedEvents: data\n }, async () => {\n await this.loadData()\n })\n }\n\n doSearch = async (q) => {\n this.setState({\n searchTerm: q\n }, async () => {\n await this.loadData()\n })\n }\n\n loadData = async () => {\n const limit = this.state.limit\n const offset = this.state.currentPage * limit\n\n const projects = this.state.selectedProjectTypes.join(\",\")\n const events = this.state.selectedEvents.join(\",\")\n\n const cards = await loadCards(offset, projects, events, this.state.searchTerm)\n\n this.setState({\n ...this.state,\n cards: cards.data,\n pages: Math.ceil(cards.count / limit),\n currentPage: 0,\n loading: false,\n }, async () => {\n\n })\n }\n\n async componentDidMount() {\n this.loadData()\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n \n \n \n
    \n
    \n )\n }\n}\n\nexport default Projects;","\nimport Projects from \"./Projects\"\n// import Data from \"./Data\"\n\n// import \"./app.css\"\n\n\n// \nfunction App() {\n return (\n \n // \n );\n}\n\nexport default App;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/web/dd-react/projects/static/js/main.ed6edb99.chunk.js.map b/web/dd-react/projects/static/js/main.ed6edb99.chunk.js.map deleted file mode 100644 index 1489f6b8..00000000 --- a/web/dd-react/projects/static/js/main.ed6edb99.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["api.js","components/ProjectFilters.js","components/Cards.js","components/Pagination.js","Projects.js","App.js","index.js"],"names":["API_HOST","process","getLangCodeOfPath","pathArray","window","location","pathname","split","langCode","length","pop","includes","loadProjectTypes","id","a","axios","get","headers","catch","error","response","data","loadEvents","loadCards","offset","projects","events","q","ProjectFilters","props","selectProjectType","tid","selectedProjectTypes","state","filter","item","push","setState","updateProjectTypes","selectEvent","nid","selectedEvents","updateEvents","onChange","event","searchTerm","target","value","doSearch","e","preventDefault","doReset","renderTag","term","key","className","href","onClick","title","renderEvent","loading","projectTypes","this","htmlFor","data-drupal-selector","multiple","name","size","map","type","maxLength","React","Component","Cards","cards","card","data-history-node-id","winner_title","url","src","image_url","width","height","alt","rel","description","project_types","project_type","index","event_url","event_title","Pagination","prevPage","nextPage","out","currentPage","current","hasPreviousLink","Boolean","total","hasNextLink","hasLastLink","aria-hidden","i","classNameLi","display","role","aria-labelledby","pagination","Projects","handlePaginationClick","page","loadData","limit","join","pages","Math","ceil","count","App","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"6OAEaA,EAAWC,GAIxB,SAASC,IAGP,IAFA,IAAMC,EAAYC,OAAOC,SAASC,SAASC,MAAM,KAC7CC,EAAW,KACRL,EAAUM,OAAS,GAExB,GADAD,EAAWL,EAAUO,MACjB,CAAC,KAAM,KAAM,MAAMC,SAASH,GAC9B,OAAOA,EAGX,OAAOA,EAIF,SAAeI,EAAtB,kC,4CAAO,WAAgCC,GAAhC,iBAAAC,EAAA,6DACCN,EAAWN,IADZ,SAEkBa,IAAMC,IAAN,UAClBhB,EADkB,YACNQ,EADM,0BAErB,CACES,QAAS,CACP,eAAgB,sBAGpBC,OAAM,SAAAC,GACN,MAAOA,EAAMC,YAVV,cAECA,EAFD,yBAaEA,EAASC,MAbX,4C,sBAgFA,SAAeC,EAAtB,kC,4CAAO,WAA0BT,GAA1B,iBAAAC,EAAA,6DACCN,EAAWN,IADZ,SAEkBa,IAAMC,IAAN,UAClBhB,EADkB,YACNQ,EADM,oBAErB,CACES,QAAS,CACP,eAAgB,sBAGpBC,OAAM,SAAAC,GACN,MAAOA,EAAMC,YAVV,cAECA,EAFD,yBAaEA,EAASC,MAbX,4C,sBAgBA,SAAeE,EAAtB,kC,4CAAO,WAAyBC,GAAzB,mCAAAV,EAAA,6DAAiCW,EAAjC,+BAA4C,GAAIC,EAAhD,+BAAyD,GAAIC,EAA7D,+BAAiE,GAChEnB,EAAWN,IADZ,SAEkBa,IAAMC,IAAN,UAClBhB,EADkB,YACNQ,EADM,kCAC4BgB,EAD5B,qBAC+CC,EAD/C,mBACkEC,EADlE,cAC8EC,GACnG,CACEV,QAAS,CACP,eAAgB,sBAGpBC,OAAM,SAAAC,GACN,MAAOA,EAAMC,YAVV,cAECA,EAFD,yBAaEA,EAASC,MAbX,4C,0BCkCQO,E,kDA/Ib,WAAYC,GAAQ,IAAD,8BACjB,cAAMA,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Q,wDAgDnBA,SAhDmB,sBAgDR,oCAAAlG,EAAA,6DACHmG,EAAQ,EAAKhF,MAAMgF,MACnBzF,EAAS,EAAKS,MAAM8D,YAAckB,EAElCxF,EAAW,EAAKQ,MAAMD,qBAAqBkF,KAAK,KAChDxF,EAAW,EAAKO,MAAMQ,eAAeyE,KAAK,KALvC,SAOW3F,EAAUC,EAAQC,EAAUC,EAAQ,EAAKO,MAAMY,YAP1D,OAOH6B,EAPG,OAST,EAAKrC,SAAL,2BACK,EAAKJ,OADV,IAEEyC,MAAOA,EAAMrD,KACb8F,MAAOC,KAAKC,KAAK3C,EAAM4C,MAAQL,GAC/BrD,SAAS,IAJX,sBAKG,sBAAA9C,EAAA,2FAdM,2CA9CT,EAAKmB,MAAQ,CACX2B,SAAS,EACTf,WAAY,GACZyE,MAAO,EACPH,MAAO,EACPpB,YAAa,EACbkB,MAAO,GACPvC,MAAO,GACP1C,qBAAqB,GACrBS,eAAe,IAXA,E,0KAoEjBqB,KAAKkD,W,qIAIL,OAAIlD,KAAK7B,MAAM2B,QACN,OAIP,qBAAKL,UAAU,uEAAf,SACE,sBAAKA,UAAU,MAAf,UACE,cAAC,EAAD,CACEjB,mBAAoBwB,KAAKxB,mBACzBI,aAAcoB,KAAKpB,aACnBM,SAAUc,KAAKd,WAEjB,cAAC,EAAD,CAAO0B,MAAOZ,KAAK7B,MAAMyC,QACzB,cAAC,EAAD,CACEyB,MAAOrC,KAAK7B,MAAMkF,MAClBnB,QAASlC,KAAK7B,MAAM8D,YACpBpD,SAAUmB,KAAKgD,sBACfG,MAAOnD,KAAK7B,MAAMgF,iB,GA5FP1C,IAAMC,WCId+C,MAPf,WACE,OACE,cAAC,EAAD,KCLJC,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.ed6edb99.chunk.js","sourcesContent":["import axios from 'axios'\n\nexport const API_HOST = process.env.REACT_APP_API_HOST\n// export const API_HOST = process.env.REACT_APP_API_HOST || \"https://\" + window.location.host\n\n\nfunction getLangCodeOfPath() {\n const pathArray = window.location.pathname.split('/');\n let langCode = \"de\"\n while (pathArray.length > 0 ) {\n langCode = pathArray.pop();\n if (['de', 'en', 'fr'].includes(langCode)) {\n return langCode\n }\n }\n return langCode\n}\n\n\nexport async function loadProjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/projecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadObjectTypes(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/objecttypes`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadLicenses(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/licenses`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadTheme(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/theme`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadInstitutions() {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/institutions`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadEvents(id) {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/events`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadCards(offset, projects = \"\", events = \"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/cards?offset=${offset}&projects=${projects}&events=${events}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}\n\nexport async function loadDatasets(offset, events = \"\", objecttypes = \"\", licenses = \"\", theme = \"\", institution=\"\", q = \"\") {\n const langCode = getLangCodeOfPath()\n const response = await axios.get(\n `${API_HOST}/${langCode}/dd_views/datasets?offset=${offset}&objecttypes=${objecttypes}&events=${events}&licenses=${licenses}&theme=${theme}&institution=${institution}&q=${q}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n }\n }\n ).catch(error => {\n throw (error.response)\n })\n\n return response.data\n}","import React from \"react\";\n\nimport { loadProjectTypes, loadEvents } from \"../api\"\n\nclass ProjectFilters extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n projectTypes: [],\n events: [],\n selectedProjectTypes: [],\n selectedEvents: [],\n }\n }\n\n selectProjectType = (tid) => {\n let selectedProjectTypes = this.state.selectedProjectTypes\n\n if (this.state.selectedProjectTypes.includes(tid)) {\n selectedProjectTypes = selectedProjectTypes.filter(item => item !== tid)\n } else {\n selectedProjectTypes.push(tid)\n }\n\n this.setState({ selectedProjectTypes }, async () => {\n this.props.updateProjectTypes(selectedProjectTypes)\n })\n }\n\n selectEvent = (nid) => {\n let selectedEvents = this.state.selectedEvents\n\n if (this.state.selectedEvents.includes(nid)) {\n selectedEvents = selectedEvents.filter(item => item !== nid)\n } else {\n selectedEvents.push(nid)\n }\n\n this.setState({ selectedEvents }, async () => {\n this.props.updateEvents(selectedEvents)\n })\n }\n\n onChange = (event) => {\n this.setState({ searchTerm: event.target.value })\n }\n\n doSearch = (e) => {\n e.preventDefault()\n\n if (this.state.searchTerm) {\n this.props.doSearch(this.state.searchTerm)\n }\n }\n\n doReset = (e) => {\n e.preventDefault()\n this.setState({ selectedProjectTypes: [], selectedEvents: [], searchTerm: \"\" }, async () => {\n this.props.updateProjectTypes([])\n this.props.updateEvents([])\n this.props.doSearch(\"\")\n })\n }\n\n async componentDidMount() {\n const projectTypes = await loadProjectTypes()\n const events = await loadEvents()\n\n this.setState({\n ...this.state,\n projectTypes: projectTypes,\n events: events,\n loading: false,\n }, async () => {\n\n })\n }\n\n renderTag = (term, key) => {\n if (this.state.selectedProjectTypes.includes(term.tid)) {\n return (
  • )\n } else {\n return (
  • )\n }\n }\n\n renderEvent = (event, key) => {\n if (this.state.selectedEvents.includes(event.nid)) {\n return (
  • )\n } else {\n return (
  • )\n }\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.projectTypes.map((term, key) => {\n return (this.renderTag(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
      \n {this.state.events.map((term, key) => {\n return (this.renderEvent(term, key))\n })}\n
    \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n );\n }\n}\n\nexport default ProjectFilters;","function Cards(props) {\n if (!props.cards.length) {\n return
    \n
    \n Es sind keine den Filtereinstellungen entsprechenden Projekte vorhanden.\n
    \n
    \n }\n return (\n
    \n {props.cards.map((card, key)=>{\n return (
    \n \n
    \n )})}\n
    \n )\n}\n\nexport default Cards;","import React from \"react\";\n\n\n\nclass Pagination extends React.Component {\n\n pagination(prevPage, nextPage) {\n const out = []\n\n const currentPage = this.props.current + 1\n const hasPreviousLink = Boolean(currentPage > 1 && prevPage !== this.props.total)\n const hasNextLink = Boolean(nextPage >= currentPage && nextPage !== this.props.total)\n\n const hasFirstLink = hasPreviousLink\n const hasLastLink = hasNextLink\n\n if (hasFirstLink) { // «\n out.push(
  • \n this.props.onChange(e, 0)}>\n Erste Seite\n «\n \n
  • )\n }\n\n if (hasPreviousLink) {\n out.push(\n
  • \n this.props.onChange(e, prevPage)}>\n Vorherige Seite\n \n \n
  • \n )\n }\n\n for (let i = 1; i < (this.props.total + 1); i++) {\n\n const pushPage = ((i < 3) || (i > (this.props.total - 2)) || (i === currentPage)) ? true : false\n\n if (pushPage) {\n const classNameLi = (i === currentPage) ? \"pager__item is-active\" : \"pager__item\"\n out.push(
  • \n this.props.onChange(e, (i - 1))}>\n {i}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === 3)\n ) {\n const display = (this.props.total === 5) ? '3' : '...'\n out.push(
  • \n \n {display}\n \n
  • )\n }\n else if (\n (this.props.total > 4)\n && (i !== currentPage)\n && (i === (this.props.total - 2))\n && !(\n (currentPage < 3)\n || (currentPage > (this.props.total - 2))\n )\n ) {\n out.push(
  • \n \n ...\n \n
  • )\n }\n }\n\n if (hasNextLink) {\n out.push(
  • \n this.props.onChange(e, nextPage)}>\n Nächste Seite\n \n \n
  • )\n }\n\n if (hasLastLink) { // »\n out.push(
  • \n this.props.onChange(e, this.props.total-1)}>\n Letzte Seite\n »\n \n
  • )\n }\n\n return out;\n }\n\n render() {\n\n const prevPage = ((this.props.current - 1) >= 0) ? this.props.current - 1 : 0\n const nextPage = ((this.props.current + 1) <= this.props.total) ? this.props.current + 1 : this.props.total\n\n return (\n
    \n \n
    \n );\n }\n}\nexport default Pagination;","import React from \"react\";\n\n\nimport ProjectFilters from \"./components/ProjectFilters\"\nimport Cards from \"./components/Cards\"\nimport Pagination from \"./components/Pagination\"\n\n\nimport { loadCards } from \"./api\"\n\n\nclass Projects extends React.Component {\n\n\n constructor(props) {\n super(props);\n this.state = {\n loading: true,\n searchTerm: \"\",\n count: 0,\n pages: 0,\n currentPage: 0,\n limit: 24,\n cards: [],\n selectedProjectTypes:[],\n selectedEvents:[],\n }\n }\n\n handlePaginationClick = async (e, page) => {\n this.setState({\n ...this.state,\n currentPage: page\n }, async () => {\n await this.loadData()\n })\n }\n\n updateProjectTypes = async (data) => {\n this.setState({\n selectedProjectTypes: data\n }, async () => {\n await this.loadData()\n })\n }\n\n updateEvents = async (data) => {\n this.setState({\n selectedEvents: data\n }, async () => {\n await this.loadData()\n })\n }\n\n doSearch = async (q) => {\n this.setState({\n searchTerm: q\n }, async () => {\n await this.loadData()\n })\n }\n\n loadData = async () => {\n const limit = this.state.limit\n const offset = this.state.currentPage * limit\n\n const projects = this.state.selectedProjectTypes.join(\",\")\n const events = this.state.selectedEvents.join(\",\")\n\n const cards = await loadCards(offset, projects, events, this.state.searchTerm)\n\n this.setState({\n ...this.state,\n cards: cards.data,\n pages: Math.ceil(cards.count / limit),\n loading: false,\n }, async () => {\n\n })\n }\n\n async componentDidMount() {\n this.loadData()\n }\n\n render() {\n if (this.state.loading) {\n return \"....\"\n }\n\n return (\n
    \n
    \n \n \n \n
    \n
    \n )\n }\n}\n\nexport default Projects;","\nimport Projects from \"./Projects\"\n// import Data from \"./Data\"\n\n// import \"./app.css\"\n\n\n// \nfunction App() {\n return (\n \n // \n );\n}\n\nexport default App;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/web/themes/custom/relaunch2018/templates/node/node--datasets-overview.html.twig b/web/themes/custom/relaunch2018/templates/node/node--datasets-overview.html.twig index faf90d89..a38a323e 100644 --- a/web/themes/custom/relaunch2018/templates/node/node--datasets-overview.html.twig +++ b/web/themes/custom/relaunch2018/templates/node/node--datasets-overview.html.twig @@ -50,5 +50,5 @@
    - + diff --git a/web/themes/custom/relaunch2018/templates/node/node--projects-overview.html.twig b/web/themes/custom/relaunch2018/templates/node/node--projects-overview.html.twig index 024f513b..8acee77e 100644 --- a/web/themes/custom/relaunch2018/templates/node/node--projects-overview.html.twig +++ b/web/themes/custom/relaunch2018/templates/node/node--projects-overview.html.twig @@ -1,5 +1,5 @@
    - +