From 78db1db5adf6e5f12cc1f4c27328e552d779189e Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Thu, 30 May 2024 09:07:04 +0100 Subject: [PATCH 1/5] fix: adjust Article 4 text per Barnet's feedback (#3213) --- .../modules/gis/service/local_authorities/metadata/base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.planx.uk/modules/gis/service/local_authorities/metadata/base.ts b/api.planx.uk/modules/gis/service/local_authorities/metadata/base.ts index 298d40bf1b..3970556b03 100644 --- a/api.planx.uk/modules/gis/service/local_authorities/metadata/base.ts +++ b/api.planx.uk/modules/gis/service/local_authorities/metadata/base.ts @@ -14,8 +14,8 @@ type PlanningConstraintsBaseSchema = Record; const baseSchema: PlanningConstraintsBaseSchema = { article4: { active: true, - neg: "is not subject to local permitted development restrictions (known as Article 4 directions)", - pos: "is subject to local permitted development restrictions (known as Article 4 directions)", + neg: "is not in an Article 4 direction area", + pos: "is in an Article 4 direction area", "digital-land-datasets": ["article-4-direction-area"], category: "General policy", }, From ca33cd100e0b0ff1cfa95fcdb5952befda645fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 30 May 2024 09:52:01 +0100 Subject: [PATCH 2/5] feat: Improve flow status form UX (#3212) --- .../FlowEditor/components/Settings/ServiceSettings.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/ServiceSettings.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/ServiceSettings.tsx index 849c5a9b91..d56abc8aa1 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/ServiceSettings.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/ServiceSettings.tsx @@ -129,9 +129,13 @@ const ServiceSettings: React.FC = () => { initialValues: { status: flowStatus || "online", }, - onSubmit: async ({ status }) => { - await updateFlowStatus(status); - setIsAlertOpen(true); + onSubmit: async (values, { resetForm }) => { + const isSuccess = await updateFlowStatus(values.status); + if (isSuccess) { + setIsAlertOpen(true); + // Reset "dirty" status to disable Save & Reset buttons + resetForm({ values }); + } }, }); From 6d649ca97a1572a6273ef95ff647618a01dcf71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 30 May 2024 09:54:53 +0100 Subject: [PATCH 3/5] fix: Incorrect status in `flow_status_history` (#3210) --- e2e/tests/api-driven/src/flowStatusHistory/steps.ts | 4 ++-- .../1715954131936_create_table_public_flow_status_enum/up.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/tests/api-driven/src/flowStatusHistory/steps.ts b/e2e/tests/api-driven/src/flowStatusHistory/steps.ts index bd36d3e407..af93d5a3f0 100644 --- a/e2e/tests/api-driven/src/flowStatusHistory/steps.ts +++ b/e2e/tests/api-driven/src/flowStatusHistory/steps.ts @@ -94,8 +94,8 @@ Then("a new flow_status_history record is created", async function () { assert.ok(flowStatusHistory[1], "flow_status_history record not created"); assert.equal( flowStatusHistory[1].status, - "offline", - `Flow status is ${flowStatusHistory[1].status} - it should be "offline"`, + "online", + `Flow status is ${flowStatusHistory[1].status} - it should be "online"`, ); assert.notEqual( flowStatusHistory[1].eventStart, diff --git a/hasura.planx.uk/migrations/1715954131936_create_table_public_flow_status_enum/up.sql b/hasura.planx.uk/migrations/1715954131936_create_table_public_flow_status_enum/up.sql index 7241db037c..0654a71cc8 100644 --- a/hasura.planx.uk/migrations/1715954131936_create_table_public_flow_status_enum/up.sql +++ b/hasura.planx.uk/migrations/1715954131936_create_table_public_flow_status_enum/up.sql @@ -60,7 +60,7 @@ BEGIN -- Start new event INSERT INTO flow_status_history (flow_id, status, event_start) - VALUES (NEW.id, OLD.status, NOW()); + VALUES (NEW.id, NEW.status, NOW()); ELSIF (TG_OP = 'INSERT') THEN -- Start new event From c250d10cfbad81a00064becb30dca6e95d2dfb48 Mon Sep 17 00:00:00 2001 From: Ian Jones <51156018+ianjon3s@users.noreply.github.com> Date: Thu, 30 May 2024 11:29:21 +0100 Subject: [PATCH 4/5] feat: Add restart text label to restart button (#3211) --- editor.planx.uk/src/components/Header.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/editor.planx.uk/src/components/Header.tsx b/editor.planx.uk/src/components/Header.tsx index 698efc2109..f3aebd2141 100644 --- a/editor.planx.uk/src/components/Header.tsx +++ b/editor.planx.uk/src/components/Header.tsx @@ -366,15 +366,16 @@ const PublicToolbar: React.FC<{ size="large" aria-describedby="restart-application-description" > + - Open a dialog with the option to restart your application. - If you chose to restart your application, this will delete - your previous answers + Restart - )} From 508175f48400975d5f4cb66e011e33d7613eafaa Mon Sep 17 00:00:00 2001 From: Rory Doak <138574807+RODO94@users.noreply.github.com> Date: Thu, 30 May 2024 12:55:30 +0100 Subject: [PATCH 5/5] feat: Adding a "Name" Column to "Flows" table (#3203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rory Doak Co-authored-by: Dafydd Llŷr Pearson --- hasura.planx.uk/metadata/tables.yaml | 10 ++++++++++ .../down.sql | 3 +++ .../up.sql | 9 +++++++++ scripts/seed-database/write/flows.sql | 12 ++++++++---- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/down.sql create mode 100644 hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/up.sql diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index eaf09ef72b..e8c8717c4b 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -418,6 +418,7 @@ - creator_id - data - id + - name - settings - slug - team_id @@ -441,6 +442,7 @@ - creator_id - data - id + - name - settings - slug - team_id @@ -471,6 +473,7 @@ - creator_id - data - id + - name - settings - slug - team_id @@ -494,6 +497,7 @@ - creator_id - data - id + - name - settings - slug - status @@ -512,6 +516,7 @@ - creator_id - data - id + - name - settings - slug - status @@ -529,6 +534,7 @@ - creator_id - data - id + - name - settings - slug - status @@ -547,6 +553,7 @@ - creator_id - data - id + - name - settings - slug - status @@ -566,6 +573,7 @@ - creator_id - data - id + - name - settings - slug - status @@ -587,6 +595,7 @@ permission: columns: - data + - name - settings - slug - status @@ -606,6 +615,7 @@ permission: columns: - data + - name - settings - slug - status diff --git a/hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/down.sql b/hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/down.sql new file mode 100644 index 0000000000..3ec5c863e5 --- /dev/null +++ b/hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."flows"."name" is NULL; + +ALTER TABLE flows DROP COLUMN name; \ No newline at end of file diff --git a/hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/up.sql b/hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/up.sql new file mode 100644 index 0000000000..349ee9274e --- /dev/null +++ b/hasura.planx.uk/migrations/1716902907392_alter_table_public_flows_add_column_name/up.sql @@ -0,0 +1,9 @@ +alter table "public"."flows" add column "name" text + null; + comment on column "public"."flows"."name" is 'The name of the flow, entered by the user and used to generate the "slug"'; + +UPDATE flows +SET name = replace(concat(upper(substring(slug,1,1)),right(slug,-1)),'-',' ') +WHERE name IS NULL + + diff --git a/scripts/seed-database/write/flows.sql b/scripts/seed-database/write/flows.sql index 93a01f5910..6244bdfe91 100644 --- a/scripts/seed-database/write/flows.sql +++ b/scripts/seed-database/write/flows.sql @@ -11,7 +11,8 @@ CREATE TEMPORARY TABLE sync_flows ( settings jsonb, copied_from uuid, analytics_link text, - status text + status text, + name text ); \copy sync_flows FROM '/tmp/flows.csv' WITH (FORMAT csv, DELIMITER ';'); @@ -26,7 +27,8 @@ INSERT INTO flows ( settings, copied_from, analytics_link, - status + status, + name ) SELECT id, @@ -38,7 +40,8 @@ SELECT settings, copied_from, NULL, - status + status, + name FROM sync_flows ON CONFLICT (id) DO UPDATE SET @@ -50,7 +53,8 @@ SET settings = EXCLUDED.settings, copied_from = EXCLUDED.copied_from, analytics_link = NULL, - status = EXCLUDED.status; + status = EXCLUDED.status, + name = EXCLUDED.name; -- ensure that original flows.version is overwritten to match new operation inserted below, else sharedb will fail UPDATE flows SET version = 1;