-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add new MapAndLabel
component to @planx components
#3446
Conversation
import { useFormik } from "formik"; | ||
import React from "react"; | ||
|
||
import { EditorProps } from "../ui"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to get this working with the path "@planx/..." but it kept throwing an error so I changed to a relative path.
If the "@planx/components/ui" path is required, I can switch it
@DafyddLlyr and @jessicamcinchak would be great to get a sense check on these changes. There's a lot more detail and work to be done, but I hope I've at least set it all up in the right places. |
Removed vultr server and associated DNS entries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recognise this is still draft, but just a few initial spots ! Definitely on the right track, always nice to see the component library growing 📚
editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Node.tsx
Outdated
Show resolved
Hide resolved
editor.planx.uk/src/pages/FlowEditor/components/forms/FormModal.tsx
Outdated
Show resolved
Hide resolved
313460f
to
5a3ed31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changes so far! A couple more spots on another review - especially please watch package versions on rebase!
@@ -62,6 +62,9 @@ const NodeTypeSelect: React.FC<{ | |||
<option value={TYPES.AddressInput}>Address Input</option> | |||
<option value={TYPES.ContactInput}>Contact Input</option> | |||
<option value={TYPES.List}>List</option> | |||
{hasFeatureFlag("TREES") && ( | |||
<option value={TYPES.MapAndLabel}>Map and Label</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jessicamcinchak do you think this should be under Inputs or Location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking with Inputs was that the user needs to input data we need...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inputs makes sense to me too! Existing location components typically fetch/present external data, which isn't necessarily a requirement here. And as long as it's feature flagged we can change our minds later without issue 🙂
Yeah, sorry to miss those, I always forget the e2e package.json. Should be all good now, and I've updated the Node file which was pulling in the Editor component instead of the Public one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most recent changes look good, but I can't open flows on this pizza? Can you?
Would like to be able to do one final in-editor manual test before approving! Maybe Vultr needs a destroy/re-create ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor last things - but overall working for me!
Since feature flagged, feels safe to merge whenever you're ready !
placeholder={"Title"} | ||
value={formik.values.title} | ||
onChange={formik.handleChange} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: while manually testing in the Editor, I can currently create a new component without entering any input, which doesn't match the types you've defined in model.ts
(eg I'd expect title
& fn
to be required and throw an error if no value!)
Simply adding the required
prop on the Input
should do the trick! (Will just throw a native browser error if empty then, not full Gov UK styled error - but that's fine for the Editor for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I'll update before merging
name="fn" | ||
placeholder={"Data Field"} | ||
value={formik.values.fn} | ||
disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this one disabled
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lingering mistake from me turning things off and on! I'll correct before merging
7b2ba93
to
1d53d5f
Compare
What does this PR do?
This PR creates the framework for a new Editor "@planx" component.
To create this PR, I have followed the steps laid out here: https://github.com/theopensystemslab/planx-new/blob/main/editor.planx.uk/docs/adding-a-new-component.md
*Replacing
SetValue
withMapAndLabel
With this PR, there has also been an update to the planx-core ref in the package.json
Still To-Do In Other PRs