Bug et retours
This commit is contained in:
parent
8e1844acd9
commit
b2c9405ce1
@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDOfOFPvQNw5XguFuX1YNvED8ulP+tIA/5xw7LHcA0gRj3hwILCAEAjuDs+d13zCsnEb0yd+laT3PU9iRIKa28Tynu+sTjGDyfx8MX/HjJtbEzyd6jLn87uTvw/6lzg2y5ZDEa6PEqrPIv0KEhuq6HuU8qAA0nBpsTIAUTK3XR8qm3I6J9Rs1JyBjvIP5UeICApvoLmgHuz6mKdvoQ8qKDWamsL4pSc4Hr7HlQ8ITNhnyS8XMgQInU/I2TzT/I4Dxx5IeFUQ5KOfJJNgK1d+PByLSWUrn+eRXki8m1hjMiwGIehVAriFW1C309SEHxLHjQKUPXHSv4kH7zqjO+p3kY5gwp/lvsBRSnihj8s1lADsJlMqjnSLeIQ+sY2CNkmXXI8ABkzhuJKTGTl+8pzGGhIHzeU7e7lpSn3gLn4p217kIppHNAr6dZH9UaYbgnwVonwr5cLbatRPFyI1NfXKDyZtSYlGQxLQUt9KDrNvVTZzaTt3YwM/YCsRIADAagKosM= gisele-smartchain@MacBook-Pro-6.local
|
|
29
package-lock.json
generated
29
package-lock.json
generated
@ -22,7 +22,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.115",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.119",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
@ -1569,9 +1569,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001587",
|
"version": "1.0.30001588",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz",
|
||||||
"integrity": "sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==",
|
"integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@ -3458,7 +3458,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/le-coffre-resources": {
|
"node_modules/le-coffre-resources": {
|
||||||
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#cc49eea2e6692637edda2335970deaa4221a9201",
|
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#de8a3be3ddad5e2b583f52f9830e7a10b0fc2e4c",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@ -4625,9 +4625,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/streamx": {
|
"node_modules/streamx": {
|
||||||
"version": "2.15.8",
|
"version": "2.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.8.tgz",
|
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.0.tgz",
|
||||||
"integrity": "sha512-6pwMeMY/SuISiRsuS8TeIrAzyFbG5gGPHFQsYjUr/pbBadaL1PCWmzKw+CHZSwainfvcF6Si6cVLq4XTEwswFQ==",
|
"integrity": "sha512-a7Fi0PoUeusrUcMS4+HxivnZqYsw2MFEP841TIyLxTcEIucHcJsk+0ARcq3tGq1xDn+xK7sKHetvfMzI1/CzMA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-fifo": "^1.1.0",
|
"fast-fifo": "^1.1.0",
|
||||||
"queue-tick": "^1.0.1"
|
"queue-tick": "^1.0.1"
|
||||||
@ -4938,15 +4938,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typed-array-byte-offset": {
|
"node_modules/typed-array-byte-offset": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.1.tgz",
|
||||||
"integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==",
|
"integrity": "sha512-tcqKMrTRXjqvHN9S3553NPCaGL0VPgFI92lXszmrE8DMhiDPLBYLlvo8Uu4WZAAX/aGqp/T1sbA4ph8EWjDF9Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"available-typed-arrays": "^1.0.5",
|
"available-typed-arrays": "^1.0.6",
|
||||||
"call-bind": "^1.0.2",
|
"call-bind": "^1.0.7",
|
||||||
"for-each": "^0.3.3",
|
"for-each": "^0.3.3",
|
||||||
|
"gopd": "^1.0.1",
|
||||||
"has-proto": "^1.0.1",
|
"has-proto": "^1.0.1",
|
||||||
"is-typed-array": "^1.1.10"
|
"is-typed-array": "^1.1.13"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.115",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.119",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
|
.root {
|
||||||
|
width: calc(100vh - 83px);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchbar {
|
||||||
|
padding: 40px 24px 24px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folderlist-container {
|
||||||
|
max-height: calc(100vh - 215px);
|
||||||
|
height: calc(100vh - 215px);
|
||||||
|
overflow: auto;
|
||||||
|
border-right: 1px solid var(--grey-medium);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,150 @@
|
|||||||
|
import Module from "@Front/Config/Module";
|
||||||
|
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
|
import { EDocumentStatus } from "le-coffre-resources/dist/Notary/Document";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { NextRouter, useRouter } from "next/router";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import BlockList, { IBlock } from "../BlockList";
|
||||||
|
import Button from "../Button";
|
||||||
|
import SearchBar from "../SearchBar";
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
import Rules, { RulesMode } from "@Front/Components/Elements/Rules";
|
||||||
|
import { AppRuleActions, AppRuleNames } from "@Front/Api/Entities/rule";
|
||||||
|
|
||||||
|
type IProps = {
|
||||||
|
folders: OfficeFolder[];
|
||||||
|
isArchived: boolean;
|
||||||
|
onSelectedFolder?: (folder: OfficeFolder) => void;
|
||||||
|
onCloseLeftSide?: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
type IPropsClass = IProps & {
|
||||||
|
router: NextRouter;
|
||||||
|
selectedFolder: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type IState = {
|
||||||
|
filteredFolders: OfficeFolder[];
|
||||||
|
blocks: IBlock[];
|
||||||
|
};
|
||||||
|
|
||||||
|
class FolderArchivedListContainerClass extends React.Component<IPropsClass, IState> {
|
||||||
|
private redirectPath: string = this.props.isArchived
|
||||||
|
? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path
|
||||||
|
: Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path;
|
||||||
|
public constructor(props: IPropsClass) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
filteredFolders: this.props.folders,
|
||||||
|
blocks: this.getBlocks(this.props.folders),
|
||||||
|
};
|
||||||
|
this.filterFolders = this.filterFolders.bind(this);
|
||||||
|
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override render(): JSX.Element {
|
||||||
|
const navigatePath = Module.getInstance().get().modules.pages.Folder.pages.CreateFolder.props.path;
|
||||||
|
return (
|
||||||
|
<div className={classes["root"]}>
|
||||||
|
<div className={classes["header"]}>
|
||||||
|
<div className={classes["searchbar"]}>
|
||||||
|
<SearchBar onChange={this.filterFolders} placeholder="Chercher un dossier" />
|
||||||
|
</div>
|
||||||
|
<div className={classes["folderlist-container"]}>
|
||||||
|
<BlockList blocks={this.state.blocks} onSelectedBlock={this.onSelectedFolder} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{!this.props.isArchived && (
|
||||||
|
<div>
|
||||||
|
<Rules
|
||||||
|
mode={RulesMode.NECESSARY}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
action: AppRuleActions.create,
|
||||||
|
name: AppRuleNames.officeFolders,
|
||||||
|
},
|
||||||
|
]}>
|
||||||
|
<Link href={navigatePath}>
|
||||||
|
<Button fullwidth={true}>Créer un dossier</Button>
|
||||||
|
</Link>
|
||||||
|
</Rules>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override componentDidUpdate(prevProps: Readonly<IPropsClass>, prevState: Readonly<IState>, snapshot?: any): void {
|
||||||
|
if (prevProps.selectedFolder !== this.props.selectedFolder) {
|
||||||
|
this.setState({ filteredFolders: this.props.folders, blocks: this.getBlocks(this.props.folders) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private getBlocks(folders: OfficeFolder[]): IBlock[] {
|
||||||
|
const pendingFolders = folders
|
||||||
|
.filter((folder) => {
|
||||||
|
const pendingDocuments = (folder.documents ?? []).filter(
|
||||||
|
(document) => document.document_status === EDocumentStatus.DEPOSITED,
|
||||||
|
);
|
||||||
|
return pendingDocuments.length >= 1;
|
||||||
|
})
|
||||||
|
.sort((folder1, folder2) => {
|
||||||
|
return folder1.created_at! > folder2.created_at! ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
const otherFolders = folders
|
||||||
|
.filter((folder) => {
|
||||||
|
const pendingDocuments = (folder.documents ?? []).filter(
|
||||||
|
(document) => document.document_status === EDocumentStatus.DEPOSITED,
|
||||||
|
);
|
||||||
|
return pendingDocuments.length === 0;
|
||||||
|
})
|
||||||
|
.sort((folder1, folder2) => {
|
||||||
|
return folder1.created_at! > folder2.created_at! ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
return [...pendingFolders, ...otherFolders].map((folder) => {
|
||||||
|
return {
|
||||||
|
id: folder.uid!,
|
||||||
|
name: folder.folder_number! + " - " + folder.name!,
|
||||||
|
selected: this.props.selectedFolder === folder.uid,
|
||||||
|
hasFlag: folder.documents?.some((document) => document.document_status === EDocumentStatus.DEPOSITED),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private onSelectedFolder(block: IBlock) {
|
||||||
|
const folder = this.props.folders.find((folder) => folder.uid === block.id);
|
||||||
|
if (!folder) return;
|
||||||
|
this.props.onSelectedFolder && this.props.onSelectedFolder(folder);
|
||||||
|
const path = this.redirectPath.replace("[folderUid]", folder.uid ?? "");
|
||||||
|
this.props.router.push(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
private filterFolders(value: string): void {
|
||||||
|
const filteredFolders: OfficeFolder[] = this.props.folders.filter((folder) => {
|
||||||
|
const name = folder.name.toLowerCase();
|
||||||
|
const number = folder.folder_number.toLowerCase();
|
||||||
|
value = value.toLowerCase();
|
||||||
|
if (folder.customers) {
|
||||||
|
const customerNames = folder.customers
|
||||||
|
.map((customer) => {
|
||||||
|
return `${customer.contact?.first_name.toLowerCase()} ${customer.contact?.last_name.toLowerCase()}`;
|
||||||
|
})
|
||||||
|
.join(", ");
|
||||||
|
|
||||||
|
return name.includes(value) || number.includes(value) || customerNames.includes(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return name.includes(value) || number.includes(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.setState({ filteredFolders, blocks: this.getBlocks(filteredFolders) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function FolderListContainer(props: IProps) {
|
||||||
|
const router = useRouter();
|
||||||
|
const { folderUid } = router.query;
|
||||||
|
return <FolderArchivedListContainerClass {...props} router={router} selectedFolder={folderUid as string} />;
|
||||||
|
}
|
@ -17,8 +17,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.folderlist-container {
|
.folderlist-container {
|
||||||
max-height: calc(100vh - 215px);
|
max-height: calc(100vh - 290px);
|
||||||
height: calc(100vh - 215px);
|
height: calc(100vh - 290px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-right: 1px solid var(--grey-medium);
|
border-right: 1px solid var(--grey-medium);
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.folderlist-container {
|
.folderlist-container {
|
||||||
max-height: calc(100vh - 215px);
|
max-height: calc(100vh - 290px);
|
||||||
height: calc(100vh - 215px);
|
height: calc(100vh - 290px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-right: 1px solid var(--grey-medium);
|
border-right: 1px solid var(--grey-medium);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import ChevronIcon from "@Assets/Icons/chevron.svg";
|
|||||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer";
|
import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer";
|
||||||
|
import FolderArchivedListContainer from "@Front/Components/DesignSystem/FolderArchivedListContainer";
|
||||||
import Header from "@Front/Components/DesignSystem/Header";
|
import Header from "@Front/Components/DesignSystem/Header";
|
||||||
import Version from "@Front/Components/DesignSystem/Version";
|
import Version from "@Front/Components/DesignSystem/Version";
|
||||||
import BackArrow from "@Front/Components/Elements/BackArrow";
|
import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||||
@ -54,12 +55,20 @@ export default class DefaultNotaryDashboard extends React.Component<IProps, ISta
|
|||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
{this.state.isLeftSideOpen && <div className={classes["overlay"]} onClick={this.onCloseLeftSide} />}
|
{this.state.isLeftSideOpen && <div className={classes["overlay"]} onClick={this.onCloseLeftSide} />}
|
||||||
<div className={classNames(classes["left-side"], this.state.isLeftSideOpen && classes["opened"])}>
|
<div className={classNames(classes["left-side"], this.state.isLeftSideOpen && classes["opened"])}>
|
||||||
{this.state.folders && (
|
{this.props.isArchived && this.state.folders && (
|
||||||
|
<FolderArchivedListContainer
|
||||||
|
folders={this.state.folders}
|
||||||
|
onSelectedFolder={this.props.onSelectedFolder}
|
||||||
|
onCloseLeftSide={this.onCloseLeftSide}
|
||||||
|
isArchived={true}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!this.props.isArchived && this.state.folders && (
|
||||||
<FolderListContainer
|
<FolderListContainer
|
||||||
folders={this.state.folders}
|
folders={this.state.folders}
|
||||||
onSelectedFolder={this.props.onSelectedFolder}
|
onSelectedFolder={this.props.onSelectedFolder}
|
||||||
onCloseLeftSide={this.onCloseLeftSide}
|
onCloseLeftSide={this.onCloseLeftSide}
|
||||||
isArchived={this.props.isArchived!}
|
isArchived={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,7 +14,6 @@ import { ValidationError } from "class-validator";
|
|||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
|
||||||
|
|
||||||
export default function DeedTypesEdit() {
|
export default function DeedTypesEdit() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
let { deedTypeUid } = router.query;
|
let { deedTypeUid } = router.query;
|
||||||
@ -107,8 +106,18 @@ export default function DeedTypesEdit() {
|
|||||||
<Typography typo={ITypo.H1Bis}>Modifier les informations de l'acte</Typography>
|
<Typography typo={ITypo.H1Bis}>Modifier les informations de l'acte</Typography>
|
||||||
</div>
|
</div>
|
||||||
<Form onSubmit={onSubmitHandler} className={classes["form-container"]} onFieldChange={onFieldChange}>
|
<Form onSubmit={onSubmitHandler} className={classes["form-container"]} onFieldChange={onFieldChange}>
|
||||||
<TextField name="name" placeholder="Nom de l'acte" defaultValue={deedTypeSelected?.name} validationError={validationError.find((error) => error.property === 'name')}/>
|
<TextField
|
||||||
<TextAreaField name="description" placeholder="Description" defaultValue={deedTypeSelected?.description} validationError={validationError.find((error) => error.property === 'description')} />
|
name="name"
|
||||||
|
placeholder="Nom de l'acte"
|
||||||
|
defaultValue={deedTypeSelected?.name}
|
||||||
|
validationError={validationError.find((error) => error.property === "name")}
|
||||||
|
/>
|
||||||
|
<TextAreaField
|
||||||
|
name="description"
|
||||||
|
placeholder="Description"
|
||||||
|
defaultValue={deedTypeSelected?.description || ""}
|
||||||
|
validationError={validationError.find((error) => error.property === "description")}
|
||||||
|
/>
|
||||||
<div className={classes["buttons-container"]}>
|
<div className={classes["buttons-container"]}>
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={onCancel}>
|
<Button variant={EButtonVariant.GHOST} onClick={onCancel}>
|
||||||
Annuler
|
Annuler
|
||||||
|
Loading…
x
Reference in New Issue
Block a user