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 #2830

Merged
merged 28 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
16b09a1
infra: point application to new westberks domain (#2824)
Mike-Heneghan Feb 27, 2024
5599851
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /scripts/encrypt…
dependabot[bot] Feb 28, 2024
414ef63
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /editor.planx.uk…
dependabot[bot] Feb 28, 2024
7291056
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /api.planx.uk (#…
dependabot[bot] Feb 28, 2024
a8ae4ba
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /e2e/tests/ui-dr…
dependabot[bot] Feb 28, 2024
5397c9e
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /e2e/tests/api-d…
dependabot[bot] Feb 28, 2024
c44e1a4
chore: Remove circular dependency in `saveAndReturn` module (#2818)
DafyddLlyr Feb 28, 2024
05b855f
fix: rename SPA & Green Belt planning designations using ODP Schema v…
jessicamcinchak Feb 28, 2024
6a49bd3
test: add tests for Feedback component (#2822)
Mike-Heneghan Feb 28, 2024
fffd285
story: add FeedbackForm to storybook (#2832)
Mike-Heneghan Feb 29, 2024
903e0db
chore: Add `user.role` and `property.constraints.planning` to analyti…
DafyddLlyr Feb 29, 2024
24fbed3
story: add basic stories for feedback components (#2837)
Mike-Heneghan Feb 29, 2024
9aa82e5
fix: Read allow list values from breadcrumbs not flow (#2835)
DafyddLlyr Feb 29, 2024
8256bd1
chore: Add `allow_list_answers` column to `analytics_summary` view (…
DafyddLlyr Mar 1, 2024
ce35836
[skip pizza] bump eslint from 8.56.0 to 8.57.0 in /e2e (#2845)
dependabot[bot] Mar 1, 2024
c9c6c5e
chore(deps-dev): bump nock from 13.4.0 to 13.5.4 in /api.planx.uk (#2…
dependabot[bot] Mar 1, 2024
c121c21
chore(deps-dev): bump @babel/core from 7.23.6 to 7.24.0 in /api.planx…
dependabot[bot] Mar 1, 2024
40b8594
chore(deps): bump ramda from 0.28.0 to 0.29.1 in /editor.planx.uk (#2…
dependabot[bot] Mar 1, 2024
b52d5fe
chore(deps-dev): bump sass from 1.69.6 to 1.71.1 in /editor.planx.uk …
dependabot[bot] Mar 1, 2024
8d1b442
chore(deps): bump pnpm/action-setup from 2.4.0 to 3.0.0 (#2846)
dependabot[bot] Mar 1, 2024
1b4d374
chore(deps): bump type-fest from 4.6.0 to 4.10.3 in /api.planx.uk (#2…
dependabot[bot] Mar 1, 2024
2523a58
chore: hookup staging Gov Pay for Camden (#2852)
jessicamcinchak Mar 1, 2024
d3b36b2
chore(deps-dev): bump @babel/plugin-syntax-flow from 7.22.5 to 7.23.3…
dependabot[bot] Mar 1, 2024
ac32f02
chore(deps): bump cookie-session from 1.4.0 to 2.1.0 in /api.planx.uk…
dependabot[bot] Mar 1, 2024
3b60c74
chore: Fix `CVE-2024-27088` (#2833)
DafyddLlyr Mar 1, 2024
6627374
chore: update default copy for FindProperty plot a new address (#2853)
jessicamcinchak Mar 1, 2024
24b2549
chore(deps): bump @tiptap/extension-document from 2.0.3 to 2.2.4 in /…
dependabot[bot] Mar 1, 2024
01272f9
chore(deps-dev): bump @testing-library/react from 13.4.0 to 14.2.1 in…
dependabot[bot] Mar 1, 2024
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ UNIFORM_CLIENT_AYLESBURY_VALE=👻
UNIFORM_CLIENT_CHILTERN=👻
UNIFORM_CLIENT_WYCOMBE=👻

## Camden
GOV_UK_PAY_TOKEN_CAMDEN=👻

## Gloucester
GOV_UK_PAY_TOKEN_GLOUCESTER=👻

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
fail: true
- name: Setup .gitconfig
run: mv .gitconfig ~/.gitconfig
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
fail: true
- name: Setup .gitconfig
run: mv .gitconfig ~/.gitconfig
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
with:
files: ".env, .env.staging, api.planx.uk/.env.test, hasura.planx.uk/.env.test"
fail: true
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
with:
path: ./${{ env.EDITOR_DIRECTORY }}/build
key: ${{ runner.os }}-${{ hashFiles('editor.planx.uk/**') }}
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
if: steps.cache-react-build-assets.outputs.cache-hit != 'true'
with:
version: ${{ vars.PNPM_VERSION }}
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
aws-access-key-id: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
aws-region: eu-west-2
aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
- name: Copy .env files from Staging S3 to the current working directory with AWS CLI
run: ./scripts/pull-secrets.sh
- name: Setup PNPM
uses: pnpm/action-setup@v2.4.0
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- name: Setup Node
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail: true
- name: Setup .gitconfig
run: mv .gitconfig ~/.gitconfig
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
with:
files: ".env, .env.staging, api.planx.uk/.env.test, hasura.planx.uk/.env.test"
fail: true
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
with:
files: ".env, .env.staging, api.planx.uk/.env.test, hasura.planx.uk/.env.test"
fail: true
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Copy .env files from Staging S3 to the current working directory with AWS CLI
run: ./scripts/pull-secrets.sh
- name: Setup PNPM
uses: pnpm/action-setup@v2.4.0
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ vars.PNPM_VERSION }}
- name: Setup Node
Expand Down
3 changes: 3 additions & 0 deletions api.planx.uk/.env.test.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ GOV_UK_PAY_TOKEN_SOUTHWARK=👻
## Buckinghamshire
GOV_UK_PAY_TOKEN_BUCKINGHAMSHIRE=👻

## Camden
GOV_UK_PAY_TOKEN_CAMDEN=👻

## Gloucester
GOV_UK_PAY_TOKEN_GLOUCESTER=👻

Expand Down
8 changes: 1 addition & 7 deletions api.planx.uk/modules/gis/service/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,7 @@ const addDesignatedVariable = (responseObject) => {
designated: { value: false },
};

const subVariables = [
"conservationArea",
"AONB",
"nationalPark",
"WHS",
"SPA",
];
const subVariables = ["conservationArea", "AONB", "nationalPark", "WHS"];

// If any of the subvariables are true, then set "designated" to true
subVariables.forEach((s) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const baseSchema: PlanningConstraintsBaseSchema = {
"digital-land-datasets": ["conservation-area"],
category: "Heritage and conservation",
},
"designated.greenBelt": {
greenBelt: {
active: true,
neg: "is not in a Green Belt",
pos: "is in a Green Belt",
"digital-land-datasets": ["green-belt"],
category: "Heritage and conservation",
category: "General policy",
},
"designated.nationalPark": {
active: true,
Expand All @@ -70,13 +70,6 @@ const baseSchema: PlanningConstraintsBaseSchema = {
"digital-land-entities": [520007], // https://www.planning.data.gov.uk/entity/520007
category: "Heritage and conservation",
},
"designated.SPA": {
active: true,
neg: "is not in a Special Protection Area (SPA)",
pos: "is in a Special Protection Area (SPA)",
"digital-land-datasets": ["special-protection-area"],
category: "Heritage and conservation",
},
"designated.WHS": {
active: true,
neg: "is not an UNESCO World Heritage Site",
Expand Down Expand Up @@ -136,6 +129,13 @@ const baseSchema: PlanningConstraintsBaseSchema = {
"digital-land-datasets": ["special-area-of-conservation"],
category: "Ecology",
},
"nature.SPA": {
active: true,
neg: "is not in a Special Protection Area (SPA)",
pos: "is in a Special Protection Area (SPA)",
"digital-land-datasets": ["special-protection-area"],
category: "Ecology",
},
"nature.SSSI": {
active: true,
neg: "is not a Site of Special Scientific Interest (SSSI)",
Expand Down
86 changes: 18 additions & 68 deletions api.planx.uk/modules/saveAndReturn/controller.ts
Original file line number Diff line number Diff line change
@@ -1,73 +1,6 @@
import { z } from "zod";
import { ValidatedRequestHandler } from "../../shared/middleware/validate";
import { resumeApplication } from "./service/resumeApplication";
import { LowCalSessionData } from "../../types";
import { findSession, validateSession } from "./service/validateSession";
import { PaymentRequest } from "@opensystemslab/planx-core/types";

interface ResumeApplicationResponse {
message: string;
expiryDate?: string | undefined;
}

export const resumeApplicationSchema = z.object({
body: z.object({
payload: z.object({
teamSlug: z.string(),
email: z.string().email(),
}),
}),
});

export type ResumeApplication = ValidatedRequestHandler<
typeof resumeApplicationSchema,
ResumeApplicationResponse
>;

export const resumeApplicationController: ResumeApplication = async (
_req,
res,
next,
) => {
try {
const { teamSlug, email } = res.locals.parsedReq.body.payload;
const response = await resumeApplication(teamSlug, email);
return res.json(response);
} catch (error) {
return next({
error,
message: `Failed to send "Resume" email. ${(error as Error).message}`,
});
}
};

export interface ValidationResponse {
message: string;
changesFound: boolean | null;
alteredSectionIds?: Array<string>;
reconciledSessionData: Omit<LowCalSessionData, "passport">;
}

interface LockedSessionResponse {
message: "Session locked";
paymentRequest?: Partial<
Pick<PaymentRequest, "id" | "payeeEmail" | "payeeName">
>;
}

export const validateSessionSchema = z.object({
body: z.object({
payload: z.object({
sessionId: z.string(),
email: z.string().email(),
}),
}),
});

export type ValidateSessionController = ValidatedRequestHandler<
typeof validateSessionSchema,
ValidationResponse | LockedSessionResponse
>;
import { ResumeApplication, ValidateSessionController } from "./types";

export const validateSessionController: ValidateSessionController = async (
_req,
Expand Down Expand Up @@ -107,3 +40,20 @@ export const validateSessionController: ValidateSessionController = async (
});
}
};

export const resumeApplicationController: ResumeApplication = async (
_req,
res,
next,
) => {
try {
const { teamSlug, email } = res.locals.parsedReq.body.payload;
const response = await resumeApplication(teamSlug, email);
return res.json(response);
} catch (error) {
return next({
error,
message: `Failed to send "Resume" email. ${(error as Error).message}`,
});
}
};
3 changes: 1 addition & 2 deletions api.planx.uk/modules/saveAndReturn/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import { Router } from "express";

import {
resumeApplicationController,
resumeApplicationSchema,
validateSessionController,
validateSessionSchema,
} from "./controller";
import { sendEmailLimiter } from "../../rateLimit";
import { validate } from "../../shared/middleware/validate";
import { resumeApplicationSchema, validateSessionSchema } from "./types";

const router = Router();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
Node,
} from "../../../types";
import { $api } from "../../../client";
import { ValidationResponse } from "../controller";
import { ValidationResponse } from "../types";

export type ReconciledSession = {
alteredSectionIds: Array<string>;
Expand Down
51 changes: 51 additions & 0 deletions api.planx.uk/modules/saveAndReturn/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { z } from "zod";
import { ValidatedRequestHandler } from "../../shared/middleware/validate";
import { LowCalSessionData } from "../../types";
import { PaymentRequest } from "@opensystemslab/planx-core/types";

interface ResumeApplicationResponse {
message: string;
expiryDate?: string | undefined;
}

export const resumeApplicationSchema = z.object({
body: z.object({
payload: z.object({
teamSlug: z.string(),
email: z.string().email(),
}),
}),
});

export type ResumeApplication = ValidatedRequestHandler<
typeof resumeApplicationSchema,
ResumeApplicationResponse
>;

export interface ValidationResponse {
message: string;
changesFound: boolean | null;
alteredSectionIds?: Array<string>;
reconciledSessionData: Omit<LowCalSessionData, "passport">;
}

interface LockedSessionResponse {
message: "Session locked";
paymentRequest?: Partial<
Pick<PaymentRequest, "id" | "payeeEmail" | "payeeName">
>;
}

export const validateSessionSchema = z.object({
body: z.object({
payload: z.object({
sessionId: z.string(),
email: z.string().email(),
}),
}),
});

export type ValidateSessionController = ValidatedRequestHandler<
typeof validateSessionSchema,
ValidationResponse | LockedSessionResponse
>;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const ALLOW_LIST = [
"application.declaration.connection",
"property.type",
"drawBoundary.action",
"user.role",
"property.constraints.planning",
];

export const getAnalyzeSessionOperations = (): Operation[] => [
Expand Down
10 changes: 5 additions & 5 deletions api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"dependencies": {
"@airbrake/node": "^2.1.8",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f8f2155",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#296592c",
"@types/isomorphic-fetch": "^0.0.36",
"adm-zip": "^0.5.10",
"aws-sdk": "^2.1467.0",
"axios": "^1.6.5",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"cookie-session": "^1.4.0",
"cookie-session": "^2.1.0",
"copyfiles": "^2.4.1",
"cors": "^2.8.5",
"csv-stringify": "^6.4.5",
Expand Down Expand Up @@ -45,7 +45,7 @@
"string-to-stream": "^3.0.1",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.0",
"type-fest": "^4.6.0",
"type-fest": "^4.10.3",
"zod": "^3.22.4"
},
"scripts": {
Expand All @@ -68,7 +68,7 @@
]
},
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/core": "^7.24.0",
"@babel/preset-typescript": "^7.23.3",
"@types/adm-zip": "^0.5.0",
"@types/body-parser": "^1.19.5",
Expand Down Expand Up @@ -104,7 +104,7 @@
"jest": "^29.7.0",
"json-stringify-pretty-compact": "^3.0.0",
"lint-staged": "^15.0.2",
"nock": "^13.4.0",
"nock": "^13.5.4",
"node-dev": "^8.0.0",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
Expand Down
Loading
Loading