From 4f2ba1c102e77235fdac30bd930f1d840d24351c Mon Sep 17 00:00:00 2001 From: augustlindemer <118665588+augustlindemer@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:47:41 +0000 Subject: [PATCH] Add explicit handling of notes to portal components --- .../src/@planx/components/ExternalPortal/Editor.tsx | 6 ++++-- .../src/@planx/components/InternalPortal/Editor.tsx | 13 +++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/ExternalPortal/Editor.tsx b/editor.planx.uk/src/@planx/components/ExternalPortal/Editor.tsx index 1950446f1b..47d8fafc6a 100644 --- a/editor.planx.uk/src/@planx/components/ExternalPortal/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/ExternalPortal/Editor.tsx @@ -1,6 +1,6 @@ import { - NodeTag, ComponentType as TYPES, + NodeTag, } from "@opensystemslab/planx-core/types"; import { useFormik } from "formik"; import React from "react"; @@ -18,14 +18,16 @@ interface Flow { const ExternalPortalForm: React.FC<{ id?: string; flowId?: string; + notes?: string; handleSubmit?: (val: any) => void; flows?: Array; tags?: NodeTag[]; -}> = ({ id, handleSubmit, flowId = "", flows = [], tags = [] }) => { +}> = ({ id, handleSubmit, flowId = "", flows = [], tags = [], notes = "" }) => { const formik = useFormik({ initialValues: { flowId, tags, + notes, }, onSubmit: (values) => { if (handleSubmit) { diff --git a/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx b/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx index 40abd0b416..16c023c673 100644 --- a/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx @@ -1,7 +1,7 @@ import MenuItem from "@mui/material/MenuItem"; import { - NodeTag, ComponentType as TYPES, + NodeTag, } from "@opensystemslab/planx-core/types"; import { useFormik } from "formik"; import React from "react"; @@ -24,15 +24,24 @@ const InternalPortalForm: React.FC<{ id?: string; text?: string; flowId?: string; + notes?: string; handleSubmit?: (val: any) => void; flows?: Array; tags?: NodeTag[]; -}> = ({ handleSubmit, text = "", flowId = "", flows = [], tags = [] }) => { +}> = ({ + handleSubmit, + text = "", + flowId = "", + flows = [], + tags = [], + notes = "", +}) => { const formik = useFormik({ initialValues: { text, flowId, tags, + notes, }, validate: (values) => { const errors: Record = {};