Skip to content

Commit 2b00297

Browse files
authored
Merge pull request #60 from Mykyta-Petrov/mnt2
Maintenance
2 parents 9505362 + 761a1c2 commit 2b00297

File tree

9 files changed

+3192
-2848
lines changed

9 files changed

+3192
-2848
lines changed

app/envelope.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ def download(args, session):
9898
ds_client = DsClient.get_configured_instance(access_token)
9999
envelope_api = EnvelopesApi(ds_client)
100100
file_path = envelope_api.get_document(
101-
account_id, args['document_id'], args['envelope_id']
101+
account_id, args['document_id'], args['envelope_id'], certificate=True
102102
)
103103
(dirname, filename) = os.path.split(file_path)
104104
return send_from_directory(
105105
directory=dirname,
106-
filename=filename,
106+
path=filename,
107107
as_attachment=True
108108
)

package-lock.json

Lines changed: 3122 additions & 2784 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,44 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@babel/core": "^7.22.5",
7-
"@testing-library/react": "^14.0.0",
8-
"axios": "^1.4.0",
6+
"@babel/core": "^7.24.4",
7+
"@testing-library/react": "^14.3.1",
8+
"axios": "^1.6.8",
99
"bootstrap": "^4.6.2",
10-
"bootstrap-icons": "^1.10.5",
11-
"chokidar": "^3.5.3",
10+
"bootstrap-icons": "^1.11.3",
11+
"chokidar": "^3.6.0",
1212
"history": "^4.10.1",
13-
"html-react-parser": "^4.0.0",
14-
"i18next": "^23.1.0",
13+
"html-react-parser": "^4.2.10",
14+
"i18next": "^23.11.2",
1515
"i18next-xhr-backend": "^3.2.2",
16-
"jquery": "^3.7.0",
16+
"jquery": "^3.7.1",
1717
"node-sass": "^9.0.0",
1818
"popper.js": "^1.16.1",
1919
"react": "^18.2.0",
20-
"react-bootstrap": "^2.7.4",
21-
"react-datepicker": "^4.14.0",
20+
"react-bootstrap": "^2.10.2",
21+
"react-datepicker": "^4.25.0",
2222
"react-dom": "^18.2.0",
2323
"react-helmet": "^6.1.0",
24-
"react-i18next": "^13.0.0",
25-
"react-router-dom": "^6.13.0",
24+
"react-i18next": "^13.5.0",
25+
"react-router-dom": "^6.22.3",
2626
"react-scripts": "^5.0.1",
27-
"typescript": "^4.2.4",
28-
"uuid": "^9.0.0",
27+
"typescript": "^4.9.5",
28+
"uuid": "^9.0.1",
2929
"watchpack-chokidar2": "^2.0.1"
3030
},
3131
"optionalDependencies": {
32-
"fsevents": "*"
32+
"fsevents": "^2.3.3"
3333
},
3434
"overrides": {
3535
"nth-check": "^2.1.1",
3636
"node-forge": "^1.3.1",
3737
"minimist": "^1.2.7",
3838
"glob-parent": "^6.0.2",
3939
"ejs": "3.1.8",
40-
"async": "^3.2.4"
40+
"async": "^3.2.4",
41+
"postcss": "^8.4.38",
42+
"tough-cookie": "^4.1.3",
43+
"node-sass": "^9.0.0"
4144
},
4245
"scripts": {
4346
"start": "react-scripts start",

requirements.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
cachelib==0.10.2
2-
certifi==2023.5.7
3-
cffi==1.15.1
4-
chardet==5.1.0
5-
click==8.1.3
6-
cryptography==41.0.1
7-
docusign-esign==3.23.0
8-
Flask==1.1.2
9-
Flask-Cors==3.0.10
10-
Flask-Session==0.3.2
11-
Flask-WTF==1.1.1
12-
idna==3.4
13-
itsdangerous==2.0.1
14-
Jinja2==3.0.3
15-
MarkupSafe==2.1.3
2+
certifi==2024.2.2
3+
cffi==1.16.0
4+
chardet==5.2.0
5+
click==8.1.7
6+
cryptography==42.0.5
7+
docusign-esign==3.25.1
8+
Flask==3.0.3
9+
Flask-Cors==4.0.0
10+
Flask-Session==0.8.0
11+
Flask-WTF==1.2.1
12+
idna==3.7
13+
itsdangerous==2.2.0
14+
Jinja2==3.1.3
15+
MarkupSafe==2.1.5
1616
nose==1.3.7
1717
oauthlib==3.2.2
18-
pycparser==2.21
19-
PyJWT==2.4.0
20-
python-dateutil==2.8.2
21-
python-dotenv==1.0.0
18+
pycparser==2.22
19+
PyJWT==2.8.0
20+
python-dateutil==2.9.0
21+
python-dotenv==1.0.1
2222
requests==2.31.0
23-
requests-oauthlib==1.3.1
23+
requests-oauthlib==2.0.0
2424
six==1.16.0
25-
urllib3==2.0.3
26-
Werkzeug==2.0.3
27-
WTForms==3.0.1
25+
urllib3==2.2.1
26+
Werkzeug==3.0.2
27+
WTForms==3.1.2

src/api/auth.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { handleError } from "./apiHelper";
2-
import history from "./history";
32
import axios from './interceptors';
43

54
export async function codeGrantAuth(redirectUrl) {
@@ -13,7 +12,7 @@ export async function codeGrantAuth(redirectUrl) {
1312
}
1413
}
1514

16-
export async function callback() {
15+
export async function callback(navigate) {
1716
try {
1817
const urlParams = new URLSearchParams(window.location.search);
1918
const code = urlParams.get('code');
@@ -28,7 +27,7 @@ export async function callback() {
2827
);
2928
return response.data.message
3029
} catch (error) {
31-
history.push("/");
30+
navigate("/");
3231
handleError(error);
3332
}
3433
}
@@ -45,7 +44,6 @@ export async function logOut() {
4544
}
4645
);
4746
} catch (error) {
48-
history.push('/');
4947
handleError(error);
5048
}
5149
}
@@ -65,7 +63,7 @@ export async function getStatus(setStatus, setAuthType) {
6563
}
6664
}
6765

