From eec2d34fa2c9698292731925d60038fe62d0a698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Mon, 27 May 2024 11:27:00 +0100 Subject: [PATCH 1/5] feat: Basic model and Editor modal --- .../src/@planx/components/List/Editor.tsx | 85 ++++++++++++++++++- .../src/@planx/components/List/model.ts | 52 +++++++++++- .../src/@planx/components/List/schemas/Zoo.ts | 69 +++++++++++++++ 3 files changed, 202 insertions(+), 4 deletions(-) create mode 100644 editor.planx.uk/src/@planx/components/List/schemas/Zoo.ts diff --git a/editor.planx.uk/src/@planx/components/List/Editor.tsx b/editor.planx.uk/src/@planx/components/List/Editor.tsx index 080e07a605..d2975e52ed 100644 --- a/editor.planx.uk/src/@planx/components/List/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/List/Editor.tsx @@ -1,13 +1,28 @@ +import MenuItem from "@mui/material/MenuItem"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; import { useFormik } from "formik"; import React from "react"; -import { FeaturePlaceholder } from "ui/editor/FeaturePlaceholder"; +import ModalSection from "ui/editor/ModalSection"; +import ModalSectionContent from "ui/editor/ModalSectionContent"; +import RichTextInput from "ui/editor/RichTextInput"; +import SelectInput from "ui/editor/SelectInput"; +import Input from "ui/shared/Input"; +import InputRow from "ui/shared/InputRow"; +import InputRowItem from "ui/shared/InputRowItem"; +import InputRowLabel from "ui/shared/InputRowLabel"; -import { EditorProps } from "../ui"; +import { EditorProps, ICONS, InternalNotes, MoreInformation } from "../ui"; import { List, parseContent } from "./model"; +import { Zoo } from "./schemas/Zoo"; type Props = EditorProps; +export const SCHEMAS = [ + { name: "Zoo", schema: Zoo }, + // TODO: Residential units + // TODO: Residential units (GLA) +]; + function ListComponent(props: Props) { const formik = useFormik({ initialValues: parseContent(props.node?.data), @@ -21,7 +36,71 @@ function ListComponent(props: Props) { return (