diff --git a/src/front/Components/DesignSystem/UserFolder/index.tsx b/src/front/Components/DesignSystem/UserFolder/index.tsx index 3e5094bd..0ff66682 100644 --- a/src/front/Components/DesignSystem/UserFolder/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/index.tsx @@ -26,6 +26,7 @@ type IProps = { isOpened: boolean; onChange: (id: string) => void; anchorStatus: AnchorStatus; + getFolderCallback: () => Promise; }; type IState = { isOpenDeletionModal: boolean; @@ -145,7 +146,7 @@ export default class UserFolder extends React.Component { private async deleteAskedDocument() { try { await Documents.getInstance().delete(this.state.selectedDocumentToDelete); - window.location.reload(); + await this.props.getFolderCallback(); } catch (e) { console.error(e); } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx index b4920f84..15b06256 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx @@ -13,6 +13,7 @@ import { AnchorStatus } from ".."; type IProps = { folder: OfficeFolder; anchorStatus: AnchorStatus; + getFolderCallback: () => Promise; }; type IState = { openedCustomer: string; @@ -76,6 +77,7 @@ export default class ClientSection extends React.Component { isOpened={this.state.openedCustomer === customer.uid} onChange={this.changeUserFolder} anchorStatus={this.props.anchorStatus} + getFolderCallback={this.props.getFolderCallback} /> ); }); diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 654aa40b..3f424ffa 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -37,6 +37,7 @@ type IPropsClass = IProps & { isLoading: boolean; selectedFolder: OfficeFolder | null; getAnchoringStatus: () => Promise; + getFolderCallback: () => Promise; }; type IState = { @@ -115,12 +116,20 @@ class FolderInformationClass extends BasePage { /> {this.doesFolderHaveCustomer() && ( - + )} {!this.doesFolderHaveCustomer() && ( - + )}
@@ -471,6 +480,7 @@ export default function FolderInformation(props: IProps) { isLoading={isLoading} selectedFolder={selectedFolder} getAnchoringStatus={getAnchoringStatus} + getFolderCallback={getFolder} /> ); } diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx index 3052c261..bd084620 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx @@ -8,6 +8,7 @@ import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation type IProps = { folder: OfficeFolder; anchorStatus: AnchorStatus; + getFolderCallback: () => Promise; }; type IState = { openedCustomer: string; @@ -53,6 +54,7 @@ export default class ClientSection extends React.Component { onChange={this.changeUserFolder} anchorStatus={this.props.anchorStatus} isArchived + getFolderCallback={this.props.getFolderCallback} /> ); }); diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 28a8a6e2..453b86ea 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -26,6 +26,7 @@ type IPropsClass = IProps & { isLoading: boolean; selectedFolder: OfficeFolder | null; isAnchored: AnchorStatus; + getFolderCallback: () => Promise; }; type IState = { @@ -54,68 +55,80 @@ class FolderInformationClass extends BasePage { return ( {!this.props.isLoading && ( -
- {this.state.selectedFolder ? ( -
-
-
-
- Informations du dossier +
+ {this.state.selectedFolder ? ( +
+
+
+
+ Informations du dossier +
+ + +
- - - -
- -
+
+ +
+
+ +
+ +
+ +
+ {this.doesFolderHaveCustomer() && ( + + )}
-
- + )} + +
+
- -
- +
+ ) : ( +
+ Informations du dossier +
+ + Aucun dossier sélectionné +
- {this.doesFolderHaveCustomer() && }
- - {!this.doesFolderHaveCustomer() && } - -
- -
-
- ) : ( -
- Informations du dossier -
- - Aucun dossier sélectionné - -
-
- )} -
+ )} +
)} {this.props.isLoading && (
@@ -181,7 +194,7 @@ export default function FolderInformation(props: IProps) { folderUid = folderUid as string; const getAnchoringStatus = useCallback(async () => { - if(!folderUid) return; + if (!folderUid) return; setIsLoading(true); try { const anchorStatus = await OfficeFolderAnchors.getInstance().getByUid(folderUid as string); @@ -237,5 +250,15 @@ export default function FolderInformation(props: IProps) { getFolder(); }, [getFolder]); - return ; + return ( + + ); }