diff --git a/frontend/src/components/ChatEnd/ModalChatEnd/index.js b/frontend/src/components/ChatEnd/ModalChatEnd/index.js index f83bdc4..5889331 100644 --- a/frontend/src/components/ChatEnd/ModalChatEnd/index.js +++ b/frontend/src/components/ChatEnd/ModalChatEnd/index.js @@ -1,4 +1,5 @@ -import * as React from 'react'; + +import React, { useState, useEffect, useRef } from 'react'; import Button from '@mui/material/Button'; import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; @@ -19,8 +20,8 @@ import TextArea1 from '../TextArea' import TextArea2 from '../TextArea' - -function Item(props) { +const Item = (props) => { + const { sx, ...other } = props; return ( { - const [open, setOpen] = React.useState(true); - const [scroll, /*setScroll*/] = React.useState('body'); - const [schedulingId, setScheduling] = React.useState(null) - const [startDate, setDatePicker] = React.useState(new Date()) - const [timerPicker, setTimerPicker] = React.useState(new Date()) - const [textArea1, setTextArea1] = React.useState() - const [textArea2, setTextArea2] = React.useState() + const [open, setOpen] = useState(true); + const [scroll, /*setScroll*/] = useState('body'); + const [schedulingId, setScheduling] = useState(null) + const [startDate, setDatePicker] = useState(new Date()) + const [timerPicker, setTimerPicker] = useState(new Date()) + const [textArea1, setTextArea1] = useState() + const [textArea2, setTextArea2] = useState() - const [data, setData] = React.useState([ + const [data] = useState([ {'id': 1, 'name': 'STATUS1'}, {'id': 2, 'name': 'STATUS2'}, {'id': 3, 'name': 'STATUS3'}, @@ -72,14 +73,14 @@ const Modal = (props) => { const handleClose = (event, reason) => { - if (reason && reason == "backdropClick") + if (reason && reason === "backdropClick") return; setOpen(false); }; - const descriptionElementRef = React.useRef(null); - React.useEffect(() => { + const descriptionElementRef = useRef(null); + useEffect(() => { if (open) { const { current: descriptionElement } = descriptionElementRef; if (descriptionElement !== null) { @@ -119,18 +120,16 @@ const textArea2Value = (data) => { setTextArea2(data) } - return ( - + -
- - { {props.modal_header} + - {/* :not(style)': { m: 1, width: '35ch' }, - }} - noValidate - autoComplete="off" - > - - */} - - - {/* - - - */} - - + + { // backgroundColor: 'primary.dark', // '&:hover': {backgroundColor: 'primary.main', opacity: [0.9, 0.8, 0.7],}, }}> - -
Selecione um status para encerrar o Atendimento
+ + {return {'value': obj.id, 'label': obj.name}})} + /> + + + +
+ +
*/} + + + + + Selecione um status para encerrar o Atendimento { @@ -195,17 +193,18 @@ const textArea2Value = (data) => { maxWidth: '100%', }} > - + -
+ - -
Lembrete de retorno
+ + + Lembrete de retorno @@ -216,25 +215,17 @@ const textArea2Value = (data) => { - + {/* - + */} - - - - - - - - - +
@@ -244,8 +235,8 @@ const textArea2Value = (data) => {
- - + + ); } diff --git a/frontend/src/components/ChatEnd/TextArea/index.js b/frontend/src/components/ChatEnd/TextArea/index.js index b71e6eb..ce1f90f 100644 --- a/frontend/src/components/ChatEnd/TextArea/index.js +++ b/frontend/src/components/ChatEnd/TextArea/index.js @@ -1,8 +1,9 @@ import * as React from 'react'; import TextareaAutosize from '@mui/material/TextareaAutosize'; - -export default function MinHeightTextarea(props) { + + +const MinHeightTextarea = (props) => { const [value, setValue] = React.useState(''); @@ -24,3 +25,5 @@ export default function MinHeightTextarea(props) { /> ); } + +export default MinHeightTextarea; \ No newline at end of file diff --git a/frontend/src/components/ChatEnd/TimerPickerSelect/index.js b/frontend/src/components/ChatEnd/TimerPickerSelect/index.js index 4bc4620..fe331d7 100644 --- a/frontend/src/components/ChatEnd/TimerPickerSelect/index.js +++ b/frontend/src/components/ChatEnd/TimerPickerSelect/index.js @@ -1,5 +1,6 @@ -import * as React from 'react'; + +import React, { Fragment, useState, useEffect } from "react"; import TextField from '@mui/material/TextField'; import DateFnsUtils from '@date-io/date-fns'; @@ -8,23 +9,43 @@ import { MuiPickersUtilsProvider, } from '@material-ui/pickers'; -export default function ResponsiveTimePickers(props) { - const [value, setValue] = React.useState(new Date()); - props.func(value); +import ptBrLocale from "date-fns/locale/pt-BR"; + + +const ResponsiveTimePickers = (props) => { + + const [value, setValue] = useState(new Date()); + + // props.func(value); + + useEffect(()=>{ + + props.func(value); + + }, [value]) return ( - - { - setValue(newValue); - }} - renderInput={(params) => } - /> - + + + + { + setValue(newValue); + }} + // Ativar se necessario + // renderInput={(params) => } + + /> + + + ); } + +export default ResponsiveTimePickers diff --git a/frontend/src/components/MessageInput/index.js b/frontend/src/components/MessageInput/index.js index 84de659..cd0b6f5 100644 --- a/frontend/src/components/MessageInput/index.js +++ b/frontend/src/components/MessageInput/index.js @@ -585,7 +585,8 @@ const MessageInput = ({ ticketStatus }) => { : i18n.t("messagesInput.placeholderClosed") } multiline - rowsMax={5} + // rowsMax={5} + maxRows={5} value={inputMessage} onChange={handleChangeInput} disabled={recording || loading || ticketStatus !== "open"} diff --git a/frontend/src/components/NotificationsPopOver/index.js b/frontend/src/components/NotificationsPopOver/index.js index 8925fe2..31936a7 100644 --- a/frontend/src/components/NotificationsPopOver/index.js +++ b/frontend/src/components/NotificationsPopOver/index.js @@ -190,7 +190,8 @@ const NotificationsPopOver = () => { <> diff --git a/frontend/src/components/Report/DatePicker/index.js b/frontend/src/components/Report/DatePicker/index.js index effcdb9..f2c8be4 100644 --- a/frontend/src/components/Report/DatePicker/index.js +++ b/frontend/src/components/Report/DatePicker/index.js @@ -1,6 +1,6 @@ -import React, { Fragment, useState } from "react"; +import React, { Fragment, useState, useEffect } from "react"; import DateFnsUtils from '@date-io/date-fns'; // choose your lib @@ -24,7 +24,13 @@ function formatDateDatePicker(data){ function ResponsiveDatePickers(props) { const [selectedDate, handleDateChange] = useState(new Date()); - props.func(formatDateDatePicker(selectedDate)); + // props.func(formatDateDatePicker(selectedDate)); + + useEffect(()=>{ + + props.func(formatDateDatePicker(selectedDate)); + + }, [selectedDate]) return ( diff --git a/frontend/src/components/Report/SelectField/index.js b/frontend/src/components/Report/SelectField/index.js index 0ae15fd..cdc6d0b 100644 --- a/frontend/src/components/Report/SelectField/index.js +++ b/frontend/src/components/Report/SelectField/index.js @@ -1,4 +1,5 @@ -import * as React from 'react'; +import React, { useState, useEffect } from 'react'; + import Box from '@mui/material/Box'; import TextField from '@mui/material/TextField'; @@ -6,11 +7,18 @@ import TextField from '@mui/material/TextField'; const SelectTextFields = (props) => { - const [currency, setCurrency] = React.useState('0'); + const [currency, setCurrency] = useState('0'); - props.currencies.push({ 'value': 0, 'label': ''}) + props.currencies.push({ 'value': 0, 'label': ''}) + - props.func(currency); + useEffect(()=>{ + + props.func(currency); + + }, [currency]) + + // props.func(currency); const handleChange = (event) => { setCurrency(event.target.value); @@ -18,45 +26,48 @@ const SelectTextFields = (props) => { - return ( + return ( - - - {props.currencies.map((option) => ( - - ))} - + + + {props.currencies.map((option, index) => ( + + ))} - + + + +
); diff --git a/frontend/src/components/TicketActionButtons/index.js b/frontend/src/components/TicketActionButtons/index.js index 7288049..fbced14 100644 --- a/frontend/src/components/TicketActionButtons/index.js +++ b/frontend/src/components/TicketActionButtons/index.js @@ -49,29 +49,30 @@ const TicketActionButtons = ({ ticket }) => { //alert(`ticket.id: ${ticket.id} | status: ${status}| userId: ${userId}`) render() + console.log('Constinuação..................') - return + - setLoading(true); - try { - await api.put(`/tickets/${ticket.id}`, { - status: status, - userId: userId || null, - }); + // setLoading(true); + // try { + // await api.put(`/tickets/${ticket.id}`, { + // status: status, + // userId: userId || null, + // }); - setLoading(false); - if (status === "open") { - history.push(`/tickets/${ticket.id}`); - } else { - history.push("/tickets"); - } - } catch (err) { - setLoading(false); - toastError(err); - } + // setLoading(false); + // if (status === "open") { + // history.push(`/tickets/${ticket.id}`); + // } else { + // history.push("/tickets"); + // } + // } catch (err) { + // setLoading(false); + // toastError(err); + // } }; return (