✨ Preventing anchoring if not validated
This commit is contained in:
parent
439a0f5bc6
commit
f756e12c5f
@ -37,6 +37,7 @@ type IState = {
|
||||
hasValidateAnchoring: boolean;
|
||||
isVerifDeleteModalVisible: boolean;
|
||||
isAnchored: boolean | null;
|
||||
isPreventArchiveModalOpen: boolean;
|
||||
};
|
||||
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
public constructor(props: IPropsClass) {
|
||||
@ -49,6 +50,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
hasValidateAnchoring: false,
|
||||
isVerifDeleteModalVisible: false,
|
||||
isAnchored: null,
|
||||
isPreventArchiveModalOpen: false,
|
||||
};
|
||||
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||
this.openArchivedModal = this.openArchivedModal.bind(this);
|
||||
@ -63,6 +65,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
this.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this);
|
||||
this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this);
|
||||
this.verifyAnchorStatus = this.verifyAnchorStatus.bind(this);
|
||||
this.closePreventArchiveModal = this.closePreventArchiveModal.bind(this);
|
||||
}
|
||||
|
||||
// TODO: Message if the user has not created any folder yet
|
||||
@ -174,6 +177,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<Confirm
|
||||
isOpen={this.state.isPreventArchiveModalOpen}
|
||||
onAccept={this.closePreventArchiveModal}
|
||||
onClose={this.closePreventArchiveModal}
|
||||
closeBtn
|
||||
header={"Vous devez valider et certifier un dossier avant de pouvoir l'archiver"}
|
||||
cancelText={"Annuler"}
|
||||
confirmText={"J'ai compris"}>
|
||||
<div className={classes["modal-title"]}>
|
||||
<Typography typo={ITypo.P_16}>
|
||||
Pour valider un dossier, toutes les pièces envoyées par vos clients doivent être validées (vert). Si certains
|
||||
documents sont en attente (orange), alors, veuillez les valider ou les refuser et veillez à ce qu'aucun document
|
||||
ne soit encore en demandé au client (gris)
|
||||
</Typography>
|
||||
</div>
|
||||
</Confirm>
|
||||
<Confirm
|
||||
isOpen={this.state.isValidateModalVisible}
|
||||
onClose={this.closeModal}
|
||||
@ -225,6 +244,12 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
);
|
||||
}
|
||||
|
||||
private closePreventArchiveModal() {
|
||||
this.setState({
|
||||
isPreventArchiveModalOpen: false,
|
||||
});
|
||||
}
|
||||
|
||||
private async verifyAnchorStatus() {
|
||||
if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return;
|
||||
try {
|
||||
@ -352,7 +377,11 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
}
|
||||
|
||||
private openArchivedModal(): void {
|
||||
this.setState({ isArchivedModalOpen: true });
|
||||
if (this.everyDocumentValidated() && this.state.isAnchored) {
|
||||
this.setState({ isArchivedModalOpen: true });
|
||||
} else {
|
||||
this.setState({ isPreventArchiveModalOpen: true });
|
||||
}
|
||||
}
|
||||
|
||||
private closeArchivedModal(): void {
|
||||
|
Loading…
x
Reference in New Issue
Block a user