Skip to content

Commit

Permalink
Merge pull request #1978 from prefeiturasp/release/8.10.0
Browse files Browse the repository at this point in the history
Release/8.10.0
  • Loading branch information
Lucas-Santos-Rocha-dev authored Oct 9, 2023
2 parents a7addeb + 61da53d commit 49c1fcf
Show file tree
Hide file tree
Showing 49 changed files with 1,714 additions and 771 deletions.
1,412 changes: 789 additions & 623 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ptrf",
"version": "8.9.0",
"version": "8.10.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.2.1",
Expand All @@ -10,8 +10,8 @@
"@sentry/react": "^6.0.4",
"@tanstack/react-query": "^4.29.19",
"@tanstack/react-query-devtools": "^4.29.19",
"@testing-library/jest-dom": "^5.1.1",
"@testing-library/react": "^10.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^8.1.3",
"@tinymce/tinymce-react": "^3.10.1",
"@trendmicro/react-sidenav": "^0.5.0",
Expand All @@ -29,15 +29,16 @@
"ordinal-pt-br": "^1.0.0",
"primeicons": "^2.0.0",
"primereact": "^4.1.2",
"react": "^17.0.2",
"react": "^18.1.0",
"react-bootstrap": "1.0.1",
"react-currency-input": "^1.3.6",
"react-datepicker": "^3.0.0",
"react-dom": "^17.0.2",
"react-dom": "^18.1.0",
"react-loading": "^2.0.3",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.4",
"react-router-dom": "^5.1.2",
"react-router-dom-v5-compat": "^6.16.0",
"react-scripts": "3.4.4",
"react-sortable-hoc": "^2.0.0",
"react-text-mask": "^5.4.3",
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import './assets/css/styles.scss'
import {Cabecalho} from './componentes/Globais/Cabecalho'
import {SidebarLeft} from './componentes/Globais/SidebarLeft'
import {ToastContainer} from "react-toastify";
import Modal from './componentes/Globais/Modal/Modal'

export const App = () => {
const pathName = useHistory().location.pathname;
Expand Down Expand Up @@ -38,6 +39,7 @@ export const App = () => {
<Rotas/>
</>
}
<Modal/>
</section>
</>
)
Expand Down
4 changes: 4 additions & 0 deletions src/assets/img/icone-close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/img/icone-modal-aviso-vermelho.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions src/componentes/Globais/Modal/CustomModalConfirm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from "react";
import {Button} from "react-bootstrap";
import { openModal, closeModal } from "../../../store/reducers/componentes/Globais/Modal/actions";
import IconeConfirmacao from "../../../assets/img/icone-modal-confirmacao.svg"
import IconeClose from "../../../assets/img/icone-close.svg"
import "./modal-bootstrap.scss"
import "./custom-modal.scss"

export function CustomModalConfirm({
dispatch,
title,
message,
dataQa,
cancelText = "Cancelar",
onCancel,
confirmText = "Confirmar",
onConfirm,
}) {

function handleClose() {
if (onCancel) {
onCancel();
}

dispatch(closeModal());
}

function handleConfirm() {
if (onConfirm) {
onConfirm();
}
handleClose();
}

return dispatch(
openModal({
children: (
<div className="row text-center d-flex align-items-center justify-content-center" style={{padding: '10% 15%'}}>
<div className="w-100 d-flex justify-content-end">
<button onClick={handleClose} className="btn p-0">
<img src={IconeClose} alt="IconeClose" className="img-fluid"/>
</button>
</div>
<img src={IconeConfirmacao} alt="IconeConfirmacao" className="img-fluid mb-3"/>
<h4 className="custom-modal-title">{title}</h4>
<p className="custom-modal-message">{message}</p>
<div className="col-12 mt-3 d-flex justify-content-center">
<Button
onClick={handleClose}
className="btn-outline-success"
data-qa={dataQa ? `${dataQa}-btn-${cancelText}` : ""}
>
{cancelText}
</Button>
{onConfirm ? (
<Button
onClick={handleConfirm}
className="btn btn-success ml-2"
data-qa={dataQa ? `${dataQa}-btn-${confirmText}` : ""}
>
{confirmText}
</Button>
) : null}
</div>
</div>
),
})
);
}
25 changes: 25 additions & 0 deletions src/componentes/Globais/Modal/Modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import { useDispatch, useSelector } from "react-redux";
import {Modal} from "react-bootstrap";
import { closeModal as close } from "../../../store/reducers/componentes/Globais/Modal/actions";


function ModalDialog() {
const dispatch = useDispatch();
const {open, options} = useSelector(state => state.Modal)

function handleClose() {
dispatch(close());
}
return (
<Modal
centered
show={open}
onHide={handleClose}
>
{options.children}
</Modal>
);
}

export default ModalDialog;
62 changes: 62 additions & 0 deletions src/componentes/Globais/Modal/ModalConfirm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from "react";
import {Modal} from "react-bootstrap";
import { openModal, closeModal } from "../../../store/reducers/componentes/Globais/Modal/actions";
import "./modal-bootstrap.scss"

