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

Merged
merged 2 commits into from
Nov 21, 2023
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
1 change: 1 addition & 0 deletions api.planx.uk/modules/send/utils/exportZip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jest.mock("fs", () => ({
existsSync: () => true,
unlinkSync: () => undefined,
createWriteStream: () => undefined,
writeFileSync: () => undefined,
rmSync: () => undefined,
}));

Expand Down
4 changes: 3 additions & 1 deletion api.planx.uk/modules/send/utils/exportZip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ export class ExportZip {
throw new Error("file not found");
}
const filePath = path.join(this.tmpDir, name);
this.zip.addFile(filePath, body as Buffer);
fs.writeFileSync(filePath, body as Buffer);
this.zip.addLocalFile(filePath);
fs.unlinkSync(filePath);
}

toBuffer(): Buffer {
Expand Down
7 changes: 6 additions & 1 deletion editor.planx.uk/src/@planx/components/Calculate/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import { TYPES } from "@planx/components/types";
import {
EditorProps,
Expand Down Expand Up @@ -69,7 +70,11 @@ export default function Component(props: Props) {
return (
<form onSubmit={formik.handleSubmit} id="modal">
<ModalSection>
<ModalSectionContent title="Calculate" Icon={ICONS[TYPES.Calculate]} />
<ModalSectionContent title="Calculate" Icon={ICONS[TYPES.Calculate]}>
<Typography variant="body2">
This component does math! Write formulas using <a href="https://mathjs.org/index.html" target="_blank">Math.js</a>, omitting the <code>math.</code> prefix
</Typography>
</ModalSectionContent>
<ModalSectionContent title="Output">
<InputRow>
<Input
Expand Down
Loading