🐛 Retours Melissa sprint planning

This commit is contained in:
Maxime Lalo 2023-04-28 14:53:28 +02:00
parent 2aaa5cd3ed
commit 247b0ba108
6 changed files with 15 additions and 10 deletions

View File

@ -26,6 +26,7 @@
border: 1px solid $grey-medium; border: 1px solid $grey-medium;
&:disabled { &:disabled {
cursor: not-allowed;
~ .fake-placeholder { ~ .fake-placeholder {
/** /**
TODO TODO

View File

@ -22,7 +22,10 @@ export default class BurgerModal extends React.Component<IProps, IState> {
<NavigationLink <NavigationLink
path={Module.getInstance().get().modules.pages.Folder.props.path} path={Module.getInstance().get().modules.pages.Folder.props.path}
text="Dossiers en cours" text="Dossiers en cours"
routesActive={[Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path]} routesActive={[
Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path,
Module.getInstance().get().modules.pages.Folder.pages.CreateFolder.props.path,
]}
/> />
<NavigationLink <NavigationLink
path={Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.props.path} path={Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.props.path}

View File

@ -14,7 +14,10 @@ export default class Navigation extends React.Component<IProps, IState> {
<HeaderLink <HeaderLink
text={"Dossiers en cours"} text={"Dossiers en cours"}
path={Module.getInstance().get().modules.pages.Folder.props.path} path={Module.getInstance().get().modules.pages.Folder.props.path}
routesActive={[Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path]} routesActive={[
Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path,
Module.getInstance().get().modules.pages.Folder.pages.CreateFolder.props.path,
]}
/> />
<HeaderLink <HeaderLink
text={"Dossiers archivés"} text={"Dossiers archivés"}

View File

@ -20,7 +20,6 @@ export default class ProfileModal extends React.Component<IProps, IState> {
<div className={classes["root"]}> <div className={classes["root"]}>
<NavigationLink path={Module.getInstance().get().modules.pages.MyAccount.props.path} text="Mon compte" /> <NavigationLink path={Module.getInstance().get().modules.pages.MyAccount.props.path} text="Mon compte" />
<NavigationLink text="CGU" /> <NavigationLink text="CGU" />
<NavigationLink path={Module.getInstance().get().modules.pages.Home.props.path} text="Home" />
<div className={classes["separator"]} /> <div className={classes["separator"]} />
<LogOutButton /> <LogOutButton />
</div> </div>

View File

@ -73,8 +73,6 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
private hasPendingFiles(){ private hasPendingFiles(){
const documents = this.props.folder.documents?.filter((document) => document.depositor.contact.uid === this.props.contact.uid) ?? []; const documents = this.props.folder.documents?.filter((document) => document.depositor.contact.uid === this.props.contact.uid) ?? [];
const notAskedDocuments = documents.filter((document) => document.document_status === "PENDING") ?? []; const notAskedDocuments = documents.filter((document) => document.document_status === "PENDING") ?? [];
console.log(this.props.contact.uid);
console.log(notAskedDocuments.length);
return notAskedDocuments.length > 0; return notAskedDocuments.length > 0;
} }

View File

@ -35,6 +35,7 @@ type IState = {
hasValidateAnchoring: boolean; hasValidateAnchoring: boolean;
selectedFileIndex: number; selectedFileIndex: number;
selectedFile: File | null; selectedFile: File | null;
validatedPercentage: number;
}; };
class ViewDocumentsClass extends BasePage<IPropsClass, IState> { class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
@ -48,6 +49,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
hasValidateAnchoring: false, hasValidateAnchoring: false,
selectedFileIndex: 0, selectedFileIndex: 0,
selectedFile: null, selectedFile: null,
validatedPercentage: this.getRandomPercentageForOcr()
}; };
this.closeModals = this.closeModals.bind(this); this.closeModals = this.closeModals.bind(this);
@ -97,7 +99,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
<div className={classes["footer"]}> <div className={classes["footer"]}>
{this.props.selectedDocument?.document_type.name === "Carte d'identité" && ( {this.props.selectedDocument?.document_type.name === "Carte d'identité" && (
<div className={classes["ocr-container"]}> <div className={classes["ocr-container"]}>
<OcrResult percentage={this.getRandomPercentageForOcr()} /> <OcrResult percentage={this.state.validatedPercentage} />
</div> </div>
)} )}
@ -112,7 +114,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
</> </>
)} )}
{this.props.selectedDocument?.document_status === "VALIDATED" && ( {this.props.selectedDocument?.document_status === "VALIDATED" && (
<a href={this.state.selectedFile.file_path!} download> <a href={this.state.selectedFile.file_path!} download target="_blank">
<Button>Télécharger</Button> <Button>Télécharger</Button>
</a> </a>
)} )}
@ -122,8 +124,8 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
isOpen={this.state.isValidateModalVisible} isOpen={this.state.isValidateModalVisible}
onClose={this.closeModals} onClose={this.closeModals}
onAccept={this.validateAnchoring} onAccept={this.validateAnchoring}
closeBtn={!this.state.hasValidateAnchoring} closeBtn={true}
hasContainerClosable={!this.state.hasValidateAnchoring} hasContainerClosable={true}
header={this.state.hasValidateAnchoring ? "Document en cours de validation" : "Ancrer le document"} header={this.state.hasValidateAnchoring ? "Document en cours de validation" : "Ancrer le document"}
cancelText={"Annuler"} cancelText={"Annuler"}
confirmText={"Confirmer"} confirmText={"Confirmer"}
@ -280,7 +282,6 @@ export default function ViewDocuments(props: IProps) {
let { folderUid, documentUid } = router.query; let { folderUid, documentUid } = router.query;
const folder = folders.find((folder) => folder.uid === folderUid) ?? null; const folder = folders.find((folder) => folder.uid === folderUid) ?? null;
console.log(folder);
const documents = folder?.documents!.filter((document) => document.document_status !== "ASKED") ?? []; const documents = folder?.documents!.filter((document) => document.document_status !== "ASKED") ?? [];
const selectedDocument = documents.find((document) => document.uid === documentUid) ?? null; const selectedDocument = documents.find((document) => document.uid === documentUid) ?? null;
return <ViewDocumentsClass {...props} selectedDocument={selectedDocument} router={router} folderUid={folderUid as string} />; return <ViewDocumentsClass {...props} selectedDocument={selectedDocument} router={router} folderUid={folderUid as string} />;