diff --git a/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx b/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx index fe6b1c22..cce649bf 100644 --- a/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx @@ -257,7 +257,7 @@ export default class DepositOtherDocument extends React.Component ({ key: documentNotary.uid ?? "", - name: formatName(documentNotary.files?.[0]?.file_name?.split(".")?.[0] ?? "") || "_", + name: documentNotary.files?.[0]?.file_name?.split(".")?.[0] || "_", sentAt: new Date(documentNotary.created_at!).toLocaleDateString(), // actions: onDownloadFileNotary(documentNotary)} icon={} />, actions: { @@ -228,7 +228,3 @@ function buildRows( }, })); } - -function formatName(text: string): string { - return text.replace(/[^a-zA-Z0-9 ]/g, ""); -} diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx index 925929d7..8776d020 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx @@ -314,7 +314,7 @@ export default function DocumentTables(props: IProps) { }, file: { sx: { width: 120 }, - content: document.files?.[0]?.file_name ?? "_", + content: document.files?.[0]?.file_name?.split(".")?.[0] ?? "_", }, actions: { sx: { width: 76 }, @@ -360,7 +360,7 @@ export default function DocumentTables(props: IProps) { }, file: { sx: { width: 120 }, - content: document.files?.[0]?.file_name ?? "_", + content: document.files?.[0]?.file_name?.split(".")?.[0] ?? "_", }, actions: { sx: { width: 76 }, @@ -411,7 +411,7 @@ export default function DocumentTables(props: IProps) { }, file: { sx: { width: 120 }, - content: document.files?.[0]?.file_name ?? "_", + content: document.files?.[0]?.file_name?.split(".")?.[0] ?? "_", }, actions: { sx: { width: 76 }, content: "" }, }; @@ -428,7 +428,7 @@ export default function DocumentTables(props: IProps) { key: document.uid, document_type: { sx: { width: 300 }, - content: formatName(document.files?.[0]?.file_name?.split(".")?.[0] ?? "") || "_", + content: "Autre document", }, document_status: { sx: { width: 107 }, @@ -440,7 +440,7 @@ export default function DocumentTables(props: IProps) { }, file: { sx: { width: 120 }, - content: document.files?.[0]?.file_name ?? "_", + content: document.files?.[0]?.file_name?.split(".")?.[0] ?? "_", }, actions: { sx: { width: 76 }, @@ -539,10 +539,6 @@ function getHeader(dateColumnTitle: string, isMobile: boolean): IHead[] { ]; } -function formatName(text: string): string { - return text.replace(/[^a-zA-Z0-9 ]/g, ""); -} - function getTagForSentDocument(status: EDocumentNotaryStatus) { if (status === EDocumentNotaryStatus.SENT) { return ( diff --git a/src/front/Components/Layouts/Folder/SendDocuments/index.tsx b/src/front/Components/Layouts/Folder/SendDocuments/index.tsx index dcc56311..9a856be1 100644 --- a/src/front/Components/Layouts/Folder/SendDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/SendDocuments/index.tsx @@ -83,7 +83,7 @@ export default function SendDocuments() { const date: Date = new Date(); const strDate: string = `${date.getDate().toString().padStart(2, '0')}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getFullYear()}`; - const fileName: string = `${customer.contact.last_name}-${strDate}-APCL.${file.name.split('.').pop()}`.toUpperCase(); + const fileName: string = `aplc-${customer.contact.last_name}-${strDate}.${file.name.split('.').pop()}`; const arrayBuffer: ArrayBuffer = event.target.result as ArrayBuffer; const uint8Array: Uint8Array = new Uint8Array(arrayBuffer);