Merge branch 'dev' of https://gitlab.com/kluppsoftware/smart-energia-web into dev
This commit is contained in:
commit
a1a5c532f7
@ -22,5 +22,6 @@
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"react/react-in-jsx-scope": "off"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import getAPIClient from '../../services/ssrApi';
|
||||
import { FaqQuestionsCardBody, FaqQuestionsCardHeader, CommonQuestionsCardView } from './NotificationQuestionsCardView'
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import React from 'react'
|
||||
import { AccumulatedEconomyTitleView } from './AccumulatedEconomyTitleView'
|
||||
|
||||
export default function AccumulatedEconomyTitle({value}: {value: string}) {
|
||||
|
||||
@ -4,7 +4,7 @@ import InputLabel from '@mui/material/InputLabel';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import React, { useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
|
||||
import { AdministrativeHeaderView } from './AdministrativeHeaderView';
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import TablePagination from '@mui/material/TablePagination';
|
||||
import TableRow from '@mui/material/TableRow';
|
||||
import TableSortLabel from '@mui/material/TableSortLabel';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { forwardRef, useEffect, useState } from 'react';
|
||||
|
||||
import Image from 'next/image';
|
||||
|
||||
@ -43,7 +43,7 @@ const style = {
|
||||
p: 4,
|
||||
overflowY: 'scroll'
|
||||
};
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
@ -213,9 +213,8 @@ export default function ClientTable({ clients, onChange }: ClientsTableInterface
|
||||
],
|
||||
"fields": ["unidade"],
|
||||
"distinct": true
|
||||
}).then(res => setUnits(res.data.data)).catch(res => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
}).then(res => setUnits(res.data.data))
|
||||
.catch(() => setOpenSnackError(true))
|
||||
|
||||
return units
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ import TableRow from '@mui/material/TableRow';
|
||||
import TableSortLabel from '@mui/material/TableSortLabel';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import getAPIClient from '../../services/ssrApi';
|
||||
|
||||
import { TableView, StyledStatus } from './TableView';
|
||||
|
||||
@ -19,7 +19,7 @@ import Toolbar from '@mui/material/Toolbar';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
import { TableView, StyledStatus } from './TableView';
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import React from 'react'
|
||||
import Image from 'next/image'
|
||||
|
||||
import { BannerView } from './BannerView'
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import React from 'react'
|
||||
|
||||
import ToggleButton from '@mui/material/ToggleButton';
|
||||
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
||||
import { ButtonGroupView } from './ButtonGroupView';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function ButtonGroup() {
|
||||
const [timeCourse, setTimeCourse] = React.useState<string | null>('Mensal');
|
||||
const [timeCourse, setTimeCourse] = useState<string | null>('Mensal');
|
||||
|
||||
const handleAlignment = (
|
||||
event: React.MouseEvent<HTMLElement>,
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import React from 'react'
|
||||
|
||||
import { BasicButtonView } from './BasicButtonView'
|
||||
|
||||
interface BasicButtonInterface {
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import React from 'react'
|
||||
|
||||
import { FaqButtonView1 } from './FaqButtonView1'
|
||||
|
||||
interface FaqButtonInterface {
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import React from 'react'
|
||||
|
||||
import { FaqButtonView2 } from './FaqButtonView2'
|
||||
|
||||
interface FaqButtonInterface {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Router } from 'next/router'
|
||||
import React from 'react'
|
||||
import { GradientButtonView } from './GradientButtonView'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import Link from 'next/link'
|
||||
import React from 'react'
|
||||
|
||||
import RenderIf from '../../../utils/renderIf'
|
||||
import { LoginButtonView } from './LoginButtonView'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import getAPIClient from '../../services/ssrApi';
|
||||
import { FaqQuestionsCardBody, FaqQuestionsCardHeader, CommonQuestionsCardView } from './FaqQuestionsCardView'
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import React from 'react'
|
||||
import { ChartTitleView } from './ChartView'
|
||||
|
||||
interface ChartTitleInterface{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { useRef, useEffect } from 'react';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
LinearScale,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Title, Tooltip } from 'chart.js';
|
||||
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
||||
import { draw, generate } from 'patternomaly'
|
||||
import React from 'react';
|
||||
import { Bar, Chart } from 'react-chartjs-2';
|
||||
// import Chart from './Chart';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
import { Bar, Line } from 'react-chartjs-2';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { useRef, useEffect } from 'react';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
LinearScale,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { useRef, useEffect } from 'react';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
LinearScale,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
import { Bar, Line } from 'react-chartjs-2';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { useRef, useEffect } from 'react';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
LinearScale,
|
||||
|
||||
@ -42,8 +42,6 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl
|
||||
|
||||
const options: any = config(miniature)
|
||||
|
||||
console.log(new Date().getFullYear())
|
||||
|
||||
const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
import { Bar, Line } from 'react-chartjs-2';
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import React from 'react'
|
||||
import Link from 'next/link';
|
||||
|
||||
import { ChartCardView } from './ChartCardView';
|
||||
|
||||
@ -89,7 +89,6 @@ export default function GrossMensalChart({
|
||||
const percentage =
|
||||
(data1[ctx?.dataIndex]?.econ_percentual * 100).toFixed(0) + '%'
|
||||
|
||||
console.log(percentage)
|
||||
dataArr.map((data) => {
|
||||
sum += data
|
||||
})
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useContext, useEffect, useState } from 'react'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import Image from 'next/image';
|
||||
|
||||
import { HeaderView } from './HeaderView'
|
||||
@ -50,8 +50,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/user').then(res => {
|
||||
userData = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React,{ useState, useEffect } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
import { InputUploadView } from './inputUploadView'
|
||||
|
||||
@ -16,7 +16,6 @@ export default function InputUploadPdf() {
|
||||
|
||||
function onImageChange(e: any) {
|
||||
setImages([...e.target.files]);
|
||||
// console.log(e);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React,{ useState, useEffect } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
import Image from 'next/image';
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ export default function InputUploadPdf() {
|
||||
|
||||
function onImageChange(e: any) {
|
||||
setImages([...e.target.files]);
|
||||
// console.log(e);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
|
||||
import Image from 'next/image'
|
||||
import { MapCardView } from './MapCardView'
|
||||
|
||||
|
||||
@ -3,8 +3,7 @@ import Box from '@mui/material/Box';
|
||||
import Button from '@mui/material/Button';
|
||||
import Modal from '@mui/material/Modal';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import * as React from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const style = {
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-as-const
|
||||
@ -27,7 +26,7 @@ interface ConfirmModalInterface{
|
||||
}
|
||||
|
||||
export default function ConfirmModal({open, handleIsClose, children}: ConfirmModalInterface) {
|
||||
const [openState, setOpenState] = React.useState(false);
|
||||
const [openState, setOpenState] = useState(false);
|
||||
const handleOpen = () => setOpenState(true);
|
||||
const handleClose = () => {setOpenState(false); handleIsClose(false)}
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import Box from '@mui/material/Box';
|
||||
import Modal from '@mui/material/Modal';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import * as React from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const style = {
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-as-const
|
||||
@ -25,7 +24,7 @@ interface BasicModalInterface{
|
||||
}
|
||||
|
||||
export default function BasicModal({open, handleIsClose, children}: BasicModalInterface) {
|
||||
const [openState, setOpenState] = React.useState(false);
|
||||
const [openState, setOpenState] = useState(false);
|
||||
const handleOpen = () => setOpenState(true);
|
||||
const handleClose = () => {setOpenState(false); handleIsClose(false)}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
|
||||
import { PageTitleView } from './PageTitleView'
|
||||
|
||||
interface PageTitleInterface {
|
||||
|
||||
@ -8,7 +8,7 @@ import Link from 'next/link'
|
||||
|
||||
import { useRouter } from 'next/router'
|
||||
import { parseCookies } from 'nookies';
|
||||
import React, { useContext, useEffect, useState } from 'react'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
|
||||
import { AuthContext } from '../../contexts/AuthContext';
|
||||
import { MenuContext } from '../../contexts/menu/MenuContext';
|
||||
@ -60,8 +60,6 @@ export default function Sidebar() {
|
||||
useEffect(() => {
|
||||
api.post('/notify').then(res => {
|
||||
setNotificationsCount(res.data)
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
}, [])
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { createContext, useState } from "react";
|
||||
import { createContext, useState } from "react";
|
||||
import Router from 'next/router'
|
||||
|
||||
import { destroyCookie, parseCookies, setCookie } from "nookies";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { createContext, useState } from "react";
|
||||
import { createContext, useState } from "react";
|
||||
|
||||
type AuthContextType = {
|
||||
pldMenu: number,
|
||||
|
||||
@ -2,7 +2,7 @@ import { AppProps } from 'next/app'
|
||||
import Head from 'next/head'
|
||||
import { useRouter } from 'next/router'
|
||||
import NProgress from 'nprogress'
|
||||
import React, { useContext, useEffect, useState } from 'react'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
|
||||
import Home from '.'
|
||||
// import Footer from '../components/footer/Footer'
|
||||
@ -79,11 +79,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
let notificationsCount
|
||||
|
||||
await apiClient.post('/download').then(res => {
|
||||
// console.log(res)
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
await apiClient.post('/download').then(console.log)
|
||||
|
||||
if (!token) {
|
||||
return {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
|
||||
|
||||
import { ServerStyleSheet } from 'styled-components';
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
|
||||
import Header from '../../components/header/Header'
|
||||
import PageTitle from '../../components/pageTitle/PageTitle'
|
||||
import getAPIClient from '../../services/ssrApi'
|
||||
@ -62,8 +62,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/aboutUs').then(res => {
|
||||
text = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
|
||||
|
||||
// import Chart2 from '../../components/graph/Chart2'
|
||||
import GrossMensalChart from '../../components/graph/grossMensalChart/GrossMensalChart'
|
||||
@ -58,11 +58,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.post('/economy/grossMonthly').then(res => {
|
||||
graphData = res.data.data
|
||||
// console.log(graphData[0].mes)
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
const years = graphData.map((value) => value.mes)
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -5,7 +5,7 @@ import Snackbar from '@mui/material/Snackbar'
|
||||
import TextField from '@mui/material/TextField'
|
||||
import Typography from '@mui/material/Typography'
|
||||
import Image from 'next/image'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
import ClientsTable from '../../../components/administrativeTables/ClientsTable'
|
||||
import BasicButton from '../../../components/buttons/basicButton/BasicButton'
|
||||
import FaqButton1 from '../../../components/buttons/faqButton/FaqButton1'
|
||||
@ -39,7 +39,7 @@ const style = {
|
||||
overflowY: 'scroll'
|
||||
}
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref
|
||||
) {
|
||||
@ -418,12 +418,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
await apiClient
|
||||
.get('/user')
|
||||
.then((res) => {
|
||||
// console.log(res)
|
||||
clients = res.data.data
|
||||
// console.log(clients)
|
||||
})
|
||||
.catch((res) => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -8,7 +8,7 @@ import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
import { api } from '../../../services/api';
|
||||
import ConfirmModal from '../../../components/modal/ConfirmModal';
|
||||
import { ConfirmModalView } from '../../../styles/layouts/modals/confirmModalView';
|
||||
@ -40,7 +40,7 @@ const style = {
|
||||
p: 4,
|
||||
};
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
@ -106,7 +106,7 @@ export default function Sidebar({faqData, userName} : any ) {
|
||||
}).catch(res => setOpenSnackError(true))
|
||||
}
|
||||
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleOpen = () => setOpen(true);
|
||||
const handleClose = () => setOpen(false);
|
||||
|
||||
@ -190,8 +190,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/faq').then(res => {
|
||||
faqData = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -2,7 +2,7 @@ import { SelectChangeEvent } from '@mui/material/Select';
|
||||
import { Editor } from '@tinymce/tinymce-react'
|
||||
import { GetServerSideProps } from 'next';
|
||||
import { parseCookies } from 'nookies';
|
||||
import React, { useRef, useState } from 'react'
|
||||
import { forwardRef, useRef, useState } from 'react'
|
||||
import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
||||
import Header from '../../components/header/Header';
|
||||
import PageTitle from '../../components/pageTitle/PageTitle';
|
||||
@ -12,7 +12,7 @@ import MuiAlert, { AlertProps } from '@mui/material/Alert'
|
||||
import Snackbar from '@mui/material/Snackbar';
|
||||
import getAPIClient from '../../services/ssrApi';
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref
|
||||
) {
|
||||
@ -119,9 +119,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/aboutUs').then(res => {
|
||||
initialText = res.data.data
|
||||
// console.log(res.data.data)
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Button from '@mui/material/Button';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid';
|
||||
import React, { useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
|
||||
import AdministrativeHeader from '../../components/administrativeHeader/AdministrativeHeader';
|
||||
import ClientsTable from '../../components/administrativeTables/ClientsTable';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
import BasicButton from '../../../components/buttons/basicButton/BasicButton'
|
||||
import Header from '../../../components/header/Header'
|
||||
import PageTitle from '../../../components/pageTitle/PageTitle'
|
||||
@ -13,7 +13,7 @@ import Snackbar from '@mui/material/Snackbar';
|
||||
import MuiAlert, { AlertProps } from '@mui/material/Alert';
|
||||
import getAPIClient from '../../../services/ssrApi'
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
@ -45,16 +45,12 @@ export default function industryInfo({userName, pdfUrl}: any) {
|
||||
|
||||
api.post('/updateFile', formData).then(res => {
|
||||
setOpenSnackSuccess(true)
|
||||
}).catch(res => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
}).catch(() => setOpenSnackError(true))
|
||||
}
|
||||
|
||||
function handleDownloadPdf() {
|
||||
api.get('/download').then(res => {
|
||||
window.open(res.data.path);
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
@ -86,12 +82,6 @@ export default function industryInfo({userName, pdfUrl}: any) {
|
||||
<BasicButton onClick={() => handleDownloadPdf()} title='Visualizar arquivo mais recente'/>
|
||||
<BasicButton onClick={() => console.log('')} title='Excluir último arquivo enviado'/>
|
||||
|
||||
{/* <PDFViewer
|
||||
document={{
|
||||
url: pdfUrl,
|
||||
}}
|
||||
/> */}
|
||||
|
||||
</IndustryInfoView>
|
||||
)
|
||||
}
|
||||
@ -105,8 +95,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
apiClient.get('/download').then(res => {
|
||||
pdfUrl = res.data.path
|
||||
}).catch(res => {
|
||||
// console.log('exception', res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -8,7 +8,7 @@ import Modal from '@mui/material/Modal';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Head from 'next/head'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
|
||||
import NotificationsTable from '../../../components/administrativeTables/NotificationsTable'
|
||||
import FaqButton1 from '../../../components/buttons/faqButton/FaqButton1';
|
||||
@ -44,7 +44,7 @@ const style = {
|
||||
overflowY: 'scroll',
|
||||
};
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
@ -257,14 +257,9 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/user').then(res => {
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
await apiClient.get('/notification').then(res => {
|
||||
notifications = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { ChatTelemetryView } from '../../styles/layouts/ChatTelemetry/ChatTelemetryView'
|
||||
|
||||
import Header from '../../components/header/Header'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
// material ui imports
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
@ -43,8 +43,6 @@ export default function CostIndicator({graphData, userName, clients}: any) {
|
||||
]
|
||||
}:{}).then(res => {
|
||||
setGraphDataState(res.data.data)
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
}, [unity])
|
||||
|
||||
@ -112,15 +110,11 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"codigo_scde"],
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
clients = res.data.data
|
||||
})
|
||||
|
||||
await apiClient.post('/economy/MWh').then(res => {
|
||||
graphData = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -242,26 +242,18 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.post('/economy/grossMonthly').then(res => {
|
||||
grossMensalGraph = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
await apiClient.post('/economy/estimates').then(res => {
|
||||
acumulatedGraph = res.data.data
|
||||
}).catch(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 => {
|
||||
mapsInfo = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
const grossMensalYears = grossMensalGraph.map((value) => value.mes)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { CativoXLivreChart } from '../../components/graph/cativoXLivreChart'
|
||||
|
||||
// material ui imports
|
||||
@ -29,8 +29,6 @@ export default function EstimatedCost({graphData, userName, clients}: any) {
|
||||
]
|
||||
}:{}).then(res => {
|
||||
setGraphDataState(res.data.data)
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
}, [unity])
|
||||
|
||||
@ -90,15 +88,10 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"codigo_scde"],
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
clients = res.data.data
|
||||
})
|
||||
await apiClient.post('/economy/estimates').then(res => {
|
||||
graphData = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
|
||||
import Banner from '../../components/banner/Banner'
|
||||
import CommonQuestionsCard from '../../components/faqQuestionsCard/FaqQuestionsCard'
|
||||
import Header from '../../components/header/Header'
|
||||
@ -48,8 +48,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/faq').then(res => {
|
||||
faqData = res.data.data
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
import Image from 'next/image';
|
||||
import { useRouter } from 'next/router'
|
||||
import FormData from 'form-data';
|
||||
@ -54,9 +54,7 @@ export default function ForgotPassword() {
|
||||
formData.append('email', email)
|
||||
api.post('/auth/forgot-password', formData).then(res => {
|
||||
setOpenSnackSuccess(true)
|
||||
}).catch(res => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
}).catch(() => setOpenSnackError(true))
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
|
||||
|
||||
import { GrossAnualChart } from '../../components/graph/grossAnualChart/GrossAnualChart'
|
||||
import Header from '../../components/header/Header'
|
||||
@ -41,8 +41,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
await apiClient.post('/economy/grossAnnual').then(res => {
|
||||
graphData = res.data.data
|
||||
// console.log(graphData[0])
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
const years = graphData.map((value) => value.ano)
|
||||
|
||||
@ -8,7 +8,7 @@ import Head from 'next/head';
|
||||
import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/router'
|
||||
import React, { useContext, useState, useEffect,useCallback, useRef } from 'react'
|
||||
import { useContext, useState, useEffect, useCallback, useRef, forwardRef } from 'react'
|
||||
import { AiOutlineEye, AiOutlineEyeInvisible } from 'react-icons/ai';
|
||||
import RenderIf from '../utils/renderIf';
|
||||
import Snackbar from '@mui/material/Snackbar';
|
||||
@ -22,7 +22,7 @@ import MuiAlert, { AlertProps } from '@mui/material/Alert';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import { parseCookies } from 'nookies';
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
@ -77,8 +77,8 @@ export default function Home() {
|
||||
setOpenSnackError(true)
|
||||
}
|
||||
})
|
||||
} catch (exception){
|
||||
// console.log(exception)
|
||||
} catch (exception) {
|
||||
console.log(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React, { useState } from 'react'
|
||||
import { forwardRef, useState } from 'react'
|
||||
import BasicButton from '../../components/buttons/basicButton/BasicButton'
|
||||
import Header from '../../components/header/Header'
|
||||
import PageTitle from '../../components/pageTitle/PageTitle'
|
||||
@ -14,7 +14,7 @@ import { useRouter } from 'next/router'
|
||||
import Banner from '../../components/banner/Banner'
|
||||
import Image from 'next/image'
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
@ -39,9 +39,7 @@ export default function industryInfo({userName}: any) {
|
||||
api.get('/download').then(res => {
|
||||
window.open(res.data.path);
|
||||
setOpenSnackSuccess(true)
|
||||
}).catch(res => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
}).catch(() => setOpenSnackError(true))
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -3,7 +3,7 @@ import Head from 'next/head';
|
||||
import Link from 'next/link'
|
||||
import { Router } from 'next/router';
|
||||
import { parseCookies } from 'nookies';
|
||||
import React from 'react'
|
||||
|
||||
|
||||
import Banner from '../../components/banner/Banner'
|
||||
import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
||||
@ -63,8 +63,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/news').then(res => {
|
||||
news = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
|
||||
import NotificationQuestionsCard from '../../components/NotificationQuestionsCard/NotificationQuestionsCard'
|
||||
import Header from '../../components/header/Header'
|
||||
import PageTitle from '../../components/pageTitle/PageTitle'
|
||||
@ -48,8 +48,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.get('/notification').then(res => {
|
||||
notificationData = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -6,7 +6,7 @@ import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import Head from 'next/head';
|
||||
import { parseCookies } from 'nookies';
|
||||
import React, { useContext, useEffect, useState } from 'react'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
|
||||
import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
||||
import { LineBarChart } from '../../components/graph/LineBarChart';
|
||||
@ -460,8 +460,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
await apiClient.post('/pld/list').then(res => {
|
||||
tableData = res.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
await apiClient.post('/pld', {
|
||||
@ -470,8 +468,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
clientMonth = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -6,7 +6,7 @@ import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import Head from 'next/head';
|
||||
import { parseCookies } from 'nookies';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
||||
import Header from '../../components/header/Header';
|
||||
@ -243,8 +243,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
import Image from 'next/image';
|
||||
import { useRouter } from 'next/router'
|
||||
import FormData from 'form-data';
|
||||
@ -15,7 +15,7 @@ import { api } from '../../services/api';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import { parseCookies } from 'nookies';
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref
|
||||
) {
|
||||
@ -61,9 +61,7 @@ export default function VerifyEmail() {
|
||||
}).then(res => {
|
||||
setSent(true)
|
||||
setOpenSnackSuccess(true)
|
||||
}).catch(res => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
}).catch(() => setOpenSnackError(true))
|
||||
}
|
||||
|
||||
function verifyConfirmationCode() {
|
||||
@ -78,9 +76,7 @@ export default function VerifyEmail() {
|
||||
setTimeout(() => {
|
||||
router.push('/')
|
||||
}, 2000);
|
||||
}).catch(res => {
|
||||
setOpenSnackErrorPassword(true)
|
||||
})
|
||||
}).catch(() => setOpenSnackErrorPassword(true))
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -19,23 +19,26 @@ type UserObjectType = {
|
||||
export async function signInRequest(data: SignInRequestData) {
|
||||
let user: UserObjectType, token: string, exception: any = null
|
||||
|
||||
await api.post('/auth/login', {
|
||||
"email": data.email,
|
||||
"password": data.password,
|
||||
"device_name": "test"
|
||||
}).then(res => {
|
||||
token = res.data.token
|
||||
user = {
|
||||
name: res.data.user.name,
|
||||
email: res.data.user.email,
|
||||
client_id: res.data.user.client_id,
|
||||
id: res.data.user.id,
|
||||
role: res.data.user.roles[0].pivot.role_id,
|
||||
profile_picture: res.data.user.profile_picture
|
||||
}
|
||||
}).catch(res => {
|
||||
exception = res
|
||||
})
|
||||
await api
|
||||
.post('/auth/login', {
|
||||
email: data.email,
|
||||
password: data.password,
|
||||
device_name: 'test'
|
||||
})
|
||||
.then((res) => {
|
||||
token = res.data.token
|
||||
user = {
|
||||
name: res.data.user.name,
|
||||
email: res.data.user.email,
|
||||
client_id: res.data.user.client_id,
|
||||
id: res.data.user.id,
|
||||
role: res.data.user.roles[0].pivot.role_id,
|
||||
profile_picture: res.data.user.profile_picture
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
exception = res
|
||||
})
|
||||
|
||||
return {
|
||||
token,
|
||||
@ -63,8 +66,6 @@ export default async function recoverUserInformation(id) {
|
||||
role: res.data.user.roles[0].pivot.role_id,
|
||||
profile_picture: res.data.user.profile_picture
|
||||
}
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@ -12,9 +12,9 @@ export default function getAPIClient(ctx?: Pick<next.NextPageContext, 'req'> | {
|
||||
const { '@smartAuth-token': token } = parseCookies(ctx)
|
||||
|
||||
const api = axios.create({
|
||||
// baseURL: "https://api.energiasmart.com.br/api",
|
||||
baseURL: "https://api.energiasmart.klupp.com.br/api",
|
||||
});
|
||||
baseURL: 'https://api.energiasmart.com.br/api'
|
||||
// baseURL: 'https://api.energiasmart.klupp.com.br/api'
|
||||
})
|
||||
|
||||
api.interceptors.request.use(config => {
|
||||
return config;
|
||||
|
||||
@ -4417,7 +4417,8 @@ react-transition-group@^4.0.0, react-transition-group@^4.4.0, react-transition-g
|
||||
|
||||
react@18.1.0:
|
||||
version "18.1.0"
|
||||
resolved "https://registry.npmjs.org/react/-/react-18.1.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890"
|
||||
integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user