Remoção de e comentário de variáves não utilizadas do frontend
parent
5d22b772d1
commit
737d6f6a46
|
@ -2,7 +2,7 @@ import React from "react";
|
||||||
|
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
import Container from "@material-ui/core/Container";
|
import Container from "@material-ui/core/Container";
|
||||||
import { colors } from "@material-ui/core";
|
//import { colors } from "@material-ui/core";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
mainContainer: {
|
mainContainer: {
|
||||||
|
|
|
@ -310,7 +310,8 @@ const MessageInput = ({ ticketStatus }) => {
|
||||||
setReplyingMessage(null);
|
setReplyingMessage(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleStartRecording = async () => {
|
const handleStartRecording = async () => {
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
await navigator.mediaDevices.getUserMedia({ audio: true });
|
await navigator.mediaDevices.getUserMedia({ audio: true });
|
||||||
|
|
|
@ -363,8 +363,8 @@ const MessagesList = ({ ticketId, isGroup }) => {
|
||||||
|
|
||||||
socket.on("appMessage", (data) => {
|
socket.on("appMessage", (data) => {
|
||||||
if (data.action === "create") {
|
if (data.action === "create") {
|
||||||
dispatch({ type: "ADD_MESSAGE", payload: data.message });
|
dispatch({ type: "ADD_MESSAGE", payload: data.message });
|
||||||
|
|
||||||
console.log('* NOVA MENSAGEM CAP: ', data.message)
|
console.log('* NOVA MENSAGEM CAP: ', data.message)
|
||||||
|
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
|
@ -421,6 +421,7 @@ const MessagesList = ({ ticketId, isGroup }) => {
|
||||||
return <ModalImageCors imageUrl={message.mediaUrl} />;
|
return <ModalImageCors imageUrl={message.mediaUrl} />;
|
||||||
}
|
}
|
||||||
if (message.mediaType === "audio") {
|
if (message.mediaType === "audio") {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<audio controls>
|
<audio controls>
|
||||||
<source src={message.mediaUrl} type="audio/ogg"></source>
|
<source src={message.mediaUrl} type="audio/ogg"></source>
|
||||||
|
|
|
@ -6,9 +6,9 @@ import React, { Fragment, useState } from "react";
|
||||||
import DateFnsUtils from '@date-io/date-fns'; // choose your lib
|
import DateFnsUtils from '@date-io/date-fns'; // choose your lib
|
||||||
import {
|
import {
|
||||||
KeyboardDatePicker,
|
KeyboardDatePicker,
|
||||||
DatePicker,
|
// DatePicker,
|
||||||
TimePicker,
|
//TimePicker,
|
||||||
DateTimePicker,
|
//DateTimePicker,
|
||||||
MuiPickersUtilsProvider,
|
MuiPickersUtilsProvider,
|
||||||
} from '@material-ui/pickers';
|
} from '@material-ui/pickers';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import React, { useState, useEffect, useRef} from "react";
|
import React, { useState, useRef} from "react";
|
||||||
import { CSVLink } from "react-csv";
|
import { CSVLink } from "react-csv";
|
||||||
import Button from '@mui/material/Button';
|
import Button from '@mui/material/Button';
|
||||||
|
|
||||||
|
@ -17,28 +17,21 @@ const data = [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ExportCSV = (props) => {
|
const ExportCSV = (props) => {
|
||||||
|
|
||||||
const [header, setHeader] = useState([])
|
const csvLink = useRef()
|
||||||
const [dataRow, setDataRow] = useState([])
|
|
||||||
|
|
||||||
const csvLink = useRef()
|
|
||||||
|
|
||||||
let headerFormat = JSON.parse(JSON.stringify(props.columns).split('"field":').join('"key":'))
|
let headerFormat = JSON.parse(JSON.stringify(props.columns).split('"field":').join('"key":'))
|
||||||
headerFormat = JSON.parse(JSON.stringify(headerFormat).split('"title":').join('"label":'))
|
headerFormat = JSON.parse(JSON.stringify(headerFormat).split('"title":').join('"label":'))
|
||||||
|
|
||||||
//const dataRows = props.data.map((row) => { return { ...row }});
|
const [header, /*setHeader*/] = useState(headerFormat)
|
||||||
|
const [dataRow, /*setDataRow*/] = useState(props.data)
|
||||||
|
|
||||||
// const dataRows = props.data.map((obj)=>{
|
//useEffect(()=>{
|
||||||
// return {'fromMe': obj.fromMe, 'body': obj.body.replace(/ /g,''), 'createdAt': obj.createdAt}
|
|
||||||
// })
|
// setHeader(headerFormat)
|
||||||
|
// setDataRow(props.data)
|
||||||
//console.log('******************************* dataRows: ',dataRows)
|
// },[])
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
setHeader(headerFormat)
|
|
||||||
setDataRow(props.data)
|
|
||||||
},[])
|
|
||||||
|
|
||||||
const getTransactionData = async () => {
|
const getTransactionData = async () => {
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@ import DialogContent from '@mui/material/DialogContent';
|
||||||
import DialogContentText from '@mui/material/DialogContentText';
|
import DialogContentText from '@mui/material/DialogContentText';
|
||||||
import DialogTitle from '@mui/material/DialogTitle';
|
import DialogTitle from '@mui/material/DialogTitle';
|
||||||
|
|
||||||
import DataGridTable from '../Table';
|
//import DataGridTable from '../Table';
|
||||||
import MTable from "../MTable";
|
import MTable from "../MTable";
|
||||||
|
|
||||||
import ExportCSV from '../ExportCSV'
|
import ExportCSV from '../ExportCSV'
|
||||||
import { margin } from '@mui/system';
|
//import { margin } from '@mui/system';
|
||||||
|
|
||||||
let columns = [
|
let columns = [
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,9 @@ let columns = [
|
||||||
|
|
||||||
const Modal = (props) => {
|
const Modal = (props) => {
|
||||||
const [open, setOpen] = React.useState(true);
|
const [open, setOpen] = React.useState(true);
|
||||||
const [scroll, setScroll] = React.useState('paper');
|
const [scroll, /*setScroll*/] = React.useState('paper');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dataChat = props.data.map((dt) => {
|
const dataChat = props.data.map((dt) => {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -127,7 +127,7 @@ const DataGridTable = (props) => {
|
||||||
|
|
||||||
onCellKeyDown = {(params, event) => {
|
onCellKeyDown = {(params, event) => {
|
||||||
|
|
||||||
if(event.key.toString().toLowerCase() == 'enter'){
|
if(event.key.toString().toLowerCase() === 'enter'){
|
||||||
alert(params.value)
|
alert(params.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { AuthContext } from "../context/Auth/AuthContext";
|
||||||
import BackdropLoading from "../components/BackdropLoading";
|
import BackdropLoading from "../components/BackdropLoading";
|
||||||
import { i18n } from "../translate/i18n";
|
import { i18n } from "../translate/i18n";
|
||||||
|
|
||||||
import MailLogo from '../assets/logo.jpg';
|
//import MailLogo from '../assets/logo.jpg';
|
||||||
|
|
||||||
const drawerWidth = 240;
|
const drawerWidth = 240;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ import React, { useState, useEffect, useReducer, useContext} from "react";
|
||||||
import MainContainer from "../../components/MainContainer";
|
import MainContainer from "../../components/MainContainer";
|
||||||
import api from "../../services/api";
|
import api from "../../services/api";
|
||||||
import SelectField from "../../components/Report/SelectField";
|
import SelectField from "../../components/Report/SelectField";
|
||||||
import { data } from '../../components/Report/MTable/data';
|
//import { data } from '../../components/Report/MTable/data';
|
||||||
import DatePicker1 from '../../components/Report/DatePicker'
|
import DatePicker1 from '../../components/Report/DatePicker'
|
||||||
import DatePicker2 from '../../components/Report/DatePicker'
|
import DatePicker2 from '../../components/Report/DatePicker'
|
||||||
import { Button } from "@material-ui/core";
|
//import { Button } from "@material-ui/core";
|
||||||
import MTable from "../../components/Report/MTable";
|
import MTable from "../../components/Report/MTable";
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
|
@ -159,12 +159,12 @@ const Report = () => {
|
||||||
const { user: userA } = useContext(AuthContext);
|
const { user: userA } = useContext(AuthContext);
|
||||||
|
|
||||||
//--------
|
//--------
|
||||||
const [searchParam, setSearchParam] = useState("");
|
const [searchParam] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
//const [loading, setLoading] = useState(false);
|
||||||
const [hasMore, setHasMore] = useState(false);
|
//const [hasMore, setHasMore] = useState(false);
|
||||||
const [pageNumber, setPageNumber] = useState(1);
|
const [pageNumber, setPageNumber] = useState(1);
|
||||||
const [users, dispatch] = useReducer(reducer, []);
|
const [users, dispatch] = useReducer(reducer, []);
|
||||||
const [columns, setColums] = useState([])
|
//const [columns, setColums] = useState([])
|
||||||
const [startDate, setDatePicker1] = useState(new Date())
|
const [startDate, setDatePicker1] = useState(new Date())
|
||||||
const [endDate, setDatePicker2] = useState(new Date())
|
const [endDate, setDatePicker2] = useState(new Date())
|
||||||
const [userId, setUser] = useState(null)
|
const [userId, setUser] = useState(null)
|
||||||
|
@ -178,7 +178,7 @@ const Report = () => {
|
||||||
}, [searchParam]);
|
}, [searchParam]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoading(true);
|
//setLoading(true);
|
||||||
|
|
||||||
const delayDebounceFn = setTimeout(() => {
|
const delayDebounceFn = setTimeout(() => {
|
||||||
|
|
||||||
|
@ -189,8 +189,8 @@ const Report = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch({ type: "LOAD_USERS", payload: data.users });
|
dispatch({ type: "LOAD_USERS", payload: data.users });
|
||||||
setHasMore(data.hasMore);
|
//setHasMore(data.hasMore);
|
||||||
setLoading(false);
|
//setLoading(false);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ const Report = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
setLoading(true);
|
//setLoading(true);
|
||||||
|
|
||||||
const delayDebounceFn = setTimeout(() => {
|
const delayDebounceFn = setTimeout(() => {
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ const Report = () => {
|
||||||
dispatchQ({ type: "RESET" })
|
dispatchQ({ type: "RESET" })
|
||||||
dispatchQ({ type: "LOAD_QUERY", payload: dataQuery.data });
|
dispatchQ({ type: "LOAD_QUERY", payload: dataQuery.data });
|
||||||
|
|
||||||
setLoading(false);
|
//setLoading(false);
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -249,15 +249,7 @@ const textFieldSelectUser = (data) => {
|
||||||
console.log('textField: ',data);
|
console.log('textField: ',data);
|
||||||
setUser(data)
|
setUser(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function handleQuery (){
|
|
||||||
|
|
||||||
console.log('startDate: ', startDate)
|
|
||||||
console.log('endDate: ', endDate)
|
|
||||||
console.log('userid: ', userId)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue