🐛 Fixing refresh on delete asked document
This commit is contained in:
parent
d8f24721cb
commit
ae28122852
@ -26,6 +26,7 @@ type IProps = {
|
|||||||
isOpened: boolean;
|
isOpened: boolean;
|
||||||
onChange: (id: string) => void;
|
onChange: (id: string) => void;
|
||||||
anchorStatus: AnchorStatus;
|
anchorStatus: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
isOpenDeletionModal: boolean;
|
isOpenDeletionModal: boolean;
|
||||||
@ -145,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);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import { AnchorStatus } from "..";
|
|||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
anchorStatus: AnchorStatus;
|
anchorStatus: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -76,6 +77,7 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
isOpened={this.state.openedCustomer === customer.uid}
|
isOpened={this.state.openedCustomer === customer.uid}
|
||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
anchorStatus={this.props.anchorStatus}
|
anchorStatus={this.props.anchorStatus}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -37,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 = {
|
||||||
@ -115,12 +116,20 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{this.doesFolderHaveCustomer() && (
|
{this.doesFolderHaveCustomer() && (
|
||||||
<ClientSection folder={this.props.selectedFolder} anchorStatus={this.props.isAnchored} />
|
<ClientSection
|
||||||
|
folder={this.props.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && (
|
{!this.doesFolderHaveCustomer() && (
|
||||||
<ClientSection folder={this.props.selectedFolder} anchorStatus={this.props.isAnchored} />
|
<ClientSection
|
||||||
|
folder={this.props.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
@ -471,6 +480,7 @@ export default function FolderInformation(props: IProps) {
|
|||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
selectedFolder={selectedFolder}
|
selectedFolder={selectedFolder}
|
||||||
getAnchoringStatus={getAnchoringStatus}
|
getAnchoringStatus={getAnchoringStatus}
|
||||||
|
getFolderCallback={getFolder}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation
|
|||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
anchorStatus: AnchorStatus;
|
anchorStatus: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -53,6 +54,7 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
anchorStatus={this.props.anchorStatus}
|
anchorStatus={this.props.anchorStatus}
|
||||||
isArchived
|
isArchived
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -26,6 +26,7 @@ type IPropsClass = IProps & {
|
|||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
selectedFolder: OfficeFolder | null;
|
selectedFolder: OfficeFolder | null;
|
||||||
isAnchored: AnchorStatus;
|
isAnchored: AnchorStatus;
|
||||||
|
getFolderCallback: () => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = {
|
type IState = {
|
||||||
@ -94,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} anchorStatus={this.props.isAnchored} />}
|
{this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection
|
||||||
|
folder={this.state.selectedFolder}
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
|
getFolderCallback={this.props.getFolderCallback}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} anchorStatus={this.props.isAnchored} />}
|
{!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}>
|
||||||
@ -237,5 +250,15 @@ export default function FolderInformation(props: IProps) {
|
|||||||
getFolder();
|
getFolder();
|
||||||
}, [getFolder]);
|
}, [getFolder]);
|
||||||
|
|
||||||
return <FolderInformationClass {...props} selectedFolderUid={folderUid} selectedFolder={selectedFolder} router={router} isLoading={isLoading} isAnchored={isAnchored} />;
|
return (
|
||||||
|
<FolderInformationClass
|
||||||
|
{...props}
|
||||||
|
selectedFolderUid={folderUid}
|
||||||
|
selectedFolder={selectedFolder}
|
||||||
|
router={router}
|
||||||
|
isLoading={isLoading}
|
||||||
|
isAnchored={isAnchored}
|
||||||
|
getFolderCallback={getFolder}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user