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