Merge branch 'administativePages' into 'dev'

Administative pages

See merge request kluppsoftware/smart-energia-web!69
This commit is contained in:
José Corte 2022-06-23 13:38:15 +00:00
commit bb84a6424e
44 changed files with 696 additions and 321 deletions

View File

@ -20,6 +20,7 @@
"@date-io/date-fns": "^2.14.0", "@date-io/date-fns": "^2.14.0",
"@emotion/react": "^11.9.0", "@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1", "@emotion/styled": "^11.8.1",
"@hookform/resolvers": "^2.9.1",
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@mui/icons-material": "^5.8.2", "@mui/icons-material": "^5.8.2",
@ -28,6 +29,7 @@
"@mui/x-date-pickers": "^5.0.0-alpha.3", "@mui/x-date-pickers": "^5.0.0-alpha.3",
"@tinymce/tinymce-react": "^4.1.0", "@tinymce/tinymce-react": "^4.1.0",
"@types/react-csv": "^1.1.2", "@types/react-csv": "^1.1.2",
"@types/yup": "^0.29.14",
"@typescript-eslint/eslint-plugin": "^5.22.0", "@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0", "@typescript-eslint/parser": "^5.22.0",
"axios": "^0.27.2", "axios": "^0.27.2",
@ -49,9 +51,12 @@
"react-chartjs-2": "^4.1.0", "react-chartjs-2": "^4.1.0",
"react-csv": "^2.2.2", "react-csv": "^2.2.2",
"react-dom": "18.1.0", "react-dom": "18.1.0",
"react-hook-form": "^7.32.2",
"react-icons": "^4.3.1", "react-icons": "^4.3.1",
"react-input-mask": "^2.0.4",
"styled-components": "^5.3.5", "styled-components": "^5.3.5",
"tinymce": "^6.0.3" "tinymce": "^6.0.3",
"yup": "^0.32.11"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.17.10", "@babel/preset-env": "^7.17.10",

BIN
public/assets/iconePDF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
public/assets/marca1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 859 KiB

View File

