Skip to content

Commit

Permalink
Merge pull request #2466 from prefeiturasp/develop
Browse files Browse the repository at this point in the history
Posição em Develop 17/01/2025 às 10:37h
  • Loading branch information
mdiori authored Jan 17, 2025
2 parents 459cb32 + 9fd1cc6 commit 3eff88e
Show file tree
Hide file tree
Showing 23 changed files with 1,452 additions and 74 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ptrf",
"version": "9.6.2",
"version": "9.7.0",
"private": true,
"dependencies": {
"@dnd-kit/core": "^6.1.0",
Expand Down
43 changes: 0 additions & 43 deletions src/componentes/Globais/ModalBootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,49 +650,6 @@ export const ModalFormBodyText = (props) => {
)
};

export const ModalFormBodyPdf = ({
children,
...props
}) => {
return (
<Fragment>
<Modal show={
props.show
}
onHide={
props.onHide
}
size={
props.size
}>
<Modal.Header>
<Modal.Title>{
props.titulo
}</Modal.Title>
<button
onClick={
props.onHide
}
style={{
border: 'none',
background: 'transparent'
}}
>
<FontAwesomeIcon style={
{
color: "black",
fontSize: '20px',
}
}
icon={faTimes}/>
</button>
</Modal.Header>
<Modal.Body> {children} </Modal.Body>
</Modal>
</Fragment>
)
};