68-
export async function jwtAuth() {
66+
export async function jwtAuth(navigate) {
6967
try {
7068
await axios.get(
7169
process.env.REACT_APP_API_BASE_URL + "/jwt_auth",
@@ -74,37 +72,37 @@ export async function jwtAuth() {
7472
}
7573
);
7674
} catch (error){
77-
history.push('/');
75+
navigate('/');
7876
handleError(error);
7977
}
8078
}
8179

82-
export async function checkUnlogged(logged, setStatus, setAuthType) {
80+
export async function checkUnlogged(logged, setStatus, setAuthType, navigate) {
8381
if (!logged) {
84-
await jwtAuth();
82+
await jwtAuth(navigate);
8583
await getStatus(setStatus, setAuthType)
8684
}
8785
}
8886

89-
export async function completeCallback(setShowAlert, setStatus, setAuthType, setShowJWTModal) {
87+
export async function completeCallback(setShowAlert, setStatus, setAuthType, setShowJWTModal, navigate) {
9088
try {
91-
const message = await callback();
89+
const message = await callback(navigate);
9290
const redirectUrl = localStorage.getItem("redirectUrl")
9391

9492
await getStatus(setStatus, setAuthType);
9593
if (message === "Logged in with JWT") {
9694
setShowAlert(true);
9795
}
9896
else if (redirectUrl === '/byNewInsurance') {
99-
await checkPayment(setShowJWTModal);
97+
await checkPayment(setShowJWTModal, navigate);
10098
}
101-
history.push(redirectUrl);
99+
navigate(redirectUrl);
102100
} catch (error){
103101
handleError(error, setShowJWTModal)
104102
}
105103
}
106104

107-
export async function checkPayment(setShowJWTModal) {
105+
export async function checkPayment(setShowJWTModal, navigate) {
108106
try {
109107
const response = await axios.get(
110108
process.env.REACT_APP_API_BASE_URL + "/check_payment",
@@ -114,7 +112,7 @@ export async function checkPayment(setShowJWTModal) {
114112
);
115113
return response;
116114
} catch (error){
117-
history.push('/');
115+
navigate("/");
118116
handleError(error, setShowJWTModal);
119117
}
120118
}

src/components/Callback.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React, { useEffect, useContext } from "react";
22
import { completeCallback } from "../api/auth";
33
import LoggedUserContext from "../contexts/logged-user/logged-user.context";
4+
import { useNavigate } from "react-router-dom";
45

56
export const Callback = () => {
67
const { setShowAlert, setLogged, setAuthType, setShowJWTModal } = useContext(LoggedUserContext);
8+
const navigate = useNavigate();
79
useEffect(() => {
8-
completeCallback(setShowAlert, setLogged, setAuthType, setShowJWTModal);
10+
completeCallback(setShowAlert, setLogged, setAuthType, setShowJWTModal, navigate);
911
// eslint-disable-next-line react-hooks/exhaustive-deps
1012
}, []);
1113

src/components/JWTModal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ import { useTranslation } from "react-i18next";
44
import { jwtAuth, getStatus, logOut } from "../api/auth";
55
import LoggedUserContext from "../contexts/logged-user/logged-user.context";
66
import parse from "html-react-parser";
7+
import { useNavigate } from "react-router-dom";
78

89

910
export const LoginWithJWT = props => {
1011
const [errors, setErrors] = useState({});
1112
const { setLogged, setAuthType } = useContext(LoggedUserContext);
1213
const { t } = useTranslation("JWTModal");
14+
const navigate = useNavigate();
1315

1416
async function handleClick(event) {
1517
event.preventDefault();
1618
try {
1719
await logOut();
18-
await jwtAuth();
20+
await jwtAuth(navigate);
1921
await getStatus(setLogged, setAuthType);
2022
handleClose();
2123
} catch (error) {

src/components/Modal.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { Modal, Container, Button } from "react-bootstrap";
33
import { InputRadio } from "./InputRadio";
44
import { useTranslation } from "react-i18next";
55
import { codeGrantAuth, jwtAuth, getStatus } from "../api/auth";
6-
import history from "../api/history";
76
import parse from "html-react-parser";
87
import LoggedUserContext from "../contexts/logged-user/logged-user.context";
8+
import { useNavigate } from "react-router-dom";
99

1010

1111
const initialState = {
@@ -22,6 +22,7 @@ export const Login = (props) => {
2222
const { redirectUrl, setLogged, setAuthType } = useContext(LoggedUserContext);
2323
const { t } = useTranslation("Modal");
2424
const loginOptions = t("LoginOptions", { returnObjects: true });
25+
const navigate = useNavigate();
2526

2627

2728
function handleChange(event) {
@@ -46,9 +47,9 @@ export const Login = (props) => {
4647
if (request.loginOption === loginOptions[0]) {
4748
await codeGrantAuth(redirectUrl);
4849
} else if (request.loginOption === loginOptions[1]){
49-
await jwtAuth();
50+
await jwtAuth(navigate);
5051
await getStatus(setLogged, setAuthType);
51-
history.push(redirectUrl);
52+
navigate(redirectUrl);
5253
handleClose();
5354
}
5455
} catch(error) {

src/pages/home/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from "react";
2-
import { Link } from "react-router-dom";
2+
import { Link, useNavigate } from "react-router-dom";
33
import image1 from "../../assets/img/img-01.svg";
44
import image2 from "../../assets/img/img-02.svg";
55
import image3 from "../../assets/img/img-03.svg";
@@ -9,12 +9,12 @@ import parse from "html-react-parser";
99
import LoggedUserContext from "../../contexts/logged-user/logged-user.context";
1010
import ModalContext from "../../contexts/modal/modal.context";
1111
import { checkPayment } from "../../api/auth";
12-
import history from "../../api/history";
1312

1413
export const Home = () => {
1514
const { t } = useTranslation("Home");
1615
const { logged, setRedirectUrl, setShowJWTModal, authType } = useContext(LoggedUserContext);
1716
const { setModalShow } = useContext(ModalContext);
17+
const navigate = useNavigate();
1818

1919
function handleClick(event, redirectUrl) {
2020
event.preventDefault();
@@ -25,12 +25,12 @@ export const Home = () => {
2525
async function handlePayment(event, redirectUrl) {
2626
event.preventDefault()
2727
if (authType === "code_grant"){
28-
const response = await checkPayment(setShowJWTModal)
28+
const response = await checkPayment(setShowJWTModal, navigate)
2929
if (response.status === 200) {
30-
history.push(redirectUrl);
30+
navigate(redirectUrl);
3131
}
3232
} else {
33-
history.push(redirectUrl);
33+
navigate(redirectUrl);
3434
}
3535
}
3636

0 commit comments

Comments
 (0)