✨ Don't allow to ask documents on an anchored folder
This commit is contained in:
parent
15ec6037c1
commit
e7a6af23be
@ -16,6 +16,7 @@ import QuantityProgressBar from "../QuantityProgressBar";
|
|||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import DocumentList from "./DocumentList";
|
import DocumentList from "./DocumentList";
|
||||||
import UserFolderHeader from "./UserFolderHeader";
|
import UserFolderHeader from "./UserFolderHeader";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
customer: Customer;
|
customer: Customer;
|
||||||
@ -24,6 +25,7 @@ type IProps = {
|
|||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
isOpened: boolean;
|
isOpened: boolean;
|
||||||
onChange: (id: string) => void;
|
onChange: (id: string) => void;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
isOpenDeletionModal: boolean;
|
isOpenDeletionModal: boolean;
|
||||||
@ -89,25 +91,35 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
currentNumber={this.calculateDocumentsPercentageProgress()}
|
currentNumber={this.calculateDocumentsPercentageProgress()}
|
||||||
/>
|
/>
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
<DocumentList
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
documents={documentsAsked}
|
<DocumentList
|
||||||
title="Documents demandés"
|
documents={documentsAsked}
|
||||||
openDeletionModal={this.openDeletionModal}
|
title="Documents demandés"
|
||||||
folderUid={this.props.folder.uid!}
|
openDeletionModal={this.openDeletionModal}
|
||||||
className={classes["documents-asked"]}
|
folderUid={this.props.folder.uid!}
|
||||||
/>
|
className={classes["documents-asked"]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<DocumentList
|
<DocumentList
|
||||||
documents={otherDocuments}
|
documents={otherDocuments}
|
||||||
title="Documents à valider / validés"
|
title={
|
||||||
|
this.props.anchorStatus !== AnchorStatus.NOT_ANCHORED
|
||||||
|
? "Documents validés"
|
||||||
|
: "Documents à valider / validés"
|
||||||
|
}
|
||||||
subtitle={
|
subtitle={
|
||||||
otherDocuments && otherDocuments?.length > 0
|
otherDocuments && otherDocuments?.length > 0
|
||||||
? "Vous avez des documents à valider."
|
? this.props.anchorStatus !== AnchorStatus.NOT_ANCHORED
|
||||||
|
? ""
|
||||||
|
: "Vous avez des documents à valider."
|
||||||
: "Vous n'avez aucun document à valider"
|
: "Vous n'avez aucun document à valider"
|
||||||
}
|
}
|
||||||
openDeletionModal={this.openDeletionModal}
|
openDeletionModal={this.openDeletionModal}
|
||||||
folderUid={this.props.folder.uid!}
|
folderUid={this.props.folder.uid!}
|
||||||
/>
|
/>
|
||||||
{!this.props.isArchived && (
|
|
||||||
|
{!this.props.isArchived && this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Link href={redirectPath}>
|
<Link href={redirectPath}>
|
||||||
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
||||||
|
@ -8,9 +8,11 @@ import Link from "next/link";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import { AnchorStatus } from "..";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -69,6 +71,7 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
key={customer.uid}
|
key={customer.uid}
|
||||||
isOpened={this.state.openedCustomer === customer.uid}
|
isOpened={this.state.openedCustomer === customer.uid}
|
||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
|
anchorStatus={this.props.anchorStatus}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ import ClientSection from "./ClientSection";
|
|||||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||||
import Loader from "@Front/Components/DesignSystem/Loader";
|
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
|
|
||||||
enum AnchorStatus {
|
export enum AnchorStatus {
|
||||||
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
||||||
"ANCHORING" = "ANCHORING",
|
"ANCHORING" = "ANCHORING",
|
||||||
"NOT_ANCHORED" = "NOT_ANCHORED",
|
"NOT_ANCHORED" = "NOT_ANCHORED",
|
||||||
@ -113,10 +113,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
currentNumber={this.getCompletionNumber()}
|
currentNumber={this.getCompletionNumber()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{this.doesFolderHaveCustomer() && <ClientSection folder={this.props.selectedFolder} />}
|
{this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection folder={this.props.selectedFolder} anchorStatus={this.props.isAnchored} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.props.selectedFolder} />}
|
{!this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection folder={this.props.selectedFolder} anchorStatus={this.props.isAnchored} />
|
||||||
|
)}
|
||||||
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={this.openArchivedModal}>
|
<Button variant={EButtonVariant.GHOST} onClick={this.openArchivedModal}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user