Create and edit ready

This commit is contained in:
Maxime Lalo 2023-07-24 15:08:44 +02:00
parent af7d26ffe7
commit f5ac3cc9f0
5 changed files with 33 additions and 14 deletions

View File

@ -15,7 +15,8 @@
} }
.folderlist-container { .folderlist-container {
height: 100%; max-height: calc(100vh - 290px);
overflow: auto;
border-right: 1px solid var(--grey-medium); border-right: 1px solid var(--grey-medium);
} }
} }

View File

@ -1,11 +1,11 @@
@import "@Themes/constants.scss"; @import "@Themes/constants.scss";
.root { .root {
width: calc(100vh - 83px);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
position: relative;
.header { .header {
flex: 1; flex: 1;
} }
@ -15,7 +15,15 @@
} }
.folderlist-container { .folderlist-container {
height: 100%; max-height: calc(100vh - 290px);
overflow: auto;
border-right: 1px solid var(--grey-medium); border-right: 1px solid var(--grey-medium);
} }
.create-container {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
} }

View File

@ -1,7 +1,9 @@
import BlockList, { IBlock } from "@Front/Components/DesignSystem/BlockList"; import BlockList, { IBlock } from "@Front/Components/DesignSystem/BlockList";
import Button from "@Front/Components/DesignSystem/Button";
import SearchBar from "@Front/Components/DesignSystem/SearchBar"; import SearchBar from "@Front/Components/DesignSystem/SearchBar";
import Module from "@Front/Config/Module"; import Module from "@Front/Config/Module";
import { DocumentType } from "le-coffre-resources/dist/SuperAdmin"; import { DocumentType } from "le-coffre-resources/dist/SuperAdmin";
import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React, { useCallback, useState } from "react"; import React, { useCallback, useState } from "react";
@ -57,6 +59,11 @@ export default function DocumentTypeListContainer(props: IProps) {
/> />
</div> </div>
</div> </div>
<div className={classes["create-container"]}>
<Link href={Module.getInstance().get().modules.pages.DocumentTypes.pages.Create.props.path}>
<Button fullwidth={true}>Créer un type de document</Button>
</Link>
</div>
</div> </div>
); );
} }

View File

@ -1,32 +1,33 @@
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
import Form from "@Front/Components/DesignSystem/Form"; import Form from "@Front/Components/DesignSystem/Form";
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
import TextField from "@Front/Components/DesignSystem/Form/TextField";
import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
import DefaultDeedTypesDashboard from "@Front/Components/LayoutTemplates/DefaultDeedTypeDashboard"; import DefaultDocumentTypesDashboard from "@Front/Components/LayoutTemplates/DefaultDocumentTypesDashboard";
import { useCallback } from "react"; import { useCallback } from "react";
import classes from "./classes.module.scss"; import classes from "./classes.module.scss";
import TextField from "@Front/Components/DesignSystem/Form/TextField";
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
type IProps = {}; type IProps = {};
export default function DeedTypesCreate(props: IProps) { export default function DocumentTypesCreate(props: IProps) {
const onSubmitHandler = useCallback(async (e: React.FormEvent<HTMLFormElement> | null, values: { [key: string]: string }) => {}, []); const onSubmitHandler = useCallback(async (e: React.FormEvent<HTMLFormElement> | null, values: { [key: string]: string }) => {}, []);
return ( return (
<DefaultDeedTypesDashboard mobileBackText={"Liste des types d'actes"} hasBackArrow title="Créer un type d'acte"> <DefaultDocumentTypesDashboard mobileBackText={"Liste des types d'actes"} hasBackArrow title="Créer un type d'acte">
<div className={classes["root"]}> <div className={classes["root"]}>
<div className={classes["header"]}> <div className={classes["header"]}>
<Typography typo={ITypo.H1Bis}>Créer un type d'acte</Typography> <Typography typo={ITypo.H1Bis}>Créer un nouveau document</Typography>
</div> </div>
<Form onSubmit={onSubmitHandler} className={classes["form-container"]}> <Form onSubmit={onSubmitHandler} className={classes["form-container"]}>
<TextField name="name" placeholder="Nom de l'acte" /> <TextField name="name" placeholder="Nom du document" />
<TextAreaField name="description" placeholder="Description" /> <TextAreaField name="private_description" placeholder="Description visible par les collaborateurs de l'office" />
<TextAreaField name="public_description" placeholder="Description visible par les clients de l'office" />
<div className={classes["buttons-container"]}> <div className={classes["buttons-container"]}>
<Button variant={EButtonVariant.GHOST}>Annuler</Button> <Button variant={EButtonVariant.GHOST}>Annuler</Button>
<Button type="submit">Créer le type d'acte</Button> <Button type="submit">Créer le document</Button>
</div> </div>
</Form> </Form>
</div> </div>
</DefaultDeedTypesDashboard> </DefaultDocumentTypesDashboard>
); );
} }

View File

@ -20,7 +20,9 @@ export default function DocumentTypesEdit() {
useEffect(() => { useEffect(() => {
async function getDocumentType() { async function getDocumentType() {
if (!documentTypeUid) return; if (!documentTypeUid) return;
const documentType = await DocumentTypes.getInstance().getByUid(documentTypeUid as string); const documentType = await DocumentTypes.getInstance().getByUid(documentTypeUid as string, {
_count: true,
});
setDocumentTypeSelected(documentType); setDocumentTypeSelected(documentType);
} }