Skip to content
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

Production deploy #3214

Merged
merged 5 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type PlanningConstraintsBaseSchema = Record<string, PlanningConstraintConfig>;
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",
},
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/api-driven/src/flowStatusHistory/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 6 additions & 5 deletions editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,16 @@ const PublicToolbar: React.FC<{
size="large"
aria-describedby="restart-application-description"
>
<Reset color="secondary" />
<Typography
id="restart-application-description"
style={visuallyHidden}
variant="body2"
fontSize="small"
fontWeight={FONT_WEIGHT_SEMI_BOLD}
pl={0.5}
>
Open a dialog with the option to restart your application.
If you chose to restart your application, this will delete
your previous answers
Restart
</Typography>
<Reset color="secondary" />
</IconButton>
)}
</RightBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
},
});

Expand Down
10 changes: 10 additions & 0 deletions hasura.planx.uk/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- team_id
Expand All @@ -441,6 +442,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- team_id
Expand Down Expand Up @@ -471,6 +473,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- team_id
Expand All @@ -494,6 +497,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- status
Expand All @@ -512,6 +516,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- status
Expand All @@ -529,6 +534,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- status
Expand All @@ -547,6 +553,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- status
Expand All @@ -566,6 +573,7 @@
- creator_id
- data
- id
- name
- settings
- slug
- status
Expand All @@ -587,6 +595,7 @@
permission:
columns:
- data
- name
- settings
- slug
- status
Expand All @@ -606,6 +615,7 @@
permission:
columns:
- data
- name
- settings
- slug
- status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
comment on column "public"."flows"."name" is NULL;

ALTER TABLE flows DROP COLUMN name;
Original file line number Diff line number Diff line change
@@ -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


12 changes: 8 additions & 4 deletions scripts/seed-database/write/flows.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 ';');
Expand All @@ -26,7 +27,8 @@ INSERT INTO flows (
settings,
copied_from,
analytics_link,
status
status,
name
)
SELECT
id,
Expand All @@ -38,7 +40,8 @@ SELECT
settings,
copied_from,
NULL,
status
status,
name
FROM sync_flows
ON CONFLICT (id) DO UPDATE
SET
Expand All @@ -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;
Expand Down