From f5ac3cc9f017420222dbf3f2f4df721208d37a27 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 24 Jul 2023 15:08:44 +0200 Subject: [PATCH] :sparkles: Create and edit ready --- .../DeedTypeListContainer/classes.module.scss | 3 ++- .../classes.module.scss | 12 +++++++++-- .../DocumentTypeListContainer/index.tsx | 7 +++++++ .../DocumentTypesCreate/index.tsx | 21 ++++++++++--------- .../DocumentTypes/DocumentTypesEdit/index.tsx | 4 +++- 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/front/Components/LayoutTemplates/DefaultDeedTypeDashboard/DeedTypeListContainer/classes.module.scss b/src/front/Components/LayoutTemplates/DefaultDeedTypeDashboard/DeedTypeListContainer/classes.module.scss index 300d46f2..f5b589bb 100644 --- a/src/front/Components/LayoutTemplates/DefaultDeedTypeDashboard/DeedTypeListContainer/classes.module.scss +++ b/src/front/Components/LayoutTemplates/DefaultDeedTypeDashboard/DeedTypeListContainer/classes.module.scss @@ -15,7 +15,8 @@ } .folderlist-container { - height: 100%; + max-height: calc(100vh - 290px); + overflow: auto; border-right: 1px solid var(--grey-medium); } } diff --git a/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/classes.module.scss b/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/classes.module.scss index 300d46f2..15e841c8 100644 --- a/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/classes.module.scss +++ b/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/classes.module.scss @@ -1,11 +1,11 @@ @import "@Themes/constants.scss"; .root { - width: calc(100vh - 83px); display: flex; flex-direction: column; justify-content: space-between; + position: relative; .header { flex: 1; } @@ -15,7 +15,15 @@ } .folderlist-container { - height: 100%; + max-height: calc(100vh - 290px); + overflow: auto; border-right: 1px solid var(--grey-medium); } + + .create-container { + position: absolute; + bottom: 0; + left: 0; + right: 0; + } } diff --git a/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/index.tsx b/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/index.tsx index 459f0213..97a2e073 100644 --- a/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultDocumentTypesDashboard/DocumentTypeListContainer/index.tsx @@ -1,7 +1,9 @@ import BlockList, { IBlock } from "@Front/Components/DesignSystem/BlockList"; +import Button from "@Front/Components/DesignSystem/Button"; import SearchBar from "@Front/Components/DesignSystem/SearchBar"; import Module from "@Front/Config/Module"; import { DocumentType } from "le-coffre-resources/dist/SuperAdmin"; +import Link from "next/link"; import { useRouter } from "next/router"; import React, { useCallback, useState } from "react"; @@ -57,6 +59,11 @@ export default function DocumentTypeListContainer(props: IProps) { /> +
+ + + +
); } diff --git a/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx b/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx index 274b4205..8254c0ca 100644 --- a/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx +++ b/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx @@ -1,32 +1,33 @@ import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; 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 DefaultDeedTypesDashboard from "@Front/Components/LayoutTemplates/DefaultDeedTypeDashboard"; +import DefaultDocumentTypesDashboard from "@Front/Components/LayoutTemplates/DefaultDocumentTypesDashboard"; import { useCallback } from "react"; import classes from "./classes.module.scss"; -import TextField from "@Front/Components/DesignSystem/Form/TextField"; -import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField"; type IProps = {}; -export default function DeedTypesCreate(props: IProps) { +export default function DocumentTypesCreate(props: IProps) { const onSubmitHandler = useCallback(async (e: React.FormEvent | null, values: { [key: string]: string }) => {}, []); return ( - +
- Créer un type d'acte + Créer un nouveau document
- - + + +
- +
-
+ ); } diff --git a/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx b/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx index cd21b76e..6276bf37 100644 --- a/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx +++ b/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx @@ -20,7 +20,9 @@ export default function DocumentTypesEdit() { useEffect(() => { async function getDocumentType() { 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); }