Merge branch 'staging' into preprod

This commit is contained in:
Maxime Lalo 2023-12-18 14:47:20 +01:00
commit eea32e39ed
13 changed files with 237 additions and 152 deletions

165
package-lock.json generated
View File

@ -28,6 +28,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-select": "^5.7.2", "react-select": "^5.7.2",
"react-toastify": "^9.1.3",
"sass": "^1.59.2", "sass": "^1.59.2",
"sharp": "^0.32.1", "sharp": "^0.32.1",
"typescript": "4.9.5", "typescript": "4.9.5",
@ -223,9 +224,9 @@
} }
}, },
"node_modules/@babel/runtime": { "node_modules/@babel/runtime": {
"version": "7.23.5", "version": "7.23.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.6.tgz",
"integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==", "integrity": "sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==",
"dependencies": { "dependencies": {
"regenerator-runtime": "^0.14.0" "regenerator-runtime": "^0.14.0"
}, },
@ -234,9 +235,9 @@
} }
}, },
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.23.5", "version": "7.23.6",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz",
"integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==",
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.23.4", "@babel/helper-string-parser": "^7.23.4",
"@babel/helper-validator-identifier": "^7.22.20", "@babel/helper-validator-identifier": "^7.22.20",
@ -432,9 +433,9 @@
} }
}, },
"node_modules/@floating-ui/core": { "node_modules/@floating-ui/core": {
"version": "1.5.1", "version": "1.5.2",
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.1.tgz", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.2.tgz",
"integrity": "sha512-QgcKYwzcc8vvZ4n/5uklchy8KVdjJwcOeI+HnnTNclJjs2nYsy23DOCf+sSV1kBwD9yDAoVKCkv/gEPzgQU3Pw==", "integrity": "sha512-Ii3MrfY/GAIN3OhXNzpCKaLxHQfJF9qvwq/kEJYdqDxeIHa01K8sldugal6TmeeXl+WMvhv9cnVzUTaFFJF09A==",
"dependencies": { "dependencies": {
"@floating-ui/utils": "^0.1.3" "@floating-ui/utils": "^0.1.3"
} }
@ -496,14 +497,14 @@
"integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==" "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw=="
}, },
"node_modules/@mui/base": { "node_modules/@mui/base": {
"version": "5.0.0-beta.25", "version": "5.0.0-beta.27",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.25.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.27.tgz",
"integrity": "sha512-Iiv+IcappRRv6IBlknIVmLkXxfp51NEX1+l9f+dIbBuPU4PaRULegr1lCeHKsC45KU5ruxM5xMg4R/de03aJQg==", "integrity": "sha512-duL37qxihT1N0pW/gyXVezP7SttLkF+cLAs/y6g6ubEFmVadjbnZ45SeF12/vAiKzqwf5M0uFH1cczIPXFZygA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.4", "@babel/runtime": "^7.23.5",
"@floating-ui/react-dom": "^2.0.4", "@floating-ui/react-dom": "^2.0.4",
"@mui/types": "^7.2.10", "@mui/types": "^7.2.11",
"@mui/utils": "^5.14.19", "@mui/utils": "^5.15.0",
"@popperjs/core": "^2.11.8", "@popperjs/core": "^2.11.8",
"clsx": "^2.0.0", "clsx": "^2.0.0",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
@ -527,25 +528,25 @@
} }
}, },
"node_modules/@mui/core-downloads-tracker": { "node_modules/@mui/core-downloads-tracker": {
"version": "5.14.19", "version": "5.15.0",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.19.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.0.tgz",
"integrity": "sha512-y4JseIen5pmZs1n9hHy95HKKioKco8f6N2lford2AmjJigVJOv0KsU0qryiCpyuEUZmi/xCduVilHsK9DSkPcA==", "integrity": "sha512-NpGtlHwuyLfJtdrlERXb8qRqd279O0VnuGaZAor1ehdNhUJOD1bSxHDeXKZkbqNpvi50hasFj7lsbTpluworTQ==",
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/mui-org" "url": "https://opencollective.com/mui-org"
} }
}, },
"node_modules/@mui/material": { "node_modules/@mui/material": {
"version": "5.14.19", "version": "5.15.0",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.19.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.0.tgz",
"integrity": "sha512-jSPLXst/YPgDGolhiu4rbethKjLVrI1IkoK8YrFUv8ygxDuhQdsE6+ZqjSSRXk3ytTMf6ghPnQ88OFRk4XjpNw==", "integrity": "sha512-60CDI/hQNwJv9a3vEZtFG7zz0USdQhVwpBd3fZqrzhuXSdiMdYMaZcCXeX/KMuNq0ZxQEAZd74Pv+gOb408QVA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.4", "@babel/runtime": "^7.23.5",
"@mui/base": "5.0.0-beta.25", "@mui/base": "5.0.0-beta.27",
"@mui/core-downloads-tracker": "^5.14.19", "@mui/core-downloads-tracker": "^5.15.0",
"@mui/system": "^5.14.19", "@mui/system": "^5.15.0",
"@mui/types": "^7.2.10", "@mui/types": "^7.2.11",
"@mui/utils": "^5.14.19", "@mui/utils": "^5.15.0",
"@types/react-transition-group": "^4.4.9", "@types/react-transition-group": "^4.4.9",
"clsx": "^2.0.0", "clsx": "^2.0.0",
"csstype": "^3.1.2", "csstype": "^3.1.2",
@ -580,12 +581,12 @@
} }
}, },
"node_modules/@mui/private-theming": { "node_modules/@mui/private-theming": {
"version": "5.14.19", "version": "5.15.0",
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.19.tgz", "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.0.tgz",
"integrity": "sha512-U9w39VpXLGVM8wZlUU/47YGTsBSk60ZQRRxQZtdqPfN1N7OVllQeN4cEKZKR8PjqqR3aYRcSciQ4dc6CttRoXQ==", "integrity": "sha512-7WxtIhXxNek0JjtsYy+ut2LtFSLpsUW5JSDehQO+jF7itJ8ehy7Bd9bSt2yIllbwGjCFowLfYpPk2Ykgvqm1tA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.4", "@babel/runtime": "^7.23.5",
"@mui/utils": "^5.14.19", "@mui/utils": "^5.15.0",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
}, },
"engines": { "engines": {
@ -606,11 +607,11 @@
} }
}, },
"node_modules/@mui/styled-engine": { "node_modules/@mui/styled-engine": {
"version": "5.14.19", "version": "5.15.0",
"resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.19.tgz", "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.15.0.tgz",
"integrity": "sha512-jtj/Pyn/bS8PM7NXdFNTHWZfE3p+vItO4/HoQbUeAv3u+cnWXcTBGHHY/xdIn446lYGFDczTh1YyX8G4Ts0Rtg==", "integrity": "sha512-6NysIsHkuUS2lF+Lzv1jiK3UjBJk854/vKVcJQVGKlPiqNEVZJNlwaSpsaU5xYXxWEZYfbVFSAomLOS/LV/ovQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.4", "@babel/runtime": "^7.23.5",
"@emotion/cache": "^11.11.0", "@emotion/cache": "^11.11.0",
"csstype": "^3.1.2", "csstype": "^3.1.2",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
@ -637,15 +638,15 @@
} }
}, },
"node_modules/@mui/system": { "node_modules/@mui/system": {
"version": "5.14.19", "version": "5.15.0",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.19.tgz", "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.0.tgz",
"integrity": "sha512-4e3Q+2nx+vgEsd0h5ftxlZGB7XtkkPos/zWqCqnxUs1l/T70s0lF2YNrWHHdSQ7LgtBu0eQ0qweZG2pR7KwkAw==", "integrity": "sha512-8TPjfTlYBNB7/zBJRL4QOD9kImwdZObbiYNh0+hxvhXr2koezGx8USwPXj8y/JynbzGCkIybkUztCdWlMZe6OQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.4", "@babel/runtime": "^7.23.5",
"@mui/private-theming": "^5.14.19", "@mui/private-theming": "^5.15.0",
"@mui/styled-engine": "^5.14.19", "@mui/styled-engine": "^5.15.0",
"@mui/types": "^7.2.10", "@mui/types": "^7.2.11",
"@mui/utils": "^5.14.19", "@mui/utils": "^5.15.0",
"clsx": "^2.0.0", "clsx": "^2.0.0",
"csstype": "^3.1.2", "csstype": "^3.1.2",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
@ -676,9 +677,9 @@
} }
}, },
"node_modules/@mui/types": { "node_modules/@mui/types": {
"version": "7.2.10", "version": "7.2.11",
"resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.10.tgz", "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.11.tgz",
"integrity": "sha512-wX1vbDC+lzF7FlhT6A3ffRZgEoKWPF8VqRoTu4lZwouFX2t90KyCMsgepMw5DxLak1BSp/KP86CmtZttikb/gQ==", "integrity": "sha512-KWe/QTEsFFlFSH+qRYf3zoFEj3z67s+qAuSnMMg+gFwbxG7P96Hm6g300inQL1Wy///gSRb8juX7Wafvp93m3w==",
"peerDependencies": { "peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0" "@types/react": "^17.0.0 || ^18.0.0"
}, },
@ -689,11 +690,11 @@
} }
}, },
"node_modules/@mui/utils": { "node_modules/@mui/utils": {
"version": "5.14.19", "version": "5.15.0",
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.19.tgz", "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.0.tgz",
"integrity": "sha512-qAHvTXzk7basbyqPvhgWqN6JbmI2wLB/mf97GkSlz5c76MiKYV6Ffjvw9BjKZQ1YRb8rDX9kgdjRezOcoB91oQ==", "integrity": "sha512-XSmTKStpKYamewxyJ256+srwEnsT3/6eNo6G7+WC1tj2Iq9GfUJ/6yUoB7YXjOD2jTZ3XobToZm4pVz1LBt6GA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.4", "@babel/runtime": "^7.23.5",
"@types/prop-types": "^15.7.11", "@types/prop-types": "^15.7.11",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"react-is": "^18.2.0" "react-is": "^18.2.0"
@ -1016,9 +1017,9 @@
} }
}, },
"node_modules/@types/react-transition-group": { "node_modules/@types/react-transition-group": {
"version": "4.4.9", "version": "4.4.10",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.9.tgz", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz",
"integrity": "sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==", "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==",
"dependencies": { "dependencies": {
"@types/react": "*" "@types/react": "*"
} }
@ -1508,9 +1509,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001566", "version": "1.0.30001570",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz",
"integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==", "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@ -1717,9 +1718,9 @@
} }
}, },
"node_modules/csstype": { "node_modules/csstype": {
"version": "3.1.2", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
}, },
"node_modules/damerau-levenshtein": { "node_modules/damerau-levenshtein": {
"version": "1.0.8", "version": "1.0.8",
@ -2681,9 +2682,9 @@
} }
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "13.23.0", "version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dependencies": { "dependencies": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
}, },
@ -3598,9 +3599,9 @@
} }
}, },
"node_modules/node-abi": { "node_modules/node-abi": {
"version": "3.51.0", "version": "3.52.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.52.0.tgz",
"integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", "integrity": "sha512-JJ98b02z16ILv7859irtXn4oUaFWADtvkzy2c0IAatNVX2Mc9Yoh8z6hZInn3QwvMEYhHuQloYi+TTQy67SIdQ==",
"dependencies": { "dependencies": {
"semver": "^7.3.5" "semver": "^7.3.5"
}, },
@ -4085,6 +4086,26 @@
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
} }
}, },
"node_modules/react-toastify": {
"version": "9.1.3",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.3.tgz",
"integrity": "sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==",
"dependencies": {
"clsx": "^1.1.1"
},
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
}
},
"node_modules/react-toastify/node_modules/clsx": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
"engines": {
"node": ">=6"
}
},
"node_modules/react-transition-group": { "node_modules/react-transition-group": {
"version": "4.4.5", "version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
@ -4125,9 +4146,9 @@
} }
}, },
"node_modules/reflect-metadata": { "node_modules/reflect-metadata": {
"version": "0.1.13", "version": "0.1.14",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A=="
}, },
"node_modules/reflect.getprototypeof": { "node_modules/reflect.getprototypeof": {
"version": "1.0.4", "version": "1.0.4",
@ -4495,9 +4516,9 @@
} }
}, },
"node_modules/streamx": { "node_modules/streamx": {
"version": "2.15.5", "version": "2.15.6",
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz",
"integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==", "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==",
"dependencies": { "dependencies": {
"fast-fifo": "^1.1.0", "fast-fifo": "^1.1.0",
"queue-tick": "^1.0.1" "queue-tick": "^1.0.1"

View File

@ -30,6 +30,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-select": "^5.7.2", "react-select": "^5.7.2",
"react-toastify": "^9.1.3",
"sass": "^1.59.2", "sass": "^1.59.2",
"sharp": "^0.32.1", "sharp": "^0.32.1",
"typescript": "4.9.5", "typescript": "4.9.5",

View File

@ -18,6 +18,7 @@ import Alert from "../Modal/Alert";
import GreenCheckIcon from "@Assets/Icons/green-check.svg"; import GreenCheckIcon from "@Assets/Icons/green-check.svg";
import Loader from "../Loader"; import Loader from "../Loader";
import TextAreaField from "../Form/TextareaField"; import TextAreaField from "../Form/TextareaField";
import { toast } from "react-toastify";
type IProps = { type IProps = {
defaultFiles?: FileCustomer[]; defaultFiles?: FileCustomer[];
@ -86,6 +87,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
this.addDocument = this.addDocument.bind(this); this.addDocument = this.addDocument.bind(this);
this.onFileChange = this.onFileChange.bind(this); this.onFileChange = this.onFileChange.bind(this);
this.addFile = this.addFile.bind(this);
this.removeFile = this.removeFile.bind(this); this.removeFile = this.removeFile.bind(this);
this.onDragOver = this.onDragOver.bind(this); this.onDragOver = this.onDragOver.bind(this);
this.onDragDrop = this.onDragDrop.bind(this); this.onDragDrop = this.onDragDrop.bind(this);
@ -128,7 +130,8 @@ export default class DepositDocument extends React.Component<IProps, IState> {
}> }>
{this.props.document.document_type?.name} {this.props.document.document_type?.name}
</div> </div>
{this.props.document.document_type?.public_description !== "" && {this.props.document.document_type?.public_description !== " " &&
this.props.document.document_type?.public_description !== "" &&
this.props.document.document_status !== EDocumentStatus.VALIDATED && ( this.props.document.document_status !== EDocumentStatus.VALIDATED && (
<Tooltip text={this.props.document.document_type?.public_description} /> <Tooltip text={this.props.document.document_type?.public_description} />
)} )}
@ -146,44 +149,42 @@ export default class DepositDocument extends React.Component<IProps, IState> {
))} ))}
</div> </div>
</div> </div>
{this.props.document.document_status !== EDocumentStatus.VALIDATED && this.state.files.length > 0 && ( <div className={classes["documents-container"]}>
<div className={classes["documents-container"]}> {this.state.files.map((file) => {
{this.state.files.map((file) => { const fileObj = file.file;
const fileObj = file.file; if (file.archived) return;
if (file.archived) return; return (
return ( <div className={classes["file-container"]} key={fileObj.name + file.index}>
<div className={classes["file-container"]} key={fileObj.name + file.index}>
<div className={classes["left-part"]}>
<Image src={DocumentCheckIcon} alt="Document check" />
<Typography typo={ITypo.P_16} color={ITypoColor.GREY} title={file.fileName ?? fileObj.name}>
{this.shortName(file.fileName || fileObj.name)}
</Typography>
</div>
<Image
src={CrossIcon}
alt="Cross icon"
className={classes["cross"]}
onClick={this.removeFile}
data-file={file.index}
/>
</div>
);
})}
{this.state.loading && (
<div className={classes["file-container"]}>
<div className={classes["left-part"]}> <div className={classes["left-part"]}>
<div className={classes["loader"]}> <Image src={DocumentCheckIcon} alt="Document check" />
<Loader /> <Typography typo={ITypo.P_16} color={ITypoColor.GREY} title={file.fileName ?? fileObj.name}>
</div> {this.shortName(file.fileName || fileObj.name)}
<Typography typo={ITypo.P_16} color={ITypoColor.GREY}>
Chargement...
</Typography> </Typography>
</div> </div>
<div /> <Image
src={CrossIcon}
alt="Cross icon"
className={classes["cross"]}
onClick={this.removeFile}
data-file={file.index}
/>
</div> </div>
)} );
</div> })}
)} {this.state.loading && (
<div className={classes["file-container"]}>
<div className={classes["left-part"]}>
<div className={classes["loader"]}>
<Loader />
</div>
<Typography typo={ITypo.P_16} color={ITypoColor.GREY}>
Chargement...
</Typography>
</div>
<div />
</div>
)}
</div>
{this.props.document.document_status !== EDocumentStatus.VALIDATED && ( {this.props.document.document_status !== EDocumentStatus.VALIDATED && (
<div className={classes["bottom-container"]}> <div className={classes["bottom-container"]}>
<Button variant={EButtonVariant.LINE} className={classes["add-button"]} onClick={this.addDocument}> <Button variant={EButtonVariant.LINE} className={classes["add-button"]} onClick={this.addDocument}>
@ -215,13 +216,11 @@ export default class DepositDocument extends React.Component<IProps, IState> {
</Typography> </Typography>
)} )}
{this.state.showFailedUploaded && ( {this.state.showFailedUploaded && (
<Alert onClose={this.onCloseAlertUpload} <Alert onClose={this.onCloseAlertUpload} header={"Fichier non autorisé"} isOpen={!!this.state.showFailedUploaded}>
header={"Fichier non autorisé"}
isOpen={!!this.state.showFailedUploaded}>
<div className={classes["modal-content"]}> <div className={classes["modal-content"]}>
<Typography typo={ITypo.P_16} className={classes["text"]}> <Typography typo={ITypo.P_16} className={classes["text"]}>
{this.state.showFailedUploaded} {this.state.showFailedUploaded}
</Typography> </Typography>
</div> </div>
</Alert> </Alert>
)} )}
@ -243,6 +242,10 @@ export default class DepositDocument extends React.Component<IProps, IState> {
} }
} }
private openSuccessToast() {
toast.success("Document envoyé avec succès");
}
private onCloseModalShowRefusedReason() { private onCloseModalShowRefusedReason() {
this.setState({ this.setState({
isShowRefusedReasonModalVisible: false, isShowRefusedReasonModalVisible: false,
@ -344,7 +347,6 @@ export default class DepositDocument extends React.Component<IProps, IState> {
alert("Ce fichier est trop volumineux"); alert("Ce fichier est trop volumineux");
return false; return false;
} }
this.setState({ this.setState({
loading: true, loading: true,
}); });
@ -358,8 +360,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
try { try {
newFile = await Files.getInstance().post(formData); newFile = await Files.getInstance().post(formData);
} catch (e) { } catch (e) {
this.setState({ showFailedUploaded: "Le fichier ne correspond pas aux critères demandés", loading: false });
this.setState({ showFailedUploaded: "Le fichier ne correspond pas aux critères demandés", loading: false, });
return false; return false;
} }
const files = this.state.currentFiles ? [...this.state.currentFiles, newFile] : [newFile]; const files = this.state.currentFiles ? [...this.state.currentFiles, newFile] : [newFile];
@ -374,6 +375,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
fileName: newFile?.file_name ?? "", fileName: newFile?.file_name ?? "",
}, },
]; ];
this.openSuccessToast();
this.setState( this.setState(
{ {
currentFiles: files, currentFiles: files,
@ -412,8 +414,13 @@ export default class DepositDocument extends React.Component<IProps, IState> {
const file = files[0]; const file = files[0];
try { try {
if (file) this.addFile(file); if (file) {
await this.setState({ loading: true }, () => {
this.addFile(file);
});
}
} catch (e) { } catch (e) {
this.setState({ loading: false });
console.log(e); console.log(e);
} }
} }

View File

@ -50,12 +50,16 @@ class DocumentNotaryClass extends React.Component<IPropsClass, IState> {
} }
private getDocumentsTitle() { private getDocumentsTitle() {
const documentFiles = this.props.document.files; const documentFiles = this.props.document.files?.filter((file) => !file.archived_at);
if (documentFiles) { if (documentFiles) {
if (documentFiles.length === 1) { if (
documentFiles.length === 1 &&
(this.props.document.document_status === EDocumentStatus.VALIDATED ||
this.props.document.document_status === EDocumentStatus.DEPOSITED)
) {
const fileName = documentFiles[0]?.file_path?.split("/").pop(); const fileName = documentFiles[0]?.file_path?.split("/").pop();
if (fileName && fileName.length > 20) { if (fileName && fileName.length > 20) {
return `${fileName.substring(0, 7)}...${fileName.substring(fileName.length - 7, fileName.length)}`; return `Nombre de documents : 1`;
} else { } else {
return fileName; return fileName;
} }
@ -69,7 +73,7 @@ class DocumentNotaryClass extends React.Component<IPropsClass, IState> {
return "Aucun document déposé"; return "Aucun document déposé";
} }
return `${documentFileLength} documents déposés`; return `Nombre de documents : ${documentFileLength}`;
} }
} else { } else {
return "Aucun document déposé"; return "Aucun document déposé";

View File

@ -61,6 +61,17 @@ export default class UserFolder extends React.Component<IProps, IState> {
.get() .get()
.modules.pages.Folder.pages.AskDocument.props.path.replace("[folderUid]", this.props.folder.uid ?? "") .modules.pages.Folder.pages.AskDocument.props.path.replace("[folderUid]", this.props.folder.uid ?? "")
.replace("[customerUid]", this.props.customer.uid ?? ""); .replace("[customerUid]", this.props.customer.uid ?? "");
let documentAskedSubtitle = "";
if (documentsAsked && documentsAsked?.length > 0) {
documentAskedSubtitle = "Un mail de demande de documents a été envoyé pour ces documents :";
} else {
if (otherDocuments && otherDocuments.length === 0) {
documentAskedSubtitle = "Vous n'avez pas encore demandé de documents";
} else {
documentAskedSubtitle = "Aucun document en attente";
}
}
return ( return (
<div className={classes["root"]} data-opened={this.props.isOpened.toString()}> <div className={classes["root"]} data-opened={this.props.isOpened.toString()}>
<Confirm <Confirm
@ -96,11 +107,7 @@ export default class UserFolder extends React.Component<IProps, IState> {
<DocumentList <DocumentList
documents={documentsAsked} documents={documentsAsked}
title="Documents demandés" title="Documents demandés"
subtitle={ subtitle={documentAskedSubtitle}
documentsAsked && documentsAsked?.length === 0
? "Vous n'avez pas encore demandé de documents"
: "Un mail de demande de documents a été envoyé pour ces documents :"
}
openDeletionModal={this.openDeletionModal} openDeletionModal={this.openDeletionModal}
folderUid={this.props.folder.uid!} folderUid={this.props.folder.uid!}
className={classes["documents-asked"]} className={classes["documents-asked"]}
@ -129,7 +136,7 @@ export default class UserFolder extends React.Component<IProps, IState> {
<div className={classes["button-container"]}> <div className={classes["button-container"]}>
<Link href={redirectPath}> <Link href={redirectPath}>
<Button variant={EButtonVariant.LINE} icon={PlusIcon}> <Button variant={EButtonVariant.LINE} icon={PlusIcon}>
Demander un autre document{" "} Demander des documents
</Button> </Button>
</Link> </Link>
</div> </div>

View File

@ -1,7 +1,8 @@
import Head from "next/head"; import Head from "next/head";
import { ReactNode } from "react"; import { ReactNode } from "react";
type DefaultLayoutProps = { children: ReactNode }; type DefaultLayoutProps = { children: ReactNode };
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
export const DefaultLayout = ({ children }: DefaultLayoutProps) => { export const DefaultLayout = ({ children }: DefaultLayoutProps) => {
return ( return (
<> <>
@ -9,7 +10,10 @@ export const DefaultLayout = ({ children }: DefaultLayoutProps) => {
<title>LECoffre</title> <title>LECoffre</title>
{/* <link rel="shortcut icon" href="/favicon.svg" /> */} {/* <link rel="shortcut icon" href="/favicon.svg" /> */}
</Head> </Head>
<main>{children}</main> <main>
{children}
<ToastContainer />
</main>
</> </>
); );
}; };

View File

@ -47,10 +47,9 @@ export default function ClientDashboard(props: IProps) {
include: { include: {
contact: true, contact: true,
}, },
},
} },
} },
}
}, },
}; };
@ -98,10 +97,10 @@ export default function ClientDashboard(props: IProps) {
</Typography> </Typography>
<Typography typo={ITypo.P_16} className={classes["text"]}> <Typography typo={ITypo.P_16} className={classes["text"]}>
Votre notaire est dans l'attente de documents pour valider votre dossier. Voici la liste des documents.Veuillez Votre notaire est dans l'attente de documents pour valider votre dossier. Voici la liste des documents.
glisser / déposez chaque document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le <br /> Veuillez glisser / déposer chaque document dans la zone prévue à cet effet ou cliquez sur la zone puis
document correspondant. Si un des documents demandés ne vous concernent pas, veuillez contacter votre notaire à sélectionnez le document correspondant. <br /> En déposant un document, celui-ci est automatiquement enregistré et
l'aide du bouton ci-dessus. transmis à votre notaire.
</Typography> </Typography>
</div> </div>
</div> </div>

View File

@ -59,14 +59,19 @@ class AskDocumentsClass extends BasePage<IPropsClass, IState> {
<Form onSubmit={this.onFormSubmit}> <Form onSubmit={this.onFormSubmit}>
<div className={classes["form-container"]}> <div className={classes["form-container"]}>
<div className={classes["checkbox-container"]}> <div className={classes["checkbox-container"]}>
{this.state.documentTypes.map((documentType) => ( {this.state.documentTypes.map((documentType) => {
<CheckBox if (documentType.description && documentType.description.length > 1) {
name="document_types" return (
toolTip={documentType.description} <CheckBox
option={documentType} name="document_types"
key={documentType.value as string} toolTip={documentType.description}
/> option={documentType}
))} key={documentType.value as string}
/>
);
}
return <CheckBox name="document_types" option={documentType} key={documentType.value as string} />;
})}
</div> </div>
<div className={classes["add-document-container"]}> <div className={classes["add-document-container"]}>
<Button <Button
@ -161,7 +166,7 @@ class AskDocumentsClass extends BasePage<IPropsClass, IState> {
}; };
}); });
documentTypesOptions.sort((a, b) => a.label > b.label ? 1 : -1); documentTypesOptions.sort((a, b) => (a.label > b.label ? 1 : -1));
return documentTypesOptions; return documentTypesOptions;
} }

