Merge branch 'dev' into staging
This commit is contained in:
commit
0bbdc76b6e
66
package-lock.json
generated
66
package-lock.json
generated
@ -472,22 +472,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@mui/core-downloads-tracker": {
|
||||
"version": "5.15.18",
|
||||
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.18.tgz",
|
||||
"integrity": "sha512-/9pVk+Al8qxAjwFUADv4BRZgMpZM4m5E+2Q/20qhVPuIJWqKp4Ie4tGExac6zu93rgPTYVQGgu+1vjiT0E+cEw==",
|
||||
"version": "5.15.19",
|
||||
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.19.tgz",
|
||||
"integrity": "sha512-tCHSi/Tomez9ERynFhZRvFO6n9ATyrPs+2N80DMDzp6xDVirbBjEwhPcE+x7Lj+nwYw0SqFkOxyvMP0irnm55w==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/mui-org"
|
||||
}
|
||||
},
|
||||
"node_modules/@mui/material": {
|
||||
"version": "5.15.18",
|
||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.18.tgz",
|
||||
"integrity": "sha512-n+/dsiqux74fFfcRUJjok+ieNQ7+BEk6/OwX9cLcLvriZrZb+/7Y8+Fd2HlUUbn5N0CDurgAHm0VH1DqyJ9HAw==",
|
||||
"version": "5.15.19",
|
||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.19.tgz",
|
||||
"integrity": "sha512-lp5xQBbcRuxNtjpWU0BWZgIrv2XLUz4RJ0RqFXBdESIsKoGCQZ6P3wwU5ZPuj5TjssNiKv9AlM+vHopRxZhvVQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.23.9",
|
||||
"@mui/base": "5.0.0-beta.40",
|
||||
"@mui/core-downloads-tracker": "^5.15.18",
|
||||
"@mui/core-downloads-tracker": "^5.15.19",
|
||||
"@mui/system": "^5.15.15",
|
||||
"@mui/types": "^7.2.14",
|
||||
"@mui/utils": "^5.15.14",
|
||||
@ -1347,9 +1347,9 @@
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"node_modules/bare-events": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.2.2.tgz",
|
||||
"integrity": "sha512-h7z00dWdG0PYOQEvChhOSWvOfkIKsdZGkWr083FgN/HyoQuebSew/cgirYqh9SCuy/hRvxc5Vy6Fw8xAmYHLkQ==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.3.1.tgz",
|
||||
"integrity": "sha512-sJnSOTVESURZ61XgEleqmP255T6zTYwHPwE4r6SssIh0U9/uDvfpdoJYpVUerJJZH2fueO+CdT8ZT+OC/7aZDA==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/bare-fs": {
|
||||
@ -1508,9 +1508,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001623",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001623.tgz",
|
||||
"integrity": "sha512-X/XhAVKlpIxWPpgRTnlgZssJrF0m6YtRA0QDWgsBNT12uZM6LPRydR7ip405Y3t1LamD8cP2TZFEDZFBf5ApcA==",
|
||||
"version": "1.0.30001625",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001625.tgz",
|
||||
"integrity": "sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@ -2340,28 +2340,28 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react": {
|
||||
"version": "7.34.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz",
|
||||
"integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==",
|
||||
"version": "7.34.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.2.tgz",
|
||||
"integrity": "sha512-2HCmrU+/JNigDN6tg55cRDKCQWicYAPB38JGSFDQt95jDm8rrvSUo7YPkOIm5l6ts1j1zCvysNcasvfTMQzUOw==",
|
||||
"dependencies": {
|
||||
"array-includes": "^3.1.7",
|
||||
"array.prototype.findlast": "^1.2.4",
|
||||
"array-includes": "^3.1.8",
|
||||
"array.prototype.findlast": "^1.2.5",
|
||||
"array.prototype.flatmap": "^1.3.2",
|
||||
"array.prototype.toreversed": "^1.1.2",
|
||||
"array.prototype.tosorted": "^1.1.3",
|
||||
"doctrine": "^2.1.0",
|
||||
"es-iterator-helpers": "^1.0.17",
|
||||
"es-iterator-helpers": "^1.0.19",
|
||||
"estraverse": "^5.3.0",
|
||||
"jsx-ast-utils": "^2.4.1 || ^3.0.0",
|
||||
"minimatch": "^3.1.2",
|
||||
"object.entries": "^1.1.7",
|
||||
"object.fromentries": "^2.0.7",
|
||||
"object.hasown": "^1.1.3",
|
||||
"object.values": "^1.1.7",
|
||||
"object.entries": "^1.1.8",
|
||||
"object.fromentries": "^2.0.8",
|
||||
"object.hasown": "^1.1.4",
|
||||
"object.values": "^1.2.0",
|
||||
"prop-types": "^15.8.1",
|
||||
"resolve": "^2.0.0-next.5",
|
||||
"semver": "^6.3.1",
|
||||
"string.prototype.matchall": "^4.0.10"
|
||||
"string.prototype.matchall": "^4.0.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
@ -3710,9 +3710,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-abi": {
|
||||
"version": "3.62.0",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz",
|
||||
"integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==",
|
||||
"version": "3.63.0",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.63.0.tgz",
|
||||
"integrity": "sha512-vAszCsOUrUxjGAmdnM/pq7gUgie0IRteCQMX6d4A534fQCR93EJU5qgzBvU6EkFfK27s0T3HEV3BOyJIr7OMYw==",
|
||||
"dependencies": {
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
@ -4463,9 +4463,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.77.2",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.77.2.tgz",
|
||||
"integrity": "sha512-eb4GZt1C3avsX3heBNlrc7I09nyT00IUuo4eFhAbeXWU2fvA7oXI53SxODVAA+zgZCk9aunAZgO+losjR3fAwA==",
|
||||
"version": "1.77.4",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.77.4.tgz",
|
||||
"integrity": "sha512-vcF3Ckow6g939GMA4PeU7b2K/9FALXk2KF9J87txdHzXbUF9XRQRwSxcAs/fGaTnJeBFd7UoV22j3lzMLdM0Pw==",
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
@ -4674,9 +4674,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/streamx": {
|
||||
"version": "2.16.1",
|
||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz",
|
||||
"integrity": "sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==",
|
||||
"version": "2.17.0",
|
||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.17.0.tgz",
|
||||
"integrity": "sha512-mzRXEeafEA0skX5XLiDht/zdIqEVs4kgayUTFHDoMjiaZ2kC7DoFsQDJVXRILI2Qme/kWXxLpuU6P0B+xcXpFA==",
|
||||
"dependencies": {
|
||||
"fast-fifo": "^1.1.0",
|
||||
"queue-tick": "^1.0.1"
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { type OfficeFolder } from "le-coffre-resources/dist/Customer";
|
||||
import { type OfficeFolder as OfficeFolderNotary } from "le-coffre-resources/dist/Notary";
|
||||
|
||||
import BaseCustomer from "../BaseCustomer";
|
||||
|
||||
@ -45,11 +46,11 @@ export default class Folders extends BaseCustomer {
|
||||
/**
|
||||
* @description : Get a folder by uid
|
||||
*/
|
||||
public async getByUid(uid: string, q?: any): Promise<OfficeFolder> {
|
||||
public async getByUid(uid: string, q?: any): Promise<OfficeFolderNotary> {
|
||||
const url = new URL(this.baseURl.concat(`/${uid}`));
|
||||
if (q) Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||
try {
|
||||
return await this.getRequest<OfficeFolder>(url);
|
||||
return await this.getRequest<OfficeFolderNotary>(url);
|
||||
} catch (err) {
|
||||
this.onError(err);
|
||||
return Promise.reject(err);
|
||||
|
@ -38,6 +38,27 @@
|
||||
.subtitle {
|
||||
margin: 64px 0 32px 0;
|
||||
}
|
||||
|
||||
.contact {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.contact-text {
|
||||
text-align: right;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.contact-button {
|
||||
margin-top: 4%;
|
||||
}
|
||||
|
||||
.separator {
|
||||
width: 20px;
|
||||
height: 50px; /* Adjust the height as needed */
|
||||
background-color: gray;
|
||||
margin: 0 20px; /* Adjust the margin as needed */
|
||||
}
|
||||
}
|
||||
|
||||
.sub-container {
|
||||
|
@ -22,6 +22,7 @@ export default function ClientDashboard(props: IProps) {
|
||||
const [documents, setDocuments] = useState<Document[] | null>(null);
|
||||
|
||||
const [customer, setCustomer] = useState<Customer | null>(null);
|
||||
const [contact, setContact] = useState<Customer["contact"] | null>(null);
|
||||
const [folder, setFolder] = useState<OfficeFolder | null>(null);
|
||||
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(false);
|
||||
|
||||
@ -31,7 +32,23 @@ export default function ClientDashboard(props: IProps) {
|
||||
jwt = JwtService.getInstance().decodeCustomerJwt();
|
||||
}
|
||||
|
||||
const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
||||
const folder = await Folders.getInstance().getByUid(folderUid as string, {
|
||||
q: {
|
||||
office: true,
|
||||
customers: true,
|
||||
stakeholders: {
|
||||
include: {
|
||||
contact: true,
|
||||
office_role: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//Loop through the folder stakeholders, if there is at least one stakeholder that role is "Collaborateur" set contact to this stakeholders.contact, else, take the first stakeholders of the list
|
||||
const contact = folder.stakeholders!.find((stakeholder) => stakeholder.office_role?.name === "Collaborateur")?.contact;
|
||||
setContact(contact ?? folder.stakeholders![0]!.contact);
|
||||
|
||||
const actualCustomer = folder?.customers?.find((customer) => customer.contact?.email === jwt?.email);
|
||||
if (!actualCustomer) throw new Error("Customer not found");
|
||||
|
||||
@ -120,10 +137,22 @@ export default function ClientDashboard(props: IProps) {
|
||||
transmis à votre notaire.
|
||||
</Typography>
|
||||
</div>
|
||||
{folder?.office?.rib_name && (
|
||||
//Div to avoid the button to be on the same line as the text
|
||||
<Button onClick={downloadFile}>Télécharger le RIB de votre notaire</Button>
|
||||
)}
|
||||
<div className={classes["contact"]}>
|
||||
<Typography typo={ITypo.P_SB_18} className={classes["contact-text"]} color={ITypoColor.GREY}>
|
||||
<p>
|
||||
{contact?.first_name} {contact?.last_name}
|
||||
</p>
|
||||
<p>{contact?.phone_number ?? contact?.cell_phone_number}</p>
|
||||
<p>{contact?.email}</p>
|
||||
</Typography>
|
||||
<div className="separator"></div>
|
||||
{!folder?.office?.rib_name && (
|
||||
//Div to avoid the button to be on the same line as the text
|
||||
<Button className={classes["contact-button"]} onClick={downloadFile}>
|
||||
Télécharger le RIB de votre notaire
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}, [
|
||||
|
Loading…
x
Reference in New Issue
Block a user