export function ModalConfirm({
dispatch,
title,
message,
dataQa,
cancelText = "Cancelar",
onCancel,
confirmText = "Confirmar",
onConfirm,
}) {


function handleClose() {
if (onCancel) {
onCancel();
}

dispatch(closeModal());
}

function handleConfirm() {
if (onConfirm) {
onConfirm();
}
handleClose();
}


return dispatch(
openModal({
children: (
<>
<Modal.Header>
<Modal.Title>{title}</Modal.Title>
</Modal.Header>
<Modal.Body>
{message}
</Modal.Body>
<Modal.Footer>
<button data-qa={dataQa ? `${dataQa}-btn-${cancelText}` : ""}
onClick={handleClose}
className="btn btn-outline-success">
{cancelText}
</button>
{onConfirm ? (
<button data-qa={dataQa ? `${dataQa}-btn-${confirmText}` : ""}
onClick={handleConfirm}
className="btn btn btn-success mt-2">
{confirmText}
</button>
) : null}
</Modal.Footer>
</>
),
})
);
}
47 changes: 47 additions & 0 deletions src/componentes/Globais/Modal/ModalInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from "react";
import {Button, Modal} from "react-bootstrap";
import { openModal, closeModal } from "../../../store/reducers/componentes/Globais/Modal/actions";
import "./modal-bootstrap.scss"

export function ModalInfo({
dispatch,
title,
message,
dataQa,
cancelText = "Fechar",
onCancel,
}) {


function handleClose() {
if (onCancel) {
onCancel();
}

dispatch(closeModal());
}

return dispatch(
openModal({
children: (
<>
<Modal.Header>
<Modal.Title>{title}</Modal.Title>
</Modal.Header>
<Modal.Body>
{message}
</Modal.Body>
<Modal.Footer>
<Button
data-qa={dataQa ? `${dataQa}-btn-${cancelText}` : ""}
onClick={handleClose}
className="btn btn-outline-success"
>
{cancelText}
</Button>
</Modal.Footer>
</>
),
})
);
}
10 changes: 10 additions & 0 deletions src/componentes/Globais/Modal/custom-modal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import 'src/assets/css/variaveis.scss';

.custom-modal-title{
font-weight: 700;
color: $corFonte;
}
.custom-modal-message{
font-size: 18px;
color: $corFonte;
}
18 changes: 18 additions & 0 deletions src/componentes/Globais/Modal/modal-bootstrap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import "../../../assets/css/variaveis";

.btn-success {
background-color: $corBtnSuccess;
border-color: $corBtnSuccess;
}

.btn-outline-success {
border-color: $corBtnSuccess;
color: $corBtnSuccess;
background-color: transparent;
}

.btn-outline-success:hover, .btn-success:hover {
color: #fff;
background-color: $corBtnSuccess;
border-color: $corBtnSuccess;
}
16 changes: 16 additions & 0 deletions src/componentes/Globais/ModalAntDesign/modal-antdesign.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@
}
}
}

.modal-ant-design{
.title-modal-antdesign-aviso{
font-weight: 700;
font-size: 24px;
line-height: 28px;
color: #42474A;
}

.text-modal-antdesign-aviso{
font-weight: 400;
font-size: 18px;
line-height: 24px;
color: #B40C02;
}
}
38 changes: 38 additions & 0 deletions src/componentes/Globais/ModalAntDesign/modalAviso.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react";
import { Modal } from 'antd';
import "./modal-antdesign.scss"
import IconeAvisoVermelho from "../../../assets/img/icone-modal-aviso-vermelho.svg"


export const ModalAntDesignAviso = (propriedades) => {
return(
<div className="modal-ant-design">
<Modal
open={propriedades.handleShow}
onCancel={propriedades.handleCancel}
cancelText={propriedades.cancelText}
wrapClassName={'modal-ant-design'}
okButtonProps={{ style: { display: 'none' } }}
>
<div className="row">
<div className="col-md-auto col-lg-12">
<div className="text-center">
<img src={IconeAvisoVermelho} alt="" className="img-fluid"/>
</div>
</div>

<div className="col-md-auto col-lg-12 mt-3">
<div className="text-center">
<p className="title-modal-antdesign-aviso">{propriedades.titulo}</p>
</div>
<div className="text-center mt-2">
<p className="text-modal-antdesign-aviso">{propriedades.bodyText}</p>
</div>
</div>
</div>
</Modal>
</div>


)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {YupSignupSchemaDetalharAcertosDocumentos} from './YupSignupSchemaDetalha
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faTimesCircle, faExclamationCircle, faCheckCircle} from "@fortawesome/free-solid-svg-icons";

const FormularioAcertos = ({solicitacoes_acerto, onSubmitFormAcertos, formRef, tiposDeAcertoDocumentosAgrupados, handleChangeTipoDeAcertoDocumento, textoCategoria, corTextoCategoria, adicionaTextoECorCategoriaVazio, removeTextoECorCategoriaTipoDeAcertoJaCadastrado, ehSolicitacaoCopiada}) =>{
const FormularioAcertos = ({solicitacoes_acerto, validaContaAoSalvar, formRef, tiposDeAcertoDocumentosAgrupados, handleChangeTipoDeAcertoDocumento, textoCategoria, corTextoCategoria, adicionaTextoECorCategoriaVazio, removeTextoECorCategoriaTipoDeAcertoJaCadastrado, ehSolicitacaoCopiada}) =>{

const categoriaNaoPodeRepetir = (categoria) => {
const categoriasQueNaoPodemRepetir = [
Expand Down Expand Up @@ -71,7 +71,7 @@ const FormularioAcertos = ({solicitacoes_acerto, onSubmitFormAcertos, formRef, t
validateOnBlur={true}
validateOnChange={true}
validationSchema={YupSignupSchemaDetalharAcertosDocumentos}
onSubmit={onSubmitFormAcertos}
onSubmit={validaContaAoSalvar}
innerRef={formRef}
>
{props => {
Expand Down
Loading

0 comments on commit 49c1fcf

Please sign in to comment.