Skip to content

Commit

Permalink
Merge pull request #1825 from prefeiturasp/release/8.5.0
Browse files Browse the repository at this point in the history
Release/8.5.0
  • Loading branch information
ollyvergithub authored Jul 17, 2023
2 parents b8ddde7 + a609964 commit 03e14ce
Show file tree
Hide file tree
Showing 51 changed files with 3,499 additions and 22,671 deletions.
23,902 changes: 1,499 additions & 22,403 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "ptrf",
"version": "8.4.1",
"version": "8.5.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.27",
"@fortawesome/free-solid-svg-icons": "^5.12.1",
"@fortawesome/react-fontawesome": "^0.1.9",
"@sentry/react": "^5.27.6",
"@tanstack/react-query": "^4.29.19",
"@tanstack/react-query-devtools": "^4.29.19",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
Expand All @@ -26,11 +28,11 @@
"ordinal-pt-br": "^1.0.0",
"primeicons": "^2.0.0",
"primereact": "^4.1.2",
"react": "^16.13.1",
"react": "^17.0.2",
"react-bootstrap": "1.0.1",
"react-currency-input": "^1.3.6",
"react-datepicker": "^2.14.1",
"react-dom": "^16.13.1",
"react-dom": "^17.0.2",
"react-loading": "^2.0.3",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.4",
Expand Down
6 changes: 4 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
</script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-9DECLC0CB2"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-KCKKHGM5RN"></script>
<script>
window.dataLayer = window.dataLayer || [];

function gtag() {
dataLayer.push(arguments);
}

gtag('js', new Date());
gtag('config', 'G-9DECLC0CB2');
gtag('config', 'G-KCKKHGM5RN');
</script>
</head>
<body>
Expand Down
66 changes: 66 additions & 0 deletions src/assets/css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,37 @@ body {
border: none !important;
}

.btn-base-vermelho {
color: #ffffff !important;
transition: 0s background-color;
background-color: $corBtnErrorPrimaria !important;

.icon-btn-base-vermelho {
color: #ffffff;
margin-right: 7px;
font-size: 14px;
transition: 0s color;
}

.text-btn-base-vermelho {
font-size: 14px;
}

&:hover {
background-color: $corBtnErrorSecundaria !important;
}

&:disabled {
border-color: $corBtnDisabled !important;
color: $corBtnDisabled !important;
cursor: default;

.icon-btn-base-vermelho {
color: $corBtnDisabled;
}
}
}

.btn-base-vermelho-outline {
border-color: $corBtnErrorPrimaria;
color: $corBtnErrorPrimaria;
Expand Down Expand Up @@ -234,6 +265,41 @@ body {
}
}

.btn-base-verde {
color: #ffffff !important;
transition: 0s background-color;
background-color: $mainColor !important;

.icon-btn-base-verde {
color: #ffffff;
margin-right: 7px;
font-size: 14px;
transition: 0s color;
}

.text-btn-base-verde {
font-size: 14px;
}

&:hover {
background-color: $hoverBackgroundColor !important;

.icon-btn-base-verde {
color: $hoverBackgroundColor;
}
}

&:disabled {
border-color: $corBtnDisabled !important;
color: $corBtnDisabled !important;
cursor: default;

.icon-btn-base-verde {
color: $corBtnDisabled;
}
}
}

