-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 51.7 KB
/
.eslintcache
1
[{"C:\\xampp\\htdocs\\escape-web-react\\src\\index.js":"1","C:\\xampp\\htdocs\\escape-web-react\\src\\App.js":"2","C:\\xampp\\htdocs\\escape-web-react\\src\\reportWebVitals.js":"3","C:\\xampp\\htdocs\\escape-web-react\\src\\views\\user\\login.js":"4","C:\\xampp\\htdocs\\escape-web-react\\src\\i18n.js":"5","C:\\xampp\\htdocs\\escape-web-react\\src\\globals.js":"6","C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\User.js":"7","C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Resource.js":"8","C:\\xampp\\htdocs\\escape-web-react\\src\\plugins\\axios.js":"9","C:\\xampp\\htdocs\\escape-web-react\\src\\config.js":"10","C:\\xampp\\htdocs\\escape-web-react\\src\\store\\actions.js":"11","C:\\xampp\\htdocs\\escape-web-react\\src\\store\\stateReducers.js":"12","C:\\xampp\\htdocs\\escape-web-react\\src\\plugins\\store.js":"13","C:\\xampp\\htdocs\\escape-web-react\\src\\views\\layout\\dashboard.js":"14","C:\\xampp\\htdocs\\escape-web-react\\src\\views\\dashboard\\view.js":"15","C:\\xampp\\htdocs\\escape-web-react\\src\\plugins\\i18nr.js":"16","C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Room.js":"17","C:\\xampp\\htdocs\\escape-web-react\\src\\classes.js":"18","C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Timetable.js":"19","C:\\xampp\\htdocs\\escape-web-react\\src\\routes.js":"20","C:\\xampp\\htdocs\\escape-web-react\\src\\views\\room\\list.js":"21","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\EnhancedTable.js":"22","C:\\xampp\\htdocs\\escape-web-react\\src\\views\\user\\register.js":"23","C:\\xampp\\htdocs\\escape-web-react\\src\\styles.js":"24","C:\\xampp\\htdocs\\escape-web-react\\src\\views\\room\\save.js":"25","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\schedules-list.js":"26","C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Schedule.js":"27","C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Info.js":"28","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\schedules.js":"29","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\timetables.js":"30","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\revenue.js":"31","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\summary\\schedules.js":"32","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\summary\\occupancy.js":"33","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\summary\\revenue.js":"34","C:\\xampp\\htdocs\\escape-web-react\\src\\filters\\filters.js":"35"},{"size":770,"mtime":1612386725841,"results":"36","hashOfConfig":"37"},{"size":2610,"mtime":1612785124719,"results":"38","hashOfConfig":"37"},{"size":375,"mtime":1612352953595,"results":"39","hashOfConfig":"37"},{"size":6909,"mtime":1613131654161,"results":"40","hashOfConfig":"37"},{"size":1328,"mtime":1612354955894,"results":"41","hashOfConfig":"37"},{"size":345,"mtime":1609113654827,"results":"42","hashOfConfig":"37"},{"size":1803,"mtime":1612545381575,"results":"43","hashOfConfig":"37"},{"size":29979,"mtime":1613152880643,"results":"44","hashOfConfig":"37"},{"size":586,"mtime":1612352953593,"results":"45","hashOfConfig":"37"},{"size":80,"mtime":1612352953588,"results":"46","hashOfConfig":"37"},{"size":491,"mtime":1612352953602,"results":"47","hashOfConfig":"37"},{"size":1261,"mtime":1612376478884,"results":"48","hashOfConfig":"37"},{"size":959,"mtime":1612352953594,"results":"49","hashOfConfig":"37"},{"size":3626,"mtime":1612383694457,"results":"50","hashOfConfig":"37"},{"size":1618,"mtime":1613585578376,"results":"51","hashOfConfig":"37"},{"size":316,"mtime":1612352953594,"results":"52","hashOfConfig":"37"},{"size":2956,"mtime":1612545700264,"results":"53","hashOfConfig":"37"},{"size":191,"mtime":1612352953587,"results":"54","hashOfConfig":"37"},{"size":952,"mtime":1612352953598,"results":"55","hashOfConfig":"37"},{"size":534,"mtime":1612352953600,"results":"56","hashOfConfig":"37"},{"size":8424,"mtime":1612545576106,"results":"57","hashOfConfig":"37"},{"size":15691,"mtime":1613585116276,"results":"58","hashOfConfig":"37"},{"size":10627,"mtime":1612545388967,"results":"59","hashOfConfig":"37"},{"size":882,"mtime":1612388555395,"results":"60","hashOfConfig":"37"},{"size":15532,"mtime":1613063317904,"results":"61","hashOfConfig":"37"},{"size":4579,"mtime":1613585431540,"results":"62","hashOfConfig":"37"},{"size":1773,"mtime":1612786064515,"results":"63","hashOfConfig":"37"},{"size":2237,"mtime":1613390569334,"results":"64","hashOfConfig":"37"},{"size":4774,"mtime":1613583848496,"results":"65","hashOfConfig":"37"},{"size":5169,"mtime":1613583859619,"results":"66","hashOfConfig":"37"},{"size":5525,"mtime":1613585167315,"results":"67","hashOfConfig":"37"},{"size":2575,"mtime":1613583826363,"results":"68","hashOfConfig":"37"},{"size":3829,"mtime":1613583817117,"results":"69","hashOfConfig":"37"},{"size":2919,"mtime":1613583817102,"results":"70","hashOfConfig":"37"},{"size":953,"mtime":1613580949700,"results":"71","hashOfConfig":"37"},{"filePath":"72","messages":"73","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},"10be5s0",{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"89","messages":"90","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"119","messages":"120","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"121","messages":"122","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"123","usedDeprecatedRules":"74"},{"filePath":"124","messages":"125","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"130","messages":"131","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"132","usedDeprecatedRules":"74"},{"filePath":"133","messages":"134","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"135","usedDeprecatedRules":"74"},{"filePath":"136","messages":"137","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"138","usedDeprecatedRules":"74"},{"filePath":"139","messages":"140","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"141","messages":"142","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"143","usedDeprecatedRules":"74"},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"74"},"C:\\xampp\\htdocs\\escape-web-react\\src\\index.js",[],["148","149"],"C:\\xampp\\htdocs\\escape-web-react\\src\\App.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\reportWebVitals.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\views\\user\\login.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\i18n.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\globals.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\User.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Resource.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\plugins\\axios.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\config.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\store\\actions.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\store\\stateReducers.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\plugins\\store.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\views\\layout\\dashboard.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\views\\dashboard\\view.js",["150"],"C:\\xampp\\htdocs\\escape-web-react\\src\\plugins\\i18nr.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Room.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\classes.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Timetable.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\routes.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\views\\room\\list.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\components\\EnhancedTable.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\views\\user\\register.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\styles.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\views\\room\\save.js",["151","152","153"],"import React, {useEffect, useState} from 'react';\r\nimport Room from \"../../resources/Room\"\r\n\r\nimport {\r\n Button,\r\n Card,\r\n CardContent,\r\n CardHeader,\r\n TextField,\r\n FormControlLabel,\r\n Switch,\r\n Slider,\r\n FormHelperText,\r\n MenuItem\r\n} from \"@material-ui/core\";\r\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield'\r\nimport Modal from '@material-ui/core/Modal';\r\nimport Typography from '@material-ui/core/Typography';\r\n\r\nimport {t} from '../../plugins/i18nr'\r\nimport {Col, Row} from \"react-bootstrap\";\r\nimport SimpleReactValidator from \"simple-react-validator\";\r\n\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport {toast} from \"react-toastify\";\r\n\r\nexport default function RoomSave(props) {\r\n const modal = props.open;\r\n const [data, setData] = useState(Room.new())\r\n const [validator, setValidator] = useState(new SimpleReactValidator())\r\n // const classes = useStyles();\r\n\r\n const scheduleType = [\r\n {'value': 1, 'text': t('room.labels.ticket'), 'hint': t('room.labels.ticket_hint')},\r\n {'value': 2, 'text': t('room.labels.room'), 'hint': t('room.labels.room_hint')},\r\n ];\r\n\r\n function inputChange(event) {\r\n setData({...data, [event.target.name]: event.target.value});\r\n }\r\n\r\n function switchChange(event) {\r\n setData({...data, [event.target.name]: event.target.checked});\r\n }\r\n\r\n function slideChange(event, value, name) {\r\n setData({...data, [name]: value});\r\n }\r\n\r\n function onValidate(event) {\r\n if (!validator.fieldValid(event.target.name)) {\r\n validator.showMessageFor(event.target.name)\r\n }\r\n setValidator(validator);\r\n setData({...data}); //Force to update view\r\n }\r\n\r\n\r\n const closeModal = () => {\r\n props.closeModal()\r\n };\r\n\r\n /**\r\n * Refresh the data\r\n * @returns void\r\n */\r\n function refresh() {\r\n if (props.id)\r\n Room.show({\r\n params: {id: props.id},\r\n loader: true\r\n }).then((response) => {\r\n //After refresh, clean all the selected values\r\n console.log(response.data)\r\n setData(response.data)\r\n })\r\n }\r\n\r\n /**\r\n * Refresh the data\r\n * @returns void\r\n */\r\n function save() {\r\n if (validator.allValid()) {\r\n Room.save({\r\n params: data,\r\n }).then(() => {\r\n toast.success(t('message.save.success'))\r\n closeModal()\r\n });\r\n } else {\r\n // turn on validation message and re-render\r\n validator.showMessages()\r\n setData({...data}); //Force to update view\r\n setValidator(validator);\r\n toast.error(t('form.invalid_fields'))\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (modal) {\r\n //Open modal\r\n setData(Room.new())\r\n console.log('modal ' + modal)\r\n refresh()\r\n }\r\n }, [props.id, modal]);\r\n\r\n return (\r\n\r\n <Modal\r\n open={modal}\r\n onClose={closeModal}\r\n aria-labelledby=\"simple-modal-title\"\r\n aria-describedby=\"simple-modal-description\"\r\n >\r\n <Row className=\"justify-content-center w-100 align-items-center\">\r\n <Col xs=\"12\" sm=\"12\" md=\"10\" lg=\"8\" xl=\"7\">\r\n <Card className=\"mt-3 px-3\">\r\n <CardContent className=\"p-0\">\r\n <Grid container\r\n justify=\"flex-start\"\r\n alignItems=\"center\"\r\n spacing={2}\r\n className={'mt-3'}\r\n >\r\n <Grid item spacing={2} sm xs>\r\n <CardHeader title={props.id === undefined ? t('room.add') : t('room.edit')}\r\n titleTypographyProps={{variant: 'h5'}}>\r\n </CardHeader>\r\n </Grid>\r\n <Grid item spacing={2}>\r\n <FormControlLabel\r\n control={\r\n <Switch\r\n checked={data.enable} color=\"primary\"\r\n onChange={switchChange}\r\n value={data.enable}\r\n name=\"enable\"/>\r\n }\r\n label=\"Enable\"\r\n />\r\n </Grid>\r\n </Grid>\r\n <CardContent className=\"px-3 py-0 pb-3\">\r\n <form noValidate autoComplete=\"off\">\r\n <Row className=\"mt-3\">\r\n <Col>\r\n <TextField\r\n label={t('room.labels.name')}\r\n name=\"name\"\r\n type=\"text\"\r\n className=\"w-100\"\r\n value={data.name}\r\n onChange={inputChange}\r\n onBlur={onValidate}\r\n InputLabelProps={{shrink: !!data.name}}\r\n />\r\n {validator.message('name', data.name, Room.validations().name)}\r\n </Col>\r\n </Row>\r\n\r\n <Row className=\"mt-3\">\r\n <Col>\r\n <TextField\r\n label={t('room.labels.short_name')}\r\n name=\"short_name\"\r\n type=\"text\"\r\n className=\"w-100\"\r\n value={data.short_name}\r\n onChange={inputChange}\r\n onBlur={onValidate}\r\n InputLabelProps={{shrink: !!data.short_name}}\r\n />\r\n {validator.message('short_name', data.short_name, Room.validations().short_name)}\r\n </Col>\r\n <Col>\r\n <TextField\r\n label={t('room.labels.schedule_types')}\r\n name=\"schedule_types\"\r\n select\r\n value={data.schedule_type}\r\n onChange={inputChange}\r\n onBlur={onValidate}\r\n helperText={data.schedule_type ? scheduleType.find(option => option.value === data.schedule_type).hint : ''}\r\n >\r\n {scheduleType.map((option) => (\r\n <MenuItem key={option.value}\r\n value={option.value}\r\n selected={data.schedule_type === option.value}>\r\n {option.text}\r\n </MenuItem>\r\n ))}\r\n </TextField>\r\n </Col>\r\n </Row>\r\n\r\n <Row className=\"px-3 py-5\">\r\n <Grid container spacing={2}>\r\n <Grid item>\r\n <Typography gutterBottom>{t('room.labels.play_time')}</Typography>\r\n </Grid>\r\n <Grid item sm>\r\n <Slider\r\n defaultValue={1}\r\n valueLabelDisplay=\"auto\"\r\n valueLabelDisplay=\"on\"\r\n name=\"play_time\"\r\n value={data.play_time}\r\n step={1}\r\n min={15}\r\n max={120}\r\n marks\r\n onChange={(event, value) => slideChange(event, value, 'play_time')}\r\n />\r\n </Grid>\r\n </Grid>\r\n <FormHelperText>{t('room.labels.play_time_hint')}</FormHelperText>\r\n </Row>\r\n\r\n <Row className=\"px-3\">\r\n <Grid container spacing={2}>\r\n <Grid item>\r\n <Typography gutterBottom>{t('room.labels.vacancies')}</Typography>\r\n </Grid>\r\n <Grid item sm>\r\n <Slider\r\n defaultValue={1}\r\n valueLabelDisplay=\"auto\"\r\n valueLabelDisplay=\"on\"\r\n name=\"vacancies\"\r\n value={data.vacancies}\r\n step={1}\r\n min={1}\r\n max={20}\r\n marks\r\n onChange={(event, value) => slideChange(event, value, 'vacancies')}\r\n />\r\n </Grid>\r\n </Grid>\r\n <FormHelperText>{t('room.labels.vacancies_hint')}</FormHelperText>\r\n </Row>\r\n <Row className=\"mt-3\">\r\n <Col>\r\n <CurrencyTextField\r\n label={t('room.labels.room_price')}\r\n name=\"room_price\"\r\n variant=\"standard\"\r\n value={data.room_price}\r\n currencySymbol={t('currency.prefix')}\r\n minimumValue=\"0\"\r\n outputFormat=\"string\"\r\n decimalCharacter={t('currency.decimal')}\r\n digitGroupSeparator={t('currency.thousands')}\r\n onChange={inputChange}\r\n onBlur={onValidate}\r\n />\r\n <FormHelperText>{t('room.labels.room_price_hint')}</FormHelperText>\r\n {validator.message('room_price', data.room_price, Room.validations().room_price)}\r\n </Col>\r\n <Col>\r\n <CurrencyTextField\r\n label={t('room.labels.ticket_price')}\r\n name=\"ticket_price\"\r\n variant=\"standard\"\r\n value={data.ticket_price}\r\n currencySymbol={t('currency.prefix')}\r\n minimumValue=\"0\"\r\n outputFormat=\"string\"\r\n decimalCharacter={t('currency.decimal')}\r\n digitGroupSeparator={t('currency.thousands')}\r\n onChange={inputChange}\r\n onBlur={onValidate}\r\n />\r\n <FormHelperText>{t('room.labels.ticket_price_hint')}</FormHelperText>\r\n {validator.message('ticket_price', data.ticket_price, Room.validations().ticket_price)}\r\n </Col>\r\n </Row>\r\n\r\n </form>\r\n\r\n <Grid container\r\n direction=\"row\"\r\n justify=\"flex-end\"\r\n alignItems=\"center\"\r\n spacing={2}\r\n className={'mt-4'}\r\n >\r\n <Grid item spacing={2}>\r\n <Button variant=\"contained\" onClick={closeModal}>\r\n {t('common.close')}\r\n </Button>\r\n </Grid>\r\n <Grid item spacing={2}>\r\n <Button variant=\"contained\" color=\"primary\"\r\n // className={classes.status}\r\n onClick={save}>\r\n {t('common.save')}\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n </CardContent>\r\n </CardContent>\r\n </Card>\r\n </Col>\r\n </Row>\r\n </Modal>\r\n\r\n );\r\n}","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\schedules-list.js",["154"],"C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Schedule.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\resources\\Info.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\schedules.js",["155"],"import React, {useEffect, useState} from 'react';\r\nimport User from '../../../resources/User'\r\nimport Schedule from \"../../../resources/Schedule\"\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport {\r\n Button,\r\n Card,\r\n CardContent,\r\n CardHeader\r\n} from \"@material-ui/core\";\r\n\r\nimport {t} from '../../../plugins/i18nr'\r\n\r\nimport moment from \"moment\";\r\nimport {Line} from 'react-chartjs-2';\r\nimport Room from \"../../../resources/Room\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport {FilterAltIcon} from \"@material-ui/data-grid\";\r\n\r\nconst options = {\r\n responsive: true,\r\n scales: {\r\n yAxes: [{\r\n display: true,\r\n ticks: {\r\n beginAtZero: true,\r\n min: 0,\r\n }\r\n }]\r\n },\r\n}\r\n\r\n\r\nexport default function Schedules() {\r\n const [schedules, setSchedules] = useState([]);\r\n const [rooms, setRooms] = useState(null);\r\n const [loaded, setLoaded] = useState(false);\r\n\r\n const [chart, setChart] = useState({\r\n labels: [],\r\n values: [],\r\n datasets: [\r\n {\r\n label: 'All rooms',\r\n lineTension: 0.2,\r\n backgroundColor: 'rgb(0,123,255)',\r\n borderColor: 'rgba(0,123,255,1)',\r\n pointBorderColor: 'rgba(75,192,192,1)',\r\n pointHoverRadius: 10,\r\n pointHoverBackgroundColor: 'rgba(75,192,192,1)',\r\n pointHoverBorderColor: 'rgba(220,220,220,1)',\r\n pointHoverBorderWidth: 3,\r\n pointRadius: 1,\r\n pointHitRadius: 1,\r\n data: [],\r\n },\r\n ],\r\n })\r\n\r\n /**\r\n * Refresh the data\r\n * @returns void\r\n */\r\n function getSchedules() {\r\n Schedule.get({\r\n params: {company_id: User.command('get.company').id, range: 'last7days'},\r\n }).then((response) => {\r\n let beginDate = moment().subtract(7, 'days');\r\n let endDate = moment();\r\n //fill the array 'x'\r\n while (beginDate.diff(endDate, 'days') < 0) {\r\n chart.labels.push(beginDate.format(t('dates.day-month')))\r\n chart.values.push(beginDate.clone())\r\n beginDate.add(1, 'days')\r\n }\r\n fillChart(response.data)\r\n setSchedules(response.data)\r\n })\r\n }\r\n\r\n\r\n /**\r\n * Search the activated rooms\r\n */\r\n function getRooms() {\r\n Room.get({\r\n params: {company_id: User.command('get.company').id, enable: true},\r\n supply: {method: setRooms}\r\n })\r\n }\r\n\r\n /**\r\n * Fill the Y axis\r\n * @returns void\r\n */\r\n function fillChart(items, room = null) {\r\n chart.datasets['0'].label = (room ? room.name : 'All rooms')\r\n chart.datasets['0'].data = []\r\n chart.values.forEach((day) => {\r\n chart.datasets['0'].data.push(items.filter(schedule => {\r\n return (schedule.day === day.format(t('database.date')))\r\n && (room ? schedule.timetable.room.id === room.id : true)\r\n }).length)\r\n })\r\n setChart({...chart, chart})\r\n setLoaded(true)\r\n }\r\n\r\n useEffect(() => {\r\n getSchedules()\r\n getRooms()\r\n console.log(1)\r\n }, []);\r\n\r\n return (\r\n <Card>\r\n {!loaded && <LinearProgress/>}\r\n {loaded && (\r\n <Card color=\"primary\" className='m-2' style={{padding: 10}}>\r\n <Line options={options} data={chart}/>\r\n </Card>\r\n )}\r\n <CardContent className=\"p-0\">\r\n <CardHeader title={t('widget.schedules.title')} titleTypographyProps={{variant: 'subtitle1'}}/>\r\n <CardHeader title={t('widget.schedules.subtitle')} titleTypographyProps={{variant: 'subtitle2'}}/>\r\n </CardContent>\r\n <div className=\"mx-3 my-1\">\r\n {loaded && rooms && rooms.map((room) => {\r\n return (\r\n <Button variant=\"contained\"\r\n color=\"primary\"\r\n size=\"small\"\r\n key={room.id}\r\n className=\"mr-3\"\r\n onClick={() => fillChart(schedules, room)}>{room.short_name}</Button>)\r\n })}\r\n {loaded && rooms &&\r\n <IconButton variant=\"contained\"\r\n color=\"primary\"\r\n onClick={() => fillChart(schedules, null)}>\r\n <FilterAltIcon/>\r\n </IconButton>\r\n }\r\n </div>\r\n </Card>\r\n );\r\n}\r\n\r\n","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\timetables.js",["156"],"import React, {useEffect, useRef, useState} from 'react';\r\nimport User from '../../../resources/User'\r\nimport Schedule from \"../../../resources/Schedule\"\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport {\r\n Button,\r\n // Button,\r\n Card,\r\n CardContent,\r\n CardHeader\r\n} from \"@material-ui/core\";\r\n\r\nimport {t} from '../../../plugins/i18nr'\r\n\r\nimport {Line} from 'react-chartjs-2';\r\nimport Room from \"../../../resources/Room\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport {FilterAltIcon} from \"@material-ui/data-grid\";\r\n\r\nconst options = {\r\n responsive: true,\r\n scales: {\r\n yAxes: [{\r\n display: true,\r\n ticks: {\r\n beginAtZero: true,\r\n min: 0,\r\n }\r\n }]\r\n },\r\n}\r\n\r\n\r\nexport default function Timetables() {\r\n const timetables = useRef({'items': []});\r\n const schedules = useRef({'items': []});\r\n const [rooms, setRooms] = useState(null);\r\n const [loaded, setLoaded] = useState(false);\r\n\r\n const [chart, setChart] = useState({\r\n labels: [],\r\n values: [],\r\n datasets: [\r\n {\r\n label: 'All rooms',\r\n lineTension: 0.2,\r\n backgroundColor: 'rgb(0,123,255)',\r\n borderColor: 'rgba(0,123,255,1)',\r\n pointBorderColor: 'rgba(75,192,192,1)',\r\n pointHoverRadius: 10,\r\n pointHoverBackgroundColor: 'rgba(75,192,192,1)',\r\n pointHoverBorderColor: 'rgba(220,220,220,1)',\r\n pointHoverBorderWidth: 3,\r\n pointRadius: 1,\r\n pointHitRadius: 1,\r\n data: [],\r\n },\r\n ],\r\n })\r\n\r\n /**\r\n * Search the activated rooms\r\n */\r\n function getRooms() {\r\n Room.get({\r\n params: {company_id: User.command('get.company').id, enable: true},\r\n }).then((response) => {\r\n setRooms(response.data)\r\n let times = []\r\n response.data.forEach((item) => {\r\n //fill all the times\r\n item.timetables.forEach((timetable) => {\r\n times.push({start: timetable.start, name: timetable.start, value: 0})\r\n })\r\n //must not repeat the times\r\n times = [...new Map(times.map(item => [item['start'], item])).values()];\r\n //sort times by start time\r\n times.sort((a, b) => parseInt(a.start.replace(':', '')) - parseInt(b.start.replace(':', '')))\r\n })\r\n chart.labels = times.map(timetable => timetable.start)\r\n timetables.current.items = times\r\n getSchedules()\r\n setChart({...chart, chart})\r\n })\r\n }\r\n\r\n /**\r\n * Refresh the data\r\n * @returns void\r\n */\r\n function getSchedules() {\r\n Schedule.get({\r\n params: {company_id: User.command('get.company').id, range: 'last7days'},\r\n }).then((response) => {\r\n schedules.current.items = response.data\r\n fillChart()\r\n })\r\n }\r\n\r\n /**\r\n * Fill the Y axis\r\n * @returns void\r\n */\r\n function fillChart(room = null) {\r\n chart.datasets['0'].label = (room ? room.name : 'All rooms')\r\n chart.datasets['0'].data = []\r\n timetables.current.items.forEach((timetable) => {\r\n chart.datasets['0'].data.push(schedules.current.items.filter(schedule => {\r\n return (schedule.timetable.start === timetable.start) && (room ? schedule.timetable.room.id === room.id : true)\r\n }).length)\r\n })\r\n setChart({...chart, chart})\r\n setLoaded(true)\r\n }\r\n\r\n useEffect(() => {\r\n getRooms()\r\n }, []);\r\n\r\n return (\r\n <Card>\r\n {!loaded && <LinearProgress/>}\r\n {loaded && (\r\n <Card color=\"primary\" className='m-2' style={{padding: 10}}>\r\n <Line options={options} data={chart}/>\r\n </Card>\r\n )}\r\n <CardContent className=\"p-0\">\r\n <CardHeader title={t('widget.timetables.title')} titleTypographyProps={{variant: 'subtitle1'}}/>\r\n <CardHeader title={t('widget.timetables.subtitle')} titleTypographyProps={{variant: 'subtitle2'}}/>\r\n </CardContent>\r\n <div className=\"mx-3 my-1\">\r\n {loaded && rooms && rooms.map((room) => {\r\n return (\r\n <Button variant=\"contained\"\r\n color=\"primary\"\r\n size=\"small\"\r\n key={room.id}\r\n className=\"mr-3\"\r\n onClick={() => fillChart(room)}>{room.short_name}</Button>)\r\n })}\r\n {loaded && rooms &&\r\n <IconButton variant=\"contained\"\r\n color=\"primary\"\r\n onClick={() => fillChart(null)}>\r\n <FilterAltIcon/>\r\n </IconButton>\r\n }\r\n </div>\r\n </Card>\r\n );\r\n}\r\n\r\n","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\widget\\revenue.js",["157","158"],"import React, {useEffect, useRef, useState} from 'react';\r\nimport User from '../../../resources/User'\r\nimport Schedule from \"../../../resources/Schedule\"\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport {\r\n Button,\r\n Card,\r\n CardContent,\r\n CardHeader\r\n} from \"@material-ui/core\";\r\n\r\nimport {t} from '../../../plugins/i18nr'\r\n\r\nimport moment from \"moment\";\r\nimport {Line} from 'react-chartjs-2';\r\nimport Room from \"../../../resources/Room\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport {FilterAltIcon} from \"@material-ui/data-grid\";\r\n\r\nconst options = {\r\n responsive: true,\r\n scales: {\r\n yAxes: [{\r\n display: true,\r\n ticks: {\r\n beginAtZero: true,\r\n min: 0,\r\n }\r\n }]\r\n },\r\n}\r\n\r\n\r\nexport default function Revenue() {\r\n const days = useRef({items: []});\r\n const [schedules, setSchedules] = useState([]);\r\n const [rooms, setRooms] = useState(null);\r\n const [loaded, setLoaded] = useState(false);\r\n\r\n const [chart, setChart] = useState({\r\n labels: [],\r\n values: [],\r\n datasets: [\r\n {\r\n label: 'All rooms',\r\n lineTension: 0.2,\r\n backgroundColor: 'rgb(0,123,255)',\r\n borderColor: 'rgba(0,123,255,1)',\r\n pointBorderColor: 'rgba(75,192,192,1)',\r\n pointHoverRadius: 10,\r\n pointHoverBackgroundColor: 'rgba(75,192,192,1)',\r\n pointHoverBorderColor: 'rgba(220,220,220,1)',\r\n pointHoverBorderWidth: 3,\r\n pointRadius: 1,\r\n pointHitRadius: 1,\r\n data: [],\r\n },\r\n ],\r\n })\r\n\r\n\r\n useEffect(() => {\r\n getRooms()\r\n }, []);\r\n\r\n useEffect(() => {\r\n fillChart()\r\n }, [schedules])\r\n\r\n /**\r\n * Fill the Y axis\r\n * @returns void\r\n */\r\n function fillChart(room = null) {\r\n chart.datasets['0'].label = (room ? room.name : 'All rooms')\r\n chart.datasets['0'].data = []\r\n days.current.items.forEach((day) => {\r\n let dailySchedules = schedules.filter(schedule => {\r\n return (schedule.day === day.date.format(t('database.date')))\r\n && (room ? schedule.timetable.room.id === room.id : true)\r\n })\r\n day.value = 0\r\n if (dailySchedules.length > 0)\r\n chart.datasets['0'].data.push(parseFloat(dailySchedules.reduce(\r\n (sum, schedule) => ({\r\n payment_value: parseFloat(sum.payment_value) + parseFloat(schedule.payment_value)\r\n })\r\n ).payment_value))\r\n })\r\n setChart({...chart, chart})\r\n setLoaded(true)\r\n }\r\n\r\n /**\r\n * Search the activated rooms\r\n */\r\n function getRooms() {\r\n Room.get({\r\n params: {company_id: User.command('get.company').id, enable: true},\r\n }).then((response) => {\r\n setRooms(response.data)\r\n getSchedules()\r\n })\r\n }\r\n\r\n /**\r\n * Refresh the data\r\n * @returns void\r\n */\r\n function getSchedules() {\r\n Schedule.get({\r\n params: {company_id: User.command('get.company').id, range: 'last7days'},\r\n }).then((response) => {\r\n let beginDate = moment().startOf('month');\r\n let endDate = moment().endOf(\"month\");\r\n //fill the array\r\n let arDays = []\r\n arDays.push({date: beginDate.clone(), name: beginDate.format(t('dates.day')), value: []})\r\n while (beginDate.format('DD-MM-YYYY') !== endDate.format('DD-MM-YYYY')) {\r\n arDays.push({\r\n date: beginDate.add(1, 'days').clone(),\r\n name: beginDate.format(t('dates.day')),\r\n value: []\r\n })\r\n }\r\n chart.labels = arDays.map(day => day.name)\r\n setChart({...chart, chart})\r\n days.current.items = arDays\r\n setSchedules(response.data)\r\n })\r\n }\r\n\r\n\r\n return (\r\n <Card>\r\n {!loaded && <LinearProgress/>}\r\n {loaded && (\r\n <Card color=\"primary\" className='m-2' style={{padding: 10}}>\r\n <Line options={options} data={chart}/>\r\n </Card>\r\n )}\r\n <CardContent className=\"p-0\">\r\n <CardHeader title={t('widget.revenue.title')} titleTypographyProps={{variant: 'subtitle1'}}/>\r\n <CardHeader title={t('widget.revenue.subtitle')} titleTypographyProps={{variant: 'subtitle2'}}/>\r\n </CardContent>\r\n <div className=\"mx-3 my-1\">\r\n {rooms && rooms.map((room) => {\r\n return (\r\n <Button variant=\"contained\"\r\n color=\"primary\"\r\n size=\"small\"\r\n key={room.id}\r\n className=\"mr-3\"\r\n onClick={() => fillChart(room)}>{room.short_name}</Button>)\r\n })}\r\n {rooms &&\r\n <IconButton variant=\"contained\"\r\n color=\"primary\"\r\n onClick={() => fillChart(null)}>\r\n <FilterAltIcon/>\r\n </IconButton>\r\n }\r\n </div>\r\n </Card>\r\n );\r\n}\r\n\r\n","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\summary\\schedules.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\summary\\occupancy.js",["159","160"],"import React, {useEffect, useState} from 'react';\r\nimport User from '../../../resources/User'\r\nimport Schedule from \"../../../resources/Schedule\"\r\nimport {t} from '../../../plugins/i18nr'\r\nimport CircularProgress from '@material-ui/core/CircularProgress';\r\nimport AvTimerIcon from \"@material-ui/icons/AvTimer\";\r\nimport EventIcon from \"@material-ui/icons/Event\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport moment from 'moment'\r\nimport {\r\n Card,\r\n CardContent,\r\n Divider,\r\n Grid, Typography\r\n} from \"@material-ui/core\";\r\nimport Room from \"../../../resources/Room\";\r\n\r\n\r\nconst useStyles = makeStyles({\r\n paper: {\r\n backgroundColor: '#007bff',\r\n },\r\n});\r\n\r\n\r\nexport default function Occupancy() {\r\n const classes = useStyles();\r\n const [schedules, setSchedules] = useState([]);\r\n const [loader, setLoader] = useState(true);\r\n const [availableTimetable, setAvailableTimetable] = useState(0);\r\n const [occupancy, setOccupancy] = useState('');\r\n\r\n /**\r\n * Refresh the data\r\n * @returns void\r\n */\r\n function getSchedules() {\r\n Schedule.get({\r\n params: {company_id: User.command('get.company').id, range: 'last7days'},\r\n loader: {method: setLoader}\r\n }).then((response) => {\r\n setSchedules(response.data)\r\n })\r\n }\r\n\r\n /**\r\n * Search the activated rooms\r\n */\r\n function getRooms() {\r\n Room.get({\r\n params: {company_id: User.command('get.company').id, enable: true},\r\n }).then((response) => {\r\n let availableTimetable = 0\r\n response.data.forEach(room => {\r\n availableTimetable += room.timetables.length\r\n })\r\n setAvailableTimetable(availableTimetable)\r\n getSchedules()\r\n })\r\n }\r\n\r\n /**\r\n * Search the activated rooms\r\n */\r\n function calculate() {\r\n // Use the rule of three to calculate the occupancy rate\r\n let daysInMonth = moment().daysInMonth();\r\n //TODO calculate quantity by days*available hours, because some days are not working days\r\n let occupancy = ((schedules.length * 100) / (availableTimetable * daysInMonth)).toFixed(2).toString()\r\n setOccupancy(occupancy)\r\n }\r\n\r\n\r\n useEffect(() => {\r\n getRooms()\r\n }, []);\r\n\r\n useEffect(() => {\r\n calculate()\r\n }, [availableTimetable]);\r\n\r\n return (\r\n <Card className=\"mx-1 overflow-visible\">\r\n <Grid container\r\n spacing={2}\r\n alignItems=\"center\"\r\n style={{minHeight: '120px'}}>\r\n <Grid item>\r\n <CardContent className=\"p-0\" style={{position: 'absolute', top: '-20px'}}>\r\n <Card color=\"primary\" className='m-2' style={{padding: 30}}\r\n classes={{\r\n root: classes.paper,\r\n }}>\r\n <AvTimerIcon style={{fontSize: 40, color: 'white'}}/>\r\n </Card>\r\n </CardContent>\r\n </Grid>\r\n <Grid item xs className=\"pr-4 text-right\">\r\n <Grid item>\r\n <Typography>{t('summary.occupancy.title')}</Typography>\r\n {loader && <div><CircularProgress className=\"mr-3\"/></div>}\r\n {!loader && <Typography variant=\"h5\">{occupancy}%</Typography>}\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n <Divider/>\r\n <div className=\"p-2\">\r\n <EventIcon style={{fontSize: 20}}/>\r\n <Typography variant=\"caption\" className=\"pl-2\">{t('summary.occupancy.footer')}</Typography>\r\n </div>\r\n </Card>\r\n );\r\n}\r\n","C:\\xampp\\htdocs\\escape-web-react\\src\\components\\dashboard\\summary\\revenue.js",[],"C:\\xampp\\htdocs\\escape-web-react\\src\\filters\\filters.js",[],{"ruleId":"161","replacedBy":"162"},{"ruleId":"163","replacedBy":"164"},{"ruleId":"165","severity":1,"message":"166","line":10,"column":9,"nodeType":"167","messageId":"168","endLine":10,"endColumn":18},{"ruleId":"169","severity":1,"message":"170","line":107,"column":8,"nodeType":"171","endLine":107,"endColumn":25,"suggestions":"172"},{"ruleId":"173","severity":1,"message":"174","line":207,"column":53,"nodeType":"175","endLine":207,"endColumn":75},{"ruleId":"173","severity":1,"message":"174","line":230,"column":53,"nodeType":"175","endLine":230,"endColumn":75},{"ruleId":"169","severity":1,"message":"176","line":71,"column":8,"nodeType":"171","endLine":71,"endColumn":10,"suggestions":"177"},{"ruleId":"169","severity":1,"message":"178","line":113,"column":8,"nodeType":"171","endLine":113,"endColumn":10,"suggestions":"179"},{"ruleId":"169","severity":1,"message":"180","line":118,"column":8,"nodeType":"171","endLine":118,"endColumn":10,"suggestions":"181"},{"ruleId":"169","severity":1,"message":"180","line":64,"column":8,"nodeType":"171","endLine":64,"endColumn":10,"suggestions":"182"},{"ruleId":"169","severity":1,"message":"183","line":68,"column":8,"nodeType":"171","endLine":68,"endColumn":19,"suggestions":"184"},{"ruleId":"169","severity":1,"message":"180","line":76,"column":8,"nodeType":"171","endLine":76,"endColumn":10,"suggestions":"185"},{"ruleId":"169","severity":1,"message":"186","line":80,"column":8,"nodeType":"171","endLine":80,"endColumn":28,"suggestions":"187"},"no-native-reassign",["188"],"no-negated-in-lhs",["189"],"no-unused-vars","'Container' is defined but never used.","Identifier","unusedVar","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'refresh'. Either include it or remove the dependency array.","ArrayExpression",["190"],"react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute","React Hook useEffect has missing dependencies: 'getRooms' and 'getSchedules'. Either include them or remove the dependency array.",["191"],"React Hook useEffect has a missing dependency: 'getSchedules'. Either include it or remove the dependency array.",["192"],"React Hook useEffect has a missing dependency: 'getRooms'. Either include it or remove the dependency array.",["193"],["194"],"React Hook useEffect has a missing dependency: 'fillChart'. Either include it or remove the dependency array.",["195"],["196"],"React Hook useEffect has a missing dependency: 'calculate'. Either include it or remove the dependency array.",["197"],"no-global-assign","no-unsafe-negation",{"desc":"198","fix":"199"},{"desc":"200","fix":"201"},{"desc":"202","fix":"203"},{"desc":"204","fix":"205"},{"desc":"204","fix":"206"},{"desc":"207","fix":"208"},{"desc":"204","fix":"209"},{"desc":"210","fix":"211"},"Update the dependencies array to be: [props.id, modal, refresh]",{"range":"212","text":"213"},"Update the dependencies array to be: [getRooms, getSchedules]",{"range":"214","text":"215"},"Update the dependencies array to be: [getSchedules]",{"range":"216","text":"217"},"Update the dependencies array to be: [getRooms]",{"range":"218","text":"219"},{"range":"220","text":"219"},"Update the dependencies array to be: [fillChart, schedules]",{"range":"221","text":"222"},{"range":"223","text":"219"},"Update the dependencies array to be: [availableTimetable, calculate]",{"range":"224","text":"225"},[3017,3034],"[props.id, modal, refresh]",[2198,2200],"[getRooms, getSchedules]",[3348,3350],"[getSchedules]",[3762,3764],"[getRooms]",[1800,1802],[1859,1870],"[fillChart, schedules]",[2323,2325],[2382,2402],"[availableTimetable, calculate]"]