Merge branch 'dev' into staging
This commit is contained in:
commit
aa6de06a17
@ -207,7 +207,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
{this.props.document.document_status === EDocumentStatus.REFUSED && (
|
||||
<Typography typo={ITypo.CAPTION_14} className={classes["error-message"]}>
|
||||
Ce document n’est pas conforme. Veuillez le déposer à nouveau.
|
||||
Ce document n'est pas conforme. Veuillez le déposer à nouveau.
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
|
@ -24,7 +24,6 @@ export default function Navigation() {
|
||||
redirectUrl: notification.notification.redirection_url,
|
||||
});
|
||||
});
|
||||
console.log(notifications);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -24,15 +24,15 @@ export default function ClientDashboard(props: IProps) {
|
||||
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(false);
|
||||
|
||||
const getDocuments = useCallback(async () => {
|
||||
let jwt: ICustomerJwtPayload | undefined;;
|
||||
let jwt: ICustomerJwtPayload | undefined;
|
||||
if (typeof document !== "undefined") {
|
||||
jwt = JwtService.getInstance().decodeCustomerJwt();
|
||||
}
|
||||
|
||||
const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
||||
console.log(folder)
|
||||
console.log(folder);
|
||||
const actualCustomer = folder?.customers?.find((customer) => customer.uid === jwt?.customerId);
|
||||
if(!actualCustomer) throw new Error("Customer not found");
|
||||
if (!actualCustomer) throw new Error("Customer not found");
|
||||
|
||||
const query: IGetDocumentsparams = {
|
||||
where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string },
|
||||
@ -47,7 +47,7 @@ export default function ClientDashboard(props: IProps) {
|
||||
const documentList = await Documents.getInstance().get(query);
|
||||
|
||||
//const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
||||
|
||||
|
||||
setFolder(folder);
|
||||
setDocuments(documentList);
|
||||
setCustomer(actualCustomer);
|
||||
@ -91,12 +91,9 @@ export default function ClientDashboard(props: IProps) {
|
||||
Votre notaire est dans l'attente de documents pour valider votre dossier. Voici la liste des documents.Veuillez
|
||||
glisser / déposez chaque document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le
|
||||
document correspondant. Si un des documents demandés ne vous concernent pas, veuillez contacter votre notaire à
|
||||
l’aide du bouton ci-dessus.
|
||||
l'aide du bouton ci-dessus.
|
||||
</Typography>
|
||||
</div>
|
||||
<a href="mailto:g.texier@notaires.fr" target="_blank">
|
||||
<Button className={classes["button"]}>Contacter mon notaire</Button>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}, [customer, folder?.folder_number, folder?.name, folder?.office?.name]);
|
||||
|
@ -97,12 +97,9 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
||||
Votre notaire est dans l'attente de documents pour valider votre dossier. Voici la liste des documents.Veuillez
|
||||
glisser / déposez chaque document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le
|
||||
document correspondant. Si un des documents demandés ne vous concernent pas, veuillez contacter votre notaire à
|
||||
l’aide du bouton ci-dessus.
|
||||
l'aide du bouton ci-dessus.
|
||||
</Typography>
|
||||
</div>
|
||||
<a href="mailto:g.texier@notaires.fr" target="_blank">
|
||||
<Button className={classes["button"]}>Contacter mon notaire</Button>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ export default function DocumentTypesEdit() {
|
||||
/>
|
||||
<TextAreaField
|
||||
name="public_description"
|
||||
placeholder="Description visible par les clients de l’office"
|
||||
placeholder="Description visible par les clients de l'office"
|
||||
defaultValue={documentTypeSelected?.public_description}
|
||||
/>
|
||||
<div className={classes["buttons-container"]}>
|
||||
|
@ -36,6 +36,7 @@ type IState = {
|
||||
isValidateModalVisible: boolean;
|
||||
hasValidateAnchoring: boolean;
|
||||
isVerifDeleteModalVisible: boolean;
|
||||
isAnchored: boolean | null;
|
||||
};
|
||||
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
public constructor(props: IPropsClass) {
|
||||
@ -47,6 +48,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
isValidateModalVisible: false,
|
||||
hasValidateAnchoring: false,
|
||||
isVerifDeleteModalVisible: false,
|
||||
isAnchored: null,
|
||||
};
|
||||
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||
this.openArchivedModal = this.openArchivedModal.bind(this);
|
||||
@ -60,6 +62,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
this.openValidateModal = this.openValidateModal.bind(this);
|
||||
this.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this);
|
||||
this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this);
|
||||
this.verifyAnchorStatus = this.verifyAnchorStatus.bind(this);
|
||||
}
|
||||
|
||||
// TODO: Message if the user has not created any folder yet
|
||||
@ -109,16 +112,20 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
Archiver le dossier
|
||||
</Button>
|
||||
{this.everyDocumentValidated() && (
|
||||
<Button variant={EButtonVariant.PRIMARY} onClick={this.openValidateModal}>
|
||||
Ancrer le dossier
|
||||
</Button>
|
||||
)}
|
||||
{this.everyDocumentValidated() && (
|
||||
<Button
|
||||
variant={EButtonVariant.PRIMARY}
|
||||
onClick={() => this.downloadAnchoringProof(this.state.selectedFolder?.uid)}>
|
||||
Télécharger la preuve d'ancrage
|
||||
</Button>
|
||||
<>
|
||||
{this.state.isAnchored === null && (
|
||||
<Button variant={EButtonVariant.PRIMARY} onClick={this.openValidateModal}>
|
||||
Ancrer le dossier
|
||||
</Button>
|
||||
)}
|
||||
{this.state.isAnchored === true && (
|
||||
<Button
|
||||
variant={EButtonVariant.PRIMARY}
|
||||
onClick={() => this.downloadAnchoringProof(this.state.selectedFolder?.uid)}>
|
||||
Télécharger la preuve d'ancrage
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{!this.doesFolderHaveCustomer() && (
|
||||
<span className={classes["delete-folder"]} onClick={this.openVerifDeleteFolder}>
|
||||
@ -207,11 +214,30 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
);
|
||||
}
|
||||
public override async componentDidMount() {
|
||||
this.setState({
|
||||
selectedFolder: (await this.getFolder()) as OfficeFolder,
|
||||
});
|
||||
const selectedFolder = await this.getFolder();
|
||||
this.setState(
|
||||
{
|
||||
selectedFolder,
|
||||
},
|
||||
() => {
|
||||
this.verifyAnchorStatus();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
private async verifyAnchorStatus() {
|
||||
if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return;
|
||||
try {
|
||||
const anchorStatus = await OfficeFolderAnchors.getInstance().get(this.state.selectedFolder.uid!);
|
||||
this.setState({
|
||||
isAnchored: anchorStatus.status === "VERIFIED_ON_CHAIN",
|
||||
});
|
||||
} catch (e) {
|
||||
this.setState({
|
||||
isAnchored: null,
|
||||
});
|
||||
}
|
||||
}
|
||||
public openVerifDeleteFolder() {
|
||||
this.setState({
|
||||
isVerifDeleteModalVisible: true,
|
||||
@ -267,15 +293,11 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
private async anchorFolder() {
|
||||
if (!this.state.selectedFolder?.uid) return;
|
||||
const anchor = await OfficeFolderAnchors.getInstance().post(this.state.selectedFolder.uid);
|
||||
console.log(anchor);
|
||||
}
|
||||
|
||||
private async downloadAnchoringProof(uid?: string) {
|
||||
if (!uid) return;
|
||||
|
||||
const anchor = await OfficeFolderAnchors.getInstance().get(uid);
|
||||
if (anchor.status !== "VERIFIED_ON_CHAIN") return;
|
||||
|
||||
try {
|
||||
const file: Blob = await OfficeFolderAnchors.getInstance().download(uid);
|
||||
const url = window.URL.createObjectURL(file);
|
||||
|
@ -19,7 +19,7 @@ export default class PageNotFound extends BasePage {
|
||||
La page que vous recherchez semble introuvable.
|
||||
</Typography>
|
||||
<Link href={Module.getInstance().get().modules.pages.Home.props.path}>
|
||||
<Button>Retour à l’accueil</Button>
|
||||
<Button>Retour à l'accueil</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user