Skip to content

Commit

Permalink
Merge pull request #2460 from prefeiturasp/develop
Browse files Browse the repository at this point in the history
Posição em Develop 06/01/2025 às 13:23h
  • Loading branch information
mdiori authored Jan 6, 2025
2 parents f8b187b + f297a5d commit 459cb32
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faDownload, faEye} from "@fortawesome/free-solid-svg-icons";
import {getDownloadArquivoDeReferencia} from "../../../../../services/dres/PrestacaoDeContas.service";
import ModalVisualizarArquivoDeReferencia from "../ModalVisualizarArquivoDeReferencia";
import ReactTooltip from "react-tooltip";

const ArquivosDeReferenciaVisualizacaoDownload = ({prestacaoDeContas, infoAta}) => {

Expand Down Expand Up @@ -43,10 +44,13 @@ const ArquivosDeReferenciaVisualizacaoDownload = ({prestacaoDeContas, infoAta})
return (
<div className="d-flex align-items-center justify-content-start">
<button onClick={() => handleClickVisualizarArquivoDeReferencia(rowData)} className="btn-editar-membro">
<FontAwesomeIcon
style={{fontSize: '20px', marginRight: "0", marginTop: '2px', color: "#00585E"}}
icon={faEye}
/>
<span data-html={true} data-tip="Visualização">
<FontAwesomeIcon
style={{fontSize: '20px', marginRight: "0", marginTop: '2px', color: "#00585E"}}
icon={faEye}
/>
</span>
<ReactTooltip html={true}/>
</button>
<span> | </span>
<button onClick={() => handleClickDownloadArquivoDeReferencia(rowData)} className="btn-editar-membro">
Expand Down
28 changes: 22 additions & 6 deletions src/componentes/escolas/Despesas/ListaDeDespesas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,34 @@ export const ListaDeDespesas = () => {
const [camposOrdenacao, setCamposOrdenacao] = useState(initOrdenacao)
const [buscaUtilizandoOrdenacao, setBuscaUtilizandoOrdenacao] = useState(false)

const [previousPath, setPreviousPath] = useState(null);

useEffect(() => {
if (!previousPath) {
const storedPath = sessionStorage.getItem('previousPath');
setPreviousPath(storedPath || '/');
sessionStorage.removeItem('previousPath');
}
}, [previousPath]);

useEffect(() => {
if (!previousPath) return;

setLoading(true);

const storedFiltros = mantemEstadoFiltrosUnidade.getEstadoFiltrosUnidades();
const filtrosCompletos = { ...initFiltrosAvancados, ...storedFiltros };


let filtrosCompletos = { ...initFiltrosAvancados };

if (previousPath.includes('/edicao-de-despesa')) {
const storedFiltros = mantemEstadoFiltrosUnidade.getEstadoFiltrosUnidades();
filtrosCompletos = { ...initFiltrosAvancados, ...storedFiltros };
}

setFiltrosAvancados(filtrosCompletos);
set_filtro_informacoes(filtrosCompletos?.filtro_informacoes || []);
set_filtro_vinculo_atividades(filtrosCompletos?.filtro_vinculo_atividades || []);

buscaDespesasOrdenacao('NAO', filtrosCompletos);
}, []);
}, [previousPath]);


const handleChangeFiltroInformacoes = (value) => {
Expand Down
1 change: 1 addition & 0 deletions src/componentes/escolas/Despesas/metodosAuxiliares.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const getPath = (origem, parametroLocation=null) => {
}
}

sessionStorage.setItem('previousPath', window.location.pathname);
window.location.assign(path)
};

Expand Down

0 comments on commit 459cb32

Please sign in to comment.