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

Merged
merged 7 commits into from
Oct 10, 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 @@ -70,6 +70,7 @@ describe("sendAgentAndPayeeConfirmationEmail", () => {
helpOpeningHours: "9-5",
helpPhone: "123",
serviceName: "Some Flow",
sessionId: "mockSessionId",
},
};
await sendAgentAndPayeeConfirmationEmail("mockSessionId");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { formatRawProjectTypes } from "@opensystemslab/planx-core";
import { gql } from "graphql-request";
import { $api } from "../../../../client/index.js";
import { sendEmail } from "../../../../lib/notify/index.js";
import type { AgentAndPayeeSubmissionNotifyConfig } from "../../../../types.js";
import type {
AgentAndPayeeSubmissionNotifyConfig,
AgentAndPayeeSubmissionNotifyPersonalisation,
} from "../../../../types.js";

export async function sendAgentAndPayeeConfirmationEmail(sessionId: string) {
const { personalisation, applicantEmail, payeeEmail, projectTypes } =
Expand All @@ -22,16 +25,10 @@ export async function sendAgentAndPayeeConfirmationEmail(sessionId: string) {
}

type PayeeAndAgentEmailData = {
personalisation: {
emailReplyToId: string;
helpEmail: string;
helpOpeningHours: string;
helpPhone: string;
serviceName: string;
payeeName: string;
address: string;
applicantName: string;
};
personalisation: Omit<
AgentAndPayeeSubmissionNotifyPersonalisation,
"projectType"
>;
applicantEmail: string;
payeeEmail: string;
projectTypes: string[];
Expand All @@ -45,6 +42,7 @@ async function getDataForPayeeAndAgentEmails(
lowcal_sessions(where: { id: { _eq: $sessionId } }, limit: 1) {
email
flow {
name
slug
team {
notifyPersonalisation: team_settings {
Expand Down Expand Up @@ -109,6 +107,7 @@ async function getDataForPayeeAndAgentEmails(
payeeName,
address,
applicantName,
sessionId,
},
applicantEmail,
payeeEmail,
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@airbrake/node": "^2.1.8",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#5781880",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6a83682",
"@types/isomorphic-fetch": "^0.0.36",
"adm-zip": "^0.5.10",
"aws-sdk": "^2.1467.0",
Expand Down
8 changes: 4 additions & 4 deletions api.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api.planx.uk/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export interface AgentAndPayeeSubmissionNotifyPersonalisation
payeeName: string;
address: string;
projectType: string;
serviceName: string;
sessionId: string;
}

export interface AgentAndPayeeSubmissionNotifyConfig {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/api-driven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"packageManager": "[email protected]",
"dependencies": {
"@cucumber/cucumber": "^9.3.0",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#5781880",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6a83682",
"axios": "^1.7.4",
"dotenv": "^16.3.1",
"dotenv-expand": "^10.0.0",
Expand Down
9 changes: 5 additions & 4 deletions e2e/tests/api-driven/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/tests/ui-driven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"postinstall": "./install-dependencies.sh"
},
"dependencies": {
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#5781880",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6a83682",
"axios": "^1.7.4",
"dotenv": "^16.3.1",
"eslint": "^8.56.0",
Expand Down
9 changes: 5 additions & 4 deletions e2e/tests/ui-driven/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/tests/ui-driven/src/refresh-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ test.describe("Refresh page", () => {

const teamSlugInHeader = page.getByRole("link", {
name: context.team.slug,
exact: true,
});
await expect(teamSlugInHeader).toBeVisible();

Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@mui/material": "^5.15.10",
"@mui/utils": "^5.15.11",
"@opensystemslab/map": "1.0.0-alpha.3",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#0ade7fa",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6a83682",
"@tiptap/core": "^2.4.0",
"@tiptap/extension-bold": "^2.0.3",
"@tiptap/extension-bubble-menu": "^2.1.13",
Expand Down
20 changes: 9 additions & 11 deletions editor.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 2 additions & 17 deletions editor.planx.uk/src/components/EditorNavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,6 @@ const MenuTitle = styled(Typography)(({ theme }) => ({
textAlign: "left",
})) as typeof Typography;

const TooltipWrap = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} arrow placement="right" classes={{ popper: className }} />
))(() => ({
[`& .${tooltipClasses.arrow}`]: {
color: "#2c2c2c",
},
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: "#2c2c2c",
left: "-5px",
fontSize: "0.8em",
borderRadius: 0,
fontWeight: FONT_WEIGHT_SEMI_BOLD,
},
}));

const MenuButton = styled(IconButton, {
shouldForwardProp: (prop) => prop !== "isActive",
})<{ isActive: boolean }>(({ theme, isActive, disabled }) => ({
Expand Down Expand Up @@ -273,7 +258,7 @@ function EditorNavMenu() {
{visibleRoutes.map(({ title, Icon, route, disabled }) => (
<MenuItem key={title}>
{compact ? (
<TooltipWrap title={title}>
<Tooltip title={title} placement="right">
<Box component="span">
<MenuButton
isActive={isActive(route)}
Expand All @@ -284,7 +269,7 @@ function EditorNavMenu() {
<Icon />
</MenuButton>
</Box>
</TooltipWrap>
</Tooltip>
) : (
<MenuButton
isActive={isActive(route)}
Expand Down
7 changes: 7 additions & 0 deletions editor.planx.uk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ if (!window.customElements.get("my-map")) {
window.customElements.define("my-map", MyMap);
}

// Refresh window if user hits "Failed to fetch dynamically imported module" due to renamed assets following re-build after deploy
// Docs: https://vite.dev/guide/build#load-error-handling
window.addEventListener("vite:preloadError", (event) => {
event.preventDefault();
window.location.reload();
});

const hasJWT = (): boolean | void => {
// This cookie indicates the presence of the secure httpOnly "jwt" cookie
const authCookie = getCookie("auth");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,9 @@ import LabelIcon from "@mui/icons-material/Label";
import LabelOffIcon from "@mui/icons-material/LabelOff";
import Box from "@mui/material/Box";
import IconButton from "@mui/material/IconButton";
import { styled } from "@mui/material/styles";
import Tooltip, { tooltipClasses, TooltipProps } from "@mui/material/Tooltip";
import Tooltip from "@mui/material/Tooltip";
import { useStore } from "pages/FlowEditor/lib/store";
import React from "react";
import { FONT_WEIGHT_SEMI_BOLD } from "theme";

const TooltipWrap = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} arrow placement="right" classes={{ popper: className }} />
))(() => ({
[`& .${tooltipClasses.arrow}`]: {
color: "#2c2c2c",
},
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: "#2c2c2c",
left: "-5px",
fontSize: "0.8em",
borderRadius: 0,
fontWeight: FONT_WEIGHT_SEMI_BOLD,
},
}));

export const ToggleTagsButton: React.FC = () => {
const [showTags, toggleShowTags] = useStore((state) => [
Expand All @@ -41,7 +24,7 @@ export const ToggleTagsButton: React.FC = () => {
background: theme.palette.background.paper,
})}
>
<TooltipWrap title="Toggle tags">
<Tooltip title="Toggle tags" placement="right">
<IconButton
aria-label="Toggle tags"
onClick={toggleShowTags}
Expand All @@ -55,7 +38,7 @@ export const ToggleTagsButton: React.FC = () => {
>
{showTags ? <LabelIcon /> : <LabelOffIcon />}
</IconButton>
</TooltipWrap>
</Tooltip>
</Box>
);
};
Loading