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