Merge branch 'dev' of https://github.com/smart-chain-fr/leCoffre-front into dev
This commit is contained in:
commit
f8604a8641
@ -2,6 +2,7 @@ import { Document } from "le-coffre-resources/dist/SuperAdmin";
|
||||
import { Service } from "typedi";
|
||||
|
||||
import BaseSuperAdmin from "../BaseSuperAdmin";
|
||||
import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document";
|
||||
|
||||
// TODO Type get query params -> Where + inclue + orderby
|
||||
export interface IGetDocumentsparams {
|
||||
@ -11,7 +12,9 @@ export interface IGetDocumentsparams {
|
||||
|
||||
// TODO Type getbyuid query params
|
||||
|
||||
export type IPutDocumentsParams = {};
|
||||
export type IPutDocumentsParams = {
|
||||
document_status?: EDocumentStatus
|
||||
};
|
||||
|
||||
export interface IPostDocumentsParams {}
|
||||
|
||||
|
@ -2,6 +2,7 @@ import "reflect-metadata";
|
||||
|
||||
import LeftArrowIcon from "@Assets/Icons/left-arrow.svg";
|
||||
import RightArrowIcon from "@Assets/Icons/right-arrow.svg";
|
||||
import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents";
|
||||
import ValidateAnchoringGif from "@Front/Assets/images/validate_anchoring.gif";
|
||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||
@ -10,7 +11,9 @@ import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"
|
||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||
import Module from "@Front/Config/Module";
|
||||
import { Document, File } from "le-coffre-resources/dist/Customer";
|
||||
import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document";
|
||||
import Image from "next/image";
|
||||
import { NextRouter, useRouter } from "next/router";
|
||||
import React from "react";
|
||||
@ -18,8 +21,6 @@ import React from "react";
|
||||
import BasePage from "../../Base";
|
||||
import classes from "./classes.module.scss";
|
||||
import OcrResult from "./OcrResult";
|
||||
import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document";
|
||||
import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents";
|
||||
|
||||
|
||||
type IProps = {};
|
||||
@ -185,7 +186,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
try {
|
||||
const document = await Documents.getInstance().getByUid(this.props.documentUid, {
|
||||
files: true,
|
||||
document_type: true
|
||||
document_type: true,
|
||||
});
|
||||
this.setState({
|
||||
document,
|
||||
@ -193,7 +194,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
selectedFile: document.files![0]!,
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,16 +244,26 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
return index < this.state.document!.files!.length;
|
||||
}
|
||||
|
||||
private validateAnchoring() {
|
||||
private async validateAnchoring() {
|
||||
this.setState({
|
||||
hasValidateAnchoring: true,
|
||||
});
|
||||
|
||||
try {
|
||||
await Documents.getInstance().put(this.props.documentUid, {
|
||||
document_status: EDocumentStatus.VALIDATED,
|
||||
});
|
||||
|
||||
const timeoutDelay = 9800;
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
isValidateModalVisible: false,
|
||||
});
|
||||
this.props.router.push(
|
||||
Module.getInstance()
|
||||
.get()
|
||||
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid),
|
||||
);
|
||||
}, timeoutDelay);
|
||||
|
||||
setTimeout(() => {
|
||||
@ -260,6 +271,9 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
hasValidateAnchoring: false,
|
||||
});
|
||||
}, timeoutDelay + 1000);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
private onRefuseTextChange(e: React.ChangeEvent<HTMLInputElement>) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user