You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
24 KiB
2 lines
24 KiB
/*! For license information please see 67.c9b8aeaa.chunk.js.LICENSE.txt */ |
|
(this["webpackJsonpsimpro-web"]=this["webpackJsonpsimpro-web"]||[]).push([[67],{2135:function(e,t,a){},2309:function(e,t,a){"use strict";a.r(t);var r=a(607),n=a(184),l=a(185),o=a(188),i=a(186),c=a(187),s=a(2),u=a.n(s),d=(a(2135),a(630)),p=a(1169),f=a.n(p),m=a(1170),h=a.n(m),b=a(1171),g=a.n(b),y=a(1172),v=a.n(y),E=a(938),L=a(1934),S=a(817),_=a(814),x=a(815),w=a(827),A=a(828),C=a(783),k=a(816),O=a(757),T=a(792),j=a(793),D=a(806),R=a(807),N=a(2176),P=a(2173),M=a(2174),I=a(2255),B=a(2256),F=a(812),G=(a(971),a(1173),a(1082),a(1174)),J=a.n(G),V=a(562),U=a.n(V),Y=a(864),W=a(665),z=a.n(W);function q(){q=function(){return e};var e={},t=Object.prototype,a=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function i(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(A){i=function(e,t,a){return e[t]=a}}function c(e,t,a,r){var n=t&&t.prototype instanceof d?t:d,l=Object.create(n.prototype),o=new _(r||[]);return l._invoke=function(e,t,a){var r="suspendedStart";return function(n,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw l;return w()}for(a.method=n,a.arg=l;;){var o=a.delegate;if(o){var i=E(o,a);if(i){if(i===u)continue;return i}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===r)throw r="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r="executing";var c=s(e,t,a);if("normal"===c.type){if(r=a.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(r="completed",a.method="throw",a.arg=c.arg)}}}(e,a,o),l}function s(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(A){return{type:"throw",arg:A}}}e.wrap=c;var u={};function d(){}function p(){}function f(){}var m={};i(m,n,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(x([])));b&&b!==t&&a.call(b,n)&&(m=b);var g=f.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){i(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var r;this._invoke=function(n,l){function o(){return new t((function(r,o){!function r(n,l,o,i){var c=s(e[n],e,l);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,i)}),(function(e){r("throw",e,o,i)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,i)}))}i(c.arg)}(n,l,r,o)}))}return r=r?r.then(o,o):o()}}function E(e,t){var a=e.iterator[t.method];if(void 0===a){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(a,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var n=r.arg;return n?n.done?(t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function x(e){if(e){var t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,l=function t(){for(;++r<e.length;)if(a.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return l.next=l}}return{next:w}}function w(){return{value:void 0,done:!0}}return p.prototype=f,i(g,"constructor",f),i(f,"constructor",p),p.displayName=i(f,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,o,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(v.prototype),i(v.prototype,l,(function(){return this})),e.AsyncIterator=v,e.async=function(t,a,r,n,l){void 0===l&&(l=Promise);var o=new v(c(t,a,r,n),l);return e.isGeneratorFunction(a)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},y(g),i(g,o,"Generator"),i(g,n,(function(){return this})),i(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function a(){for(;t.length;){var r=t.pop();if(r in e)return a.value=r,a.done=!1,a}return a.done=!0,a}},e.values=x,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(a,r){return o.type="throw",o.arg=e,t.next=a,r&&(t.method="next",t.arg=void 0),!!r}for(var n=this.tryEntries.length-1;n>=0;--n){var l=this.tryEntries[n],o=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var i=a.call(l,"catchLoc"),c=a.call(l,"finallyLoc");if(i&&c){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(i){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return r(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var l=n;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var o=l?l.completion:{};return o.type=e,o.arg=t,l?(this.method="next",this.next=l.finallyLoc,u):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),S(a),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var r=a.completion;if("throw"===r.type){var n=r.arg;S(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:x(e),resultName:t,nextLoc:a},"next"===this.method&&(this.arg=void 0),u}},e}var H=m.Search.SearchBar,K=(m.CSVExport.ExportCSVButton,function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(e){var l;return Object(n.a)(this,a),(l=t.call(this,e)).loading=function(){return u.a.createElement("div",{className:"animated fadeIn pt-1 text-center"},"Loading...")},l.toggleActiveTab=function(e){l.state.activeTab!==e&&l.setState({activeTab:e})},l.getLayerDetails=function(){var e=Object(r.a)(q().mark((function e(t){var a,r,n;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={method:"GET",header:JSON.stringify({"Content-Type":"application/json"})},e.prev=1,e.next=4,fetch(d.B+t,a).then((function(e){return e.json()})).then((function(e){return e}));case 4:(r=e.sent).data&&r.data.length>0&&(n=[{name:"layer_title",label:"Layer Title (label on Map)",value:r.data[0].title_en,type:"text",disabled:!1},{name:"layer_name",label:"Layer Name",value:r.data[0].name,type:"text",disabled:!0},{name:"abstract",label:"Abstract",value:r.data[0].abstract_en,type:"text",disabled:!1},{name:"workspace",label:"Workspace",value:r.data[0].workspace,type:"text",disabled:!0},{name:"datastore",label:"Data Store",value:r.data[0].store,type:"text",disabled:!0}],l.setState({layer_details:r.data,layer_details_contents:n},(function(){}))),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.log(e.t0),alert(e.t0.message.toString());case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l.getLayerAttribute=function(){var e=Object(r.a)(q().mark((function e(t){var a,r,n,o;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={method:"GET",header:JSON.stringify({"Content-Type":"application/json"})},e.prev=1,e.next=4,fetch(d.y+t,a).then((function(e){return e.json()})).then((function(e){return e}));case 4:if((r=e.sent).data&&r.data.length>0){for([],n=[],o=0;o<r.data.length;o++)n.push({attribute:r.data[o].attribute,attribute_label:r.data[o].attribute_label,attribute_type:r.data[o].attribute_type,description:r.data[o].description,visible:r.data[o].visible});console.log("result data getLayerAttribute",r.data),l.setState({dataAttribute:r.data})}e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.log(e.t0),alert(e.t0.message.toString());case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l.getLayerSearchLabel=function(){var e=Object(r.a)(q().mark((function e(t){var a,r;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l.state.selectedSearchLabelId,a={method:"GET",header:JSON.stringify({"Content-Type":"application/json"})},e.prev=2,e.next=5,fetch(d.E+t,a).then((function(e){return e.json()})).then((function(e){return e}));case 5:(r=e.sent).data&&r.data.length>0&&(console.log("getLayerSearchLabel result",r),l.setState({selectedSearchLabelId:r.data[0].attribute_id,searchLabelData:r.data})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),console.log(e.t0),alert(e.t0.message.toString());case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),l.onSelectRowTable=function(){},l.onSelectAllRowTable=function(){},l.toggleEditCell=function(){l.setState({editCellMode:!l.state.editCellMode,updateAttributeBtnVisible:!l.state.updateAttributeBtnVisible})},l.handleChangeInputLayerDetails=function(e,t){var a=l.state.layer_details_contents,r=Object(Y.b)(a,{name:e}),n=t.target.value;r.value=n,console.log("changedItem",r),l.setState({layer_details_contents:a}),console.log("layer_details_contents",l.state.layer_details_contents)},l.handleChangeSelectSearchLabel=function(e){l.state.selectedSearchLabelId;var t=e.target.value;l.setState({selectedSearchLabelId:t},(function(){console.log(l.state.selectedSearchLabelId)}))},l.renderModalEditLayerDetails=function(){var e=l.state.layer_details_contents;return u.a.createElement("div",null,u.a.createElement(S.a,{isOpen:l.state.modalEditLayerDetailsVisible,toggle:function(){return l.toggleEditLayerDetails()}},u.a.createElement(_.a,{toggle:function(){return l.toggleEditLayerDetails()}},"Edit Layer Details"),u.a.createElement(x.a,null,u.a.createElement("div",{className:"modal-body-container"},e.length>0?e.map((function(e,t){return u.a.createElement(w.a,{key:t},u.a.createElement(A.a,{for:e.name},e.label),e.disabled?u.a.createElement(C.a,{onChange:l.handleChangeInputLayerDetails.bind(Object(o.a)(l),e.name),type:e.type,value:e.value,disabled:!0}):u.a.createElement(C.a,{onChange:l.handleChangeInputLayerDetails.bind(Object(o.a)(l),e.name),type:e.type,value:e.value}))})):null)),u.a.createElement(k.a,null,u.a.createElement(O.a,{color:"secondary",onClick:function(){return l.toggleEditLayerDetails()}},"Cancel"),u.a.createElement(O.a,{color:"success",onClick:function(){return l.updateLayerDetailPost()}},"Update")," ")))},l.editLayerDetails=function(){l.toggleEditLayerDetails()},l.toggleEditLayerDetails=function(){l.setState({modalEditLayerDetailsVisible:!l.state.modalEditLayerDetailsVisible})},l.updateAttribute=function(){l.setState({confirmParam:"update_attribute"},(function(){return l.showConfirm(l.state.confirmParam)}))},l.updateSearchLabel=function(){""===l.state.selectedSearchLabelId?l.showWarning("empty_selectedSearchLabelId"):l.setState({confirmParam:"update_search_label"},(function(){return l.showConfirm(l.state.confirmParam)}))},l.showWarning=function(e){"empty_selectedSearchLabelId"===e&&l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:"Please select the attribute label"})},l.showConfirm=function(e){"update_attribute"===e?l.setState({alertConfirm:!0,alertConfirmBtnText:"Update",alertConfirmType:"success",alertConfirmMsg:"Save the updates"}):"update_search_label"===e&&l.setState({alertConfirm:!0,alertConfirmBtnText:"Update",alertConfirmType:"success",alertConfirmMsg:"Update Search Label"})},l.confirmOnClose=function(){l.setState({alertConfirm:!1,alertConfirmBtnText:"",alertConfirmType:"",alertConfirmMsg:"",confirmParam:""})},l.closeAlertResponse=function(){l.setState({alertResponse:!1,successAlert:!1,dangerAlert:!1,alertResponseMsg:""})},l.confirmYes=Object(r.a)(q().mark((function e(){var t,a,r;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=l.state,a=t.confirmParam,r=t.dataAttribute,"update_attribute"===a?(console.log("dataAttribute",r),l.updateAttributePost(),l.confirmOnClose()):"update_search_label"===a&&(l.updateSearchLabelPost(),l.confirmOnClose());case 2:case"end":return e.stop()}}),e)}))),l.updateLayerDetailPost=Object(r.a)(q().mark((function e(){var t,a,r,n,o,i;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.state,a=t.layer_details_contents,r=t.layer_id,n={layer_id:r,layer_detail:{title_en:Object(Y.b)(a,{name:"layer_title"}).value,abstract_en:Object(Y.b)(a,{name:"abstract"}).value}},o={method:"POST",header:JSON.stringify({"Content-Type":"application/json"}),body:JSON.stringify(n)},console.log("updateLayerDetailPost param",o),e.prev=4,e.next=7,fetch(d.C,o).then((function(e){return e.json()})).then((function(e){return e}));case 7:i=e.sent,console.log("updateLayerDetailPost result",i),"success"==i.code_type?l.setState({alertResponse:!0,successAlert:!0,dangerAlert:!1,alertResponseMsg:i.code_message},(function(){l.getLayerDetails(r),l.toggleEditLayerDetails()})):"error"==i.code_type&&l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:i.code_message}),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),console.log(e.t0),l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:e.t0.message.toString()});case 16:case"end":return e.stop()}}),e,null,[[4,12]])}))),l.updateAttributePost=Object(r.a)(q().mark((function e(){var t,a,r,n,o,i;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.state,a=t.dataAttribute,r=t.layer_id,n={layer_id:r,layer_attribute:a},o={method:"POST",header:JSON.stringify({"Content-Type":"application/json"}),body:JSON.stringify(n)},console.log("updateAttributePost param",o),e.prev=4,e.next=7,fetch(d.A,o).then((function(e){return e.json()})).then((function(e){return e}));case 7:"success"==(i=e.sent).code_type?l.setState({alertResponse:!0,successAlert:!0,dangerAlert:!1,alertResponseMsg:i.code_message},(function(){l.getLayerAttribute(r),l.toggleEditCell()})):"error"==i.code_type&&l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:i.code_message}),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),console.log(e.t0),l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:e.t0.message.toString()});case 15:case"end":return e.stop()}}),e,null,[[4,11]])}))),l.updateSearchLabelPost=Object(r.a)(q().mark((function e(){var t,a,r,n,o,i;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.state,a=t.selectedSearchLabelId,r=t.layer_id,n={layer_id:r,attribute_id:a},o={method:"POST",header:JSON.stringify({"Content-Type":"application/json"}),body:JSON.stringify(n)},console.log("updateAttributePost param",o),e.prev=4,e.next=7,fetch(d.F,o).then((function(e){return e.json()})).then((function(e){return e}));case 7:"success"==(i=e.sent).code_type?l.setState({alertResponse:!0,successAlert:!0,dangerAlert:!1,alertResponseMsg:i.code_message},(function(){l.getLayerSearchLabel(r)})):"error"==i.code_type&&l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:i.code_message}),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),console.log(e.t0),l.setState({alertResponse:!0,successAlert:!1,dangerAlert:!0,alertResponseMsg:e.t0.message.toString()});case 15:case"end":return e.stop()}}),e,null,[[4,11]])}))),l.renderLayerDetails=function(){return l.state.layer_details.length>0?u.a.createElement(s.Fragment,null,l.renderLayerDetailsContent(),u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},u.a.createElement("div",{className:"layer-details-button-group"},u.a.createElement(O.a,{outline:!0,color:"success",onClick:function(){return l.editLayerDetails()}},"Edit"))))):null},l.renderLayerDetailsContent=function(){return l.state.layer_details_contents.map((function(e,t){return u.a.createElement(T.a,{key:t},u.a.createElement(j.a,{xl:3,md:3,xs:12},u.a.createElement("b",null,e.label)),u.a.createElement(j.a,{xl:9,md:9,xs:12},": ",e.value))}))},l.renderLayerAttribute=function(){var e=l.state,t=e.columnsAttribute,a=e.dataAttribute,r=e.editCellMode;e.selectedRows,e.selectRow;return u.a.createElement(h.a,{keyField:"id",data:a,columns:t,search:!0,exportCSV:!0},(function(e){return u.a.createElement("div",null,u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:6,xs:6},u.a.createElement("div",{className:"search-bar-wrapper"},u.a.createElement(H,e.searchProps))),u.a.createElement(j.a,{xl:6,xs:6},u.a.createElement("div",{className:"table-option-button-group pull-right"},u.a.createElement(T.a,null,l.state.updateAttributeBtnVisible?u.a.createElement("div",{className:"option-button-wrapper"},u.a.createElement(O.a,{color:"success",size:"sm",outline:!0,id:"updateAttribute",onClick:function(){return l.updateAttribute()}},u.a.createElement(F.Icon,{icon:J.a,width:20,height:20})),u.a.createElement(L.a,{placement:"top",target:"updateAttribute"},"Update Attribute")):null,u.a.createElement("div",{className:"switch-button-edit clearfix"},u.a.createElement("small",null,u.a.createElement("b",null,"Edit")),u.a.createElement("br",null),u.a.createElement(E.l,{className:"float-right",variant:"pill",label:!0,color:"success",size:"sm",onChange:function(){return l.toggleEditCell()},checked:r})),u.a.createElement("div",{className:"clearfix"}))))),u.a.createElement("div",{className:"table-wrapper"},r?u.a.createElement(f.a,Object.assign({},e.baseProps,{bootstrap4:!0,keyField:"id",hover:!0,pagination:g()(),noDataIndication:"No results found",cellEdit:v()({mode:"click",blurToSave:!0,timeToCloseMessage:2500,errorMessage:""})})):u.a.createElement(f.a,Object.assign({},e.baseProps,{bootstrap4:!0,keyField:"id",hover:!0,pagination:g()(),noDataIndication:"No results found"}))))}))},l.renderSearchLabel=function(){return u.a.createElement(s.Fragment,null,u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},u.a.createElement(w.a,null,u.a.createElement(A.a,{for:"searchLabelSelect"},u.a.createElement("b",null,"Set Attribute Label on Search Features")),u.a.createElement(C.a,{type:"select",name:"select",id:"searchLabelSelect",onChange:l.handleChangeSelectSearchLabel.bind(Object(o.a)(l))},u.a.createElement("option",{value:""},"Please select the attribute label"),l.renderSearchLabelSelect())))),u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},u.a.createElement("div",{className:"layer-details-button-group"},u.a.createElement(O.a,{outline:!0,color:"success",onClick:function(){return l.updateSearchLabel()}},"Update")))))},l.renderSearchLabelSelect=function(){var e=l.state.dataAttribute,t=l.state.searchLabelData;return console.log("searchLabelData",t),e.map((function(e,a){if(t.length>0)if(t[0].attribute_id===e.id){if(null!==e.attribute_label&&""!==e.attribute_label)return u.a.createElement("option",{key:a,value:e.id,selected:!0},e.attribute_label);if("the_geom"!==e.attribute)return u.a.createElement("option",{key:a,value:e.id,selected:!0},e.attribute)}else{if(null!==e.attribute_label&&""!==e.attribute_label)return u.a.createElement("option",{key:a,value:e.id},e.attribute_label);if("the_geom"!==e.attribute)return u.a.createElement("option",{key:a,value:e.id},e.attribute)}else{if(null!==e.attribute_label&&""!==e.attribute_label)return u.a.createElement("option",{key:a,value:e.id},e.attribute_label);if("the_geom"!==e.attribute)return u.a.createElement("option",{key:a,value:e.id},e.attribute)}}))},l.state={layer_id:null,layer_details:[],layerAttribute:[],columnsAttribute:[{dataField:"attribute",text:"Attribute",sort:!0,editable:!1},{dataField:"attribute_label",text:"Attribute Label",sort:!0},{dataField:"attribute_type",text:"Attribute Type",sort:!0,editable:!1},{dataField:"description",text:"Description",sort:!0}],dataAttribute:[],selectRow:{mode:"checkbox",clickToSelect:!0,clickToEdit:!1,bgColor:"#e4e5e6",onSelect:function(e,t,a,r){return l.onSelectRowTable({row:e,isSelect:t,e:r,rowIndex:a})},onSelectAll:function(e,t,a){return l.onSelectAllRowTable(e,t,a)}},editCellMode:!1,onSelectAllMode:!1,selectedRows:[],activeTab:"1",modalEditLayerDetailsVisible:!1,layer_details_contents:[],updateAttributeBtnVisible:!1,alertResponse:!1,successAlert:!1,dangerAlert:!1,alertResponseMsg:!1,alertConfirm:!1,alertConfirmBtnText:!1,alertConfirmType:"",alertConfirmMsg:!1,confirmParam:"",selectedSearchLabelId:"",searchLabelData:[]},l}return Object(l.a)(a,[{key:"componentDidMount",value:function(){var e=this;this.setState({layer_id:this.props.match.params.id},(function(){var t=e.state.layer_id;e.getLayerDetails(t),e.getLayerAttribute(t),e.getLayerSearchLabel(t)}))}},{key:"componentDidUpdate",value:function(e,t){}},{key:"render",value:function(){var e=this,t=this.state,a=(t.layer_details,t.layer_details_contents),r=t.columnsAttribute,n=t.activeTab,l=t.alertResponse,o=t.successAlert,i=t.dangerAlert,c=t.alertResponseMsg,d=t.alertConfirm,p=t.alertConfirmBtnText,f=t.alertConfirmType,m=t.alertConfirmMsg;t.confirmParam;return console.log("layer_details_contents",a),u.a.createElement(s.Suspense,{fallback:this.loading()},u.a.createElement(z.a,{show:l,success:o,danger:i,title:o?"Success":"Error",onConfirm:function(){return e.closeAlertResponse()}},c),u.a.createElement(z.a,{show:d,warning:!0,showCancel:!0,confirmBtnText:p,confirmBtnBsStyle:f,title:"Are you sure?",onConfirm:function(){return e.confirmYes()},onCancel:function(){return e.confirmOnClose()},focusCancelBtn:!0},m),u.a.createElement(T.a,null,this.renderModalEditLayerDetails(),u.a.createElement(j.a,{xl:12,md:12,xs:12},u.a.createElement(D.a,null,u.a.createElement(R.a,null,u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},u.a.createElement("h4",null,a.length>0?a[0].value:"Layer Title"),u.a.createElement("hr",null))),u.a.createElement(N.a,{tabs:!0},u.a.createElement(P.a,null,u.a.createElement(M.a,{className:U()({active:"1"===n}),onClick:function(){e.toggleActiveTab("1")}},"Layer Details")),u.a.createElement(P.a,null,u.a.createElement(M.a,{className:U()({active:"2"===n}),onClick:function(){e.toggleActiveTab("2")}},"Attributes")),u.a.createElement(P.a,null,u.a.createElement(M.a,{className:U()({active:"3"===n}),onClick:function(){e.toggleActiveTab("3")}},"Search Label"))),u.a.createElement(I.a,{activeTab:n},u.a.createElement(B.a,{tabId:"1"},u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},this.renderLayerDetails()))),u.a.createElement(B.a,{tabId:"2"},u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},r.length>0?this.renderLayerAttribute():null))),u.a.createElement(B.a,{tabId:"3"},u.a.createElement(T.a,null,u.a.createElement(j.a,{xl:12,md:12,xs:12},this.renderSearchLabel()))),u.a.createElement(B.a,{tabId:"4"})))))))}}]),a}(s.Component));t.default=K}}]); |