{"version":3,"sources":["theme.js","PalletProduction.js","PalletTableFilter.js","PalletTable.js","ResetDatabase.js","App.js","serviceWorker.js","index.js"],"names":["theme","createMuiTheme","palette","primary","main","secondary","error","red","A400","background","default","PalletProduction","state","cookie","handleInputChange","e","setState","target","name","value","handleSubmit","preventDefault","isFormValid","params","axios","post","then","res","console","log","data","id","message","props","setStatus","alert","status","refresh","catch","length","Paper","className","this","classes","PalletProductionPaper","Typography","color","variant","gutterBottom","Grid","container","direction","justify","alignItems","TextField","style","minWidth","select","label","onChange","SelectProps","native","cookies","map","c","key","Button","marginLeft","onClick","disabled","Component","withStyles","padding","marginBottom","PalletTableFilter","from","to","blocked","palletsFilter","handleClear","paddingLeft","marginTop","type","InputLabelProps","shrink","root","width","overflowX","table","header","Table","TableHead","TableRow","TableCell","TableBody","pallets","p","customer","component","scope","production_date","ResetDatabase","open","openDialog","closeDialog","resetDatabase","response","Dialog","onClose","aria-labelledby","aria-describedby","DialogTitle","DialogContent","DialogContentText","DialogActions","autoFocus","App","disconnected","cookieStatus","palletStatus","fetchCookies","fetchPallets","get","filter","Object","keys","k","forEach","setPalletsFilter","mainArea","statusMessage","join","defaults","baseURL","StatusPaper","Boolean","window","location","hostname","match","ReactDOM","render","ThemeProvider","CssBaseline","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"wQAqBeA,EAjBDC,YAAe,CAC3BC,QAAS,CACPC,QAAS,CACPC,KAAM,WAERC,UAAW,CACTD,KAAM,WAERE,MAAO,CACLF,KAAMG,IAAIC,MAEZC,WAAY,CACVC,QAAS,W,4HCNTC,E,2MACJC,MAAQ,CACNC,OAAQ,I,EAGVC,kBAAoB,SAACC,GACnB,EAAKC,SAAL,eACGD,EAAEE,OAAOC,KAAOH,EAAEE,OAAOE,S,EAI9BC,aAAe,SAACL,GAEd,GADAA,EAAEM,iBACE,EAAKC,cAAe,CACtB,IAAMT,EAAS,EAAKD,MAAMC,OACpBU,EAAS,CAACV,OAAQA,GACxBW,IAAMC,K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kD,QACpBiC,QAAS,EAAKnF,MAAMmF,QACpBjB,cAAe,EAAKkD,mBACtB,kBAAC,EAAD,CACE3F,QAAS,EAAKA,QACdH,UAAW,EAAKA,c,mFAlEpBQ,KAAKL,Y,+BAuEL,IAAI6F,EAAgB,CAACxF,KAAK9B,MAAM0G,aAAc5E,KAAK9B,MAAM2G,cAAcY,KAAK,OACxEzF,KAAK9B,MAAMyG,eACba,EACE,6EAAmD1G,IAAM4G,SAASC,QAAlE,MAIJ,IAAIjI,EAAO,KAKX,OAJKsC,KAAK9B,MAAMyG,eACdjH,EAAOsC,KAAKuF,YAIZ,yBAAKxF,UAAU,OACb,kBAACI,EAAA,EAAD,CAAYE,QAAQ,KAAKC,cAAY,GAArC,UAIA,kBAACR,EAAA,EAAD,CAAOC,UAAWC,KAAKT,MAAMU,QAAQ2F,aACnC,6BACE,sCADF,IACkBJ,IAInB9H,O,GA1GSkE,aAwHHC,eAPA,SAAAvE,GAAK,MAAK,CACvBsI,YAAa,CACX9D,QAAS,OACTC,aAAc,WAIHF,CAAmB6C,GCxHdmB,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCNNnH,IAAM4G,SAASC,QAAU,UAEzBO,IAASC,OACT,kBAACC,EAAA,EAAD,CAAe9I,MAAOA,GAElB,kBAAC+I,EAAA,EAAD,MACA,kBAAC,EAAD,OACgBC,SAASC,eAAe,SDgHtC,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB1H,MAAK,SAAA2H,GACJA,EAAaC,gBAEdhH,OAAM,SAAAhC,GACLsB,QAAQtB,MAAMA,EAAM0B,c","file":"static/js/main.4ee489f9.chunk.js","sourcesContent":["import { red } from '@material-ui/core/colors';\nimport { createMuiTheme } from '@material-ui/core/styles';\n\n// A custom theme for this app\nconst theme = createMuiTheme({\n palette: {\n primary: {\n main: '#556cd6',\n },\n secondary: {\n main: '#19857b',\n },\n error: {\n main: red.A400,\n },\n background: {\n default: '#fff',\n },\n },\n});\n\nexport default theme;","import React, { Component } from 'react';\nimport axios from 'axios';\n\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport Paper from '@material-ui/core/Paper';\n\nclass PalletProduction extends Component {\n state = {\n cookie: \"\",\n }\n\n handleInputChange = (e) => {\n this.setState({\n [e.target.name]: e.target.value\n });\n }\n\n handleSubmit = (e) => {\n e.preventDefault();\n if (this.isFormValid()) {\n const cookie = this.state.cookie\n const params = {cookie: cookie}\n axios.post('pallets', null, {params: params})\n .then(res => {\n console.log(res);\n if (res.data.id) {\n const message = \"A pallet of \" + cookie\n + \" was produced with id \" + res.data.id;\n this.props.setStatus(message)\n } else {\n alert('An error occured: ' + res.data.status\n + '. See console for more info.');\n }\n this.props.refresh();\n })\n .catch(error => {\n alert('An error occured. See console for more info.');\n console.log(error);\n });\n this.setState({cookie: \"\"});\n }\n }\n\n isFormValid = () => this.state.cookie.length > 0;\n\n render() {\n return (\n
\n \n \n
\n );\n }\n}\n\nexport default ResetDatabase;\n","import React, { Component } from 'react';\nimport axios from 'axios';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\n\nimport './App.css';\nimport PalletProduction from './PalletProduction';\nimport PalletTable from './PalletTable'\nimport ResetDatabase from './ResetDatabase';\n\nclass App extends Component {\n state = {\n cookies: [],\n pallets: [],\n palletsFilter: {},\n disconnected: false,\n cookieStatus: \"\",\n palletStatus: \"\"\n }\n\n componentDidMount() {\n this.refresh();\n }\n\n refresh = () => {\n this.fetchCookies();\n this.fetchPallets(this.state.palletsFilter);\n }\n\n fetchCookies = () => {\n axios.get(\"cookies\")\n .then(res => {\n if (res.data && res.data.cookies) {\n this.setState({ cookies: res.data.cookies, cookieStatus: (!res.data.cookies || res.data.cookies.length === 0) ? \"Cookie request success, but no cookies returned from API\": \"\"});\n } else {\n this.setState({ cookieStatus: \"Couldn't fetch cookies from REST server\"});\n }\n })\n .catch(error => {\n console.log(error);\n this.setState({disconnected: true})\n });\n }\n\n fetchPallets = (filter) => {\n // Only apply filters that are non-empty\n let params = {}\n Object.keys(filter)\n .filter(k => filter[k].length > 0)\n .forEach(k => params[k] = filter[k])\n\n axios.get(\"pallets\", {params: params})\n .then(res => {\n console.log(res);\n if (res.data && res.data.pallets) {\n this.setState({ pallets: res.data.pallets, palletStatus: (!res.data.pallets || res.data.pallets.length === 0) ? \"Pallet request success, but no pallets returned from API.\": \"\" });\n } elseĀ {\n this.setState({ palletStatus: \"Couldn't fetch pallets from REST server\"});\n }\n })\n .catch(error => {\n console.log(error);\n this.setState({disconnected: true})\n });\n }\n\n setStatus = (message) => {\n this.setState({status: message});\n }\n\n setPalletsFilter = (filter) => {\n this.setState({palletsFilter: filter});\n this.fetchPallets(filter);\n }\n\n mainArea = () => (\n