.btn-base-verde-outline {
border-color: $mainColor;
color: $mainColor;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";

export const AcertoComprovanteSaldoDaConta = ({extratosBancariosAjustes}) => {
return (
<>
{extratosBancariosAjustes && extratosBancariosAjustes.solicitar_envio_do_comprovante_do_saldo_da_conta ? (
<div className='row'>
<div className='col-12'>
<p className="text-saldo-reprogramado" id='p_enviar_arquivo_do_comprovante'><strong>Enviar arquivo de Comprovante do saldo da conta</strong></p>
{extratosBancariosAjustes && extratosBancariosAjustes.observacao_solicitar_envio_do_comprovante_do_saldo_da_conta && extratosBancariosAjustes.observacao_solicitar_envio_do_comprovante_do_saldo_da_conta.trim() !== "" &&
<>
<label id='lbl_enviar_arquivo_do_comprovant' htmlFor="texto-enviar-arquivo-do-comprovante"><strong>Observação</strong></label>
<textarea
rows="3"
defaultValue={extratosBancariosAjustes.observacao_solicitar_envio_do_comprovante_do_saldo_da_conta}
name="texto-enviar-arquivo-do-comprovante"
className="form-control mb-3"
disabled={true}
id='texto_enviar_arquivo_do_comprovante'
style={{backgroundColor: "#fff"}}
/>
</>
}
</div>
</div>
) :
<></>
}
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {getPeriodos} from "../../../services/dres/Dashboard.service";
import { SidebarLeftService } from "../../../services/SideBarLeft.service";
import { SidebarContext } from "../../../context/Sidebar";
import { useCarregaPrestacaoDeContasPorUuid } from "../../../hooks/dres/PrestacaoDeContas/useCarregaPrestacaoDeContasPorUuid";
import {AcertoComprovanteSaldoDaConta} from "./AcertoComprovanteSaldoDaConta";


const TabelaAcertosEmExtratosBancarios = ({extratosBancariosAjustes, contaUuidAjustesExtratosBancarios, prestacaoDeContasUuid}) => {
const contextSideBar = useContext(SidebarContext);
const parametros = useLocation();
const [uuidPeriodo, setUuidPeriodo] = useState('')
const [expandedRows, setExpandedRows] = useState(null);
const prestacaoDeContas = useCarregaPrestacaoDeContasPorUuid(prestacaoDeContasUuid)

useEffect(() => {
Expand Down Expand Up @@ -60,18 +60,21 @@ const TabelaAcertosEmExtratosBancarios = ({extratosBancariosAjustes, contaUuidAj
<>
<div className="row mt-2">
{extratosBancariosAjustes.data_extrato &&
<div className="col-lg-4">
<strong><p className="text-saldo-reprogramado">Ajuste da data do extrato</p></strong>
<p>{moment(extratosBancariosAjustes.data_extrato).format('DD/MM/YYYY')}</p>
</div>
<div className="col-lg-4">
<strong><p className="text-saldo-reprogramado">Ajuste da data do extrato</p></strong>
<p>{moment(extratosBancariosAjustes.data_extrato).format('DD/MM/YYYY')}</p>
</div>
}
{extratosBancariosAjustes.saldo_extrato &&
<div className="col-lg-4">
<strong><p className="text-saldo-reprogramado">Ajuste no saldo do extrato</p></strong>
<p>{formataValor(extratosBancariosAjustes.saldo_extrato)}</p>
</div>
<div className="col-lg-4">
<strong><p className="text-saldo-reprogramado">Ajuste no saldo do extrato</p></strong>
<p>{formataValor(extratosBancariosAjustes.saldo_extrato)}</p>
</div>
}
</div>
<AcertoComprovanteSaldoDaConta
extratosBancariosAjustes={extratosBancariosAjustes}
/>
{visoesService.getItemUsuarioLogado('visao_selecionada.nome') === 'UE' &&
<Link
to={{pathname: `/detalhe-das-prestacoes`,
Expand Down
17 changes: 17 additions & 0 deletions src/componentes/Globais/GestaoDeUsuarios/AddUsuario.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faPlus} from "@fortawesome/free-solid-svg-icons";
export const AddUsuario = () => {
return (
<button onClick={() => {
console.log("Adicionar Usuário")
}
} type="button" className="btn btn-success mt-2">
<FontAwesomeIcon
style={{fontSize: '15px', marginRight: "5", color: "#fff"}}
icon={faPlus}
/>
Adicionar
</button>
)
}
14 changes: 14 additions & 0 deletions src/componentes/Globais/GestaoDeUsuarios/BarraTopoLista.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import {AddUsuario} from "./AddUsuario";
export const BarraTopoLista = () => {
return (
<>
<div className="barra-topo-lista-usuarios d-flex bd-highlight align-items-center">
<div className="py-2 flex-grow-1 bd-highlight"><h2>Usuários com acesso</h2></div>
<div className="p-2 bd-highlight">
<AddUsuario/>
</div>
</div>
</>
)
}
110 changes: 110 additions & 0 deletions src/componentes/Globais/GestaoDeUsuarios/FormFiltros.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import React, {useContext, useState} from "react";
import {GestaoDeUsuariosContext} from "./context/GestaoDeUsuariosProvider";

export const FormFiltros = ({grupos}) => {
const {setFilter, initialFilter, visaoBase} = useContext(GestaoDeUsuariosContext);
const [formFilter, setFormFilter] = useState(initialFilter);

const handleChangeFormFilter = (name, value) => {
setFormFilter({
...formFilter,
[name]: value
});
};

const handleSubmitFormFilter = async (event) => {
event.preventDefault();
setFilter(formFilter);
};

const clearFilter = () => {
setFormFilter(initialFilter);
setFilter(initialFilter);
};

return (
<form onSubmit={handleSubmitFormFilter} method="post">
<div className="row mt-3">
<div className="col">
<label htmlFor="filtrar_por_termo">Filtrar por nome ou id de usuário</label>
<input
value={formFilter.search}
onChange={(e) => handleChangeFormFilter(e.target.name, e.target.value)}
name='search'
type="text"
className="form-control"
placeholder="Escreva o nome ou id"
/>
</div>
<div className="col">
<label htmlFor="filtrar_por_grupo">Filtrar por grupo</label>
<select
value={formFilter.grupo}
onChange={(e) => handleChangeFormFilter(e.target.name, e.target.value)}
name='grupo'
id='filtrar_por_grupo'
className='form-control'
>
<option key='' value="">Selecione um grupo</option>
{grupos && grupos.length > 0 && grupos.map((grupo, index) => (
<option key={index} value={grupo.id}>{grupo.name}</option>
))}
</select>
</div>
<div className="col">
<label htmlFor="filtrar_por_grupo">Filtrar por tipo de usuário</label>
<select
value={formFilter.tipoUsuario}
onChange={(e) => handleChangeFormFilter(e.target.name, e.target.value)}
name='tipoUsuario'
id='filtrar_tipo_de_usuario'
className='form-control'
>
<option value="">Selecione um tipo</option>
<option value="servidor">Servidor</option>
<option value="nao-servidor">Não Servidor</option>
</select>
</div>
</div>

{(visaoBase === 'DRE' || visaoBase === 'SME') &&
<div className='row mt-3'>
<div className="col">
<label htmlFor="filtrar_por_termo">Filtrar por unidade educacional</label>
<input
value={formFilter.nomeUnidade}
onChange={(e) => handleChangeFormFilter(e.target.name, e.target.value)}
name='nomeUnidade'
type="text"
className="form-control"
placeholder="Escreva qualquer parte do nome da unidade"
/>
</div>
</div>
}

{(visaoBase === 'DRE' || visaoBase === 'SME') &&
<div className='row mt-3'>
<div className="form-check check-apenas-usuarios-da-unidade">
<input
onChange={(e) => handleChangeFormFilter(e.target.name, e.target.checked)}
checked={formFilter.apenasUsuariosDaUnidade}
name={`apenasUsuariosDaUnidade`}
id={`apenasUsuariosDaUnidade`}
type="checkbox"
className="form-check-input"
/>
<label className="form-check-label" htmlFor={`apenasUsuariosDaUnidade`}>Selecionar usuários da própria unidade.</label>
</div>
</div>
}

<div className={"barra-botoes-filtro d-flex justify-content-end mt-n2"}>
<button onClick={() => clearFilter()} type="reset"
className="btn btn btn-outline-success mt-2 mr-2">Limpar
</button>
<button type="submit" className="btn btn-success mt-2">Filtrar</button>
</div>
</form>
);
};
25 changes: 25 additions & 0 deletions src/componentes/Globais/GestaoDeUsuarios/GestaoDeUsuariosMain.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import {useGruposAcesso} from "./hooks/useGruposAcesso";
import {GruposAcessoInfo} from "./GruposAcessoInfo";
import {ListaUsuarios} from "./ListaUsuarios";
import {useUsuarios} from "./hooks/useUsuarios";
import {BarraTopoLista} from "./BarraTopoLista";
import {FormFiltros} from "./FormFiltros";
import {Paginacao} from "./Paginacao";

export const GestaoDeUsuariosMain = () => {
const { data: grupos } = useGruposAcesso();
const { data: usuarios, isLoading } = useUsuarios();
return (
<>
<p>Faça a gestão dos seus usuários e determine seus perfis atrelando-os aos grupos de acesso.</p>
<GruposAcessoInfo grupos={grupos}/>
<BarraTopoLista/>
<FormFiltros grupos={grupos}/>
<ListaUsuarios usuarios={usuarios?.results} isLoading={isLoading}/>
{! isLoading &&
<Paginacao/>
}
</>
)
}
Loading

0 comments on commit 03e14ce

Please sign in to comment.