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

Merged
merged 38 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
df91481
chore(api): Move `/me` route to user module (#2585)
DafyddLlyr Dec 20, 2023
f356fdf
fix: Syntax issue in `SetupTeamIntegrationE2E` mutation (#2587)
DafyddLlyr Dec 20, 2023
176a515
fix: Form wrapper for upload + label (#2588)
ianjon3s Dec 20, 2023
1c90acb
chore: Temp skip of e2e tests [skip pizza] (#2589)
DafyddLlyr Dec 20, 2023
b51edcd
docs: add how-to for enabling planning constraints and setting up gra…
jessicamcinchak Dec 21, 2023
5157154
chore: Ignore AWS healthcheck from API logs [skip pizza] (#2593)
DafyddLlyr Dec 21, 2023
1c8365c
fix: rationalise analytics logs to remove duplication and inconsisten…
Mike-Heneghan Dec 21, 2023
01bcb76
feat: Set `httpOnly` flag in cookie (#2591)
DafyddLlyr Dec 21, 2023
da0c42b
chore: Restructure UI components into folders (#2594)
ianjon3s Dec 21, 2023
58492de
Revert "feat: Set `httpOnly` flag in cookie (#2591)" (#2596)
DafyddLlyr Dec 21, 2023
b96c589
chore: Restore permissions for flow.data column (#2599)
DafyddLlyr Dec 22, 2023
5193448
fix: Drop redundant sanitation for Find and Replace (#2598)
DafyddLlyr Dec 22, 2023
f62b9eb
feat: Drop permission workaround for copy flow (#2600)
DafyddLlyr Dec 22, 2023
c3e5618
chore(deps): bump actions/download-artifact from 3 to 4 (#2621)
dependabot[bot] Jan 2, 2024
421200b
chore(deps): bump actions/upload-artifact from 3 to 4 (#2620)
dependabot[bot] Jan 2, 2024
56e5eac
chore(editor): Minor update for all Editor dependencies (#2606)
DafyddLlyr Jan 2, 2024
d94c2c2
chore(api): Update all minor version changes (#2605)
DafyddLlyr Jan 2, 2024
9366de1
chore: Run `pnpm lint:fix` in `editor.planx.uk` [skip pizza] (#2603)
DafyddLlyr Jan 2, 2024
e6b418b
[skip pizza] bump lint-staged from 15.1.0 to 15.2.0 in /e2e (#2617)
dependabot[bot] Jan 2, 2024
2469406
[skip pizza] bump eslint from 8.54.0 to 8.56.0 in /e2e (#2618)
dependabot[bot] Jan 2, 2024
19da878
chore(deps): bump ws from 8.14.2 to 8.16.0 in /sharedb.planx.uk (#2619)
dependabot[bot] Jan 2, 2024
fe321fa
chore(deps-dev): bump eslint-config-prettier in /api.planx.uk (#2607)
dependabot[bot] Jan 2, 2024
869b2bc
chore(deps-dev): bump eslint from 8.47.0 to 8.56.0 in /api.planx.uk (…
dependabot[bot] Jan 2, 2024
19d557d
chore(deps-dev): bump webpack from 5.88.1 to 5.89.0 in /editor.planx.…
dependabot[bot] Jan 2, 2024
0e26c5e
chore(deps-dev): bump prettier from 3.0.2 to 3.1.1 in /api.planx.uk (…
dependabot[bot] Jan 2, 2024
a56f5e3
chore(deps): bump express-rate-limit in /api.planx.uk (#2611)
dependabot[bot] Jan 2, 2024
8db9e42
feat: Add `team_themes` table (#2602)
DafyddLlyr Jan 2, 2024
e679528
Revert "chore(deps): bump actions/download-artifact from 3 to 4 (#262…
jessicamcinchak Jan 2, 2024
598b25f
Revert "Revert "chore(deps): bump actions/download-artifact from 3 to…
jessicamcinchak Jan 2, 2024
96c5999
chore: Bump `MUI` and `planx-core` dependencies (#2626)
DafyddLlyr Jan 2, 2024
38931b3
chore(deps): bump scroll-into-view-if-needed in /editor.planx.uk (#2616)
dependabot[bot] Jan 2, 2024
efdbeba
chore(deps-dev): bump sass from 1.63.6 to 1.69.6 in /editor.planx.uk …
dependabot[bot] Jan 2, 2024
fe30515
chore(deps-dev): bump nock from 13.3.2 to 13.4.0 in /api.planx.uk (#2…
dependabot[bot] Jan 2, 2024
1213bc9
feat: Team settings page and routes (#2604)
DafyddLlyr Jan 2, 2024
2c6ea43
chore: Bump Storybook dependencies (#2625)
DafyddLlyr Jan 2, 2024
ebad785
refactor: Simplify help text button (#2543)
ianjon3s Jan 3, 2024
651721a
chore: Bump planx-core (#2628)
DafyddLlyr Jan 3, 2024
59d016a
fix: Unescape HTML entities for alternate DOMPurify check (#2630)
DafyddLlyr Jan 5, 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
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ jobs:
working-directory: e2e
- name: Archive Playwright Test Results
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: e2e/tests/ui-driven/test-results/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
REACT_APP_AIRBRAKE_PROJECT_KEY: ${{ secrets.AIRBRAKE_PROJECT_KEY }}
REACT_APP_ENV: staging
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: ./editor.planx.uk/build
Expand All @@ -87,7 +87,7 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: infrastructure/application
- name: Download Build Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
path: ./editor.planx.uk/build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
REACT_APP_AIRBRAKE_PROJECT_KEY: ${{ secrets.AIRBRAKE_PROJECT_KEY }}
REACT_APP_ENV: production
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: ./editor.planx.uk/build
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: infrastructure/application
- name: Download Build Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
path: ./editor.planx.uk/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
working-directory: e2e
- name: Archive Playwright Test Results
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: e2e/tests/ui-driven/test-results/
Expand Down
27 changes: 6 additions & 21 deletions api.planx.uk/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { gql } from "graphql-request";
import { capitalize } from "lodash";
import { Flow, Node } from "./types";
import { ComponentType, FlowGraph } from "@opensystemslab/planx-core/types";
import { $api, $public, getClient } from "./client";
import { $public, getClient } from "./client";

// Get a flow's data (unflattened, without external portal nodes)
const getFlowData = async (id: string): Promise<Flow> => {
Expand All @@ -28,6 +28,7 @@ interface InsertFlow {
id: string;
};
}

// Insert a new flow into the `flows` table
const insertFlow = async (
teamId: number,
Expand All @@ -45,13 +46,15 @@ const insertFlow = async (
mutation InsertFlow(
$team_id: Int!
$slug: String!
$data: jsonb = {}
$creator_id: Int
$copied_from: uuid
) {
flow: insert_flows_one(
object: {
team_id: $team_id
slug: $slug
data: $data
version: 1
creator_id: $creator_id
copied_from: $copied_from
Expand All @@ -64,35 +67,17 @@ const insertFlow = async (
{
team_id: teamId,
slug: slug,
data: flowData,
creator_id: creatorId,
copied_from: copiedFrom,
},
);

// Populate flow data using API role now that we know user has permission to insert flow
// Access to flow.data column is restricted to limit unsafe content that could be inserted
await $api.client.request<InsertFlow>(
gql`
mutation UpdateFlowData($data: jsonb = {}, $id: uuid!) {
flow: update_flows_by_pk(
pk_columns: { id: $id }
_set: { data: $data }
) {
id
}
}
`,
{
id: id,
data: flowData,
},
);

await createAssociatedOperation(id);
return { id };
} catch (error) {
throw Error(
`User ${creatorId} failed to insert flow to teamId ${teamId}. Please check permissions.`,
`User ${creatorId} failed to insert flow to teamId ${teamId}. Please check permissions. Error: ${error}`,
);
}
};
Expand Down
10 changes: 0 additions & 10 deletions api.planx.uk/modules/flows/copyFlow/copyFlow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ beforeEach(() => {
},
});

queryMock.mockQuery({
name: "UpdateFlowData",
matchOnVariables: false,
data: {
flow: {
id: 2,
},
},
});

queryMock.mockQuery({
name: "InsertOperation",
matchOnVariables: false,
Expand Down
13 changes: 1 addition & 12 deletions api.planx.uk/modules/flows/findReplace/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { z } from "zod";
import { ServerError } from "../../../errors";
import { findAndReplaceInFlow } from "./service";
import { FlowGraph } from "@opensystemslab/planx-core/types";
import { JSDOM } from "jsdom";
import createDOMPurify from "dompurify";

// Setup JSDOM and DOMPurify
const window = new JSDOM("").window;
const DOMPurify = createDOMPurify(window);

interface FindAndReplaceResponse {
message: string;
Expand All @@ -23,12 +17,7 @@ export const findAndReplaceSchema = z.object({
}),
query: z.object({
find: z.string(),
replace: z
.string()
.optional()
.transform(
(val) => val && DOMPurify.sanitize(val, { ADD_ATTR: ["target"] }),
),
replace: z.string().optional(),
}),
});

Expand Down
Loading
Loading