export const ModalFormBodyTextCloseButtonCabecalho = (props) => {
return (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import {
ModalCheckNaoPermitidoConfererenciaDeDocumentos
} from "../../../../dres/PrestacaoDeContas/DetalhePrestacaoDeContas/ConferenciaDeDocumentos/ModalCheckNaoPermitidoConfererenciaDeDocumentos";
import {toastCustom} from "../../../../Globais/ToastCustom";
import {ModalFormBodyPdf} from "../../../../Globais/ModalBootstrap"
import {ModalFormBodyTextCloseButtonCabecalho} from "../../../../Globais/ModalBootstrap"
import Dropdown from "react-bootstrap/Dropdown";
import Loading from "../../../../../utils/Loading";
import {AxiosError} from "axios";
import "./conferencia-de-documentos.scss"
import ReactTooltip from "react-tooltip";

const TabelaConferenciaDeDocumentosRelatorios = ({
relatorioConsolidado,
Expand Down Expand Up @@ -501,37 +502,40 @@ const TabelaConferenciaDeDocumentosRelatorios = ({
if (rowData.tipo_documento !== "DOCUMENTO_ADICIONAL") {
return (
<>
<button disabled={
!editavel
}
title="Visualizar"
className="btn btn-link fonte-14"
type="button"
onClick={() => handleShowPdf(rowData)}>
<FontAwesomeIcon style={
{
fontSize: '18px',
marginRight: "5px",
color: "#00585E"
<button
disabled={!editavel}
className="btn btn-link fonte-14"
type="button"
onClick={() => handleShowPdf(rowData)}
>
<span data-html={true} data-tip="Visualização">
<FontAwesomeIcon style={
{
fontSize: '18px',
marginRight: "5px",
color: "#00585E"
}
}
}
icon={faEye}/>
icon={faEye}/>
</span>
<ReactTooltip html={true}/>
</button>
<button disabled={
!editavel
}
title="Download"
onClick={() => getDownloadDocumentoRelatorio(rowData)}
className="btn btn-link fonte-14"
type="button">
<FontAwesomeIcon style={
{
fontSize: '18px',
marginRight: "5px",
color: "#00585E"
}
}
icon={faDownload}/>
<span data-html={true} data-tip="Download">
<FontAwesomeIcon style={
{
fontSize: '18px',
marginRight: "5px",
color: "#00585E"
}
}icon={faDownload}/>
</span>
<ReactTooltip html={true}/>
</button>
</>
)
Expand Down Expand Up @@ -598,6 +602,20 @@ const TabelaConferenciaDeDocumentosRelatorios = ({
carregaListaDeDocumentosRelatorio();
}

const bodyTextarea = () => {
const height = `${window.innerHeight * 0.85}px`;

return (
<object
style={{ height: height, width: '100%' }}
type="application/pdf"
data={pdfVisualizacao}
>
Este navegador não suporta a visualização de PDFs diretamente. Por favor, faça o download do arquivo.
</object>
);
};

return (
<> {
loadingDocumentosRelatorio ? (
Expand Down Expand Up @@ -692,14 +710,13 @@ const TabelaConferenciaDeDocumentosRelatorios = ({
/>
</section>
<section>
<ModalFormBodyPdf
<ModalFormBodyTextCloseButtonCabecalho
onClose={() => setShowModalPdfDownload(false)}
show={showModalPdfDownload}
size="lg"
titulo={'Visualização do documento.'}
onHide={() => setShowModalPdfDownload(false)}
>
<embed src={pdfVisualizacao} frameBorder="0" width="100%" height="700px"></embed>
</ModalFormBodyPdf>
size='xl'
bodyText={bodyTextarea()}
/>
</section>
</>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";
import {RetornaSeTemPermissaoEdicaoPainelParametrizacoes} from "../../../Parametrizacoes/RetornaSeTemPermissaoEdicaoPainelParametrizacoes"

export const BtnAdd = ({FontAwesomeIcon, faPlus, setShowModalForm, initialStateFormModal, setStateFormModal}) =>{
const TEM_PERMISSAO_EDICAO_PAINEL_PARAMETRIZACOES = RetornaSeTemPermissaoEdicaoPainelParametrizacoes()
return(
<div className="d-flex justify-content-end pb-4 mt-2">
<button data-qa="botao-adicionar-tipo-documento" onClick={()=>{
setStateFormModal(initialStateFormModal);
setShowModalForm(true);
}
} type="button" className="btn btn-success mt-2" disabled={!TEM_PERMISSAO_EDICAO_PAINEL_PARAMETRIZACOES}>
<FontAwesomeIcon
data-qa="botao-adicionar-tipo-documento-icone"
style={{fontSize: '15px', marginRight: "5", color:"#fff"}}
icon={faPlus}/>
Adicionar tipo de documento
</button>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";

export const Filtros = ({stateFiltros, handleChangeFiltros, handleSubmitFiltros, limpaFiltros}) => {
return (
<>
<form>
<div className="form-row">
<div className="form-group col-md-12">
<label htmlFor="filtrar_por_nome">Filtrar por nome</label>
<input
data-qa="campo-filtrar-por-nome-tipo-documento"
value={stateFiltros.filtrar_por_nome}
onChange={(e) => handleChangeFiltros(e.target.name, e.target.value)}
name='filtrar_por_nome'
id="filtrar_por_nome"
type="text"
className="form-control"
placeholder='Escreva o nome do tipo'
/>
</div>
</div>
<div className="d-flex justify-content-end mt-n2">
<button
data-qa="botao-limpar-filtros-tipo-documento"
onClick={() => limpaFiltros()} type="button" className="btn btn btn-outline-success mr-2">Limpar</button>
<button
data-qa="botao-filtrar-tipo-documento"
onClick={handleSubmitFiltros} type="button" className="btn btn-success">Filtrar</button>
</div>
</form>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {ModalBootstrap} from "../../../../Globais/ModalBootstrap";
import React from "react";

export const ModalConfirmDelete = (props) => {
return (
<ModalBootstrap
data-qa="modal-confirmar-exclusao-tipo-documento"
show={props.show}
onHide={props.handleClose}
titulo={props.titulo}
bodyText={props.texto}
primeiroBotaoOnclick={props.handleClose}
primeiroBotaoTexto={props.primeiroBotaoTexto}
primeiroBotaoCss={props.primeiroBotaoCss}
segundoBotaoOnclick={props.onDeleteTrue}
segundoBotaoCss={props.segundoBotaoCss}
segundoBotaoTexto={props.segundoBotaoTexto}
/>
)
};
Loading

0 comments on commit 3eff88e

Please sign in to comment.