2 lines
9.5 KiB
JavaScript
2 lines
9.5 KiB
JavaScript
|
(this.webpackJsonpfrontend=this.webpackJsonpfrontend||[]).push([[0],{70:function(e,t,a){e.exports=a(97)},75:function(e,t,a){},93:function(e,t,a){},97:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),l=a(8),r=a.n(l),c=(a(75),a(149)),s=a(148),i=a(44),u=a(61),m=Object(u.a)({palette:{primary:{main:"#556cd6"},secondary:{main:"#19857b"},error:{main:i.a.A400},background:{default:"#fff"}}}),p=a(15),d=a(12),h=a(19),f=a(20),k=a(24),b=a(16),g=a.n(b),E=a(4),v=a(135),S=a(63),y=(a(93),a(11)),C=a(150),j=a(151),O=a(138),P=function(e){function t(){var e,a;Object(p.a)(this,t);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return(a=Object(h.a)(this,(e=Object(f.a)(t)).call.apply(e,[this].concat(o)))).state={cookie:""},a.handleInputChange=function(e){a.setState(Object(y.a)({},e.target.name,e.target.value))},a.handleSubmit=function(e){if(e.preventDefault(),a.isFormValid()){var t=a.state.cookie,n={cookie:t};g.a.post("pallets",null,{params:n}).then((function(e){if(console.log(e),e.data.id){var n="A pallet of "+t+" was produced with id "+e.data.id;a.props.setStatus(n)}else alert("An error occured: "+e.data.status+". See console for more info.");a.props.refresh()})).catch((function(e){alert("An error occured. See console for more info."),console.log(e)})),a.setState({cookie:""})}},a.isFormValid=function(){return a.state.cookie.length>0},a}return Object(k.a)(t,e),Object(d.a)(t,[{key:"render",value:function(){return o.a.createElement(v.a,{className:this.props.classes.PalletProductionPaper},o.a.createElement(S.a,{color:"textSecondary",variant:"button",gutterBottom:!0},"Production"),o.a.createElement("form",null,o.a.createElement(O.a,{container:!0,direction:"row",justify:"flex-start",alignItems:"flex-end"},o.a.createElement(C.a,{style:{minWidth:"140px"},id:"cookie",select:!0,label:"Select Cookie",value:this.state.cookie,onChange:this.handleInputChange,name:"cookie",SelectProps:{native:!0}},o.a.createElement("option",{value:""}),this.props.cookies.map((function(e){return o.a.createElement("option",{key:e.name,value:e.name},e.name)}))),o.a.createElement(j.a,{style:{marginLeft:"10px"},variant:"contained",onClick:this.handleSubmit,disabled:!this.isFormValid()},"Produce pallet!"))))}}]),t}(n.Component),x=Object(E.a)((function(e){return{PalletProductionPaper:{padding:"10px",marginBottom:"15px"}}}))(P),w=function(e){function t(){var e,a;Object(p.a)(this,t);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return(a=Object(h.a)(this,(e=Object(f.a)(t)).call.apply(e,[this].concat(o)))).state={cookie:"",from:"",to:"",blocked:""},a.handleInputChange=function(e){a.setState(Object(y.a)({},e.target.name,e.target.value))},a.handleSubmit=function(){a.props.palletsFilter(a.state)},a.handleClear=function(){a.setState({cookie:"",from:"",to:"",blocked:""}),a.props.palletsFilter({})},a}return Object(k.a)(t,e),Object(d.a)(t,[{key:"render",value:function(){return o.a.createElement("form",{style:{paddingLeft:"10px",marginBottom:"10px",marginTop:"5px"}},o.a.createElement(O.a,{container:!0,direction:"row",justify:"flex-start",alignItems:"flex-end"},o.a.createElement(C.a,{style:{minWidth:"140px"},id:"cookie",select:!0,label:"Select Cookie",value:this.state.cookie,onChange:this.handleInputChange,name:"cookie",SelectProps:{native:!0}},o.a.createElement("option",{value:""}),this.props.cookies.map((function(e){return o.a.createElement("option",{key:e.name,value:e.name},e.name)}))),o.a.createElement(C.a,{style:{marginLeft:"10px"},id:"from",label:"From",type:"date",value:this.state.from,onChange:this.handleInputChange,name:"from",InputLabelProps:{shrink:!0}}),o.a.createElement(C.a,{style:{marginLeft:"10px"},id:"to",label:"To",type:"date",value:this.state.to,onChange:this.handleInputChange,name:"to",InputLabelProps:{shrink:!0}}),o.a.createElement(C.a,{style:{marginLeft:"10px",minWidth:"90px"},id:"blocked",select:!0,label:"Blocked?",value:this.state.blocked,onChange:this.handleInputChange,name:"blocked",SelectProps:{native:!0}},o.a.createElement("option",{value:""}),o.a.createElement("option",{value:"yes"},"Yes"),o.a.createElement("
|
||
|
//# sourceMappingURL=main.4ee489f9.chunk.js.map
|