From 66da6a9d59ddeffa2dcdf0e1928de8f2ccada591 Mon Sep 17 00:00:00 2001 From: adriano Date: Wed, 26 Jan 2022 09:47:52 -0300 Subject: [PATCH] =?UTF-8?q?Altera=C3=A7ao=20no=20modal=20para=20que=20as?= =?UTF-8?q?=20colunas=20de=20mensagem=20n=C3=A3o=20seja=20ordenadas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Report/MTable/index.js | 16 +++++++++----- frontend/src/components/Report/Modal/index.js | 22 ++++++++++++++++--- frontend/src/pages/Report/index.js | 2 +- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Report/MTable/index.js b/frontend/src/components/Report/MTable/index.js index ed32cde..58c38ba 100644 --- a/frontend/src/components/Report/MTable/index.js +++ b/frontend/src/components/Report/MTable/index.js @@ -23,9 +23,11 @@ const MTable = (props) => { return (
{ @@ -34,8 +36,12 @@ const MTable = (props) => { console.log(selectedRow); console.log(selectedRow.messages); setSelectedRow(selectedRow.tableData.id) - - render() + + if(props.hasChild) { + render() + } + + console.log('props.hasChild: ', props.hasChild) //evt.stopPropagation() } @@ -46,6 +52,7 @@ const MTable = (props) => { selection: false, paging: false, padding: 'dense', + sorting: true ? props.hasChild: false, //loadingType: 'linear', searchFieldStyle: { width: 300, @@ -53,8 +60,7 @@ const MTable = (props) => { rowStyle: rowData => ({ fontSize: 12, - backgroundColor: - selectedRow === rowData.tableData.id ? '#ec5114' : '#FFF' + backgroundColor: selectedRow === rowData.tableData.id ? '#ec5114' : '#FFF' }) }} /> diff --git a/frontend/src/components/Report/Modal/index.js b/frontend/src/components/Report/Modal/index.js index 0099389..f50b2c8 100644 --- a/frontend/src/components/Report/Modal/index.js +++ b/frontend/src/components/Report/Modal/index.js @@ -3,6 +3,10 @@ import Button from '@mui/material/Button'; import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogContentText from '@mui/material/DialogContentText'; +import DialogTitle from '@mui/material/DialogTitle'; + import DataGridTable from '../Table'; import MTable from "../MTable"; @@ -10,12 +14,13 @@ let columns = [ { title: 'Atendente/Cliente', field: 'fromMe', + }, { title: 'Mensagem', field: 'body', - cellStyle: {whiteSpace: 'nowrap'}, + //cellStyle: {whiteSpace: 'nowrap'}, }, { title: 'Criado', field: 'createdAt' } @@ -73,10 +78,21 @@ const Modal = (props) => { scroll={scroll} aria-labelledby="scroll-dialog-title" aria-describedby="scroll-dialog-description" - > + > - + {props.modal_header} + + + + + + + diff --git a/frontend/src/pages/Report/index.js b/frontend/src/pages/Report/index.js index aecfd5f..c750b43 100644 --- a/frontend/src/pages/Report/index.js +++ b/frontend/src/pages/Report/index.js @@ -296,7 +296,7 @@ console.log('XXXXXXXXX: ', query) display: 'grid', }}> - +