From 56fccf84146902e4cf44c27f4f093bb002a75d3f Mon Sep 17 00:00:00 2001 From: adriano Date: Wed, 30 Mar 2022 11:09:20 -0300 Subject: [PATCH] =?UTF-8?q?Finaliza=C3=A7=C3=A3o=20da=20funcionalidade=20d?= =?UTF-8?q?e=20lembrete/agendameto=20com=20remo=C3=A7=C3=A3o=20das=20vari?= =?UTF-8?q?=C3=A1veis=20n=C3=A3o=20usadas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ChatEnd/ModalChatEnd/index.js | 116 +++----------- .../DatePicker2/index.js | 4 +- .../ModalUpdateScheduleReminder/index.js | 145 +++++++++--------- .../components/Report/SelectField/index.js | 2 +- frontend/src/pages/Report/index.js | 8 +- frontend/src/pages/SchedulesReminder/index.js | 127 ++++++--------- 6 files changed, 144 insertions(+), 258 deletions(-) diff --git a/frontend/src/components/ChatEnd/ModalChatEnd/index.js b/frontend/src/components/ChatEnd/ModalChatEnd/index.js index 4fe240a..b6edf6d 100644 --- a/frontend/src/components/ChatEnd/ModalChatEnd/index.js +++ b/frontend/src/components/ChatEnd/ModalChatEnd/index.js @@ -13,27 +13,14 @@ import DatePicker from '../../Report/DatePicker' import TimerPickerSelect from '../TimerPickerSelect' import TextareaAutosize from '@mui/material/TextareaAutosize'; -import { subHours, addDays, isEqual, subDays} from "date-fns"; +import { subHours, addDays, subDays} from "date-fns"; import TextFieldSelectHourBefore from '@mui/material/TextField'; import MenuItem from '@mui/material/MenuItem'; - -import { - IconButton, - Paper, - Table, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; -import { DeleteOutline } from "@material-ui/icons"; -import { toast } from "react-toastify"; import api from "../../../services/api"; -import toastError from "../../../errors/toastError"; -import ConfirmationModal from "../../ConfirmationModal"; +import toastError from "../../../errors/toastError"; const reducer = (state, action) => { @@ -109,8 +96,7 @@ Item.propTypes = { const Modal = (props) => { // const [clientSchedules, dispatch] = useReducer(reducer, []); - const [selectedSchedule, setSelectedSchedule] = useState(null); - const [confirmModalOpen, setConfirmModalOpen] = useState(false); + // const [selectedSchedule, setSelectedSchedule] = useState(null); const [open, setOpen] = useState(true); const [scroll, /*setScroll*/] = useState('body'); const [statusChatEndId, setStatusChatEnd] = useState(null) @@ -161,23 +147,18 @@ const Modal = (props) => { } + - const handleCloseConfirmationModal = () => { - setConfirmModalOpen(false); - setSelectedSchedule(null); - }; - - - const handleDeleteSchedule = async (scheduleId) => { - try { - await api.delete(`/schedule/${scheduleId}`); - toast.success(("Lembrete/Agendamento deletado com sucesso!")); - dispatch({ type: "DELETE_SCHEDULE", payload: scheduleId }); - } catch (err) { - toastError(err); - } - setSelectedSchedule(null); - }; + // const handleDeleteSchedule = async (scheduleId) => { + // try { + // await api.delete(`/schedule/${scheduleId}`); + // toast.success(("Lembrete/Agendamento deletado com sucesso!")); + // dispatch({ type: "DELETE_SCHEDULE", payload: scheduleId }); + // } catch (err) { + // toastError(err); + // } + // setSelectedSchedule(null); + // }; // Get from child 2 const datePickerValue = (data) => { @@ -225,7 +206,7 @@ const timerPickerValue = (data) => { console.log('Entrou! textArea1: ', textArea1) - if( startDate.trim().length==0){ + if( startDate.trim().length === 0){ alert('Selecione uma data atual ou futura!') @@ -579,70 +560,9 @@ const handleChangeHourBefore = (event) => { } - {/* {schedulesContact.length>0 && - - - - - - handleDeleteSchedule(selectedSchedule.id)} - > - Deseja realmente deletar esse Lembrete? - - Lembretes - - - - - - - Data - - - Hora - - - Mensagem - - - Deletar - - - - - - <> - {schedulesContact.map((scheduleData, index) => ( - - {scheduleData.schedulingDate.split(' ')[0]} - {scheduleData.schedulingTime.split(' ')[1]} - {scheduleData.message} - - - - { - setSelectedSchedule(scheduleData); - setConfirmModalOpen(true); - - }} - > - - - - - - ))} - - -
-
-
} */} + {schedulesContact.length>0 && +
+ } diff --git a/frontend/src/components/ModalUpdateScheduleReminder/DatePicker2/index.js b/frontend/src/components/ModalUpdateScheduleReminder/DatePicker2/index.js index 54f3538..a4e953e 100644 --- a/frontend/src/components/ModalUpdateScheduleReminder/DatePicker2/index.js +++ b/frontend/src/components/ModalUpdateScheduleReminder/DatePicker2/index.js @@ -30,9 +30,7 @@ function formatDate(strDate){ function ResponsiveDatePickers(props) { - - console.log('schedulingDate schedulingDate schedulingDate2: ', (props.schedulingDate)) - console.log('schedulingDate schedulingDate schedulingDate: ', formatDate(props.schedulingDate)) + const [selectedDate, handleDateChange] = useState(new Date(formatDate(props.schedulingDate))); diff --git a/frontend/src/components/ModalUpdateScheduleReminder/index.js b/frontend/src/components/ModalUpdateScheduleReminder/index.js index bf02e94..cdca7f2 100644 --- a/frontend/src/components/ModalUpdateScheduleReminder/index.js +++ b/frontend/src/components/ModalUpdateScheduleReminder/index.js @@ -14,30 +14,17 @@ import DatePicker from './DatePicker2' import TimerPickerSelect from './TimerPickerSelect2' import TextareaAutosize from '@mui/material/TextareaAutosize'; -import { subHours, addDays, isEqual, subDays} from "date-fns"; +import { subHours, addDays, subDays} from "date-fns"; import TextFieldSelectHourBefore from '@mui/material/TextField'; import MenuItem from '@mui/material/MenuItem'; - - -import { - IconButton, - Paper, - Table, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; - -import { DeleteOutline } from "@material-ui/icons"; -import { toast } from "react-toastify"; + import api from "../../services/api"; -import toastError from "../../errors/toastError"; -import ConfirmationModal from "../ConfirmationModal"; +import toastError from "../../errors/toastError"; + const reducer = (state, action) => { @@ -111,8 +98,8 @@ Item.propTypes = { const Modal = (props) => { - const [selectedSchedule, setSelectedSchedule] = useState(null); - const [confirmModalOpen, setConfirmModalOpen] = useState(false); + // const [selectedSchedule, setSelectedSchedule] = useState(null); + // const [confirmModalOpen, setConfirmModalOpen] = useState(false); const [open, setOpen] = useState(true); const [scroll, /*setScroll*/] = useState('body'); @@ -124,11 +111,11 @@ const Modal = (props) => { const [currencyHourBefore, setCurrency] = useState(props.rowData.schedulingTime.split(' ')[1].slice(0,5)); const [currenciesTimeBefore, setCurrenciesTimeBefore] = useState(null); - const [contador, setCount] = useState(0) - - - + const [currencyHourBeforeAux, ] = useState(props.rowData.schedulingTime.split(' ')[1].slice(0,5)); + + if(schedulesContact){} + const handleCancel = (event, reason) => { @@ -170,26 +157,26 @@ const Modal = (props) => { - const handleCloseConfirmationModal = () => { - setConfirmModalOpen(false); - setSelectedSchedule(null); - }; + // const handleCloseConfirmationModal = () => { + // setConfirmModalOpen(false); + // setSelectedSchedule(null); + // }; - const handleDeleteSchedule = async (scheduleId) => { - try { - await api.delete(`/schedule/${scheduleId}`); - toast.success(("Lembrete/Agendamento deletado com sucesso!")); - dispatch({ type: "DELETE_SCHEDULE", payload: scheduleId }); - } catch (err) { - toastError(err); - } - setSelectedSchedule(null); - }; + // const handleDeleteSchedule = async (scheduleId) => { + // try { + // await api.delete(`/schedule/${scheduleId}`); + // toast.success(("Lembrete/Agendamento deletado com sucesso!")); + // dispatch({ type: "DELETE_SCHEDULE", payload: scheduleId }); + // } catch (err) { + // toastError(err); + // } + // setSelectedSchedule(null); + // }; // Get from child 2 const datePickerValue = (data) => { - console.log('datePickerValue: ',(data)); + setDatePicker(data) @@ -197,7 +184,7 @@ const datePickerValue = (data) => { // Get from child 3 const timerPickerValue = (data) => { - console.log('timerPickerValue: ',(data)); + setTimerPicker(data) @@ -235,7 +222,7 @@ const dateCurrentFormated = (dateF=null) => { if (statusChatEndId === '2'|| statusChatEndId === '3'){ - console.log('Entrou! textArea1: ', textArea1) + if(textArea1 && textArea1.trim().length<5){ @@ -278,18 +265,17 @@ const dateCurrentFormated = (dateF=null) => { if(sendMessageDayBefore.length > 0 && timeBefore === formatedTimeHour(timerPicker)) { - console.log('ENVIAR MENSAGEM UM DIA ANTES!') - console.log('MENSAGEM SERÁ ENVIA NO DIA: ', dateCurrentFormated( new Date(subDays(new Date(startDate+' '+formatedTimeHour(new Date(`${startDate} ${timerPicker.getHours()}:${timerPicker.getMinutes()}:00`))), 1)))) + + dateSendMessage = dateCurrentFormated( new Date(subDays(new Date(startDate+' '+formatedTimeHour(new Date(`${startDate} ${timerPicker.getHours()}:${timerPicker.getMinutes()}:00`))), 1))) } - console.log('AGENDAMENTO ENVIO MENSAGEM1: ', `${dateSendMessage} ${timeBefore}:00` ) + - } else if (statusChatEndId === '2'){ - - console.log('AGENDAMENTO ENVIO MENSAGEM2: ', startDate+' '+formatedTimeHour(new Date(`${startDate} ${timerPicker.getHours()}:${timerPicker.getMinutes()}`)) ) + } else if (statusChatEndId === '2'){ + } @@ -327,8 +313,19 @@ const dateCurrentFormated = (dateF=null) => { useEffect(()=>{ + + const selectedTimeOld = (_hours) => { - setCount(contador+1) + let selectedOld = _hours.filter((h)=>(h.value===currencyHourBeforeAux))[0] + + if(selectedOld){ + + return selectedOld + } + + return null + + } const hoursBeforeAvalible = (timer) =>{ @@ -338,25 +335,24 @@ const dateCurrentFormated = (dateF=null) => { if(typeof(startDate)==='string' && startDate.trim().length>0 && startDate === dateCurrentFormated()){ - console.log('HOJE++++') + while(subHours(timer, hour).getHours()>=6 && subHours(timer, hour).getHours()>=new Date().getHours() && - subHours(timer, hour).getHours()<=20){ - - console.log('******** TIMER: ', formatedTimeHour(subHours(timer,hour))) - + subHours(timer, hour).getHours()<=20){ + hours.push({value: formatedTimeHour(subHours(timer,hour)), label: `${hour} HORA ANTES DO HORÁRIO DO AGENDAMENTO`}) hour++; } if(hours.length>1){ - hours.pop() + hours.pop() - if(contador>1) - setCurrency( hours[0].value) + let selectedOld = selectedTimeOld(hours) + setCurrency(selectedOld ? selectedOld.value : hours[0].value) + } else{ setCurrency(null) @@ -365,9 +361,7 @@ const dateCurrentFormated = (dateF=null) => { } else{ - while(subHours(timer, hour).getHours()>=6 && subHours(timer, hour).getHours()<=20){ - - console.log('******** another day TIMER: ', formatedTimeHour(subHours(timer,hour))) + while(subHours(timer, hour).getHours()>=6 && subHours(timer, hour).getHours()<=20){ hours.push( {value: formatedTimeHour(subHours(timer,hour)), @@ -377,9 +371,13 @@ const dateCurrentFormated = (dateF=null) => { } if(hours.length>0){ + - if(contador>1) - setCurrency( hours[0].value) + let selectedOld = selectedTimeOld(hours) + setCurrency(selectedOld ? selectedOld.value : hours[0].value) + + //if(contador>1) + // setCurrency( hours[0].value) } else{ setCurrency(null) @@ -390,21 +388,21 @@ const dateCurrentFormated = (dateF=null) => { if(new Date(startDate) > addDays(new Date(), 1) ){ - hours.push({value: formatedTimeHour(timerPicker) , label: `24 HORAS ANTES DO HORÁRIO DO AGENDAMENTO`}) - - console.log('#subDays: ', dateCurrentFormated( new Date(subDays(new Date(startDate+' '+formatedTimeHour(new Date(`${startDate} ${timerPicker.getHours()}:${timerPicker.getMinutes()}:00`))), 1)))) - + hours.push({value: formatedTimeHour(timerPicker) , label: `24 HORAS ANTES DO HORÁRIO DO AGENDAMENTO`}) + + let selectedOld = selectedTimeOld(hours) + + if(selectedOld) + setCurrency(selectedOld.value) } return {time: hours, hour:hour} - } - - console.log('CONTADOR 1: ', contador) - + } + setCurrenciesTimeBefore(hoursBeforeAvalible(timerPicker).time) - },[timerPicker, startDate]) + },[timerPicker, startDate, currencyHourBeforeAux]) @@ -423,7 +421,7 @@ const dateCurrentFormated = (dateF=null) => { // Get from child 1 const textFieldSelect = (data) => { - console.log('textFieldSelect: ',data); + setStatusChatEnd(data) } @@ -440,8 +438,7 @@ const handleChange = (event) => { const handleChangeHourBefore = (event) => { setCurrency(event.target.value); - - console.log('CONTADOR 2: ', contador) + }; @@ -557,14 +554,14 @@ const handleChangeHourBefore = (event) => { func={datePickerValue} minDate={true} schedulingDate={props.rowData.schedulingDate} - title={'Data do lembrete'}/> + title={'Data'}/> + title={'Hora'}/> diff --git a/frontend/src/components/Report/SelectField/index.js b/frontend/src/components/Report/SelectField/index.js index df5dec5..a234526 100644 --- a/frontend/src/components/Report/SelectField/index.js +++ b/frontend/src/components/Report/SelectField/index.js @@ -9,7 +9,7 @@ const SelectTextFields = (props) => { // const [currency, setCurrency] = useState(props.emptyField ? '0' : '1'); - console.log(':::::::::::::::::::::: props.textBoxFieldSelected: ', props.textBoxFieldSelected) + const [currency, setCurrency] = useState(props.textBoxFieldSelected ? props.textBoxFieldSelected: '0'); diff --git a/frontend/src/pages/Report/index.js b/frontend/src/pages/Report/index.js index a8de521..1af6439 100644 --- a/frontend/src/pages/Report/index.js +++ b/frontend/src/pages/Report/index.js @@ -17,7 +17,7 @@ const reducerQ = (state, action) =>{ if(action.type === 'LOAD_QUERY'){ - console.log('----------------action.payload: ', action.payload) + const queries = action.payload const newQueries = [] @@ -234,19 +234,19 @@ const Report = () => { // Get from child 1 const datePicker1Value = (data) => { - console.log('DATE1: ',(data)); + setDatePicker1(data) } // Get from child 2 const datePicker2Value = (data) => { - console.log('DATE2: ',(data)); + setDatePicker2(data) } // Get from child 3 const textFieldSelectUser = (data) => { - console.log('textField: ',data); + setUser(data) } diff --git a/frontend/src/pages/SchedulesReminder/index.js b/frontend/src/pages/SchedulesReminder/index.js index 5dfb69d..90e7af9 100644 --- a/frontend/src/pages/SchedulesReminder/index.js +++ b/frontend/src/pages/SchedulesReminder/index.js @@ -1,16 +1,16 @@ -import React, { useState, useEffect, useReducer, useContext} from "react"; +import React, { useState, useEffect, useReducer} from "react"; import MainContainer from "../../components/MainContainer"; import api from "../../services/api"; -import SelectField from "../../components/Report/SelectField"; + //import { data } from '../../components/Report/MTable/data'; import DatePicker1 from '../../components/Report/DatePicker' import DatePicker2 from '../../components/Report/DatePicker' //import { Button } from "@material-ui/core"; -import MTable from "../../components/Report/MTable"; + import PropTypes from 'prop-types'; import Box from '@mui/material/Box'; -import { AuthContext } from "../../context/Auth/AuthContext"; -import { Can } from "../../components/Can"; + + import SearchIcon from "@material-ui/icons/Search"; import TextField from "@material-ui/core/TextField"; @@ -20,29 +20,19 @@ import Button from "@material-ui/core/Button"; import MaterialTable from 'material-table'; import Delete from '@material-ui/icons/Delete'; -import Edit from '@material-ui/icons/Edit'; -import Save from '@material-ui/icons/Save'; +import Edit from '@material-ui/icons/Edit'; -import Dialog from '@mui/material/Dialog'; + import { render } from '@testing-library/react'; // import Modal from "../../../..ChatEnd/ModalChatEnd"; import Modal from "../../components/ModalUpdateScheduleReminder"; import openSocket from "socket.io-client"; - - -import { - IconButton, - Paper, - Table, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; -import { DeleteOutline } from "@material-ui/icons"; + + + import { toast } from "react-toastify"; import toastError from "../../errors/toastError"; import ConfirmationModal from "../../components/ConfirmationModal"; @@ -53,7 +43,7 @@ const reducerQ = (state, action) =>{ if(action.type === 'LOAD_QUERY'){ - console.log('----------------action.payload: ', action.payload) + const queries = action.payload const newQueries = [] @@ -80,7 +70,7 @@ const reducerQ = (state, action) =>{ // const scheduling = action.payload; // const schedulingIndex = state.findIndex((u) => u.id === +scheduling.id); - // console.log('**************** UPDATE_SCHEDULING scheduleIndex: ', schedulingIndex) + // // if (schedulingIndex !== -1) { // state[schedulingIndex] = scheduling; @@ -95,7 +85,7 @@ const reducerQ = (state, action) =>{ const scheduleId = action.payload; const scheduleIndex = state.findIndex((u) => u.id === scheduleId); - console.log('**************** scheduleIndex: ', scheduleIndex) + if (scheduleIndex !== -1) { state.splice(scheduleIndex, 1); } @@ -199,7 +189,7 @@ Item.propTypes = { const SchedulesReminder = () => { - const { user: userA } = useContext(AuthContext); + //-------- const [searchParam] = useState(""); @@ -210,7 +200,7 @@ const SchedulesReminder = () => { //const [columns, setColums] = useState([]) const [startDate, setDatePicker1] = useState(new Date()) const [endDate, setDatePicker2] = useState(new Date()) - const [userId, setUser] = useState(null) + const [query, dispatchQ] = useReducer(reducerQ, []) const [contactNumber, setContactNumber] = useState(""); @@ -231,19 +221,19 @@ const SchedulesReminder = () => { socket.on("schedulingNotify", (data) => { - console.log('SOCKET IO') + setLoading(true); // if (data.action === "update" || data.action === "create") { - // console.log('UPDATE_SCHEDULING: ', data.schedulingNotifyCreate) + // // // dispatchQ({ type: "UPDATE_SCHEDULING", payload: data.schedulingNotifyCreate }); // } if (data.action === "delete") { - console.log('DELETE_SCHEDULING id: ', data.schedulingNotifyId) + dispatchQ({ type: "DELETE_SCHEDULING", payload: +data.schedulingNotifyId }); //handleDeleteRows(data.schedulingNotifyId) } @@ -281,10 +271,14 @@ const SchedulesReminder = () => { // dispatch({ type: "LOAD_STATUS_CHAT_END", payload: statusChatEndLoad.data }); - console.log(':::::::::::::: statusChatEndLoad: ', statusChatEndLoad.data) + - setStatusEndChat(statusChatEndLoad.data.filter(status => (status.id == '2' || status.id == '3'))) + // setStatusEndChat(statusChatEndLoad.data.filter(status => (status.id == '2' || status.id == '3'))) + + setStatusEndChat(statusChatEndLoad.data.filter(status => (`${status.id}` === '2' || `${status.id}` === '3'))) + + //setHasMore(data.hasMore); // setLoading(false); } catch (err) { @@ -331,41 +325,30 @@ const SchedulesReminder = () => { useEffect(() => { if(!loading){ - console.log('carregando table...') - // const dataLoad = query.map(({ scheduleReminder, ...others }) => ( - - // { ...others, 'scheduleReminder': others.statusChatEndId == '3' ? 'Agendamento' : 'Lembrete' } - - // )); - - // console.log('NEW DATA: ', dataLoad) + setData(query.map(({ scheduleReminder, ...others }) => ( - { ...others, 'scheduleReminder': others.statusChatEndId == '3' ? 'Agendamento' : 'Lembrete' } + { ...others, 'scheduleReminder': `${others.statusChatEndId}` === '3' ? 'Agendamento' : 'Lembrete' } ))) } - }, [loading]) + }, [loading, query]) // Get from child 1 const datePicker1Value = (data) => { - console.log('DATE1: ',(data)); + setDatePicker1(data) } // Get from child 2 const datePicker2Value = (data) => { - console.log('DATE2: ',(data)); + setDatePicker2(data) } -// Get from child 3 -const textFieldSelectUser = (data) => { - console.log('textField: ',data); - setUser(data) -} + const handleSearch = (event) => { setContactNumber(event.target.value.toLowerCase()); @@ -381,21 +364,21 @@ const handleClear = () => { const handleCloseConfirmationModal = () => { setConfirmModalOpen(false); - console.log('cancelou NULL 1') + setSelectedSchedule(null); }; -const handleDeleteRows = (id) => { +// const handleDeleteRows = (id) => { - let _data = [...dataRows]; +// let _data = [...dataRows]; - _data.forEach(rd => { - _data = _data.filter(t => t.id !== id); - }); - setData(_data); +// _data.forEach(rd => { +// _data = _data.filter(t => t.id !== id); +// }); +// setData(_data); -}; +// }; const handleDeleteSchedule = async (scheduleId) => { @@ -406,7 +389,7 @@ const handleDeleteSchedule = async (scheduleId) => { } catch (err) { toastError(err); } - console.log('cancelou NULL 2') + setSelectedSchedule(null); }; @@ -424,7 +407,7 @@ const handleUpdateSchedule = async (scheduleData, rowsDataNew) => { dataUpdate[index] = rowsDataNew; setData([...dataUpdate].map(({ scheduleReminder, ...others }) => ( - { ...others, 'scheduleReminder': others.statusChatEndId == '3' ? 'Agendamento' : 'Lembrete' } + { ...others, 'scheduleReminder': `${others.statusChatEndId}` === '3' ? 'Agendamento' : 'Lembrete' } ))); @@ -436,7 +419,7 @@ const handleUpdateSchedule = async (scheduleData, rowsDataNew) => { } catch (err) { toastError(err); } - //console.log('cancelou NULL 3') + // setSelectedSchedule(null); }; @@ -445,10 +428,10 @@ const chatEndVal = (data, rowsDataNew) => { if(data){ - console.log('DATA SCHECULE: ', data) + - console.log(':::::::::::::::::::: ChatEnd2: ',(data)); - console.log(':::::::::::::::::::: Rows data fro child: ',(rowsDataNew)); + + handleUpdateSchedule(data, rowsDataNew) @@ -493,12 +476,7 @@ const handleModal = (rowData) => { /> - {/* - { - return {'value': obj.id, 'label': obj.name} - })}/> - - */} + @@ -527,7 +505,7 @@ const handleModal = (rowData) => { handleDeleteSchedule(selectedSchedule.id)} @@ -540,7 +518,7 @@ const handleModal = (rowData) => { columns={ [ - { title: 'Foto', field: 'ticket.contact.profilePicUrl', render: rowData => }, + { title: 'Foto', field: 'ticket.contact.profilePicUrl', render: rowData => imagem de perfil do whatsapp }, { title: 'Nome', field: 'ticket.contact.name' }, { title: 'Contato', field: 'ticket.contact.number' }, { title: 'Lemb/Agen', field: 'scheduleReminder'}, @@ -558,7 +536,7 @@ const handleModal = (rowData) => { icon: Edit, tooltip: 'Editar', onClick: (event, rowData) => { - console.log("You want edit data ",rowData) + setSelectedSchedule(rowData); handleModal(rowData) } @@ -568,7 +546,7 @@ const handleModal = (rowData) => { icon: Delete, tooltip: 'Deletar', onClick: (event, rowData) => { - console.log("You want to delete ",rowData) + setSelectedSchedule(rowData); setConfirmModalOpen(true); } @@ -588,13 +566,6 @@ const handleModal = (rowData) => { width: 300, }, - pageSize: 20, - headerStyle: { - position: "sticky", - top: "0" - }, - maxBodyHeight: "400px", - rowStyle: { fontSize: 12, }