✨ Preventing anchoring if not validated
This commit is contained in:
parent
439a0f5bc6
commit
f756e12c5f
@ -37,6 +37,7 @@ type IState = {
|
|||||||
hasValidateAnchoring: boolean;
|
hasValidateAnchoring: boolean;
|
||||||
isVerifDeleteModalVisible: boolean;
|
isVerifDeleteModalVisible: boolean;
|
||||||
isAnchored: boolean | null;
|
isAnchored: boolean | null;
|
||||||
|
isPreventArchiveModalOpen: boolean;
|
||||||
};
|
};
|
||||||
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||||
public constructor(props: IPropsClass) {
|
public constructor(props: IPropsClass) {
|
||||||
@ -49,6 +50,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
hasValidateAnchoring: false,
|
hasValidateAnchoring: false,
|
||||||
isVerifDeleteModalVisible: false,
|
isVerifDeleteModalVisible: false,
|
||||||
isAnchored: null,
|
isAnchored: null,
|
||||||
|
isPreventArchiveModalOpen: false,
|
||||||
};
|
};
|
||||||
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||||
this.openArchivedModal = this.openArchivedModal.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.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this);
|
||||||
this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this);
|
this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this);
|
||||||
this.verifyAnchorStatus = this.verifyAnchorStatus.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
|
// TODO: Message if the user has not created any folder yet
|
||||||
@ -174,6 +177,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</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
|
<Confirm
|
||||||
isOpen={this.state.isValidateModalVisible}
|
isOpen={this.state.isValidateModalVisible}
|
||||||
onClose={this.closeModal}
|
onClose={this.closeModal}
|
||||||
@ -225,6 +244,12 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private closePreventArchiveModal() {
|
||||||
|
this.setState({
|
||||||
|
isPreventArchiveModalOpen: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private async verifyAnchorStatus() {
|
private async verifyAnchorStatus() {
|
||||||
if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return;
|
if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return;
|
||||||
try {
|
try {
|
||||||
@ -352,7 +377,11 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private openArchivedModal(): void {
|
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 {
|
private closeArchivedModal(): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user