@ -13,7 +13,7 @@ export default function NotificationQuestionsCard({title, body}: CommonsQuestion
const [ showCardBody, setShowCardBody ] = useState<boolean>(false) const [ showCardBody, setShowCardBody ] = useState<boolean>(false)
return ( return (
<CommonQuestionsCardView> <CommonQuestionsCardView onClick={() => setShowCardBody(!showCardBody)}>
<FaqQuestionsCardHeader> <FaqQuestionsCardHeader>
<h4>{title}</h4> <h4>{title}</h4>
<Image src={showCardBody? '/assets/less-icon.svg' : '/assets/plus-icon.svg' } width={32} height={32} onClick={() => setShowCardBody(!showCardBody)} /> <Image src={showCardBody? '/assets/less-icon.svg' : '/assets/plus-icon.svg' } width={32} height={32} onClick={() => setShowCardBody(!showCardBody)} />

View File

@ -13,6 +13,7 @@ export const FaqQuestionsCardHeader = styled.div`
margin-top: 53px; margin-top: 53px;
width: 100%; width: 100%;
cursor: pointer;
img { img {
cursor: pointer; cursor: pointer;

View File

@ -12,7 +12,34 @@ import TableSortLabel from '@mui/material/TableSortLabel';
import { visuallyHidden } from '@mui/utils'; import { visuallyHidden } from '@mui/utils';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import Snackbar from '@mui/material/Snackbar';
import MuiAlert, { AlertProps } from '@mui/material/Alert';
import Modal from '@mui/material/Modal';
import { TableView, StyledStatus } from './TableView'; import { TableView, StyledStatus } from './TableView';
import { api } from '../../services/api';
const style = {
position: 'absolute' as const,
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 900,
height: 500,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 4,
overflowY: 'scroll'
};
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
props,
ref,
) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />;
});
interface Data { interface Data {
clientCode: number, clientCode: number,
@ -161,6 +188,37 @@ export default function ClientTable({clients, onChange}: ClientsTableInterface)
const [dense, setDense] = useState<boolean>(false); const [dense, setDense] = useState<boolean>(false);
const [rowsPerPage, setRowsPerPage] = useState<number>(5); const [rowsPerPage, setRowsPerPage] = useState<number>(5);
const [openSnackError, setOpenSnackError] = useState<boolean>(false);
const [open, setOpen] = useState(false);
const [openModalInativar, setOpenModalInativar] = useState(false)
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
const [cod_client, setCod_client] = useState()
const [units, setUnits] = useState([])
function getClientUnits(client_id: number) {
api.post('/units', {
"filters": [
{"type" : "=", "field": "dados_cadastrais.cod_smart_cliente", "value": client_id}
],
"fields": ["unidade"],
"distinct": true
}).then(res => setUnits(res.data.data)).catch(res => {
setOpenSnackError(true)
})
return units
}
const handleCloseSnack = (event?: React.SyntheticEvent | Event, reason?: string) => {
if (reason === 'clickaway') {
return;
}
setOpenSnackError(false);
};
const handleRequestSort = ( const handleRequestSort = (
event: React.MouseEvent<unknown>, event: React.MouseEvent<unknown>,
property: keyof Data, property: keyof Data,
@ -220,6 +278,11 @@ export default function ClientTable({clients, onChange}: ClientsTableInterface)
return ( return (
<TableView> <TableView>
<Snackbar open={openSnackError} autoHideDuration={4000} onClose={handleCloseSnack}>
<Alert onClose={handleCloseSnack} severity="error" sx={{ width: '100%' }}>
Não foi possivel encontrar unidades do client!
</Alert>
</Snackbar>
<Paper sx={{ width: '100%', mb: 2 }}> <Paper sx={{ width: '100%', mb: 2 }}>
<TableContainer> <TableContainer>
<Table <Table
@ -270,7 +333,10 @@ export default function ClientTable({clients, onChange}: ClientsTableInterface)
Client - {row.client_id} Client - {row.client_id}
</TableCell> </TableCell>
<TableCell align="left">{row.name}</TableCell> <TableCell align="left">{row.name}</TableCell>
<TableCell align="left">clique aqui para ver as unidades</TableCell> <TableCell align="left" style={{cursor: 'pointer'}} onClick={() => {
setOpen(true)
getClientUnits(row.client_id)
}}>clique aqui para ver as unidades</TableCell>
<TableCell align="left"><StyledStatus status={row.deleted_at? 'inativo' : 'ativo'}> {row.deleted_at? 'inativo' : 'ativo'}</StyledStatus></TableCell> <TableCell align="left"><StyledStatus status={row.deleted_at? 'inativo' : 'ativo'}> {row.deleted_at? 'inativo' : 'ativo'}</StyledStatus></TableCell>
</TableRow> </TableRow>
); );
@ -297,6 +363,25 @@ export default function ClientTable({clients, onChange}: ClientsTableInterface)
onRowsPerPageChange={handleChangeRowsPerPage} onRowsPerPageChange={handleChangeRowsPerPage}
/> />
</Paper> </Paper>
<Modal
open={open}
onClose={handleClose}
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
>
<Box sx={style}>
{
units.map((units, index) => {
return <>
<li style={{
listStyle: 'none'
}} key={index}>{units.unidade}</li>
<hr />
</>
})
}
</Box>
</Modal>
</TableView> </TableView>
); );
} }

View File

@ -283,7 +283,7 @@ export default function FaqTable({questionData, onChange}: FaqTableInterface) {
{row.question} {row.question}
</TableCell> </TableCell>
<TableCell align="left">{row.answer}</TableCell> <TableCell align="left">{row.answer}</TableCell>
<TableCell align="left"><StyledStatus status={row.deleted_at? 'ativo' : 'inativo'}> {row.deleted_at? 'ativo' : 'inativo'}</StyledStatus></TableCell> <TableCell align="left"><StyledStatus status={'ativo'}> {'ativo'}</StyledStatus></TableCell>
</TableRow> </TableRow>
); );
})} })}

View File

@ -41,15 +41,6 @@ function createData(
}; };
} }
const rows = [
createData('Confira tal coisa - Texto da notificação', 'Copel', 'enviada'),
createData('Confira tal coisa - Texto da notificação', 'Copel', 'enviada'),
createData('Confira tal coisa - Texto da notificação', 'Copel', 'enviada'),
createData('Confira tal coisa - Texto da notificação', 'Copel', 'falhou'),
createData('Confira tal coisa - Texto da notificação', 'Copel', 'pendente'),
createData('Confira tal coisa - Texto da notificação', 'Copel', 'enviada'),
];
function descendingComparator<T>(a: T, b: T, orderBy: keyof T) { function descendingComparator<T>(a: T, b: T, orderBy: keyof T) {
if (b[orderBy] < a[orderBy]) { if (b[orderBy] < a[orderBy]) {
return -1; return -1;
@ -299,7 +290,7 @@ export default function NotificationsTable({notifications, onChange}: Notificati
{row.title} {row.title}
</TableCell> </TableCell>
<TableCell align="left">{'copel'}</TableCell> <TableCell align="left">{'copel'}</TableCell>
<TableCell align="left"><StyledStatus status={row.deleted_at===null? 'ativo' : 'inativo'}>{row.deleted_at===null? 'ativo' : 'inativo'}</StyledStatus></TableCell> <TableCell align="left"><StyledStatus status={'ativo'}>{'ativo'}</StyledStatus></TableCell>
</TableRow> </TableRow>
); );
})} })}

View File

@ -4,9 +4,9 @@ export const FaqButtonView1 = styled.button`
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: 10px; margin-top: 40px;
margin-left: 65px; margin-left: 65px;
width: 350px; width: 320px;
height: 45px; height: 45px;
cursor: pointer; cursor: pointer;
background: #DDDDDD; background: #DDDDDD;

View File

@ -5,8 +5,8 @@ export const FaqButtonView2 = styled.button`
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: -46px; margin-top: -46px;
margin-left: 430px; margin-left: 444px;
width: 350px; width: 320px;
height: 45px; height: 45px;
cursor: pointer; cursor: pointer;
background: #254F7F; background: #254F7F;
@ -16,7 +16,5 @@ export const FaqButtonView2 = styled.button`
font-family: 'Poppins'; font-family: 'Poppins';
font-size: 90%; font-size: 90%;
color: #FFFFFF; color: #FFFFFF;
` `

View File

@ -13,9 +13,10 @@ export default function CommonsQuestionsCard({question, answer}: CommonsQuestion
const [ showCardBody, setShowCardBody ] = useState<boolean>(false) const [ showCardBody, setShowCardBody ] = useState<boolean>(false)
return ( return (
<CommonQuestionsCardView> <CommonQuestionsCardView onClick={() => setShowCardBody(!showCardBody)}>
<FaqQuestionsCardHeader> <FaqQuestionsCardHeader >
<h4>{question}</h4> <h4 >{question}</h4>
<Image src={showCardBody? '/assets/less-icon.svg' : '/assets/plus-icon.svg' } width={32} height={32} onClick={() => setShowCardBody(!showCardBody)} /> <Image src={showCardBody? '/assets/less-icon.svg' : '/assets/plus-icon.svg' } width={32} height={32} onClick={() => setShowCardBody(!showCardBody)} />
</FaqQuestionsCardHeader> </FaqQuestionsCardHeader>

View File

@ -13,6 +13,7 @@ export const FaqQuestionsCardHeader = styled.div`
margin-top: 53px; margin-top: 53px;
width: 100%; width: 100%;
cursor: pointer;
img { img {
cursor: pointer; cursor: pointer;

View File

@ -54,7 +54,7 @@ export default function Chart({ title, data1, data2, label, subtitle, dataset1,
offset: -20, offset: -20,
align: "start", align: "start",
font: { font: {
size: 16 size: 12
} }
}, },
legend: { legend: {
@ -72,13 +72,13 @@ export default function Chart({ title, data1, data2, label, subtitle, dataset1,
datasets: [ datasets: [
{ {
label: dataset1? dataset1 : '2021', label: dataset1? dataset1 : '2021',
data: data1.map(value => value.custo_unit), data: data1.map(value => value.custo_unit? value.custo_unit : 0),
backgroundColor: '#C2D5FB', backgroundColor: '#C2D5FB',
}, },
data2? data2?
{ {
label: dataset2? dataset2 : '2022', label: dataset2? dataset2 : '2022',
data: data2.map(value => value.custo_unit), data: data2.map(value => value.custo_unit? value.custo_unit : 0),
backgroundColor: '#255488', backgroundColor: '#255488',
} : null } : null
], ],

View File

@ -71,9 +71,10 @@ interface LineBarChartInterface {
dataset3?: string, dataset3?: string,
barLabel?: boolean | undefined, barLabel?: boolean | undefined,
hashurado?: boolean | undefined, hashurado?: boolean | undefined,
reais?: boolean | undefined
} }
export function LineBarChart({ title, subtitle, data1, data2, data3, label, red, dataset1, dataset2, dataset3, barLabel, hashurado }: LineBarChartInterface) { export function LineBarChart({ title, subtitle, data1, data2, data3, label, red, dataset1, dataset2, dataset3, barLabel, hashurado, reais }: LineBarChartInterface) {
const chartRef = useRef<ChartJS>(null); const chartRef = useRef<ChartJS>(null);
const currentTime = new Date(); const currentTime = new Date();
@ -93,7 +94,7 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red,
offset: -20, offset: -20,
align: "start", align: "start",
font: { font: {
size: 16 size: 12
} }
}, },
legend: { legend: {
@ -111,7 +112,7 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red,
datasets: [ datasets: [
{ {
type: 'line' as const, type: 'line' as const,
label: dataset1? dataset1 : 'Dataset 1', label: dataset1&&reais==false? parseFloat(dataset1).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2}) : dataset1,
borderColor: red? borderColor: red?
'#f00' : '#0c9200', '#f00' : '#0c9200',
datalabels: { datalabels: {

View File

@ -93,7 +93,7 @@ export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red
offset: -20, offset: -20,
align: "start", align: "start",
font: { font: {
size: 16 size: 12
} }
}, },
legend: { legend: {

View File

@ -55,7 +55,7 @@ export default function LineChart({ title, subtitle, data1, data2, data3, data4,
offset: -20, offset: -20,
align: "start", align: "start",
font: { font: {
size: 16 size: 12
} }
}, },
legend: { legend: {

View File

@ -51,7 +51,7 @@ export function SingleBar({ title, subtitle, dataProps, label, dataset, dataset1
sum += data; sum += data;
}); });
const percentage = (dataProps[ctx.dataIndex].econ_percentual*100).toFixed(0)+"%"; const percentage = (dataProps[ctx.dataIndex].econ_percentual*100).toFixed(0)+"%";
const result = `${value}\n ${percentage}` const result = `${parseFloat(value).toFixed(0)}\n ${percentage}`
return value==null? null : result return value==null? null : result
}, },
@ -61,7 +61,7 @@ export function SingleBar({ title, subtitle, dataProps, label, dataset, dataset1
offset: -40, offset: -40,
align: "start", align: "start",
font: { font: {
size: 16 size: 10
} }
}, },
legend: { legend: {

View File

@ -35,23 +35,22 @@ function stringAvatar(name: string) {
} }
interface headerInterface { interface headerInterface {
name: string name: string,
admin?: boolean | undefined
} }
export default function Header({ name }: headerInterface) { export default function Header({ name, admin }: headerInterface) {
return ( return (
<HeaderView> <HeaderView>
<section> <section>
<TextField
id="outlined-textarea"
label="Encontre na Página"
placeholder="Encontre na Página"
multiline
fullWidth
/>
</section> </section>
<section> <section>
{/* {
!admin?
<Image src='/assets/png/copel.png' width={170} height={50} /> <Image src='/assets/png/copel.png' width={170} height={50} />
:
null
} */}
<div className='icon' > <div className='icon' >
<p> <p>
olá, {name} olá, {name}

View File

@ -3,7 +3,7 @@ import React,{ useState, useEffect } from 'react'
import { InputUploadView } from './inputUploadView' import { InputUploadView } from './inputUploadView'
export default function InputUpload() { export default function InputUploadPdf() {
const [images, setImages] = useState([] as any); const [images, setImages] = useState([] as any);
const [imageURLS, setImageURLs] = useState([]); const [imageURLS, setImageURLs] = useState([]);
@ -34,6 +34,7 @@ export default function InputUpload() {
</div> </div>
<div className="update"> <div className="update">
<form action=""> <form action="">
<div > <div >
<label htmlFor="arquivo"> <p className='TitleButton'> Enviar foto de Perfil </p> </label> <label htmlFor="arquivo"> <p className='TitleButton'> Enviar foto de Perfil </p> </label>

View File

@ -0,0 +1,49 @@
import React,{ useState, useEffect } from 'react'
import Image from 'next/image';
import { InputUploadView } from './inputUploadView'
export default function InputUploadPdf() {
const [images, setImages] = useState([] as any);
const [imageURLS, setImageURLs] = useState([]);
useEffect(() => {
if (images.length < 1) return;
const newImageUrls: any = [];
images.forEach((image:any) => newImageUrls.push(URL.createObjectURL(image)));
setImageURLs(newImageUrls);
}, [images]);
function onImageChange(e: any) {
setImages([...e.target.files]);
// console.log(e);
}
return (
<InputUploadView>
<div className='imgContainer'>
{imageURLS.map((imageSrc, index) => (
<Image src='/assets/iconePDf.png' key={index} width={30} height={30} className="image" />
))}
</div>
<div className="update">
<form action="">
<div className='testess'>
<label htmlFor="arquivo"> <p className='TitleButton'> Enviar PDF </p> </label>
<input type="file" name='arquivo' id='arquivo' onChange={onImageChange} />
</div>
</form>
</div>
</InputUploadView>
)
}

View File

@ -0,0 +1,51 @@
import styled from 'styled-components'
export const InputUploadView = styled.div`
border-radius: 4px;
border:1px solid gray ;
background-color: white;
width: 300px;
height: 50px;
input[type="file"] {
display: none;
}
label {
width: 140px;
height: 30px;
margin-top: -30px;
border-radius: 4px;
margin-left: 69px;
background-color: #254F7F;
color: white;
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
display: flex;
text-align: center;
cursor: pointer;
}
.TitleButton{
margin-top: 4px;
margin-left: 30px;
}
.testess{
margin-left: 80px;
position: absolute;
}
.imgContainer{
max-width: 40px;
margin-top: 9px;
margin-left: 4px;
height: 30px;
}
`

View File

@ -7,7 +7,8 @@ import Image from 'next/image'
import Link from 'next/link' import Link from 'next/link'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { parseCookies } from 'nookies'; import { parseCookies } from 'nookies';
import React, { useEffect, useState } from 'react' import React, { useContext, useEffect, useState } from 'react'
import { AuthContext } from '../../contexts/AuthContext';
import RenderIf from '../../utils/renderIf'; import RenderIf from '../../utils/renderIf';
import { SidebarView } from './SidebarView' import { SidebarView } from './SidebarView'
@ -25,10 +26,12 @@ const style = {
}; };
export default function Sidebar() { export default function Sidebar() {
const [open, setOpen] = React.useState(false); const [open, setOpen] = useState(false);
const handleOpen = () => setOpen(true); const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false); const handleClose = () => setOpen(false);
const { signOut } = useContext(AuthContext)
const [ economiaDrawer, setEconomiaDrawer ] = useState(false) const [ economiaDrawer, setEconomiaDrawer ] = useState(false)
const [ viewModal, setViewModal ] = useState(false) const [ viewModal, setViewModal ] = useState(false)
@ -37,8 +40,6 @@ export default function Sidebar() {
const { ['user-role']: role } = parseCookies() const { ['user-role']: role } = parseCookies()
// console.log(role)
useEffect(() => { useEffect(() => {
setViewModal(false) setViewModal(false)
}, [router.pathname]) }, [router.pathname])
@ -54,10 +55,11 @@ export default function Sidebar() {
<Image src='/assets/logo.svg' width={100} height={100} /> <Image src='/assets/logo.svg' width={100} height={100} />
</div> </div>
<ul> <ul>
<Link href='/administrative/clients'><li className={router.pathname=='/administrative' ? 'actualPath' : null } ><Image src='/assets/sidebar/economyIcon.svg' width={25} height={25} />{'Clientes >'}</li></Link> <Link href='/administrative/clients'><li className={router.pathname=='/administrative/clients' ? 'actualPath' : null } ><Image src='/assets/sidebar/economyIcon.svg' width={25} height={25} />{'Clientes >'}</li></Link>
<Link href='/administrative/general'><li className={router.pathname=='/administrative/general'? 'actualPath' : null} ><Image src='/assets/sidebar/aboutUs.svg' width={25} height={25} />{'Sobre Nós'}</li></Link> <Link href='/administrative/general'><li className={router.pathname=='/administrative/general'? 'actualPath' : null} ><Image src='/assets/sidebar/aboutUs.svg' width={25} height={25} />{'Sobre Nós'}</li></Link>
<Link href='/administrative/faq'><li className={router.pathname=='/administrative/faq' ? 'actualPath' : null } ><Image src='/assets/sidebar/saqIcon.svg' width={25} height={25} />{'FAQ >'}</li></Link> <Link href='/administrative/faq'><li className={router.pathname=='/administrative/faq' ? 'actualPath' : null } ><Image src='/assets/sidebar/saqIcon.svg' width={25} height={25} />{'FAQ >'}</li></Link>
<Link href='/administrative/notification'><li className={router.pathname=='/administrative/notifications'? 'actualPath' : null}><Image src='/assets/sidebar/notificationsIcon.svg' width={25} height={25} />{'Notificações >'}<div className='notification'><p>25</p></div></li></Link> <Link href='/administrative/notification'><li className={router.pathname=='/administrative/notification'? 'actualPath' : null}><Image src='/assets/sidebar/notificationsIcon.svg' width={25} height={25} />{'Notificações >'}</li></Link>
<Link href='/administrative/industryInfo'><li className={router.pathname=='/administrative/general'? 'actualPath' : null} ><Image src='/assets/sidebar/aboutUs.svg' width={25} height={25} />{'Info Setorial'}</li></Link>
<button onClick={handleOpen}><Image src='/assets/logout.svg' width={25} height={25} />{'Sair'}</button> <button onClick={handleOpen}><Image src='/assets/logout.svg' width={25} height={25} />{'Sair'}</button>
<Modal <Modal
open={open} open={open}
@ -92,9 +94,9 @@ export default function Sidebar() {
<Link href='/dashboard'><li className={router.pathname=='/dashboard'? 'actualPath' : null} ><Image src='/assets/sidebar/dashboardIcon.svg' width={25} height={25} />{'Visão Geral'}</li></Link> <Link href='/dashboard'><li className={router.pathname=='/dashboard'? 'actualPath' : null} ><Image src='/assets/sidebar/dashboardIcon.svg' width={25} height={25} />{'Visão Geral'}</li></Link>
<li onClick={() => setEconomiaDrawer(!economiaDrawer)} className={router.pathname=='/grossSavings' || router.pathname=='/accumulatedSavings' || router.pathname=='/estimatedCost' || router.pathname=='/costIndicator' ? 'actualPath' : null } ><Image src='/assets/sidebar/economyIcon.svg' width={25} height={25} />{'Economia >'}</li> <li onClick={() => setEconomiaDrawer(!economiaDrawer)} className={router.pathname=='/grossSavings' || router.pathname=='/accumulatedSavings' || router.pathname=='/estimatedCost' || router.pathname=='/costIndicator' ? 'actualPath' : null } ><Image src='/assets/sidebar/economyIcon.svg' width={25} height={25} />{'Economia >'}</li>
<div className='economiaDrawer drawer' > <div className='economiaDrawer drawer' >
<Link href='/grossSavings'><li className={router.pathname=='/grossSavings'? 'actualPathDrawer' : null}>Economia Bruta</li></Link> <Link href='/grossSavings'><li className={router.pathname=='/grossSavings'? 'actualPathDrawer' : null}>Economia Bruta Anual</li></Link>
<Link href='/accumulatedSavings'><li className={router.pathname=='/accumulatedSavings'? 'actualPathDrawer' : null}>Economia Acumulada</li></Link> <Link href='/accumulatedSavings'><li className={router.pathname=='/accumulatedSavings'? 'actualPathDrawer' : null}>Economia Bruta Mensal</li></Link>
<Link href='/estimatedCost'><li className={router.pathname=='/estimatedCost'? 'actualPathDrawer' : null}>Custo Estimado</li></Link> <Link href='/estimatedCost'><li className={router.pathname=='/estimatedCost'? 'actualPathDrawer' : null}>Cativo x Livre mensal</li></Link>
<Link href='/costIndicator'><li className={router.pathname=='/costIndicator'? 'actualPathDrawer' : null}>Custo R/MWh</li></Link> <Link href='/costIndicator'><li className={router.pathname=='/costIndicator'? 'actualPathDrawer' : null}>Custo R/MWh</li></Link>
</div> </div>
<Link href='/telemetria'><li className={router.pathname=='/telemetria'? 'actualPath' : null}><Image src='/assets/sidebar/telemetryIcon.svg' width={25} height={25} />{'Telemetria >'}</li></Link> <Link href='/telemetria'><li className={router.pathname=='/telemetria'? 'actualPath' : null}><Image src='/assets/sidebar/telemetryIcon.svg' width={25} height={25} />{'Telemetria >'}</li></Link>
@ -117,7 +119,7 @@ export default function Sidebar() {
<Typography id="modal-modal-title" variant="h6" component="h2"> <Typography id="modal-modal-title" variant="h6" component="h2">
Deseja realmente sair ? Deseja realmente sair ?
</Typography> </Typography>
<Link href='/'><Button variant="contained" sx={{mt:5}}>Sim</Button></Link> <Link href='/'><Button variant="contained" onClick={() => signOut()} sx={{mt:5}}>Sim</Button></Link>
<Button variant="contained" onClick={handleClose} color="error" sx={{mt:5 ,ml:1}}>Não</Button> <Button variant="contained" onClick={handleClose} color="error" sx={{mt:5 ,ml:1}}>Não</Button>
</Box> </Box>
</Modal> </Modal>

View File

@ -1,7 +1,7 @@
import React, { createContext, useState } from "react"; import React, { createContext, useState } from "react";
import Router from 'next/router' import Router from 'next/router'
import { setCookie } from "nookies"; import { destroyCookie, setCookie } from "nookies";
import { signInRequest } from "../services/auth"; import { signInRequest } from "../services/auth";
import { api } from "../services/api"; import { api } from "../services/api";
@ -21,6 +21,7 @@ type AuthContextType = {
isAuthenticated: boolean; isAuthenticated: boolean;
user: UserType; user: UserType;
signIn: (data: SignInData) => Promise<void>; signIn: (data: SignInData) => Promise<void>;
signOut: any;
} }
export const AuthContext = createContext({} as AuthContextType) export const AuthContext = createContext({} as AuthContextType)
@ -60,12 +61,19 @@ export function AuthProvider({children}: {children: React.ReactNode}) {
} }
return; return;
} else { } else {
return return exception
} }
} }
function signOut() {
destroyCookie(null, 'user-name')
destroyCookie(null, 'user-role')
destroyCookie(null, 'user-id')
destroyCookie(null, '@smartAuth-token')
}
return ( return (
<AuthContext.Provider value={{ user, isAuthenticated, signIn }}> <AuthContext.Provider value={{ user, isAuthenticated, signIn, signOut }}>
{children} {children}
</AuthContext.Provider> </AuthContext.Provider>
) )

View File

@ -16,10 +16,10 @@ export default function AccumulatedSavings({graphData, years, userName}: any) {
return ( return (
<AccumulatedSavingsView> <AccumulatedSavingsView>
<Head> <Head>
<title>Smart Energia - Economia Acumulada</title> <title>Smart Energia - Economia Bruta Mensal</title>
</Head> </Head>
<Header name={userName} /> <Header name={userName} />
<PageTitle title='Economia Acumulada' subtitle='Economia Bruta Estimada e Acumulada anual (Valores em R$ mil)' /> <PageTitle title='Economia Bruta Mensal' subtitle='Economia Bruta Estimada e Acumulada mensal (Valores em R$ mil)' />
<section> <section>
<SingleBar title='Economia Bruta Estimada e Acumulada' subtitle='(Valores em R$ mil)' dataset='Consolidada' <SingleBar title='Economia Bruta Estimada e Acumulada' subtitle='(Valores em R$ mil)' dataset='Consolidada'
dataset1='Estimada' dataProps={graphData} dataset1='Estimada' dataProps={graphData}
@ -34,7 +34,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
const { ['@smartAuth-token']: token } = parseCookies(ctx) const { ['@smartAuth-token']: token } = parseCookies(ctx)
const { ['user-name']: userName } = parseCookies(ctx) const { ['user-name']: userName } = parseCookies(ctx)
let graphData = []; let graphData = [];
await apiClient.post('/economy/grossMonthly').then(res => { await apiClient.post('/economy/grossMonthly').then(res => {

View File

@ -1,64 +0,0 @@
import TextField from '@mui/material/TextField';
import Head from 'next/head'
import Image from 'next/image'
import React from 'react'
import AdministrativeHeader from '../../../components/administrativeHeader/AdministrativeHeader';
import Banner from '../../../components/banner/Banner'
import Header from '../../../components/header/Header'
import { AboutUsView } from '../../../styles/layouts/aboutUs/AboutUsView'
export default function aboutUs() {
return (
<AboutUsView>
<Head>
<title>Smart Energia - About Us</title>
</Head>
<AdministrativeHeader />
<Banner title='Quem Somos' subtitle='Soluções inteligentes em Gestão de Energia' imgSource='/assets/banners/aboutUsBanner.png' />
<div>
<h4>atualizar texto</h4>
<TextField
id="outlined-textarea"
label="Sobre nós"
placeholder="Placeholder"
multiline
fullWidth
/>
</div>
<section>
<p>A <strong>SMART ENERGIA</strong> é uma consultoria independente especializada em Gestão de Energia Elétrica, consolidada como uma das três maiores consultorias do Brasil.
Devido à grande experiência em operações na CCEE Câmara de Comercialização de Energia Elétrica e ANEEL, entrega resultados que superam as expectativas.</p>
<p>Nasceu para gerenciar a compra de energia com inovação, transparência e imparcialidade sendo o elo forte e necessário entre os Consumidores e os
Vendedores de energia. </p>
<p>Baseada em sua experiência no setor elétrico adquirida desde 2001 e em mais de 900 unidades migradas, atua na negociação de contratos de compra e venda de
energia, na Gestão de Energia no Mercado Livre e criação de produtos diferenciados para atender as necessidades específicas dos consumidores.</p>
<p>Apoiada pela sólida experiência de seus gestores, conhecendo as premissas dos agentes de Comercialização e Geração para a compra e venda de energia,
aplicamos as mesmas premissas a favor dos Consumidores, disponibilizando assim um diferencial único para a tomada de decisão e elaboração das estratégias de
contratação de energia.</p>
<ul>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Informação'}</li>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Economia'}</li>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Gestão de Energia'}</li>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Imparcialidade'}</li>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Previsão de Custos'}</li>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Experiência'}</li>
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Relacionamento'}</li>
</ul>
<article>
<aside>
<h2>Apoio a projetos sociais</h2>
<div>
<Image src='/assets/stamps/whiteStamp.png' width={200} height={200} />
<Image src='/assets/stamps/blueStamp.png' width={200} height={200} />
</div>
</aside>
</article>
</section>
</AboutUsView>
)
}

View File

@ -1,5 +1,4 @@
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Modal from '@mui/material/Modal'; import Modal from '@mui/material/Modal';
import TextField from '@mui/material/TextField'; import TextField from '@mui/material/TextField';
import Typography from '@mui/material/Typography'; import Typography from '@mui/material/Typography';
@ -12,7 +11,7 @@ import BasicButton from '../../../components/buttons/basicButton/BasicButton'
import FaqButton1 from '../../../components/buttons/faqButton/FaqButton1'; import FaqButton1 from '../../../components/buttons/faqButton/FaqButton1';
import FaqButton2 from '../../../components/buttons/faqButton/FaqButton2'; import FaqButton2 from '../../../components/buttons/faqButton/FaqButton2';
import Header from '../../../components/header/Header' import Header from '../../../components/header/Header'
import InputUpload from '../../../components/inputUplaod/inputUpload'; import InputUploadImg from '../../../components/inputUploadImg/inputUpload';
import { ClientsView } from '../../../styles/layouts/clients/ClientsView'; import { ClientsView } from '../../../styles/layouts/clients/ClientsView';
import PageTitle from '../../../components/pageTitle/PageTitle'; import PageTitle from '../../../components/pageTitle/PageTitle';
import ConfirmModal from '../../../components/modal/ConfirmModal'; import ConfirmModal from '../../../components/modal/ConfirmModal';
@ -22,6 +21,8 @@ import { parseCookies } from 'nookies';
import { GetServerSideProps } from 'next'; import { GetServerSideProps } from 'next';
import getAPIClient from '../../../services/ssrApi'; import getAPIClient from '../../../services/ssrApi';
import FormData from 'form-data';
const style = { const style = {
position: 'absolute' as const, position: 'absolute' as const,
top: '50%', top: '50%',
@ -44,6 +45,8 @@ const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
}); });
export default function clients({clients, userName}) { export default function clients({clients, userName}) {
const formData = new FormData();
const [client, setClient] = useState<any>({ const [client, setClient] = useState<any>({
name: String, name: String,
email: String, email: String,
@ -51,6 +54,7 @@ export default function clients({clients, userName}) {
password_confirmation: String, password_confirmation: String,
client_id: Number client_id: Number
}) })
const [logo, setLogo] = useState(false);
const [selectedClients, setSelectedClients] = useState([]) const [selectedClients, setSelectedClients] = useState([])
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@ -60,7 +64,6 @@ export default function clients({clients, userName}) {
const [openModal, setOpenModal] = useState(false) const [openModal, setOpenModal] = useState(false)
//
const [openSnackSuccess, setOpenSnackSuccess] = useState<boolean>(false); const [openSnackSuccess, setOpenSnackSuccess] = useState<boolean>(false);
const [openSnackError, setOpenSnackError] = useState<boolean>(false); const [openSnackError, setOpenSnackError] = useState<boolean>(false);
const [openSnackSuccessDelete, setOpenSnackSuccessDelete] = useState<boolean>(false); const [openSnackSuccessDelete, setOpenSnackSuccessDelete] = useState<boolean>(false);
@ -83,16 +86,20 @@ export default function clients({clients, userName}) {
setOpenSnackErrorDelete(false); setOpenSnackErrorDelete(false);
setOpenSnackSuccessDelete(false); setOpenSnackSuccessDelete(false);
}; };
//
function onChange(e) {
setLogo(e.target.files[0])
}
function handleCreateClient({name, email, password, password_confirmation, client_id}) { function handleCreateClient({name, email, password, password_confirmation, client_id}) {
api.post('/user', { formData.append('name', name)
name, formData.append('email', email)
email, formData.append('password', password)
password, formData.append('password_confirmation', password_confirmation)
password_confirmation, formData.append('client_id', client_id)
client_id formData.append('profile_picture', logo)
}).then(res => {
api.post('/user', formData).then(res => {
setOpenSnackSuccess(true) setOpenSnackSuccess(true)
setOpenModalInativar(false) setOpenModalInativar(false)
window.location.reload() window.location.reload()
@ -114,28 +121,28 @@ export default function clients({clients, userName}) {
<div style={{display: 'flex', flexDirection: 'column', width: '100%'}}> <div style={{display: 'flex', flexDirection: 'column', width: '100%'}}>
<Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}> <Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}>
<Alert onClose={handleCloseSnack} severity="success" sx={{ width: '100%' }}> <Alert onClose={handleCloseSnack} severity="success" sx={{ width: '100%' }}>
Usuario cadastrada com sucesso! Cliente cadastrada com Sucesso!
</Alert> </Alert>
</Snackbar> </Snackbar>
<Snackbar open={openSnackError} autoHideDuration={4000} onClose={handleCloseSnack}> <Snackbar open={openSnackError} autoHideDuration={4000} onClose={handleCloseSnack}>
<Alert onClose={handleCloseSnack} severity="error" sx={{ width: '100%' }}> <Alert onClose={handleCloseSnack} severity="error" sx={{ width: '100%' }}>
Usuario não cadastrada! Cliente não cadastrado!
</Alert> </Alert>
</Snackbar> </Snackbar>
<Snackbar open={openSnackSuccessDelete} autoHideDuration={4000} onClose={handleCloseSnackDelete}> <Snackbar open={openSnackSuccessDelete} autoHideDuration={4000} onClose={handleCloseSnackDelete}>
<Alert onClose={handleCloseSnackDelete} severity="success" sx={{ width: '100%' }}> <Alert onClose={handleCloseSnackDelete} severity="success" sx={{ width: '100%' }}>
Usuario excluida com sucesso! Cliente excluido com sucesso!
</Alert> </Alert>
</Snackbar> </Snackbar>
<Snackbar open={openSnackErrorDelete} autoHideDuration={4000} onClose={handleCloseSnackDelete}> <Snackbar open={openSnackErrorDelete} autoHideDuration={4000} onClose={handleCloseSnackDelete}>
<Alert onClose={handleCloseSnackDelete} severity="error" sx={{ width: '100%' }}> <Alert onClose={handleCloseSnackDelete} severity="error" sx={{ width: '100%' }}>
Usuario não excluida! Cliente não excluido!
</Alert> </Alert>
</Snackbar> </Snackbar>
<ClientsView> <ClientsView>
<Header name={userName} /> <Header name={userName} admin/>
<PageTitle title='Clientes' subtitle='Clientes Smart Energia'/> <PageTitle title='Clientes' subtitle='Clientes Smart Energia'/>
<div className='buttons'> <div className='buttons'>
<button className='btn2' onClick={handleOpen}>Adicionar</button> <button className='btn2' onClick={handleOpen}>Adicionar</button>
@ -189,17 +196,19 @@ export default function clients({clients, userName}) {
client_id: value.target.value client_id: value.target.value
}) })
}} variant="outlined" /> }} variant="outlined" />
<InputUpload /> <input type="file" onChange={onChange}/>
{/* <InputUpload /> */}
<br /><br /> <br /><br />
<FaqButton1 title='Cancelar' onClick={() => console.log()} /> <FaqButton1 title='Cancelar' onClick={() => setOpen(false)} />
<FaqButton2 title='Salvar' onClick={() => handleCreateClient(client)}/> <FaqButton2 title='Salvar' onClick={() => handleCreateClient(client)}/>
</Box> </Box>
</Modal> </Modal>
<ConfirmModal open={openModalInativar} handleIsClose={(value) => {setOpenModalInativar(value)}}> <ConfirmModal open={openModalInativar} handleIsClose={(value) => {setOpenModalInativar(value)}}>
<PageTitle title='Excluir Cliente' subtitle='deseja realmente excluir os clientes selecionadas?'/> <PageTitle title='Inativar Cliente(s)' subtitle='deseja realmente inativar os clientes selecionadas?'/>
<ConfirmModalView> <ConfirmModalView>
<BasicButton title='Confirmar' onClick={() => handleDeleteClient(selectedClients)}/> <BasicButton title='Confirmar' onClick={() => handleDeleteClient(selectedClients)}/>
<BasicButton title='Cancelar' onClick={() => setOpenModalInativar(true)}/> <BasicButton title='Cancelar' onClick={() => setOpenModalInativar(false)}/>
</ConfirmModalView> </ConfirmModalView>
</ConfirmModal> </ConfirmModal>
</div> </div>
@ -210,7 +219,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
const apiClient = getAPIClient(ctx) const apiClient = getAPIClient(ctx)
const { ['@smartAuth-token']: token } = parseCookies(ctx) const { ['@smartAuth-token']: token } = parseCookies(ctx)
const { ['user-name']: userName } = parseCookies(ctx) const { ['user-name']: userName } = parseCookies(ctx)
let clients = []; let clients = [];
await apiClient.get('/user').then(res => { await apiClient.get('/user').then(res => {

View File

@ -115,7 +115,7 @@ export default function Sidebar({faqData, userName} : any ) {
return ( return (
<> <>
<FaqView> <FaqView>
<Header name={userName}/> <Header name={userName} admin/>
<PageTitle title='Perguntas Frequentes' subtitle='Perguntas Frequentes'/> <PageTitle title='Perguntas Frequentes' subtitle='Perguntas Frequentes'/>
@ -145,7 +145,6 @@ export default function Sidebar({faqData, userName} : any ) {
<button className='btn2' value="Refresh Page"onClick={handleOpen} >Adicionar</button> <button className='btn2' value="Refresh Page"onClick={handleOpen} >Adicionar</button>
<button className='btn1' onClick={() => setOpenModalInativar(true)}>Inativar</button> <button className='btn1' onClick={() => setOpenModalInativar(true)}>Inativar</button>
</div> </div>
<Modal <Modal
open={open} open={open}
@ -164,12 +163,8 @@ export default function Sidebar({faqData, userName} : any ) {
<TextField id="outlined-basic" label="Resposta" onChange={value=>setFaq({...faq, answer:value.target.value})} sx={{width:710, ml:8}} variant="outlined" /> <TextField id="outlined-basic" label="Resposta" onChange={value=>setFaq({...faq, answer:value.target.value})} sx={{width:710, ml:8}} variant="outlined" />
<br /><br /> <br /><br />
<FaqButton1 title='Cancelar' onClick={function (): void { <FaqButton1 title='Cancelar' onClick={() => setOpen(false)} />
throw new Error('Function not implemented.'); <FaqButton2 title='Salvar' onClick={() => handleRegisterNewFaq(faq)}/>
} } />
<FaqButton2 title='Salvar' onClick={() => handleRegisterNewFaq(faq)}
/>
</Box> </Box>
</Modal> </Modal>

View File

@ -28,23 +28,9 @@ export default function index({userName}: any) {
return ( return (
<GeneralView> <GeneralView>
<Header name={userName}/> <Header name={userName} admin/>
<PageTitle title='Sobre nós' subtitle='alterar texto de sobre nós'/> <PageTitle title='Sobre nós' subtitle='Alterar texto de sobre nós'/>
<section> <br />
<FormControl sx={{mr: '20px', minWidth: 180, minHeight: '80px'}}>
<Select
value={text}
onChange={handleChange}
displayEmpty
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem value={0}>Sobre Nós</MenuItem>
<MenuItem value={10}>Copel</MenuItem>
<MenuItem value={20}>Cliente 1</MenuItem>
<MenuItem value={30}>Cliente 2</MenuItem>
</Select>
</FormControl>
</section>
<Editor <Editor
onInit={(evt, editor) => editorRef.current = editor} onInit={(evt, editor) => editorRef.current = editor}
initialValue=' <p>A <strong>SMART ENERGIA</strong> é uma consultoria independente especializada em Gestão de Energia Elétrica, consolidada como uma das três maiores consultorias do Brasil. initialValue=' <p>A <strong>SMART ENERGIA</strong> é uma consultoria independente especializada em Gestão de Energia Elétrica, consolidada como uma das três maiores consultorias do Brasil.
@ -84,7 +70,6 @@ export default function index({userName}: any) {
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }' content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
}} }}
/> />
<button onClick={log}>Log editor content</button>
</GeneralView> </GeneralView>
) )
} }

View File

@ -0,0 +1,48 @@
import { GetServerSideProps } from 'next'
import Head from 'next/head'
import { parseCookies } from 'nookies'
import React from 'react'
import BasicButton from '../../../components/buttons/basicButton/BasicButton'
import Header from '../../../components/header/Header'
import PageTitle from '../../../components/pageTitle/PageTitle'
import { IndustryInfoView } from '../../../styles/layouts/industryInfo/IndustryInfoView'
import InputUploadPdf from '../../../components/inputUploadPdf/inputUpload';
export default function industryInfo({userName}: any) {
return (
<IndustryInfoView>
<Head>
<title>Smart Energia - Info de Setor</title>
</Head>
<Header name={userName} />
<div className='title'>
<PageTitle title='Info Setorial' subtitle='Realize o upload da última versão de info setorial' />
<InputUploadPdf/>
</div>
<BasicButton onClick={() => console.log()} title='Atualizar'/>
</IndustryInfoView>
)
}
export const getServerSideProps: GetServerSideProps = async (ctx) => {
const { ['@smartAuth-token']: token } = parseCookies(ctx)
const { ['user-name']: userName } = parseCookies(ctx)
if (!token) {
return {
redirect: {
destination: '/',
permanent: false
}
}
}
return {
props: {
userName
}
}
}

View File

@ -41,7 +41,7 @@ const style = {
border: '2px solid #000', border: '2px solid #000',
boxShadow: 24, boxShadow: 24,
p: 4, p: 4,
overflowY: 'scroll' overflowY: 'scroll',
}; };
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert( const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
@ -122,7 +122,7 @@ export default function notification({clients, notifications, userName}: any) {
<Head> <Head>
<title>Smart Energia - Notificações</title> <title>Smart Energia - Notificações</title>
</Head> </Head>
<Header name={userName}/> <Header name={userName} admin/>
<PageTitle title='Notificações' subtitle='Notificações'/> <PageTitle title='Notificações' subtitle='Notificações'/>
<Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}> <Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}>
@ -178,7 +178,9 @@ export default function notification({clients, notifications, userName}: any) {
}} variant="outlined" /> <br /><br /> }} variant="outlined" /> <br /><br />
<div> <div>
<FormControl> <FormControl
sx={{ml:8}}
>
<RadioGroup <RadioGroup
aria-labelledby="demo-radio-buttons-group-label" aria-labelledby="demo-radio-buttons-group-label"
defaultValue="female" defaultValue="female"
@ -217,15 +219,14 @@ export default function notification({clients, notifications, userName}: any) {
{option.name} {option.name}
</li> </li>
)} )}
sx={{ml:8}}
style={{ width: 700 }} style={{ width: 700 }}
sx={{ml:8}}
renderInput={(params) => ( renderInput={(params) => (
<TextField {...params} label="Clientes" placeholder="Selecionar clientes"/> <TextField {...params} label="Clientes" placeholder="Selecionar clientes"/>
)} )}
/> : /> :
null null
} }
<FaqButton1 title='Cancelar' onClick={() => {setOpen(false)}} /> <FaqButton1 title='Cancelar' onClick={() => {setOpen(false)}} />
<FaqButton2 title='Salvar' onClick={() => { <FaqButton2 title='Salvar' onClick={() => {
handleRegisterNewNotification(notification)}} handleRegisterNewNotification(notification)}}

View File

@ -12,15 +12,28 @@ import { dataEconomiaIndicador } from '../services/economiaIndicador'
import getAPIClient from '../services/ssrApi' import getAPIClient from '../services/ssrApi'
import { CostIndicatorView } from '../styles/layouts/economy/costIndicator/CostIndicatorView' import { CostIndicatorView } from '../styles/layouts/economy/costIndicator/CostIndicatorView'
function addMissingMonths(data) {
// console.log(data[0].mes.slice(1, 1))
}
function verifyDataByYear(data) { function verifyDataByYear(data) {
if (data.length === 12) const currentYear = []
return true const currentYearAux = data.filter(value => value.mes.slice(3, 7).includes('2021'))
else console.log(currentYear.length)
return false console.log(currentYearAux.length)
currentYearAux.sort((a, b) => {
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
return 0
})
// for (let i=0; currentYear.length <= currentYearAux.length; i++) {
// console.log(i, 'dentro do for')
// // console.log(currentYearAux.length, 'tamanho aux')
// if (currentYearAux[i].mes.slice(1,2)==i) {
// currentYear.push(currentYearAux[i])
// console.log(currentYear.length, 'tamanho')
// }
// }
console.log(currentYearAux)
} }
export default function CostIndicator({graphData, userName}: any) { export default function CostIndicator({graphData, userName}: any) {
@ -34,9 +47,20 @@ export default function CostIndicator({graphData, userName}: any) {
<Header name={userName} /> <Header name={userName} />
<PageTitle title='Indicador de Custo' subtitle='Valores em R$/MWh'/> <PageTitle title='Indicador de Custo' subtitle='Valores em R$/MWh'/>
<section> <section>
<Chart title='Indicador de Custo' subtitle='(Valores em R$/MWh)' data1={graphData.filter((value, index) => value.mes.slice(3, 7).includes('2021'))} <Chart title='Indicador de Custo' subtitle='(Valores em R$/MWh)'
data1={graphData.filter((value, index) => value.mes.slice(3, 7).includes('2021')).sort((a, b) => {
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
return 0
})}
data2={graphData.filter((value, index) => value.mes.slice(3, 7).includes('2022'))} data2={graphData.filter((value, index) => value.mes.slice(3, 7).includes('2022'))}
label={['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'ago', 'set', 'out', 'nov', 'dez']} barLabel /> label={graphData.filter((value, index) => value.mes.slice(3, 7).includes('2021')).sort((a, b) => {
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
return 0
}).map(value => value.mes)} barLabel />
</section> </section>
</CostIndicatorView> </CostIndicatorView>
) )
@ -51,7 +75,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
await apiClient.post('/economy/MWh').then(res => { await apiClient.post('/economy/MWh').then(res => {
graphData = res.data.data graphData = res.data.data
console.log(graphData[0].mes)
}).catch(res => { }).catch(res => {
console.log(res) console.log(res)
}) })

View File

@ -23,7 +23,7 @@ import { parseCookies } from 'nookies'
import { GetServerSideProps } from 'next' import { GetServerSideProps } from 'next'
import getAPIClient from '../services/ssrApi' import getAPIClient from '../services/ssrApi'
export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensalGraph, grossMensalYears, acumulatedGraph, mapsInfo, userName} : any) { export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensalGraph, grossMensalYears, acumulatedGraph, mapsInfo, userName, costIndicator} : any) {
return ( return (
<DashboardView> <DashboardView>
<Head> <Head>
@ -44,14 +44,14 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal
</Link> </Link>
<section className='dashboard'> <section className='dashboard'>
<GraphCard title='Consumo' subtitle='Gráfico de Consumo'> <GraphCard title='Economia Bruta Anual' subtitle='Economia Bruta Estimada e Acumulada anual'>
<SingleBar title='Economia Bruta' subtitle='(Valores em R$ mil)' <SingleBar title='Economia Bruta' subtitle='(Valores em R$ mil)'
dataset='Consolidada' dataset1='Estimada' dataset='Consolidada' dataset1='Estimada'
dataProps={grossAnualGraph} dataProps={grossAnualGraph}
label={grossAnualYears} barLabel year/> label={grossAnualYears} barLabel year/>
</GraphCard> </GraphCard>
<GraphCard title='Economia Acumulado' subtitle='Economia Acumulada' singleBar> <GraphCard title='Economia Bruta Mensal' subtitle='Economia Bruta Estimada e Acumulada mensal' singleBar>
<SingleBar title='Economia Bruta Estimada e Acumulada' subtitle='(Valores em R$)' <SingleBar title='Economia Bruta Estimada e Acumulada' subtitle='(Valores em R$)'
dataset='Acumulada' dataset1='Estimado' dataset='Acumulada' dataset1='Estimado'
dataProps={grossMensalGraph} dataProps={grossMensalGraph}
@ -59,15 +59,27 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal
barLabel month/> barLabel month/>
</GraphCard> </GraphCard>
<GraphCard title='Custos Estimados' subtitle='Custos Estimados em R$/MWh' singleBar> <GraphCard title='Cativo x Livre mensal' subtitle='Comparativo de Custo Estimado' singleBar>
<LineBarChart2 data1={acumulatedGraph} data2={acumulatedGraph} data3={acumulatedGraph} <LineBarChart2 data1={acumulatedGraph} data2={acumulatedGraph} data3={acumulatedGraph}
label={ConsumoEstimado.label} dataset1='Custo' dataset2='Cativo' dataset3='Livre' label={ConsumoEstimado.label} dataset1='Custo' dataset2='Cativo' dataset3='Livre'
title='Custo Estimado' subtitle='(Valores em R$/MWh)' barLabel hashurado/> title='Custo Estimado' subtitle='(Valores em R$/MWh)' barLabel hashurado/>
</GraphCard> </GraphCard>
<GraphCard title='Indicador de Custo' subtitle='Valores em R$/ MWh'> <GraphCard title='Indicador de Custo' subtitle='Valores em R$/ MWh'>
<Chart title='Indicador de Custo' subtitle='(Valores em R$/MWh)' data1={dataEconomiaIndicador.data1} data2={dataEconomiaIndicador.data2} <Chart title='Indicador de Custo' subtitle='(Valores em R$/MWh)'
label={dataEconomiaIndicador.labels} barLabel/> data1={costIndicator.filter((value, index) => value.mes.slice(3, 7).includes('2021')).sort((a, b) => {
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
return 0
})}
data2={costIndicator.filter((value, index) => value.mes.slice(3, 7).includes('2022'))}
label={costIndicator.filter((value, index) => value.mes.slice(3, 7).includes('2021')).sort((a, b) => {
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
return 0
}).map(value => value.mes)} barLabel />
</GraphCard> </GraphCard>
</section> </section>
@ -86,6 +98,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
let grossAnualGraph = []; let grossAnualGraph = [];
let grossMensalGraph = []; let grossMensalGraph = [];
let acumulatedGraph = []; let acumulatedGraph = [];
let costIndicator = []
let mapsInfo = []; let mapsInfo = [];
await apiClient.post('/economy/grossAnnual').then(res => { await apiClient.post('/economy/grossAnnual').then(res => {
@ -106,6 +119,12 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
console.log(res) console.log(res)
}) })
await apiClient.post('/economy/MWh').then(res => {
costIndicator = res.data.data
}).catch(res => {
console.log(res)
})
await apiClient.post('/pld/overview').then(res => { await apiClient.post('/pld/overview').then(res => {
mapsInfo = res.data.data mapsInfo = res.data.data
}).catch(res => { }).catch(res => {
@ -131,6 +150,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
grossMensalYears, grossMensalYears,
grossMensalGraph, grossMensalGraph,
acumulatedGraph, acumulatedGraph,
costIndicator,
mapsInfo, mapsInfo,
userName userName

View File

@ -23,7 +23,7 @@ export default function EstimatedCost({graphData, userName}: any) {
<section> <section>
<LineBarChart2 data1={graphData} data2={graphData} data3={graphData} <LineBarChart2 data1={graphData} data2={graphData} data3={graphData}
dataset1="Economia (R$)" dataset2='Cativo' dataset3='Livre' dataset1="Economia (R$)" dataset2='Cativo' dataset3='Livre'
label={ConsumoEstimado.label} title='Custo Estimado' subtitle='' barLabel hashurado /> label={ConsumoEstimado.label} title='Cativo x Livre mensal' subtitle='' barLabel hashurado />
</section> </section>
</EstimatedCostView> </EstimatedCostView>
) )

View File

@ -23,7 +23,6 @@ function verifyDataByYear(data) {
return false return false
} }
export default function GrossSavings({graphData, years, userName}: any) { export default function GrossSavings({graphData, years, userName}: any) {
return ( return (
<GrossSavingsView> <GrossSavingsView>
@ -31,7 +30,7 @@ export default function GrossSavings({graphData, years, userName}: any) {
<title>Smart Energia - Economia Acumulada</title> <title>Smart Energia - Economia Acumulada</title>
</Head> </Head>
<Header name={userName} /> <Header name={userName} />
<PageTitle title='Economia Bruta' subtitle='Economia Bruta Estimada e Acumulada anual (Valores em R$ mil)' /> <PageTitle title='Economia Bruta Anual' subtitle='Economia Bruta Estimada e Acumulada anual (Valores em R$ mil)' />
<section> <section>
<SingleBar title='Economia Bruta' subtitle='(Valores em R$ mil)' <SingleBar title='Economia Bruta' subtitle='(Valores em R$ mil)'
dataset='Consolidada' dataset1='Estimada' dataset='Consolidada' dataset1='Estimada'
@ -43,6 +42,7 @@ export default function GrossSavings({graphData, years, userName}: any) {
</GrossSavingsView> </GrossSavingsView>
) )
} }
export const getServerSideProps: GetServerSideProps = async (ctx) => { export const getServerSideProps: GetServerSideProps = async (ctx) => {
const apiClient = getAPIClient(ctx) const apiClient = getAPIClient(ctx)
const { ['@smartAuth-token']: token } = parseCookies(ctx) const { ['@smartAuth-token']: token } = parseCookies(ctx)

View File

@ -8,23 +8,39 @@ import Head from 'next/head';
import Image from 'next/image'; import Image from 'next/image';
import Link from 'next/link'; import Link from 'next/link';
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import React, { useContext, useState } from 'react' import React, { useContext, useState, useEffect,useCallback } from 'react'
import { AiOutlineEye, AiOutlineEyeInvisible } from 'react-icons/ai'; import { AiOutlineEye, AiOutlineEyeInvisible } from 'react-icons/ai';
import RenderIf from '../utils/renderIf';
import Snackbar from '@mui/material/Snackbar';
import LoginButton from '../components/buttons/loginButton/LoginButton'; import LoginButton from '../components/buttons/loginButton/LoginButton';
import { AuthContext } from '../contexts/AuthContext'; import { AuthContext } from '../contexts/AuthContext';
import { api } from '../services/api'; import { api } from '../services/api';
import { LoginContainer, LoginView } from '../styles/layouts/login/LoginView'; import { LoginContainer, LoginView } from '../styles/layouts/login/LoginView';
import Dashboard from './dashboard'; import Dashboard from './dashboard';
import MuiAlert, { AlertProps } from '@mui/material/Alert';
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
props,
ref,
) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />;
});
export default function Home() { export default function Home() {
const [openSnackSuccess, setOpenSnackSuccess] = useState<boolean>(false);
const [openSnackError, setOpenSnackError] = useState<boolean>(false);
const [openSnackSuccessDelete, setOpenSnackSuccessDelete] = useState<boolean>(false);
const [openSnackErrorDelete, setOpenSnackErrorDelete] = useState<boolean>(false);
const [state, setstate] = useState(false); const [state, setstate] = useState(false);
const [values, setValues] = useState({ const [values, setValues] = useState({
password: '',
password: null,
showPassword: false, showPassword: false,
}); });
const [email, setEmail] = useState<string>() const [email, setEmail] = useState<string>("")
const [password, setPassword] = useState<string>() const [password, setPassword] = useState<string>()
const router = useRouter() const router = useRouter()
@ -42,6 +58,7 @@ export default function Home() {
}); });
}; };
const handleMouseDownPassword = (event) => { const handleMouseDownPassword = (event) => {
event.preventDefault(); event.preventDefault();
}; };
@ -49,24 +66,76 @@ export default function Home() {
const { signIn } = useContext(AuthContext) const { signIn } = useContext(AuthContext)
async function handleSignIn() { async function handleSignIn() {
await signIn({email, password}) if (email === "" || password === ""){
setOpenSnackError(true)
}else{
try {
await signIn({email, password}).then((res: any) => {
if (res.response.status === 422) {
setOpenSnackError(true)
}
})
} catch (exception){
console.log(exception)
}
}
} }
const handleCloseSnack = (event?: React.SyntheticEvent | Event, reason?: string) => {
if (reason === 'clickaway') {
return;
}
setOpenSnackError(false);
setOpenSnackSuccess(false);
};
useEffect(() => {
setValues({
password: null,
showPassword: false,
});
setEmail("")
}, [rota])
return ( return (
<LoginView auth={rota} > <LoginView auth={rota}>
<Head> <Head>
<title>Smart Energia</title> <title>Smart Energia</title>
</Head> </Head>
<Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}>
<Alert onClose={handleCloseSnack} severity="success" sx={{ width: '100%' }}>
notificação cadastrada com sucesso!
</Alert>
</Snackbar>
<Snackbar open={openSnackError} autoHideDuration={4000} onClose={handleCloseSnack}>
<Alert onClose={handleCloseSnack} severity="error" sx={{ width: '100%' }}>
Prencha os Campos corretamente!
</Alert>
</Snackbar>
{/* <Snackbar open={openSnackSuccessDelete} autoHideDuration={4000} onClose={handleCloseSnackDelete}>
<Alert onClose={handleCloseSnackDelete} severity="success" sx={{ width: '100%' }}>
notificação excluida com sucesso!
</Alert>
</Snackbar> */}
{/* <Snackbar open={openSnackErrorDelete} autoHideDuration={4000} onClose={handleCloseSnackDelete}>
<Alert onClose={handleCloseSnackDelete} severity="error" sx={{ width: '100%' }}>
Notificação não excluida!
</Alert>
</Snackbar> */}
<div> <div>
<Image src='/assets/marca1.svg' width={520} height={350} /> <Image src='/assets/marca1.png' width={500} height={340} />
</div> </div>
<LoginContainer> <LoginContainer>
<h1>Bem-Vindo</h1> <h1>Bem-Vindo</h1>
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2> <h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }} label="Login" variant="outlined" onChange={value => {
<TextField id="outlined-basic"
sx={{ m: 1, width: '90%' }} label="Login" value={email} variant="outlined"
onChange={value => {
setEmail(value.target.value) setEmail(value.target.value)
}}/> }}/>
<FormControl sx={{ m: 1, width: '90%' }} variant="outlined"> <FormControl sx={{ m: 1, width: '90%' }} variant="outlined">

View File

@ -15,7 +15,7 @@ export default function industryInfo({userName}: any) {
</Head> </Head>
<Header name={userName} /> <Header name={userName} />
<div className='title'> <div className='title'>
<PageTitle title='Info Setorial' subtitle='info setorial' /> <PageTitle title='Info Setorial' subtitle='Clique em "Baixar PDF", para fazer download do PDF' />
</div> </div>
<button>Baixar PDF</button> <button>Baixar PDF</button>
</IndustryInfoView> </IndustryInfoView>

View File

@ -26,9 +26,10 @@ interface pldInterface {
graphByHourData: any, graphByHourData: any,
graphByMonthData: any graphByMonthData: any
userName: string, userName: string,
clientMonth: any
} }
export default function pld({tableData, graphByHourData, graphByMonthData, userName}: pldInterface) { export default function pld({tableData, graphByHourData, graphByMonthData, userName, clientMonth}: pldInterface) {
const router = useRouter() const router = useRouter()
const { region } = router.query const { region } = router.query
@ -115,26 +116,23 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
}).catch(exception => console.log(exception)) }).catch(exception => console.log(exception))
} }
function handleColorNorte(value, region) {
if (value <= tableData.result[1].norte_min)
return 'green'
else if (value >= tableData.result[0][`${region}_max`])
return 'red'
else if (tableData.result[0][`${region}_max`] - value > tableData.result[0][`${region}_max`]/2)
return 'dullGreen'
else if (tableData.result[1][`${region}_min`] - value <= tableData.result[1][`${region}_min`])
return 'dullRed'
}
useEffect(() => { useEffect(() => {
getDataByHour() getDataByHour()
getDataByDay() getDataByDay()
console.log(dataByDay) console.log(dataByDay)
}, [date, day, select]) }, [date, day, select])
function handleCellColor(minimo, mi, ma, maximo) {
if (minimo - mi >= 100 && minimo - mi < 200) {
return 'green'
} else if ( mi*2 >= 200 && mi*2 < 250 ) {
return'dullGreen'
} else if ( (ma-mi)/2 >=250 && (ma-mi)/2 < 300 ) {
return 'white'
} else if ( ma/2 >= 300 && ma/2 < 600 ) {
return 'dullRed'
} else if ( maximo-ma > 600 ) {
return 'red'
}
}
return ( return (
<main style={{ <main style={{
width: '100%', width: '100%',
@ -159,39 +157,53 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
</thead> </thead>
<tbody> <tbody>
{ {
tableData.map(data => { tableData.data.map(data => {
return <> return <>
<tr> <tr>
<td className='tg-gceh'>{data.year_month_formatted}</td> <td className='tg-gceh'>{data.year_month_formatted}</td>
<td className='tg-uulg red'>{data.nordeste}</td> <td className={`tg-uulg ${handleColorNorte(parseFloat(data.norte), 'nordeste')}`}>{parseFloat(data.nordeste).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh dullRed'>{data.norte}</td> <td className={`tg-gceh ${handleColorNorte(parseFloat(data.norte), 'norte')}`}>{parseFloat(data.norte).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh dullGreen'>{data.sudeste}</td> <td className={`tg-gceh ${handleColorNorte(parseFloat(data.norte), 'sudeste')}`}>{parseFloat(data.sudeste).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-uulg red'>{data.sul}</td> <td className={`tg-uulg ${handleColorNorte(parseFloat(data.norte), 'sul')}`}>{parseFloat(data.sul).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
</tr> </tr>
</> </>
}) })
} }
<tr> {
<td className='tg-gceh'>Mín</td> tableData.result.map((data, index) => {
<td className='tg-uulg'>xxxx</td> if (index === 0) {
<td className='tg-gceh'>xxxx</td> return <>
<td className='tg-gceh'>xxxx</td>
<td className='tg-uulg'>xxxx</td>
</tr>
<tr> <tr>
<td className='tg-gceh'>Max</td> <td className='tg-gceh'>Max</td>
<td className='tg-uulg'>xxxx</td> <td className='tg-uulg'>{parseFloat(data.nordeste_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh'>xxxx</td> <td className='tg-gceh'>{parseFloat(data.norte_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh'>xxxx</td> <td className='tg-gceh'>{parseFloat(data.sudeste_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-uulg'>xxxx</td> <td className='tg-uulg'>{parseFloat(data.sul_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
</tr> </tr>
</>
} else if (index===1) {
return <>
<tr> <tr>
<td className='tg-gceh'>Desv Pad</td> <td className='tg-gceh'>Min</td>
<td className='tg-uulg'>xxxx</td> <td className='tg-uulg'>{parseFloat(data.nordeste_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh'>xxxx</td> <td className='tg-gceh'>{parseFloat(data.norte_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh'>xxxx</td> <td className='tg-gceh'>{parseFloat(data.sudeste_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-uulg'>xxxx</td> <td className='tg-uulg'>{parseFloat(data.sul_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
</tr> </tr>
</>
} else if (index===2) {
return <>
<tr>
<td className='tg-gceh'>Desv. Padrão</td>
<td className='tg-uulg'>{parseFloat(data.nordeste_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh'>{parseFloat(data.norte_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-gceh'>{parseFloat(data.sudeste_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td className='tg-uulg'>{parseFloat(data.sul_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
</tr>
</>
}
})
}
</tbody> </tbody>
</table> </table>
<section> <section>
@ -235,7 +247,7 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
width: '22%', width: '22%',
ml: 1 ml: 1
}}> }}>
<InputLabel id="demo-simple-select-label">Dia</InputLabel> <InputLabel id="demo-simple-select-label">Mês</InputLabel>
<Select <Select
value={day} value={day}
onChange={handleChangeDay} onChange={handleChangeDay}
@ -244,36 +256,17 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
label="Age" label="Age"
> >
<MenuItem value={'01'}>01</MenuItem> <MenuItem value={'0'}>Nenhum</MenuItem>
<MenuItem value={'02'}>02</MenuItem> {
<MenuItem value={'03'}>03</MenuItem> clientMonth.sort((a, b) => {
<MenuItem value={'04'}>04</MenuItem> if (parseFloat(a.mes_ref.slice(3,4)) > parseFloat(b.mes_ref.slice(3,4))) return 1
<MenuItem value={'05'}>05</MenuItem> if (parseFloat(a.mes_ref.slice(3,4)) < parseFloat(b.mes_ref.slice(3,4))) return -1
<MenuItem value={'06'}>06</MenuItem>
<MenuItem value={'07'}>07</MenuItem> return 0
<MenuItem value={'08'}>08</MenuItem> }).map((data, index) => {
<MenuItem value={'09'}>09</MenuItem> return <MenuItem key={index} value={data.mes_ref.slice(2, 4)}>{data.mes_ref.slice(2, 4)}</MenuItem>
<MenuItem value={'10'}>10</MenuItem> })
<MenuItem value={'11'}>11</MenuItem> }
<MenuItem value={'12'}>12</MenuItem>
<MenuItem value={'13'}>13</MenuItem>
<MenuItem value={'14'}>14</MenuItem>
<MenuItem value={'15'}>15</MenuItem>
<MenuItem value={'16'}>16</MenuItem>
<MenuItem value={'17'}>17</MenuItem>
<MenuItem value={'18'}>18</MenuItem>
<MenuItem value={'19'}>19</MenuItem>
<MenuItem value={'20'}>20</MenuItem>
<MenuItem value={'21'}>21</MenuItem>
<MenuItem value={'22'}>22</MenuItem>
<MenuItem value={'23'}>23</MenuItem>
<MenuItem value={'24'}>24</MenuItem>
<MenuItem value={'25'}>25</MenuItem>
<MenuItem value={'26'}>26</MenuItem>
<MenuItem value={'27'}>27</MenuItem>
<MenuItem value={'28'}>28</MenuItem>
<MenuItem value={'29'}>29</MenuItem>
<MenuItem value={'30'}>30</MenuItem>
</Select> </Select>
</FormControl> </FormControl>
</section> </section>
@ -295,7 +288,7 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
</section> </section>
<LineChart data1={nordeste} data2={norte} data3={sudeste} data4={sul} <LineChart data1={nordeste} data2={norte} data3={sudeste} data4={sul}
dataset1='NORDESTE' dataset2='NORTE' dataset3='SUDESTE' dataset4='SUL' dataset1='NORDESTE' dataset2='NORTE' dataset3='SUDESTE' dataset4='SUL'
title={`PLD - ${date}`} title={`Período - ${date}`}
subtitle='' label={['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24']} /> subtitle='' label={['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24']} />
</PldGraphView> </PldGraphView>
</RenderIf> </RenderIf>
@ -308,11 +301,21 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
const { ['@smartAuth-token']: token } = parseCookies(ctx) const { ['@smartAuth-token']: token } = parseCookies(ctx)
const { ['user-name']: userName } = parseCookies(ctx) const { ['user-name']: userName } = parseCookies(ctx)
let tableData = []; let tableData = [];
let clientMonth = [];
await apiClient.post('/pld/list').then(res => { await apiClient.post('/pld/list').then(res => {
tableData = res.data.data tableData = res.data
}).catch(res => {
console.log(res)
})
await apiClient.post('/pld', {
"filters": [],
"fields": ["mes_ref"],
"distinct": true
}).then(res => {
clientMonth = res.data.data
}).catch(res => { }).catch(res => {
console.log(res) console.log(res)
}) })
@ -329,7 +332,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
return { return {
props: { props: {
tableData, tableData,
userName userName,
clientMonth
} }
} }
} }

View File

@ -20,13 +20,15 @@ import data from '../services/dados.json'
import getAPIClient from '../services/ssrApi'; import getAPIClient from '../services/ssrApi';
import { Pagination, TableView } from '../styles/layouts/ResumoOperacao/ResumoOperacaoView'; import { Pagination, TableView } from '../styles/layouts/ResumoOperacao/ResumoOperacaoView';
export default function ResumoOperacao({tableData, userName}: any) { export default function ResumoOperacao({tableData, clientsData, userName, clientMonth}: any) {
const csvData = tableData; const csvData = tableData;
const [month, setMonth] = useState(''); const [month, setMonth] = useState('');
const [unidade, setUnidade] = useState(''); const [unidade, setUnidade] = useState('');
const [tableDataState, setTableDataState] = useState<any>([]); const [tableDataState, setTableDataState] = useState<any>([]);
const monthLabels = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'ago', 'set', 'out', 'nov', 'dez']
const handleChangeMonth = (event: SelectChangeEvent) => { const handleChangeMonth = (event: SelectChangeEvent) => {
setMonth(event.target.value); setMonth(event.target.value);
}; };
@ -36,7 +38,7 @@ export default function ResumoOperacao({tableData, userName}: any) {
useEffect(() => { useEffect(() => {
if (unidade!=='' || month!==''){ if (unidade!=='' || month!==''){
api.post('/operation', { api.post('/operation/summary', {
"filters": [ "filters": [
{"type" : "=", "field": "mes", "value": `${month}/2022`}, {"type" : "=", "field": "mes", "value": `${month}/2022`},
{"type" : "=", "field": "dados_te.cod_smart_unidade", "value": unidade} {"type" : "=", "field": "dados_te.cod_smart_unidade", "value": unidade}
@ -49,7 +51,6 @@ export default function ResumoOperacao({tableData, userName}: any) {
} else { } else {
setTableDataState(tableData) setTableDataState(tableData)
} }
}, [month, unidade]) }, [month, unidade])
return ( return (
@ -73,7 +74,7 @@ export default function ResumoOperacao({tableData, userName}: any) {
> >
<MenuItem key={1} value={''}>Nenhum</MenuItem> <MenuItem key={1} value={''}>Nenhum</MenuItem>
{ {
tableData.map((value) => { clientsData.map((value) => {
return <MenuItem key={1} value={value.cod_smart_unidade}>{value.cod_smart_unidade}</MenuItem> return <MenuItem key={1} value={value.cod_smart_unidade}>{value.cod_smart_unidade}</MenuItem>
}) })
} }
@ -90,18 +91,11 @@ export default function ResumoOperacao({tableData, userName}: any) {
onChange={handleChangeMonth} onChange={handleChangeMonth}
> >
<MenuItem value={''}>Nenhum</MenuItem> <MenuItem value={''}>Nenhum</MenuItem>
<MenuItem value={'01'}>Janeiro</MenuItem> {
<MenuItem value={'02'}>Fevereiro</MenuItem> clientMonth.map((value) => {
<MenuItem value={'03'}>Março</MenuItem> return <MenuItem key={1} value={value.mes}>{monthLabels[parseFloat(value.mes.slice(3, 4))-1]}</MenuItem>
<MenuItem value={'04'}>Abril</MenuItem> })
<MenuItem value={'05'}>Maio</MenuItem> }
<MenuItem value={'06'}>Junho</MenuItem>
<MenuItem value={'07'}>Julho</MenuItem>
<MenuItem value={'08'}>Agosto</MenuItem>
<MenuItem value={'09'}>Setembro</MenuItem>
<MenuItem value={'10'}>Outubro</MenuItem>
<MenuItem value={'11'}>Novembro</MenuItem>
<MenuItem value={'12'}>Dezembro</MenuItem>
</Select> </Select>
</FormControl> </FormControl>
</div> </div>
@ -125,8 +119,8 @@ export default function ResumoOperacao({tableData, userName}: any) {
<td key={index} className='tg-uulg'>{value.operacao}</td> <td key={index} className='tg-uulg'>{value.operacao}</td>
<td key={index} className='tg-gceh'>{value.montante_nf}</td> <td key={index} className='tg-gceh'>{value.montante_nf}</td>
<td key={index} className='tg-gceh'>{value.contraparte}</td> <td key={index} className='tg-gceh'>{value.contraparte}</td>
<td key={index} className='tg-uulg'>{value.nf_c_icms}</td> <td key={index} className='tg-uulg'>{parseFloat(value.nf_c_icms).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
<td key={index} className='tg-gceh'>{value.preco_nf}</td> <td key={index} className='tg-gceh'>{parseFloat(value.preco_nf).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
</tr> </tr>
</> </>
}) })
@ -150,17 +144,36 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
const { ['user-name']: userName } = parseCookies(ctx) const { ['user-name']: userName } = parseCookies(ctx)
let tableData = []; let tableData = [];
let clientsData = [];
let clientMonth = [];
await apiClient.post('/operation', { await apiClient.post('/operation/summary', {
"filters": [] "filters": []
}).then(res => { }).then(res => {
console.log(res.data.data)
tableData = res.data.data tableData = res.data.data
}).catch(res => { }).catch(res => {
console.log(res) console.log(res)
}) })
console.log(tableData) await apiClient.post('/operation', {
"filters": [],
"fields": ["cod_smart_unidade"],
"distinct": true
}).then(res => {
clientsData = res.data.data
}).catch(res => {
console.log(res)
})
await apiClient.post('/operation', {
"filters": [],
"fields": ["mes"],
"distinct": true
}).then(res => {
clientMonth = res.data.data
}).catch(res => {
console.log(res)
})
if (!token) { if (!token) {
return { return {
@ -174,6 +187,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
return { return {
props: { props: {
tableData, tableData,
clientsData,
clientMonth,
userName userName
} }
} }

View File

@ -46,7 +46,7 @@ export default function VerifyEmail() {
<Head> <Head>
<title>Smart Energia - Verificar Email</title> <title>Smart Energia - Verificar Email</title>
</Head> </Head>
<Image src='/assets/marca1.svg' width={350} height={350} /> <Image style={{cursor:'pointer'}} src='/assets/marca1.png' width={500} height={340} onClick={() => router.push('/')} />
<VerifyEmailContainer> <VerifyEmailContainer>
<h1>Bem-Vindo</h1> <h1>Bem-Vindo</h1>
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2> <h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
@ -56,7 +56,9 @@ export default function VerifyEmail() {
<LoginButton title='Enviar Email' onClick={() => setSent(true)} /> <LoginButton title='Enviar Email' onClick={() => setSent(true)} />
</RenderIf> </RenderIf>
<RenderIf isTrue={sent? true : false}> <RenderIf isTrue={sent? true : false}>
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }}label="Nova Senha" variant="outlined"/>
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }}label="Codigo de verificação" variant="outlined" onChange={value => setCode(value.target.value)} /> <TextField id="outlined-basic" sx={{ m: 1, width: '90%' }}label="Codigo de verificação" variant="outlined" onChange={value => setCode(value.target.value)} />
<LoginButton title='Continuar' onClick={() => {verifyConfirmationCode()}} /> <LoginButton title='Continuar' onClick={() => {verifyConfirmationCode()}} />
<RenderIf isTrue={codeStatus===true? true : false} > <RenderIf isTrue={codeStatus===true? true : false} >

View File

@ -4,7 +4,7 @@ import styled from 'styled-components';
export const VerifyEmailView = styled.main<{auth: string}>` export const VerifyEmailView = styled.main<{auth: string}>`
display: flex; display: flex;
display: ${props => props.auth == '/verifyEmail'? null : 'none'}; display: ${props => props.auth == '/verifyEmail'? null : 'none'};
justify-content: flex-end; justify-content:center;
align-items: center; align-items: center;
width: 100%; width: 100%;

View File

@ -83,19 +83,23 @@ export const PldTableView = styled.main`
} }
.green { .green {
background-color: #00A934!important; background-color: #0F9D58!important;
color: black!important;
} }
.dullGreen { .dullGreen {
background-color: #AED094!important; background-color: #AED094!important;
color: black!important;
} }
.red { .red {
background-color: #FF5429!important; background-color: #DB4437!important;
color: black!important;
} }
.dullRed { .dullRed {
background-color: #FFAA95!important; background-color: #FFAA95!important;
color: black!important;
} }
h3{ h3{

View File

@ -771,6 +771,13 @@
dependencies: dependencies:
regenerator-runtime "^0.13.4" regenerator-runtime "^0.13.4"
"@babel/runtime@^7.15.4":
version "7.18.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4"
integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/template@^7.16.7": "@babel/template@^7.16.7":
version "7.16.7" version "7.16.7"
resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz" resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz"
@ -944,6 +951,11 @@
version "1.1.3" version "1.1.3"
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
"@hookform/resolvers@^2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.1.tgz#59121e38d8fc95d2fd1f41c9631393cd21e10b65"
integrity sha512-80lyFFcExEB7A09PFnl8k7A3obQyDF6MyO/FThtwetk+MTedYMs08Aqf7mgWnOawFGyz5QF+TZXJSYiIZW2tEg==
"@humanwhocodes/config-array@^0.9.2": "@humanwhocodes/config-array@^0.9.2":
version "0.9.5" version "0.9.5"
resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz" resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz"
@ -1459,6 +1471,11 @@
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.2.tgz#513abfd256d7ad0bf1ee1873606317b33b1b2a72" resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.2.tgz#513abfd256d7ad0bf1ee1873606317b33b1b2a72"
"@types/lodash@^4.14.175":
version "4.14.182"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2"
integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==
"@types/mime@^1": "@types/mime@^1":
version "1.3.2" version "1.3.2"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
@ -1536,6 +1553,11 @@
"@types/react" "*" "@types/react" "*"
csstype "^3.0.2" csstype "^3.0.2"
"@types/yup@^0.29.14":
version "0.29.14"
resolved "https://registry.yarnpkg.com/@types/yup/-/yup-0.29.14.tgz#754f1dccedcc66fc2bbe290c27f5323b407ceb00"
integrity sha512-Ynb/CjHhE/Xp/4bhHmQC4U1Ox+I2OpfRYF3dnNgQqn1cHa6LK3H1wJMNPT02tSVZA6FYuXE2ITORfbnb6zBCSA==
"@typescript-eslint/eslint-plugin@^5.22.0": "@typescript-eslint/eslint-plugin@^5.22.0":
version "5.22.0" version "5.22.0"
resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.22.0.tgz" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.22.0.tgz"
@ -2921,6 +2943,13 @@ internal-slot@^1.0.3:
has "^1.0.3" has "^1.0.3"
side-channel "^1.0.4" side-channel "^1.0.4"
invariant@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
dependencies:
loose-envify "^1.0.0"
ip-regex@^4.1.0: ip-regex@^4.1.0:
version "4.3.0" version "4.3.0"
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5"
@ -3344,6 +3373,11 @@ locate-path@^2.0.0:
p-locate "^2.0.0" p-locate "^2.0.0"
path-exists "^3.0.0" path-exists "^3.0.0"
lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
lodash.debounce@^4.0.8: lodash.debounce@^4.0.8:
version "4.0.8" version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
@ -3356,7 +3390,7 @@ lodash.once@^4.1.1:
version "4.1.1" version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
lodash@^4.17.11: lodash@^4.17.11, lodash@^4.17.21:
version "4.17.21" version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
@ -3369,7 +3403,7 @@ log-update@^4.0.0:
slice-ansi "^4.0.0" slice-ansi "^4.0.0"
wrap-ansi "^6.2.0" wrap-ansi "^6.2.0"
loose-envify@^1.1.0, loose-envify@^1.4.0: loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
dependencies: dependencies:
@ -3537,6 +3571,11 @@ mute-stream@~0.0.4:
version "0.0.8" version "0.0.8"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
nanoclone@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/nanoclone/-/nanoclone-0.2.1.tgz#dd4090f8f1a110d26bb32c49ed2f5b9235209ed4"
integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==
nanoid@^3.1.30: nanoid@^3.1.30:
version "3.3.4" version "3.3.4"
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz" resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz"
@ -4035,6 +4074,11 @@ prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
object-assign "^4.1.1" object-assign "^4.1.1"
react-is "^16.13.1" react-is "^16.13.1"
property-expr@^2.0.4:
version "2.0.5"
resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-2.0.5.tgz#278bdb15308ae16af3e3b9640024524f4dc02cb4"
integrity sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA==
punycode@^2.1.0: punycode@^2.1.0:
version "2.1.1" version "2.1.1"
resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
@ -4071,10 +4115,23 @@ react-dom@18.1.0:
loose-envify "^1.1.0" loose-envify "^1.1.0"
scheduler "^0.22.0" scheduler "^0.22.0"
react-hook-form@^7.32.2:
version "7.32.2"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.32.2.tgz#58ec2ab0239ce97969baa2faa03ced13fae913ac"
integrity sha512-F1A6n762xaRhvtQH5SkQQhMr19cCkHZYesTcKJJeNmrphiZp/cYFTIzC05FnQry0SspM54oPJ9tXFXlzya8VNQ==
react-icons@^4.3.1: react-icons@^4.3.1:
version "4.3.1" version "4.3.1"
resolved "https://registry.npmjs.org/react-icons/-/react-icons-4.3.1.tgz" resolved "https://registry.npmjs.org/react-icons/-/react-icons-4.3.1.tgz"
react-input-mask@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/react-input-mask/-/react-input-mask-2.0.4.tgz#9ade5cf8196f4a856dbf010820fe75a795f3eb14"
integrity sha512-1hwzMr/aO9tXfiroiVCx5EtKohKwLk/NT8QlJXHQ4N+yJJFyUuMT+zfTpLBwX/lK3PkuMlievIffncpMZ3HGRQ==
dependencies:
invariant "^2.2.4"
warning "^4.0.2"
react-is@^16.13.1, react-is@^16.7.0: react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1" version "16.13.1"
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
@ -4569,6 +4626,11 @@ to-regex-range@^5.0.1:
dependencies: dependencies:
is-number "^7.0.0" is-number "^7.0.0"
toposort@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/toposort/-/toposort-2.0.2.tgz#ae21768175d1559d48bef35420b2f4962f09c330"
integrity sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==
treeverse@^2.0.0: treeverse@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-2.0.0.tgz#036dcef04bc3fd79a9b79a68d4da03e882d8a9ca" resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-2.0.0.tgz#036dcef04bc3fd79a9b79a68d4da03e882d8a9ca"
@ -4689,6 +4751,13 @@ walk-up-path@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-1.0.0.tgz#d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e" resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-1.0.0.tgz#d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e"
warning@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
dependencies:
loose-envify "^1.0.0"
wcwidth@^1.0.0: wcwidth@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8"
@ -4755,3 +4824,16 @@ yallist@^4.0.0:
yaml@^1.10.2, yaml@^1.7.2: yaml@^1.10.2, yaml@^1.7.2:
version "1.10.2" version "1.10.2"
resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz"
yup@^0.32.11:
version "0.32.11"
resolved "https://registry.yarnpkg.com/yup/-/yup-0.32.11.tgz#d67fb83eefa4698607982e63f7ca4c5ed3cf18c5"
integrity sha512-Z2Fe1bn+eLstG8DRR6FTavGD+MeAwyfmouhHsIUgaADz8jvFKbO/fXc2trJKZg+5EBjh4gGm3iU/t3onKlXHIg==
dependencies:
"@babel/runtime" "^7.15.4"
"@types/lodash" "^4.14.175"
lodash "^4.17.21"
lodash-es "^4.17.21"
nanoclone "^0.2.1"
property-expr "^2.0.4"
toposort "^2.0.2"