View File

@ -148,7 +148,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
)} )}
{this.props.isAnchored === AnchorStatus.ANCHORING && ( {this.props.isAnchored === AnchorStatus.ANCHORING && (
<Button variant={EButtonVariant.PRIMARY} disabled> <Button variant={EButtonVariant.PRIMARY} disabled>
Ancrage en cours...&nbsp;&nbsp; Demande d'ancrage envoyée...&nbsp;&nbsp;
<div className={classes["loader-container"]}> <div className={classes["loader-container"]}>
<div className={classes["loader"]}> <div className={classes["loader"]}>
<Loader /> <Loader />

View File

@ -59,7 +59,7 @@
display: flex; display: flex;
text-align: center; text-align: center;
justify-content: center; justify-content: center;
gap: 16px;
.delete-folder { .delete-folder {
display: flex; display: flex;
margin-left: 12px; margin-left: 12px;
@ -72,12 +72,12 @@
margin-left: 0; margin-left: 0;
margin-top: 12px; margin-top: 12px;
>* { > * {
flex: 1; flex: 1;
} }
} }
>* { > * {
width: 100%; width: 100%;
} }
} }

View File

@ -116,6 +116,13 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
<Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}> <Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}>
Restaurer le dossier Restaurer le dossier
</Button> </Button>
{this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && (
<Button
variant={EButtonVariant.PRIMARY}
onClick={() => this.downloadAnchoringProof(this.props.selectedFolder?.uid)}>
Télécharger la preuve d'ancrage
</Button>
)}
</div> </div>
</div> </div>
) : ( ) : (
@ -171,6 +178,25 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
this.setState({ isArchivedModalOpen: false }); this.setState({ isArchivedModalOpen: false });
} }
private async downloadAnchoringProof(uid?: string) {
if (!uid) return;
try {
const file: Blob = await OfficeFolderAnchors.getInstance().download(uid);
const url = window.URL.createObjectURL(file);
const a = document.createElement("a");
a.style.display = "none";
a.href = url;
// the filename you want
a.download = `anchoring_proof_${this.props.selectedFolder?.folder_number}_${this.props.selectedFolder?.name}.zip`;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
} catch (e) {
console.error(e);
}
}
private async getFolder(): Promise<OfficeFolder> { private async getFolder(): Promise<OfficeFolder> {
const query = { const query = {
q: { q: {

View File

@ -57,6 +57,7 @@ export default function Login() {
setPartialPhoneNumber(res.partialPhoneNumber); setPartialPhoneNumber(res.partialPhoneNumber);
setTotpCodeUid(res.totpCodeUid); setTotpCodeUid(res.totpCodeUid);
setStep(LoginStep.TOTP); setStep(LoginStep.TOTP);
setValidationErrors([]);
} catch (error: any) { } catch (error: any) {
setValidationErrors([ setValidationErrors([
{ {
@ -79,6 +80,7 @@ export default function Login() {
// If the code is valid setting it in state // If the code is valid setting it in state
if (res.validCode) setTotpCode(values["totpCode"]); if (res.validCode) setTotpCode(values["totpCode"]);
setValidationErrors([]);
// If it's first connection, show the form for first connection // If it's first connection, show the form for first connection
if (res.reason === TotpCodesReasons.FIRST_LOGIN) setStep(LoginStep.NEW_PASSWORD); if (res.reason === TotpCodesReasons.FIRST_LOGIN) setStep(LoginStep.NEW_PASSWORD);
// If it's password forgotten, show the form for password forgotten // If it's password forgotten, show the form for password forgotten
@ -130,6 +132,7 @@ export default function Login() {
} }
const token = await Auth.getInstance().setPassword({ totpCode, email, password: values["password"] }); const token = await Auth.getInstance().setPassword({ totpCode, email, password: values["password"] });
CustomerStore.instance.connect(token.accessToken, token.refreshToken); CustomerStore.instance.connect(token.accessToken, token.refreshToken);
setValidationErrors([]);
router.push(Module.getInstance().get().modules.pages.Folder.pages.Select.props.path); router.push(Module.getInstance().get().modules.pages.Folder.pages.Select.props.path);
// If set password worked, setting the token and redirecting // If set password worked, setting the token and redirecting
} catch (error: any) { } catch (error: any) {
@ -153,6 +156,7 @@ export default function Login() {
if (!values["password"]) return; if (!values["password"]) return;
const token = await Auth.getInstance().login({ totpCode, email, password: values["password"] }); const token = await Auth.getInstance().login({ totpCode, email, password: values["password"] });
CustomerStore.instance.connect(token.accessToken, token.refreshToken); CustomerStore.instance.connect(token.accessToken, token.refreshToken);
setValidationErrors([]);
router.push(Module.getInstance().get().modules.pages.Folder.pages.Select.props.path); router.push(Module.getInstance().get().modules.pages.Folder.pages.Select.props.path);
} catch (error: any) { } catch (error: any) {
setValidationErrors([ setValidationErrors([
@ -173,6 +177,7 @@ export default function Login() {
try { try {
const res = await Auth.getInstance().askNewPassword({ email }); const res = await Auth.getInstance().askNewPassword({ email });
setPartialPhoneNumber(res.partialPhoneNumber); setPartialPhoneNumber(res.partialPhoneNumber);
setValidationErrors([]);
setStep(LoginStep.TOTP); setStep(LoginStep.TOTP);
} catch (error: any) { } catch (error: any) {
// If token already exists and is still valid redirect to the connect/register page // If token already exists and is still valid redirect to the connect/register page
@ -188,6 +193,7 @@ export default function Login() {
try { try {
const res = await Auth.getInstance().sendAnotherCode({ email, totpCodeUid }); const res = await Auth.getInstance().sendAnotherCode({ email, totpCodeUid });
setValidationErrors([]);
setPartialPhoneNumber(res.partialPhoneNumber); setPartialPhoneNumber(res.partialPhoneNumber);
setTotpCodeUid(res.totpCodeUid); setTotpCodeUid(res.totpCodeUid);
} catch (error: any) { } catch (error: any) {

View File

@ -64,3 +64,8 @@ a:hover {
font-size: 18px; font-size: 18px;
font-family: Inter; font-family: Inter;
} }
.Toastify__toast-body {
font-size: 14px;
font-family: "Inter", sans-serif !important;
}