From 09c08aeb9bbf0a32976d8816592d3f1bfcc31e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 30 Nov 2023 09:56:02 +0000 Subject: [PATCH 1/5] fix(e2e): Don't write to restricted flows.data column (#2500) --- e2e/tests/api-driven/src/permissions/queries/flows.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/e2e/tests/api-driven/src/permissions/queries/flows.ts b/e2e/tests/api-driven/src/permissions/queries/flows.ts index fb2051943c..9db7a43379 100644 --- a/e2e/tests/api-driven/src/permissions/queries/flows.ts +++ b/e2e/tests/api-driven/src/permissions/queries/flows.ts @@ -3,11 +3,7 @@ import { gql } from "graphql-tag"; export const INSERT_FLOW_QUERY = gql` mutation InsertFlowE2E($team1Id: Int) { result: insert_flows( - objects: { - data: "{hello: 'world'}" - slug: "e2e-test-flow" - team_id: $team1Id - } + objects: { slug: "e2e-test-flow", team_id: $team1Id } ) { returning { id @@ -20,7 +16,7 @@ export const UPDATE_FLOW_QUERY = gql` mutation UpdateFlowE2E($team1FlowId: uuid!) { result: update_flows_by_pk( pk_columns: { id: $team1FlowId } - _set: { data: "{hello: 'world2'}" } + _set: { slug: "new-slug" } ) { id } From ce6925305c6fea95744f845d912b44647e58445f Mon Sep 17 00:00:00 2001 From: Ian Jones <51156018+ianjon3s@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:05:41 +0000 Subject: [PATCH 2/5] feat: Editor styles and layout update (#2491) * feat: Editor design settings * feat: Editor design settings * feat: Theme for editor settings * feat: Editor styles and layout update * feat: Styles for option buttons * feat: Styles for data fields * feat: Add feature flag for design settings * refactor: Input caption to input description * fix: Repeated ID --- .../@planx/components/Calculate/Editor.tsx | 7 +- .../@planx/components/Checklist/Editor.tsx | 2 +- .../@planx/components/Confirmation/Editor.tsx | 2 +- .../@planx/components/DrawBoundary/Editor.tsx | 2 + .../components/FileUploadAndLabel/Editor.tsx | 1 + .../components/InternalPortal/Editor.tsx | 3 +- .../components/PlanningConstraints/Editor.tsx | 1 + .../src/@planx/components/Question/Editor.tsx | 6 +- editor.planx.uk/src/lib/featureFlags.ts | 5 +- .../components/Settings/DesignSettings.tsx | 127 ++++++++++++++++-- .../components/Settings/ServiceSettings.tsx | 120 +++++++++-------- .../FlowEditor/components/Settings/index.tsx | 11 +- .../FlowEditor/components/forms/FormModal.tsx | 25 +++- editor.planx.uk/src/ui/ColorPicker.tsx | 22 +-- editor.planx.uk/src/ui/EditorRow.tsx | 38 ++++++ editor.planx.uk/src/ui/ImgInput.tsx | 9 +- editor.planx.uk/src/ui/Input.tsx | 16 ++- editor.planx.uk/src/ui/InputDescription.tsx | 17 +++ editor.planx.uk/src/ui/InputField.tsx | 3 +- editor.planx.uk/src/ui/InputGroup.tsx | 32 ++++- editor.planx.uk/src/ui/InputLegend.tsx | 16 +++ editor.planx.uk/src/ui/InputRow.tsx | 4 +- editor.planx.uk/src/ui/InputRowLabel.tsx | 12 +- editor.planx.uk/src/ui/ModalSection.tsx | 4 +- .../src/ui/ModalSectionContent.tsx | 29 ++-- editor.planx.uk/src/ui/ModalSubtitle.tsx | 9 +- editor.planx.uk/src/ui/OptionButton.tsx | 20 +-- .../src/ui/PublicFileUploadButton.tsx | 6 +- editor.planx.uk/src/ui/RichTextInput.css | 15 ++- 29 files changed, 415 insertions(+), 149 deletions(-) create mode 100644 editor.planx.uk/src/ui/EditorRow.tsx create mode 100644 editor.planx.uk/src/ui/InputDescription.tsx create mode 100644 editor.planx.uk/src/ui/InputLegend.tsx diff --git a/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx b/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx index 59d3cfe698..250ba9e5cf 100644 --- a/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx @@ -73,7 +73,11 @@ export default function Component(props: Props) { - This component does math! Write formulas using Math.js, omitting the math. prefix + This component does math! Write formulas using{" "} + + Math.js + + , omitting the math. prefix @@ -82,6 +86,7 @@ export default function Component(props: Props) { required placeholder="output data field" name="output" + format="data" value={formik.values.output} onChange={formik.handleChange} /> diff --git a/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx b/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx index a604c85d52..6e14019033 100644 --- a/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx @@ -146,7 +146,7 @@ const OptionEditor: React.FC<{ const Options: React.FC<{ formik: FormikHookReturn }> = ({ formik }) => { return ( - + {formik.values.groupedOptions ? ( {formik.values.groupedOptions.map( diff --git a/editor.planx.uk/src/@planx/components/Confirmation/Editor.tsx b/editor.planx.uk/src/@planx/components/Confirmation/Editor.tsx index 9ff71feff3..af7c706aaa 100644 --- a/editor.planx.uk/src/@planx/components/Confirmation/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Confirmation/Editor.tsx @@ -18,7 +18,7 @@ export type Props = EditorProps; function StepEditor(props: ListManagerEditorProps) { return ( - + @@ -75,6 +76,7 @@ function DrawBoundaryComponent(props: Props) { diff --git a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.tsx b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.tsx index 99526725f9..166d7d2683 100644 --- a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.tsx @@ -150,6 +150,7 @@ function FileTypeEditor(props: ListManagerEditorProps) { props.onChange(merge(props.value, { fn: e.target.value })) diff --git a/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx b/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx index 939d9dd591..8df014bf69 100644 --- a/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/InternalPortal/Editor.tsx @@ -47,7 +47,7 @@ const InternalPortalForm: React.FC<{ return (