Merge Staging in Preprod
This commit is contained in:
commit
93c03a54f2
139
package-lock.json
generated
139
package-lock.json
generated
@ -22,7 +22,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.89",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.90",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
@ -496,14 +496,14 @@
|
|||||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||||
},
|
},
|
||||||
"node_modules/@mui/base": {
|
"node_modules/@mui/base": {
|
||||||
"version": "5.0.0-beta.17",
|
"version": "5.0.0-beta.18",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.17.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.18.tgz",
|
||||||
"integrity": "sha512-xNbk7iOXrglNdIxFBN0k3ySsPIFLWCnFxqsAYl7CIcDkD9low4kJ7IUuy6ctwx/HAy2fenrT3KXHr1sGjAMgpQ==",
|
"integrity": "sha512-e9ZCy/ndhyt5MTshAS3qAUy/40UiO0jX+kAo6a+XirrPJE+rrQW+mKPSI0uyp+5z4Vh+z0pvNoJ2S2gSrNz3BQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.22.15",
|
"@babel/runtime": "^7.23.1",
|
||||||
"@floating-ui/react-dom": "^2.0.2",
|
"@floating-ui/react-dom": "^2.0.2",
|
||||||
"@mui/types": "^7.2.4",
|
"@mui/types": "^7.2.5",
|
||||||
"@mui/utils": "^5.14.11",
|
"@mui/utils": "^5.14.12",
|
||||||
"@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 +527,25 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/core-downloads-tracker": {
|
"node_modules/@mui/core-downloads-tracker": {
|
||||||
"version": "5.14.11",
|
"version": "5.14.12",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.11.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.12.tgz",
|
||||||
"integrity": "sha512-uY8FLQURhXe3f3O4dS5OSGML9KDm9+IE226cBu78jarVIzdQGPlXwGIlSI9VJR8MvZDA6C0+6XfWDhWCHruC5Q==",
|
"integrity": "sha512-WZhCkKqhrXaSVBzoC6LNcVkIawS000OOt7gmnp4g9HhyvN0PSclRXc/JrkC7EwfzUAZJh+hiK2LaVsbtOpNuOg==",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/mui"
|
"url": "https://opencollective.com/mui"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/material": {
|
"node_modules/@mui/material": {
|
||||||
"version": "5.14.11",
|
"version": "5.14.12",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.11.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.12.tgz",
|
||||||
"integrity": "sha512-DnSdJzcR7lwG12JA5L2t8JF+RDzMygu5rCNW+logWb/KW2/TRzwLyVWO+CorHTBjBRd38DBxnwOCDiYkDd+N3A==",
|
"integrity": "sha512-EelF2L46VcVqhg3KjzIGBBpOtcBgRh0MMy9Efuk6Do81QdcZsFC9RebCVAflo5jIdbHiBmxBs5/l5Q9NjONozg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.22.15",
|
"@babel/runtime": "^7.23.1",
|
||||||
"@mui/base": "5.0.0-beta.17",
|
"@mui/base": "5.0.0-beta.18",
|
||||||
"@mui/core-downloads-tracker": "^5.14.11",
|
"@mui/core-downloads-tracker": "^5.14.12",
|
||||||
"@mui/system": "^5.14.11",
|
"@mui/system": "^5.14.12",
|
||||||
"@mui/types": "^7.2.4",
|
"@mui/types": "^7.2.5",
|
||||||
"@mui/utils": "^5.14.11",
|
"@mui/utils": "^5.14.12",
|
||||||
"@types/react-transition-group": "^4.4.6",
|
"@types/react-transition-group": "^4.4.6",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"csstype": "^3.1.2",
|
"csstype": "^3.1.2",
|
||||||
@ -580,12 +580,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/private-theming": {
|
"node_modules/@mui/private-theming": {
|
||||||
"version": "5.14.11",
|
"version": "5.14.12",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.11.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.12.tgz",
|
||||||
"integrity": "sha512-MSnNNzTu9pfKLCKs1ZAKwOTgE4bz+fQA0fNr8Jm7NDmuWmw0CaN9Vq2/MHsatE7+S0A25IAKby46Uv1u53rKVQ==",
|
"integrity": "sha512-TWwm+9+BgHFpoR3w04FG+IqID4ALa74A27RuKq2CEaWgxliBZB24EVeI6djfjFt5t4FYmIb8BMw2ZJEir7YjLQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.22.15",
|
"@babel/runtime": "^7.23.1",
|
||||||
"@mui/utils": "^5.14.11",
|
"@mui/utils": "^5.14.12",
|
||||||
"prop-types": "^15.8.1"
|
"prop-types": "^15.8.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -606,11 +606,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/styled-engine": {
|
"node_modules/@mui/styled-engine": {
|
||||||
"version": "5.14.11",
|
"version": "5.14.12",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.11.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.12.tgz",
|
||||||
"integrity": "sha512-jdUlqRgTYQ8RMtPX4MbRZqar6W2OiIb6J5KEFbIu4FqvPrk44Each4ppg/LAqp1qNlBYq5i+7Q10MYLMpDxX9A==",
|
"integrity": "sha512-bocxt1nDmXfB3gpLfCCmFCyJ7sVmscFs+PuheO210QagZwHVp47UIRT1AiswLDYSQo1ZqmVGn7KLEJEYK0d4Xw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.22.15",
|
"@babel/runtime": "^7.23.1",
|
||||||
"@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 +637,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/system": {
|
"node_modules/@mui/system": {
|
||||||
"version": "5.14.11",
|
"version": "5.14.12",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.11.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.12.tgz",
|
||||||
"integrity": "sha512-yl8xV+y0k7j6dzBsHabKwoShmjqLa8kTxrhUI3JpqLG358VRVMJRW/ES0HhvfcCi4IVXde+Tc2P3K1akGL8zoA==",
|
"integrity": "sha512-6DXfjjLhW0/ia5qU3Crke7j+MnfDbMBOHlLIrqbrEqNs0AuSBv8pXniEGb+kqO0H804NJreRTEJRjCngwOX5CA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.22.15",
|
"@babel/runtime": "^7.23.1",
|
||||||
"@mui/private-theming": "^5.14.11",
|
"@mui/private-theming": "^5.14.12",
|
||||||
"@mui/styled-engine": "^5.14.11",
|
"@mui/styled-engine": "^5.14.12",
|
||||||
"@mui/types": "^7.2.4",
|
"@mui/types": "^7.2.5",
|
||||||
"@mui/utils": "^5.14.11",
|
"@mui/utils": "^5.14.12",
|
||||||
"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,11 +676,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/types": {
|
"node_modules/@mui/types": {
|
||||||
"version": "7.2.4",
|
"version": "7.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.5.tgz",
|
||||||
"integrity": "sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==",
|
"integrity": "sha512-S2BwfNczr7VwS6ki8GoAXJyARoeSJDLuxOEPs3vEMyTALlf9PrdHv+sluX7kk3iKrCg/ML2mIWwapZvWbkMCQA==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "*"
|
"@types/react": "^17.0.0 || ^18.0.0"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@types/react": {
|
"@types/react": {
|
||||||
@ -689,12 +689,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/utils": {
|
"node_modules/@mui/utils": {
|
||||||
"version": "5.14.11",
|
"version": "5.14.12",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.11.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.12.tgz",
|
||||||
"integrity": "sha512-fmkIiCPKyDssYrJ5qk+dime1nlO3dmWfCtaPY/uVBqCRMBZ11JhddB9m8sjI2mgqQQwRJG5bq3biaosNdU/s4Q==",
|
"integrity": "sha512-RFNXnhKQlzIkIUig6mmv0r5VbtjPdWoaBPYicq25LETdZux59HAqoRdWw15T7lp3c7gXOoE8y67+hTB8C64m2g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.22.15",
|
"@babel/runtime": "^7.23.1",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.7",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react-is": "^18.2.0"
|
"react-is": "^18.2.0"
|
||||||
},
|
},
|
||||||
@ -1507,9 +1507,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001543",
|
"version": "1.0.30001546",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz",
|
||||||
"integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==",
|
"integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@ -2518,11 +2518,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/flat-cache": {
|
"node_modules/flat-cache": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz",
|
||||||
"integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==",
|
"integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"flatted": "^3.2.7",
|
"flatted": "^3.2.9",
|
||||||
"keyv": "^4.5.3",
|
"keyv": "^4.5.3",
|
||||||
"rimraf": "^3.0.2"
|
"rimraf": "^3.0.2"
|
||||||
},
|
},
|
||||||
@ -2685,9 +2685,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/globals": {
|
"node_modules/globals": {
|
||||||
"version": "13.22.0",
|
"version": "13.23.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",
|
||||||
"integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==",
|
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"type-fest": "^0.20.2"
|
"type-fest": "^0.20.2"
|
||||||
},
|
},
|
||||||
@ -2764,12 +2764,9 @@
|
|||||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ=="
|
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ=="
|
||||||
},
|
},
|
||||||
"node_modules/has": {
|
"node_modules/has": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz",
|
||||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
"integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==",
|
||||||
"dependencies": {
|
|
||||||
"function-bind": "^1.1.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4.0"
|
"node": ">= 0.4.0"
|
||||||
}
|
}
|
||||||
@ -3340,9 +3337,9 @@
|
|||||||
"integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A=="
|
"integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A=="
|
||||||
},
|
},
|
||||||
"node_modules/keyv": {
|
"node_modules/keyv": {
|
||||||
"version": "4.5.3",
|
"version": "4.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
||||||
"integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==",
|
"integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"json-buffer": "3.0.1"
|
"json-buffer": "3.0.1"
|
||||||
}
|
}
|
||||||
@ -3361,7 +3358,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/le-coffre-resources": {
|
"node_modules/le-coffre-resources": {
|
||||||
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#a100398ef5c1984ba74cb1c8c182648315accc3e",
|
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#16baf46d39953bb19fa5b9e614ae4f72895aff31",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@ -3382,9 +3379,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/libphonenumber-js": {
|
"node_modules/libphonenumber-js": {
|
||||||
"version": "1.10.45",
|
"version": "1.10.47",
|
||||||
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.45.tgz",
|
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.47.tgz",
|
||||||
"integrity": "sha512-eeHcvGafEYCaKB4fo2uBINfG7j7PcGwBHUaTVfbwl/6KcjCgIKNlIOsSXVRp9BH10NQwmvvk+nQ1e/Yp4BGB7w=="
|
"integrity": "sha512-b4t7VQDV29xx/ni+58yl9KWPGjnDLDXCeCTLrD4V8vDpObXZRZBrg7uX/HWZ7YXiJKqdBDGgc+barUUTNB6Slw=="
|
||||||
},
|
},
|
||||||
"node_modules/lines-and-columns": {
|
"node_modules/lines-and-columns": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
@ -4297,9 +4294,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
"node_modules/sass": {
|
||||||
"version": "1.68.0",
|
"version": "1.69.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.0.tgz",
|
||||||
"integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==",
|
"integrity": "sha512-l3bbFpfTOGgQZCLU/gvm1lbsQ5mC/WnLz3djL2v4WCJBDrWm58PO+jgngcGRNnKUh6wSsdm50YaovTqskZ0xDQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
"immutable": "^4.0.0",
|
"immutable": "^4.0.0",
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.89",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.90",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -27,7 +27,6 @@ export default class User extends BaseApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async verifyJwt(jwt: string) {
|
public async verifyJwt(jwt: string) {
|
||||||
console.log(this.baseURl);
|
|
||||||
const url = new URL(`${this.baseURl}/verify-token/${jwt}`);
|
const url = new URL(`${this.baseURl}/verify-token/${jwt}`);
|
||||||
try {
|
try {
|
||||||
return await this.postRequest(url);
|
return await this.postRequest(url);
|
||||||
|
@ -16,7 +16,6 @@ export default class Auth extends BaseApiService {
|
|||||||
public async logOutWithIdNot() {
|
public async logOutWithIdNot() {
|
||||||
const variables = FrontendVariables.getInstance();
|
const variables = FrontendVariables.getInstance();
|
||||||
const url = new URL(`${variables.IDNOT_BASE_URL}/user/auth/logout?post_logout_redirect_uri=${variables.FRONT_APP_HOST}`);
|
const url = new URL(`${variables.IDNOT_BASE_URL}/user/auth/logout?post_logout_redirect_uri=${variables.FRONT_APP_HOST}`);
|
||||||
console.log(url.toString())
|
|
||||||
try {
|
try {
|
||||||
return await fetch(url);
|
return await fetch(url);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -71,6 +71,18 @@ export default class Documents extends BaseNotary {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async refuse(uid: string, refused_reason: string): Promise<Document> {
|
||||||
|
const url = new URL(this.baseURl.concat(`/${uid}/refuse`));
|
||||||
|
try {
|
||||||
|
return await this.putRequest<Document>(url, {
|
||||||
|
refused_reason,
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async put(uid: string, body: IPutDocumentsParams): Promise<Document> {
|
public async put(uid: string, body: IPutDocumentsParams): Promise<Document> {
|
||||||
const url = new URL(this.baseURl.concat(`/${uid}`));
|
const url = new URL(this.baseURl.concat(`/${uid}`));
|
||||||
try {
|
try {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { type OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { type OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
|
|
||||||
import BaseNotary from "../BaseNotary";
|
import BaseNotary from "../BaseNotary";
|
||||||
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
// TODO Type get query params -> Where + inclue + orderby
|
||||||
export interface IGetFoldersParams {
|
export interface IGetFoldersParams {
|
||||||
@ -97,20 +96,32 @@ export default class Folders extends BaseNotary {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async archive(uid: string, body: Partial<OfficeFolder>): Promise<OfficeFolder> {
|
public async archive(uid: string, archived_description: string): Promise<OfficeFolder> {
|
||||||
body.status = EFolderStatus.ARCHIVED;
|
|
||||||
try {
|
try {
|
||||||
return await this.put(uid, body);
|
const url = new URL(this.baseURl.concat(`/${uid}/archive`));
|
||||||
|
try {
|
||||||
|
return await this.putRequest(url, {
|
||||||
|
archived_description,
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async restore(uid: string, body: Partial<OfficeFolder>): Promise<OfficeFolder> {
|
public async restore(uid: string): Promise<OfficeFolder> {
|
||||||
body.status = EFolderStatus.LIVE;
|
|
||||||
try {
|
try {
|
||||||
return await this.put(uid, body);
|
const url = new URL(this.baseURl.concat(`/${uid}/restore`));
|
||||||
|
try {
|
||||||
|
return await this.putRequest(url);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
|
@ -121,7 +121,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
{this.state.currentFiles && this.state.currentFiles.length > 0 && (
|
{this.state.currentFiles && this.state.currentFiles.length > 0 && (
|
||||||
<div className={classes["documents-container"]}>
|
<div className={classes["documents-container"]}>
|
||||||
{this.state.currentFiles.map((file) => {
|
{this.state.currentFiles.map((file) => {
|
||||||
console.log(file);
|
|
||||||
|
|
||||||
const fileObj = file.file;
|
const fileObj = file.file;
|
||||||
|
|
||||||
@ -237,9 +236,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
this.setState({
|
this.setState({
|
||||||
currentFiles: tmpArray,
|
currentFiles: tmpArray,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(this.state.currentFiles);
|
|
||||||
|
|
||||||
// const formData = new FormData();
|
// const formData = new FormData();
|
||||||
// formData.append("file", file, file.name);
|
// formData.append("file", file, file.name);
|
||||||
// const query = JSON.stringify({ document: { uid: this.props.document.uid } });
|
// const query = JSON.stringify({ document: { uid: this.props.document.uid } });
|
||||||
@ -272,7 +268,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
private async removeFile(e: any) {
|
private async removeFile(e: any) {
|
||||||
const image = e.target as HTMLElement;
|
const image = e.target as HTMLElement;
|
||||||
const indexToRemove = image.getAttribute("data-file");
|
const indexToRemove = image.getAttribute("data-file");
|
||||||
console.log(indexToRemove);
|
|
||||||
|
|
||||||
if (!indexToRemove) return;
|
if (!indexToRemove) return;
|
||||||
const file = this.state.currentFiles!.find((file) => file.index === parseInt(indexToRemove));
|
const file = this.state.currentFiles!.find((file) => file.index === parseInt(indexToRemove));
|
||||||
|
@ -8,11 +8,13 @@ import React from "react";
|
|||||||
|
|
||||||
import Typography, { ITypo } from "../Typography";
|
import Typography, { ITypo } from "../Typography";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
type: EFolderBoxInformationType;
|
type: EFolderBoxInformationType;
|
||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum EFolderBoxInformationType {
|
export enum EFolderBoxInformationType {
|
||||||
@ -34,7 +36,7 @@ export default function FolderBoxInformation(props: IProps) {
|
|||||||
return (
|
return (
|
||||||
<div className={classNames(classes["root"], type !== EFolderBoxInformationType.INFORMATIONS && classes["single-information"])}>
|
<div className={classNames(classes["root"], type !== EFolderBoxInformationType.INFORMATIONS && classes["single-information"])}>
|
||||||
<div className={classes["content"]}>{renderContentByType(props.folder, type)}</div>
|
<div className={classes["content"]}>{renderContentByType(props.folder, type)}</div>
|
||||||
{!isArchived && (
|
{!isArchived && props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Link href={path} className={classes["edit-icon-container"]}>
|
<Link href={path} className={classes["edit-icon-container"]}>
|
||||||
<Image src={PenICon} alt="edit informations" />
|
<Image src={PenICon} alt="edit informations" />
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -30,6 +30,17 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification-subheader {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
text-decoration: underline;
|
||||||
|
text-underline-offset: 2px;
|
||||||
|
color: var(--pink-flash);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.notification-body {
|
.notification-body {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -5,6 +5,7 @@ import CloseIcon from "@Assets/Icons/cross.svg";
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import ToastHandler from "@Front/Components/DesignSystem/Toasts/ToastsHandler";
|
import ToastHandler from "@Front/Components/DesignSystem/Toasts/ToastsHandler";
|
||||||
import Toasts, { IToast } from "@Front/Stores/Toasts";
|
import Toasts, { IToast } from "@Front/Stores/Toasts";
|
||||||
|
import Check from "@Front/Components/Elements/Icons/Check";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@ -23,6 +24,7 @@ export default class NotificationModal extends React.Component<IProps, IState> {
|
|||||||
toastList: Toasts.getInstance().toasts,
|
toastList: Toasts.getInstance().toasts,
|
||||||
};
|
};
|
||||||
this.handleToastChange = this.handleToastChange.bind(this);
|
this.handleToastChange = this.handleToastChange.bind(this);
|
||||||
|
this.readAllNotifications = this.readAllNotifications.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override render(): JSX.Element | null {
|
public override render(): JSX.Element | null {
|
||||||
@ -37,10 +39,15 @@ export default class NotificationModal extends React.Component<IProps, IState> {
|
|||||||
<Image src={CloseIcon} alt="Close notification modal" className={classes["close-icon"]}></Image>
|
<Image src={CloseIcon} alt="Close notification modal" className={classes["close-icon"]}></Image>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
;
|
<div className={classes["notification-subheader"]} onClick={this.readAllNotifications}>
|
||||||
|
<Typography typo={ITypo.CAPTION_14} color={ITypoColor.PINK_FLASH}>
|
||||||
|
Tout marquer comme lu
|
||||||
|
</Typography>
|
||||||
|
<Check color={ITypoColor.PINK_FLASH} />
|
||||||
|
</div>
|
||||||
<div className={classes["notification-body"]}>
|
<div className={classes["notification-body"]}>
|
||||||
<>
|
<>
|
||||||
{Toasts.getInstance().toasts.length === 0 ? (
|
{!this.state.toastList || this.state.toastList.length === 0 ? (
|
||||||
<div className={classes["missing-notification"]}>
|
<div className={classes["missing-notification"]}>
|
||||||
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
||||||
Vous n'avez pas de notifications.
|
Vous n'avez pas de notifications.
|
||||||
@ -64,6 +71,11 @@ export default class NotificationModal extends React.Component<IProps, IState> {
|
|||||||
this.removeOnToastChange();
|
this.removeOnToastChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readAllNotifications() {
|
||||||
|
Toasts.getInstance().closeAll();
|
||||||
|
this.props.closeModal();
|
||||||
|
}
|
||||||
|
|
||||||
private handleToastChange(toastList: IToast[] | null) {
|
private handleToastChange(toastList: IToast[] | null) {
|
||||||
this.setState({
|
this.setState({
|
||||||
toastList,
|
toastList,
|
||||||
|
@ -95,6 +95,7 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: var(--color-neutral-500);
|
color: var(--color-neutral-500);
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@ -109,7 +109,6 @@ class ToastElementClass extends React.Component<IPropsClass, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async handleClick(e: React.MouseEvent) {
|
private async handleClick(e: React.MouseEvent) {
|
||||||
console.log('redirectUrl', this.props.toast.redirectUrl);
|
|
||||||
if (this.props.toast.redirectUrl) {
|
if (this.props.toast.redirectUrl) {
|
||||||
this.onClose(e);
|
this.onClose(e);
|
||||||
await this.props.router.push(this.props.toast.redirectUrl);
|
await this.props.router.push(this.props.toast.redirectUrl);
|
||||||
|
@ -54,7 +54,8 @@
|
|||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 64px;
|
column-gap: 64px;
|
||||||
|
row-gap: 16px;
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
|
|
||||||
@media (max-width: $screen-s) {
|
@media (max-width: $screen-s) {
|
||||||
@ -63,7 +64,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.documents-asked{
|
.documents-asked {
|
||||||
order: -1;
|
order: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +74,7 @@
|
|||||||
gap: 32px;
|
gap: 32px;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
|
|
||||||
@media(max-width: $screen-s){
|
@media (max-width: $screen-s) {
|
||||||
order: -1;
|
order: -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import QuantityProgressBar from "../QuantityProgressBar";
|
|||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import DocumentList from "./DocumentList";
|
import DocumentList from "./DocumentList";
|
||||||
import UserFolderHeader from "./UserFolderHeader";
|
import UserFolderHeader from "./UserFolderHeader";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
customer: Customer;
|
customer: Customer;
|
||||||
@ -24,6 +25,8 @@ type IProps = {
|
|||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
isOpened: boolean;
|
isOpened: boolean;
|
||||||
onChange: (id: string) => void;
|
onChange: (id: string) => void;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
isOpenDeletionModal: boolean;
|
isOpenDeletionModal: boolean;
|
||||||
@ -89,32 +92,44 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
currentNumber={this.calculateDocumentsPercentageProgress()}
|
currentNumber={this.calculateDocumentsPercentageProgress()}
|
||||||
/>
|
/>
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<DocumentList
|
<DocumentList
|
||||||
documents={documentsAsked}
|
documents={documentsAsked}
|
||||||
title="Documents demandés"
|
title="Documents demandés"
|
||||||
|
subtitle={
|
||||||
|
documentsAsked && documentsAsked?.length === 0 ? "Vous n'avez pas encore demandé de 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"]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<DocumentList
|
<DocumentList
|
||||||
documents={otherDocuments}
|
documents={otherDocuments}
|
||||||
title="Documents à valider / validés"
|
title={
|
||||||
|
this.props.anchorStatus !== AnchorStatus.NOT_ANCHORED
|
||||||
|
? "Documents validés"
|
||||||
|
: "Documents à valider / validés"
|
||||||
|
}
|
||||||
subtitle={
|
subtitle={
|
||||||
otherDocuments && otherDocuments?.length > 0
|
otherDocuments && otherDocuments?.length > 0
|
||||||
? "Vous avez des documents à valider."
|
? this.props.anchorStatus !== AnchorStatus.NOT_ANCHORED
|
||||||
|
? ""
|
||||||
|
: "Vous avez des documents à valider."
|
||||||
: "Vous n'avez aucun document à valider"
|
: "Vous n'avez aucun document à valider"
|
||||||
}
|
}
|
||||||
openDeletionModal={this.openDeletionModal}
|
openDeletionModal={this.openDeletionModal}
|
||||||
folderUid={this.props.folder.uid!}
|
folderUid={this.props.folder.uid!}
|
||||||
/>
|
/>
|
||||||
{!this.props.isArchived && (
|
|
||||||
|
{!this.props.isArchived && this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<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 un autre document{" "}
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Button disabled={documentsAsked ? false : true}>Envoyer un mail de demande</Button>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -131,7 +146,7 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
private async deleteAskedDocument() {
|
private async deleteAskedDocument() {
|
||||||
try {
|
try {
|
||||||
await Documents.getInstance().delete(this.state.selectedDocumentToDelete);
|
await Documents.getInstance().delete(this.state.selectedDocumentToDelete);
|
||||||
window.location.reload();
|
await this.props.getFolderCallback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
19
src/front/Components/Elements/Icons/Check/index.tsx
Normal file
19
src/front/Components/Elements/Icons/Check/index.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
|
|
||||||
|
type IProps = {
|
||||||
|
color?: ITypoColor;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function Check(props: IProps) {
|
||||||
|
return (
|
||||||
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path
|
||||||
|
d="M15 4.5L6.75 12.75L3 9"
|
||||||
|
stroke={`var(--${props.color ?? "white"})`}
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
@ -19,6 +19,7 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
let { folderUid } = router.query;
|
let { folderUid } = router.query;
|
||||||
const [documents, setDocuments] = useState<Document[] | null>(null);
|
const [documents, setDocuments] = useState<Document[] | null>(null);
|
||||||
|
|
||||||
const [customer, setCustomer] = useState<Customer | null>(null);
|
const [customer, setCustomer] = useState<Customer | null>(null);
|
||||||
const [folder, setFolder] = useState<OfficeFolder | null>(null);
|
const [folder, setFolder] = useState<OfficeFolder | null>(null);
|
||||||
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(false);
|
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(false);
|
||||||
|
@ -10,13 +10,14 @@ import BackArrow from "@Front/Components/Elements/BackArrow";
|
|||||||
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||||
import Module from "@Front/Config/Module";
|
import Module from "@Front/Config/Module";
|
||||||
import { ECivility } from "le-coffre-resources/dist/Customer/Contact";
|
import { ECivility } from "le-coffre-resources/dist/Customer/Contact";
|
||||||
import { Customer, OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { Contact, Customer, OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { NextRouter, useRouter } from "next/router";
|
import { NextRouter, useRouter } from "next/router";
|
||||||
|
|
||||||
import BasePage from "../../Base";
|
import BasePage from "../../Base";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import TextField from "@Front/Components/DesignSystem/Form/TextField";
|
import TextField from "@Front/Components/DesignSystem/Form/TextField";
|
||||||
|
import { ValidationError } from "class-validator";
|
||||||
|
|
||||||
enum ESelectedOption {
|
enum ESelectedOption {
|
||||||
EXISTING_CUSTOMER = "existing_customer",
|
EXISTING_CUSTOMER = "existing_customer",
|
||||||
@ -29,6 +30,7 @@ type IState = {
|
|||||||
selectedCustomers: readonly IOption[];
|
selectedCustomers: readonly IOption[];
|
||||||
existingCustomers: IOption[];
|
existingCustomers: IOption[];
|
||||||
isLoaded: boolean;
|
isLoaded: boolean;
|
||||||
|
validationError: ValidationError[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type IPropsClass = IProps & {
|
type IPropsClass = IProps & {
|
||||||
@ -44,6 +46,7 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
selectedCustomers: [],
|
selectedCustomers: [],
|
||||||
existingCustomers: [],
|
existingCustomers: [],
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
|
validationError: [],
|
||||||
};
|
};
|
||||||
this.onExistingClientSelected = this.onExistingClientSelected.bind(this);
|
this.onExistingClientSelected = this.onExistingClientSelected.bind(this);
|
||||||
this.onNewClientSelected = this.onNewClientSelected.bind(this);
|
this.onNewClientSelected = this.onNewClientSelected.bind(this);
|
||||||
@ -105,10 +108,28 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
{this.state.selectedOption === "new_customer" && (
|
{this.state.selectedOption === "new_customer" && (
|
||||||
<div className={classes["new-client"]}>
|
<div className={classes["new-client"]}>
|
||||||
<TextField name="last_name" placeholder="Nom" />
|
<TextField
|
||||||
<TextField name="first_name" placeholder="Prénom" />
|
name="last_name"
|
||||||
<TextField name="email" placeholder="E-mail" />
|
placeholder="Nom"
|
||||||
<TextField name="cell_phone_number" placeholder="Numéro de téléphone" />
|
validationError={this.state.validationError.find((error) => error.property === "last_name")}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
name="first_name"
|
||||||
|
placeholder="Prénom"
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "first_name")}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
name="email"
|
||||||
|
placeholder="E-mail"
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "email")}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
name="cell_phone_number"
|
||||||
|
placeholder="Numéro de téléphone"
|
||||||
|
validationError={this.state.validationError.find(
|
||||||
|
(error) => error.property === "cell_phone_number",
|
||||||
|
)}
|
||||||
|
/>
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Link href={backwardPath} className={classes["cancel-button"]}>
|
<Link href={backwardPath} className={classes["cancel-button"]}>
|
||||||
<Button variant={EButtonVariant.GHOST}>Annuler</Button>
|
<Button variant={EButtonVariant.GHOST}>Annuler</Button>
|
||||||
@ -207,11 +228,29 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
}) as Partial<Customer>[];
|
}) as Partial<Customer>[];
|
||||||
|
|
||||||
if (this.state.selectedOption === "new_customer") {
|
if (this.state.selectedOption === "new_customer") {
|
||||||
|
try {
|
||||||
|
const contactToCreate = Contact.hydrate<Customer>(values);
|
||||||
|
await contactToCreate.validateOrReject?.({ groups: ["createCustomer"], forbidUnknownValues: false });
|
||||||
|
} catch (validationErrors) {
|
||||||
|
console.log(validationErrors);
|
||||||
|
this.setState({
|
||||||
|
validationError: validationErrors as ValidationError[],
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const customer: Customer = await Customers.getInstance().post({
|
const customer: Customer = await Customers.getInstance().post({
|
||||||
contact: values,
|
contact: values,
|
||||||
});
|
});
|
||||||
if (!customer.uid) return;
|
if (!customer.uid) return;
|
||||||
customersToLink?.push({ uid: customer.uid } as Partial<Customer>);
|
customersToLink?.push({ uid: customer.uid } as Partial<Customer>);
|
||||||
|
} catch (backError) {
|
||||||
|
if (!Array.isArray(backError)) return;
|
||||||
|
this.setState({
|
||||||
|
validationError: backError as ValidationError[],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (customersToLink) {
|
if (customersToLink) {
|
||||||
|
@ -8,9 +8,12 @@ import Link from "next/link";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import { AnchorStatus } from "..";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -35,11 +38,13 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
{this.doesFolderHaveCustomer() ? (
|
{this.doesFolderHaveCustomer() ? (
|
||||||
<>
|
<>
|
||||||
<div className={classes["client"]}>{this.renderCustomerFolders()}</div>
|
<div className={classes["client"]}>{this.renderCustomerFolders()}</div>
|
||||||
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Link href={navigatePath}>
|
<Link href={navigatePath}>
|
||||||
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
||||||
Ajouter un client
|
Ajouter un client
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className={classes["no-client"]}>
|
<div className={classes["no-client"]}>
|
||||||
@ -48,11 +53,13 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
Aucun client n'est associé au dossier.
|
Aucun client n'est associé au dossier.
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Link href={navigatePath}>
|
<Link href={navigatePath}>
|
||||||
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
||||||
Ajouter un client
|
Ajouter un client
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -69,6 +76,8 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
key={customer.uid}
|
key={customer.uid}
|
||||||
isOpened={this.state.openedCustomer === customer.uid}
|
isOpened={this.state.openedCustomer === customer.uid}
|
||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
|
anchorStatus={this.props.anchorStatus}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -20,10 +20,9 @@ import ValidateAnchoringGif from "@Front/Assets/images/validate_anchoring.gif";
|
|||||||
import BasePage from "../../Base";
|
import BasePage from "../../Base";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import ClientSection from "./ClientSection";
|
import ClientSection from "./ClientSection";
|
||||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
|
||||||
import Loader from "@Front/Components/DesignSystem/Loader";
|
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
|
|
||||||
enum AnchorStatus {
|
export enum AnchorStatus {
|
||||||
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
||||||
"ANCHORING" = "ANCHORING",
|
"ANCHORING" = "ANCHORING",
|
||||||
"NOT_ANCHORED" = "NOT_ANCHORED",
|
"NOT_ANCHORED" = "NOT_ANCHORED",
|
||||||
@ -38,6 +37,7 @@ type IPropsClass = IProps & {
|
|||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
selectedFolder: OfficeFolder | null;
|
selectedFolder: OfficeFolder | null;
|
||||||
getAnchoringStatus: () => Promise<void>;
|
getAnchoringStatus: () => Promise<void>;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = {
|
type IState = {
|
||||||
@ -97,11 +97,13 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.props.selectedFolder}
|
folder={this.props.selectedFolder}
|
||||||
type={EFolderBoxInformationType.INFORMATIONS}
|
type={EFolderBoxInformationType.INFORMATIONS}
|
||||||
/>
|
/>
|
||||||
<div className={classes["second-box"]}>
|
<div className={classes["second-box"]}>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.props.selectedFolder}
|
folder={this.props.selectedFolder}
|
||||||
type={EFolderBoxInformationType.DESCRIPTION}
|
type={EFolderBoxInformationType.DESCRIPTION}
|
||||||
/>
|
/>
|
||||||
@ -113,10 +115,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
currentNumber={this.getCompletionNumber()}
|
currentNumber={this.getCompletionNumber()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{this.doesFolderHaveCustomer() && <ClientSection folder={this.props.selectedFolder} />}
|
{this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection
|
||||||
|
folder={this.props.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.props.selectedFolder} />}
|
{!this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection
|
||||||
|
folder={this.props.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={this.openArchivedModal}>
|
<Button variant={EButtonVariant.GHOST} onClick={this.openArchivedModal}>
|
||||||
@ -126,7 +140,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
<>
|
<>
|
||||||
{this.props.isAnchored === AnchorStatus.NOT_ANCHORED && (
|
{this.props.isAnchored === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Button variant={EButtonVariant.PRIMARY} onClick={this.openValidateModal}>
|
<Button variant={EButtonVariant.PRIMARY} onClick={this.openValidateModal}>
|
||||||
Ancrer le dossier
|
Valider et ancrer
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{this.props.isAnchored === AnchorStatus.ANCHORING && (
|
{this.props.isAnchored === AnchorStatus.ANCHORING && (
|
||||||
@ -204,7 +218,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
onAccept={this.closePreventArchiveModal}
|
onAccept={this.closePreventArchiveModal}
|
||||||
onClose={this.closePreventArchiveModal}
|
onClose={this.closePreventArchiveModal}
|
||||||
closeBtn
|
closeBtn
|
||||||
header={"Vous devez valider et certifier un dossier avant de pouvoir l'archiver"}
|
header={"Vous devez valider et ancrer un dossier avant de pouvoir l'archiver"}
|
||||||
cancelText={"Annuler"}
|
cancelText={"Annuler"}
|
||||||
confirmText={"J'ai compris"}>
|
confirmText={"J'ai compris"}>
|
||||||
<div className={classes["modal-title"]}>
|
<div className={classes["modal-title"]}>
|
||||||
@ -244,9 +258,6 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
rédaction d'acte.
|
rédaction d'acte.
|
||||||
</Typography>
|
</Typography>
|
||||||
<Image src={ValidateAnchoringGif} alt="Anchoring animation" className={classes["validate-gif"]} />
|
<Image src={ValidateAnchoringGif} alt="Anchoring animation" className={classes["validate-gif"]} />
|
||||||
<div className={classes["dont-show-again"]}>
|
|
||||||
<CheckBox option={{ label: "Ne plus afficher ce message", value: false }} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -372,7 +383,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private openArchivedModal(): void {
|
private openArchivedModal(): void {
|
||||||
if (this.everyDocumentValidated() && this.props.isAnchored) {
|
if (this.everyDocumentValidated() && this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN) {
|
||||||
this.setState({ isArchivedModalOpen: true });
|
this.setState({ isArchivedModalOpen: true });
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isPreventArchiveModalOpen: true });
|
this.setState({ isPreventArchiveModalOpen: true });
|
||||||
@ -389,9 +400,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async onArchivedModalAccepted() {
|
private async onArchivedModalAccepted() {
|
||||||
if (!this.props.selectedFolder) return;
|
if (!this.props.selectedFolder) return;
|
||||||
const ressourceFolder = OfficeFolder.hydrate<OfficeFolder>(this.props.selectedFolder);
|
await Folders.getInstance().archive(this.props.selectedFolder.uid ?? "", this.state.inputArchivedDescripton);
|
||||||
ressourceFolder.archived_description = this.state.inputArchivedDescripton;
|
|
||||||
await Folders.getInstance().archive(this.props.selectedFolder.uid ?? "", ressourceFolder);
|
|
||||||
this.closeArchivedModal();
|
this.closeArchivedModal();
|
||||||
this.props.router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
this.props.router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
||||||
}
|
}
|
||||||
@ -471,6 +480,7 @@ export default function FolderInformation(props: IProps) {
|
|||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
selectedFolder={selectedFolder}
|
selectedFolder={selectedFolder}
|
||||||
getAnchoringStatus={getAnchoringStatus}
|
getAnchoringStatus={getAnchoringStatus}
|
||||||
|
getFolderCallback={getFolder}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ import { ChangeEvent } from "react";
|
|||||||
|
|
||||||
import BasePage from "../../Base";
|
import BasePage from "../../Base";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import { Address } from "le-coffre-resources/dist/Customer";
|
||||||
|
import { ValidationError } from "class-validator";
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
|
|
||||||
@ -34,6 +36,7 @@ type IState = {
|
|||||||
inputAddress: string;
|
inputAddress: string;
|
||||||
folder: OfficeFolder | null;
|
folder: OfficeFolder | null;
|
||||||
customer: Customer | null;
|
customer: Customer | null;
|
||||||
|
validationError: ValidationError[];
|
||||||
};
|
};
|
||||||
class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
||||||
constructor(props: IPropsClass) {
|
constructor(props: IPropsClass) {
|
||||||
@ -50,6 +53,7 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
|||||||
inputAddress: "",
|
inputAddress: "",
|
||||||
folder: null,
|
folder: null,
|
||||||
customer: null,
|
customer: null,
|
||||||
|
validationError: [],
|
||||||
};
|
};
|
||||||
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||||
this.onChangeNameInput = this.onChangeNameInput.bind(this);
|
this.onChangeNameInput = this.onChangeNameInput.bind(this);
|
||||||
@ -83,24 +87,28 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
|||||||
placeholder="Nom"
|
placeholder="Nom"
|
||||||
onChange={this.onChangeNameInput}
|
onChange={this.onChangeNameInput}
|
||||||
defaultValue={this.state.customer?.contact?.first_name}
|
defaultValue={this.state.customer?.contact?.first_name}
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "first_name")}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
name="last_name"
|
name="last_name"
|
||||||
placeholder="Prénom"
|
placeholder="Prénom"
|
||||||
onChange={this.onChangeFirstNameInput}
|
onChange={this.onChangeFirstNameInput}
|
||||||
defaultValue={this.state.customer?.contact?.last_name}
|
defaultValue={this.state.customer?.contact?.last_name}
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "last_name")}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
name="email"
|
name="email"
|
||||||
placeholder="E-mail"
|
placeholder="E-mail"
|
||||||
onChange={this.onChangeEmailInput}
|
onChange={this.onChangeEmailInput}
|
||||||
defaultValue={this.state.customer?.contact?.email}
|
defaultValue={this.state.customer?.contact?.email}
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "email")}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
name="cell_phone_number"
|
name="cell_phone_number"
|
||||||
placeholder="Numéro de téléphone"
|
placeholder="Numéro de téléphone"
|
||||||
onChange={this.onChangePhoneNumberInput}
|
onChange={this.onChangePhoneNumberInput}
|
||||||
defaultValue={this.state.customer?.contact?.cell_phone_number ?? ""}
|
defaultValue={this.state.customer?.contact?.cell_phone_number ?? ""}
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "cell_phone_number")}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
name="birthdate"
|
name="birthdate"
|
||||||
@ -108,6 +116,7 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
|||||||
required={false}
|
required={false}
|
||||||
onChange={this.onChangeBirthDateInput}
|
onChange={this.onChangeBirthDateInput}
|
||||||
defaultValue={this.state.customer?.contact?.birthdate?.toString() ?? ""}
|
defaultValue={this.state.customer?.contact?.birthdate?.toString() ?? ""}
|
||||||
|
validationError={this.state.validationError.find((error) => error.property === "birthdate")}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
name="address"
|
name="address"
|
||||||
@ -167,25 +176,33 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
|||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const contact = {
|
const contact = Contact.hydrate<Contact>({
|
||||||
first_name: values["first_name"],
|
first_name: values["first_name"],
|
||||||
last_name: values["last_name"],
|
last_name: values["last_name"],
|
||||||
email: values["email"],
|
email: values["email"],
|
||||||
cell_phone_number: values["cell_phone_number"],
|
cell_phone_number: values["cell_phone_number"],
|
||||||
birthdate: values["birthdate"] === "" ? null : values["birthdate"],
|
birthdate: values["birthdate"] === "" ? null : new Date(values["birthdate"]!),
|
||||||
address:
|
address: values["address"] ? Address.hydrate<Address>({ address: values["address"] }) : undefined,
|
||||||
values["address"] === ""
|
});
|
||||||
? null
|
|
||||||
: {
|
try {
|
||||||
address: values["address"],
|
await contact.validateOrReject?.({ groups: ["createCustomer"], forbidUnknownValues: false });
|
||||||
},
|
} catch (validationErrors) {
|
||||||
} as Contact;
|
console.log(validationErrors);
|
||||||
|
this.setState({
|
||||||
|
validationError: validationErrors as ValidationError[],
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Customers.getInstance().put(this.props.customerUid, { contact });
|
await Customers.getInstance().put(this.props.customerUid, { contact });
|
||||||
this.props.router.push(this.backwardPath);
|
this.props.router.push(this.backwardPath);
|
||||||
} catch (e) {
|
} catch (backError) {
|
||||||
console.error(e);
|
if (!Array.isArray(backError)) return;
|
||||||
|
this.setState({
|
||||||
|
validationError: backError as ValidationError[],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,10 +275,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async refuseDocument() {
|
private async refuseDocument() {
|
||||||
try {
|
try {
|
||||||
await Documents.getInstance().put(this.props.documentUid, {
|
await Documents.getInstance().refuse(this.props.documentUid, this.state.refuseText);
|
||||||
document_status: EDocumentStatus.REFUSED,
|
|
||||||
refused_reason: this.state.refuseText,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.props.router.push(
|
this.props.router.push(
|
||||||
Module.getInstance()
|
Module.getInstance()
|
||||||
|
@ -3,9 +3,12 @@ import classes from "./classes.module.scss";
|
|||||||
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import UserFolder from "@Front/Components/DesignSystem/UserFolder";
|
import UserFolder from "@Front/Components/DesignSystem/UserFolder";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -49,7 +52,9 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
key={customer.uid}
|
key={customer.uid}
|
||||||
isOpened={this.state.openedCustomer === customer.uid}
|
isOpened={this.state.openedCustomer === customer.uid}
|
||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
|
anchorStatus={this.props.anchorStatus}
|
||||||
isArchived
|
isArchived
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -87,3 +87,15 @@
|
|||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loader-container {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
.loader {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
@ -13,12 +13,20 @@ import BasePage from "../../Base";
|
|||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import ClientSection from "./ClientSection";
|
import ClientSection from "./ClientSection";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { AnchorStatus } from "../../Folder/FolderInformation";
|
||||||
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import OfficeFolderAnchors from "@Front/Api/LeCoffreApi/Notary/OfficeFolderAnchors/OfficeFolderAnchors";
|
||||||
|
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
|
|
||||||
type IPropsClass = IProps & {
|
type IPropsClass = IProps & {
|
||||||
router: NextRouter;
|
router: NextRouter;
|
||||||
selectedFolderUid: string;
|
selectedFolderUid: string;
|
||||||
|
isLoading: boolean;
|
||||||
|
selectedFolder: OfficeFolder | null;
|
||||||
|
isAnchored: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = {
|
type IState = {
|
||||||
@ -46,6 +54,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
.modules.pages.Folder.pages.EditCollaborators.props.path.replace("[folderUid]", this.props.selectedFolderUid);
|
.modules.pages.Folder.pages.EditCollaborators.props.path.replace("[folderUid]", this.props.selectedFolderUid);
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Dossier"} onSelectedFolder={this.onSelectedFolder} isArchived={true}>
|
<DefaultNotaryDashboard title={"Dossier"} onSelectedFolder={this.onSelectedFolder} isArchived={true}>
|
||||||
|
{!this.props.isLoading && (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
{this.state.selectedFolder ? (
|
{this.state.selectedFolder ? (
|
||||||
<div className={classes["folder-informations"]}>
|
<div className={classes["folder-informations"]}>
|
||||||
@ -61,12 +70,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.state.selectedFolder}
|
folder={this.state.selectedFolder}
|
||||||
isArchived
|
isArchived
|
||||||
type={EFolderBoxInformationType.INFORMATIONS}
|
type={EFolderBoxInformationType.INFORMATIONS}
|
||||||
/>
|
/>
|
||||||
<div className={classes["second-box"]}>
|
<div className={classes["second-box"]}>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.state.selectedFolder}
|
folder={this.state.selectedFolder}
|
||||||
isArchived
|
isArchived
|
||||||
type={EFolderBoxInformationType.DESCRIPTION}
|
type={EFolderBoxInformationType.DESCRIPTION}
|
||||||
@ -74,6 +85,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
<div className={classes["second-box"]}>
|
<div className={classes["second-box"]}>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.state.selectedFolder}
|
folder={this.state.selectedFolder}
|
||||||
isArchived
|
isArchived
|
||||||
type={EFolderBoxInformationType.ARCHIVED_DESCRIPTION}
|
type={EFolderBoxInformationType.ARCHIVED_DESCRIPTION}
|
||||||
@ -83,10 +95,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
<div className={classes["progress-bar"]}>
|
<div className={classes["progress-bar"]}>
|
||||||
<QuantityProgressBar title="Complétion du dossier" total={100} currentNumber={0} />
|
<QuantityProgressBar title="Complétion du dossier" total={100} currentNumber={0} />
|
||||||
</div>
|
</div>
|
||||||
{this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} />}
|
{this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection
|
||||||
|
folder={this.state.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} />}
|
{!this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection
|
||||||
|
folder={this.state.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}>
|
<Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}>
|
||||||
@ -105,6 +129,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
{this.props.isLoading && (
|
||||||
|
<div className={classes["loader-container"]}>
|
||||||
|
<div className={classes["loader"]}>
|
||||||
|
<Loader />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</DefaultNotaryDashboard>
|
</DefaultNotaryDashboard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -123,9 +155,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async restoreFolder() {
|
private async restoreFolder() {
|
||||||
if (!this.state.selectedFolder) return;
|
if (!this.state.selectedFolder) return;
|
||||||
const ressourceFolder = OfficeFolder.hydrate<OfficeFolder>(this.state.selectedFolder);
|
await Folders.getInstance().restore(this.state.selectedFolder.uid ?? "");
|
||||||
ressourceFolder.archived_description = null;
|
|
||||||
await Folders.getInstance().restore(this.state.selectedFolder.uid ?? "", ressourceFolder);
|
|
||||||
this.props.router.push(
|
this.props.router.push(
|
||||||
Module.getInstance()
|
Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
@ -156,7 +186,79 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
export default function FolderInformation(props: IProps) {
|
export default function FolderInformation(props: IProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [isAnchored, setIsAnchored] = useState<AnchorStatus>(AnchorStatus.NOT_ANCHORED);
|
||||||
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||||
|
const [selectedFolder, setSelectedFolder] = useState<OfficeFolder | null>(null);
|
||||||
|
|
||||||
let { folderUid } = router.query;
|
let { folderUid } = router.query;
|
||||||
folderUid = folderUid as string;
|
folderUid = folderUid as string;
|
||||||
return <FolderInformationClass {...props} selectedFolderUid={folderUid} router={router} />;
|
|
||||||
|
const getAnchoringStatus = useCallback(async () => {
|
||||||
|
if (!folderUid) return;
|
||||||
|
setIsLoading(true);
|
||||||
|
try {
|
||||||
|
const anchorStatus = await OfficeFolderAnchors.getInstance().getByUid(folderUid as string);
|
||||||
|
setIsAnchored(anchorStatus.status === "VERIFIED_ON_CHAIN" ? AnchorStatus.VERIFIED_ON_CHAIN : AnchorStatus.ANCHORING);
|
||||||
|
} catch (e) {
|
||||||
|
setIsAnchored(AnchorStatus.NOT_ANCHORED);
|
||||||
|
}
|
||||||
|
setIsLoading(false);
|
||||||
|
}, [folderUid]);
|
||||||
|
|
||||||
|
const getFolder = useCallback(async () => {
|
||||||
|
if (!folderUid) return;
|
||||||
|
setIsLoading(true);
|
||||||
|
const query = {
|
||||||
|
q: {
|
||||||
|
deed: { include: { deed_type: true } },
|
||||||
|
office: true,
|
||||||
|
customers: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
documents: {
|
||||||
|
include: {
|
||||||
|
folder: true,
|
||||||
|
document_type: true,
|
||||||
|
files: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documents: {
|
||||||
|
include: {
|
||||||
|
depositor: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
folder_anchor: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const folder = await Folders.getInstance().getByUid(folderUid as string, query);
|
||||||
|
if (folder) {
|
||||||
|
setSelectedFolder(folder);
|
||||||
|
getAnchoringStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsLoading(false);
|
||||||
|
}, [folderUid, getAnchoringStatus]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setIsLoading(true);
|
||||||
|
getFolder();
|
||||||
|
}, [getFolder]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FolderInformationClass
|
||||||
|
{...props}
|
||||||
|
selectedFolderUid={folderUid}
|
||||||
|
selectedFolder={selectedFolder}
|
||||||
|
router={router}
|
||||||
|
isLoading={isLoading}
|
||||||
|
isAnchored={isAnchored}
|
||||||
|
getFolderCallback={getFolder}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,19 @@ import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
|
|||||||
import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage";
|
import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useCallback } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import LandingImage from "./landing-connect.jpeg";
|
import LandingImage from "./landing-connect.jpeg";
|
||||||
import { FrontendVariables } from "@Front/Config/VariablesFront";
|
import { FrontendVariables } from "@Front/Config/VariablesFront";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const error = router.query["error"];
|
||||||
|
|
||||||
|
const [isErrorModalOpen, setIsErrorModalOpen] = useState(false);
|
||||||
|
|
||||||
const redirectUserOnConnection = useCallback(() => {
|
const redirectUserOnConnection = useCallback(() => {
|
||||||
const variables = FrontendVariables.getInstance();
|
const variables = FrontendVariables.getInstance();
|
||||||
@ -24,6 +28,18 @@ export default function Login() {
|
|||||||
);
|
);
|
||||||
}, [router]);
|
}, [router]);
|
||||||
|
|
||||||
|
const openErrorModal = useCallback(() => {
|
||||||
|
setIsErrorModalOpen(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const closeErrorModal = useCallback(() => {
|
||||||
|
setIsErrorModalOpen(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (error === "1") openErrorModal();
|
||||||
|
}, [error, openErrorModal]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultDoubleSidePage title={"Login"} image={LandingImage}>
|
<DefaultDoubleSidePage title={"Login"} image={LandingImage}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
@ -41,6 +57,20 @@ export default function Login() {
|
|||||||
<Button variant={EButtonVariant.LINE}>Contacter l'administrateur</Button>
|
<Button variant={EButtonVariant.LINE}>Contacter l'administrateur</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
<Confirm
|
||||||
|
isOpen={isErrorModalOpen}
|
||||||
|
onClose={closeErrorModal}
|
||||||
|
showCancelButton={false}
|
||||||
|
onAccept={closeErrorModal}
|
||||||
|
closeBtn
|
||||||
|
header={"Erreur"}
|
||||||
|
confirmText={"OK"}>
|
||||||
|
<div className={classes["modal-content"]}>
|
||||||
|
<Typography typo={ITypo.P_16} className={classes["text"]}>
|
||||||
|
Une erreur est survenue lors de la connexion. Veuillez réessayer.
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</Confirm>
|
||||||
</DefaultDoubleSidePage>
|
</DefaultDoubleSidePage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,11 @@ export default function LoginCallBack() {
|
|||||||
if (!code) return;
|
if (!code) return;
|
||||||
try {
|
try {
|
||||||
const token = await Auth.getInstance().getIdnotJwt(code as string);
|
const token = await Auth.getInstance().getIdnotJwt(code as string);
|
||||||
|
if (!token) return router.push(Module.getInstance().get().modules.pages.Login.props.path);
|
||||||
await UserStore.instance.connect(token.accessToken, token.refreshToken);
|
await UserStore.instance.connect(token.accessToken, token.refreshToken);
|
||||||
return router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
return router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
router.push(Module.getInstance().get().modules.pages.Login.props.path + "?error=1");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,3 +83,15 @@
|
|||||||
.remove-my-vote {
|
.remove-my-vote {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loader-container {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
.loader {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -4,20 +4,21 @@ import Roles from "@Front/Api/LeCoffreApi/Admin/Roles/Roles";
|
|||||||
import LiveVotes from "@Front/Api/LeCoffreApi/SuperAdmin/LiveVotes/LiveVotes";
|
import LiveVotes from "@Front/Api/LeCoffreApi/SuperAdmin/LiveVotes/LiveVotes";
|
||||||
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
|
||||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||||
import Switch from "@Front/Components/DesignSystem/Switch";
|
import Switch from "@Front/Components/DesignSystem/Switch";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import DefaultUserDashboard from "@Front/Components/LayoutTemplates/DefaultUserDashboard";
|
import DefaultUserDashboard from "@Front/Components/LayoutTemplates/DefaultUserDashboard";
|
||||||
import JwtService from "@Front/Services/JwtService/JwtService";
|
import JwtService from "@Front/Services/JwtService/JwtService";
|
||||||
import Toasts from "@Front/Stores/Toasts";
|
import Toasts from "@Front/Stores/Toasts";
|
||||||
import User, { Appointment, OfficeRole, Vote } from "le-coffre-resources/dist/SuperAdmin";
|
import User, { Appointment, Vote } from "le-coffre-resources/dist/SuperAdmin";
|
||||||
import { EAppointmentStatus, EVote } from "le-coffre-resources/dist/SuperAdmin/Appointment";
|
import { EAppointmentStatus, EVote } from "le-coffre-resources/dist/SuperAdmin/Appointment";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles";
|
||||||
|
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
export default function UserInformations(props: IProps) {
|
export default function UserInformations(props: IProps) {
|
||||||
@ -25,9 +26,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
let { userUid } = router.query;
|
let { userUid } = router.query;
|
||||||
|
|
||||||
const [userSelected, setUserSelected] = useState<User | null>(null);
|
const [userSelected, setUserSelected] = useState<User | null>(null);
|
||||||
const [availableRoles, setAvailableRoles] = useState<IOption[]>([]);
|
|
||||||
|
|
||||||
const [roleModalOpened, setRoleModalOpened] = useState<boolean>(false);
|
|
||||||
const [isSuperAdminModalOpened, setIsSuperAdminModalOpened] = useState<boolean>(false);
|
const [isSuperAdminModalOpened, setIsSuperAdminModalOpened] = useState<boolean>(false);
|
||||||
const [superAdminModalType, setSuperAdminModalType] = useState<"add" | "remove">("add");
|
const [superAdminModalType, setSuperAdminModalType] = useState<"add" | "remove">("add");
|
||||||
const [adminModalType, setAdminModalType] = useState<"add" | "remove">("add");
|
const [adminModalType, setAdminModalType] = useState<"add" | "remove">("add");
|
||||||
@ -36,19 +35,14 @@ export default function UserInformations(props: IProps) {
|
|||||||
const [isAdminChecked, setIsAdminChecked] = useState<boolean>(false);
|
const [isAdminChecked, setIsAdminChecked] = useState<boolean>(false);
|
||||||
const [isAdminModalOpened, setIsAdminModalOpened] = useState<boolean>(false);
|
const [isAdminModalOpened, setIsAdminModalOpened] = useState<boolean>(false);
|
||||||
|
|
||||||
const [selectedOption, setSelectedOption] = useState<IOption | null>(null);
|
|
||||||
|
|
||||||
const [currentAppointment, setCurrentAppointment] = useState<Appointment | null>(null);
|
const [currentAppointment, setCurrentAppointment] = useState<Appointment | null>(null);
|
||||||
|
|
||||||
const handleRoleChange = useCallback((option: IOption) => {
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||||
setSelectedOption(option);
|
|
||||||
setRoleModalOpened(true);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
/** When page change, get the user of the page */
|
/** When page change, get the user of the page */
|
||||||
|
|
||||||
const getUser = useCallback(async () => {
|
const getUser = useCallback(async () => {
|
||||||
if (!userUid) return;
|
if (!userUid) return;
|
||||||
|
setIsLoading(true);
|
||||||
const user = await Users.getInstance().getByUid(userUid as string, {
|
const user = await Users.getInstance().getByUid(userUid as string, {
|
||||||
q: {
|
q: {
|
||||||
contact: true,
|
contact: true,
|
||||||
@ -68,11 +62,14 @@ export default function UserInformations(props: IProps) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
const roles = await Roles.getInstance().get({
|
const roles = await OfficeRoles.getInstance().get({
|
||||||
where: {NOT: {OR:[{name: "super-admin"}, {name: "admin"}]}},
|
where: {
|
||||||
|
office: { uid: user.office_membership?.uid },
|
||||||
|
NOT: { OR: [{ name: "super-admin" }, { name: "admin" }] },
|
||||||
|
},
|
||||||
});
|
});
|
||||||
if (!roles) return
|
if (!roles) return;
|
||||||
setAvailableRoles(roles.map((role) => ({ value: role.uid, label: role.label })));
|
setIsLoading(false);
|
||||||
setUserSelected(user);
|
setUserSelected(user);
|
||||||
}, [userUid]);
|
}, [userUid]);
|
||||||
|
|
||||||
@ -140,8 +137,9 @@ export default function UserInformations(props: IProps) {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
getUser();
|
||||||
setIsAdminModalOpened(false);
|
setIsAdminModalOpened(false);
|
||||||
}, [userSelected, adminModalType]);
|
}, [userSelected, adminModalType, getUser]);
|
||||||
|
|
||||||
/** Functions for the super admin modal */
|
/** Functions for the super admin modal */
|
||||||
const openSuperAdminModal = () => {
|
const openSuperAdminModal = () => {
|
||||||
@ -165,7 +163,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
let vote = Vote.hydrate<Vote>({
|
let vote = Vote.hydrate<Vote>({
|
||||||
appointment: Appointment.hydrate<Appointment>({
|
appointment: Appointment.hydrate<Appointment>({
|
||||||
uid: currentAppointment?.uid ?? undefined,
|
uid: currentAppointment?.uid ?? undefined,
|
||||||
targeted_user: User.hydrate<User>({
|
user: User.hydrate<User>({
|
||||||
uid: userSelected.uid,
|
uid: userSelected.uid,
|
||||||
}),
|
}),
|
||||||
choice: superAdminModalType === "add" ? EVote.NOMINATE : EVote.DISMISS,
|
choice: superAdminModalType === "add" ? EVote.NOMINATE : EVote.DISMISS,
|
||||||
@ -183,28 +181,6 @@ export default function UserInformations(props: IProps) {
|
|||||||
setIsSuperAdminModalOpened(false);
|
setIsSuperAdminModalOpened(false);
|
||||||
}, [userSelected, currentAppointment, superAdminModalType, getUser]);
|
}, [userSelected, currentAppointment, superAdminModalType, getUser]);
|
||||||
|
|
||||||
const closeRoleModal = useCallback(() => {
|
|
||||||
setRoleModalOpened(false);
|
|
||||||
setSelectedOption({
|
|
||||||
value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid,
|
|
||||||
label: userSelected?.office_role ? userSelected?.office_role?.name : userSelected?.role?.label!,
|
|
||||||
});
|
|
||||||
}, [userSelected?.office_role, userSelected?.role?.label, userSelected?.role?.uid]);
|
|
||||||
|
|
||||||
const changeRole = useCallback(async () => {
|
|
||||||
await Users.getInstance().put(
|
|
||||||
userSelected?.uid as string,
|
|
||||||
User.hydrate<User>({
|
|
||||||
uid: userSelected?.uid as string,
|
|
||||||
office_role: OfficeRole.hydrate<OfficeRole>({
|
|
||||||
uid: selectedOption?.value as string,
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
setRoleModalOpened(false);
|
|
||||||
getUser();
|
|
||||||
}, [getUser, selectedOption?.value, userSelected?.uid]);
|
|
||||||
|
|
||||||
/** Reset switch state when userSelect change */
|
/** Reset switch state when userSelect change */
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!userSelected) return;
|
if (!userSelected) return;
|
||||||
@ -229,9 +205,12 @@ export default function UserInformations(props: IProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultUserDashboard mobileBackText={"Liste des utilisateurs"}>
|
<DefaultUserDashboard mobileBackText={"Liste des utilisateurs"}>
|
||||||
|
{!isLoading && (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["header"]}>
|
<div className={classes["header"]}>
|
||||||
<Typography typo={ITypo.H1Bis}>{userSelected?.contact?.first_name + " " + userSelected?.contact?.last_name}</Typography>
|
<Typography typo={ITypo.H1Bis}>
|
||||||
|
{userSelected?.contact?.first_name + " " + userSelected?.contact?.last_name}
|
||||||
|
</Typography>
|
||||||
<Typography typo={ITypo.H3} color={ITypoColor.GREY}>
|
<Typography typo={ITypo.H3} color={ITypoColor.GREY}>
|
||||||
Office {userSelected?.office_membership?.name.toLocaleUpperCase()}
|
Office {userSelected?.office_membership?.name.toLocaleUpperCase()}
|
||||||
</Typography>
|
</Typography>
|
||||||
@ -269,16 +248,9 @@ export default function UserInformations(props: IProps) {
|
|||||||
<Typography typo={ITypo.P_SB_18}>Rôle au sein de son office</Typography>
|
<Typography typo={ITypo.P_SB_18}>Rôle au sein de son office</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes["second-line"]}>
|
<div className={classes["second-line"]}>
|
||||||
<SelectField
|
<Typography typo={ITypo.P_18}>
|
||||||
placeholder="Rôle"
|
{userSelected?.office_role ? userSelected?.office_role?.name : "Utilisateur restreint"}
|
||||||
name="role"
|
</Typography>
|
||||||
options={availableRoles.filter((role) => role.label !== "admin")}
|
|
||||||
onChange={handleRoleChange}
|
|
||||||
selectedOption={{
|
|
||||||
value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid,
|
|
||||||
label: userSelected?.office_role ? userSelected?.office_role?.name : "Utilisateur restreint",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes["part"]}>
|
<div className={classes["part"]}>
|
||||||
@ -286,7 +258,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
<Typography typo={ITypo.P_SB_18}>Attribuer un titre</Typography>
|
<Typography typo={ITypo.P_SB_18}>Attribuer un titre</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes["second-line"]}>
|
<div className={classes["second-line"]}>
|
||||||
{!isSuperAdminChecked && (
|
{!isSuperAdminChecked && !currentAppointment && (
|
||||||
<Switch label="Admin de son office" checked={isAdminChecked} onChange={handleAdminChanged} />
|
<Switch label="Admin de son office" checked={isAdminChecked} onChange={handleAdminChanged} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -329,21 +301,6 @@ export default function UserInformations(props: IProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Confirm
|
|
||||||
isOpen={roleModalOpened}
|
|
||||||
onClose={closeRoleModal}
|
|
||||||
onAccept={changeRole}
|
|
||||||
closeBtn
|
|
||||||
header={"Changement de rôle"}
|
|
||||||
confirmText={"Valider"}
|
|
||||||
cancelText={"Annuler"}>
|
|
||||||
<div className={classes["modal-content"]}>
|
|
||||||
<Typography typo={ITypo.P_16} className={classes["text"]}>
|
|
||||||
Attribuer le rôle de <span className={classes["role-name"]}>{selectedOption?.label}</span> à{" "}
|
|
||||||
{userSelected?.contact?.first_name} {userSelected?.contact?.last_name} ?
|
|
||||||
</Typography>
|
|
||||||
</div>
|
|
||||||
</Confirm>
|
|
||||||
<Confirm
|
<Confirm
|
||||||
isOpen={isSuperAdminModalOpened}
|
isOpen={isSuperAdminModalOpened}
|
||||||
onClose={closeSuperAdminModal}
|
onClose={closeSuperAdminModal}
|
||||||
@ -356,8 +313,8 @@ export default function UserInformations(props: IProps) {
|
|||||||
cancelText={"Annuler"}>
|
cancelText={"Annuler"}>
|
||||||
<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"]}>
|
||||||
{superAdminModalType === "add" ? "Nommer" : "Retirer"} une personne Super Administrateur nécessite 3 votes de
|
{superAdminModalType === "add" ? "Nommer" : "Retirer"} une personne Super Administrateur nécessite 3 votes
|
||||||
super administrateurs existants. Souhaitez-vous attribuer un vote ?
|
de super administrateurs existants. Souhaitez-vous attribuer un vote ?
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</Confirm>
|
</Confirm>
|
||||||
@ -380,6 +337,14 @@ export default function UserInformations(props: IProps) {
|
|||||||
<div className={classes["modal-content"]}></div>
|
<div className={classes["modal-content"]}></div>
|
||||||
</Confirm>
|
</Confirm>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
{isLoading && (
|
||||||
|
<div className={classes["loader-container"]}>
|
||||||
|
<div className={classes["loader"]}>
|
||||||
|
<Loader />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</DefaultUserDashboard>
|
</DefaultUserDashboard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,15 @@ export default class Toasts {
|
|||||||
this.event.emit("change", this.toastList);
|
this.event.emit("change", this.toastList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async closeAll() {
|
||||||
|
for (let i = 0; i < this.toastList.length; i++) {
|
||||||
|
await Notifications.getInstance().put(this.toastList[i]?.uid as string, {
|
||||||
|
read: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.event.emit("change", []);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An utility static method you can use to quickly display an error toast
|
* An utility static method you can use to quickly display an error toast
|
||||||
* with a custom error message.
|
* with a custom error message.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user