Skip to content

Commit

Permalink
move retry to event title
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed May 16, 2024
1 parent b925a59 commit 10236d2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
4 changes: 3 additions & 1 deletion api.planx.uk/modules/send/email/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ describe(`sending an application by email to a planning office`, () => {
.expect(200)
.then((res) => {
expect(res.body).toEqual({
message: 'Successfully sent "Submit" email',
message: `Successfully sent to email`,
inbox: "[email protected]",
govuk_notify_template: "Submit",
});
});
});
Expand Down
4 changes: 3 additions & 1 deletion api.planx.uk/modules/send/email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export async function sendToEmail(
);

return res.status(200).send({
message: `Successfully sent "Submit" email`,
message: `Successfully sent to email`,
inbox: sendToEmail,
govuk_notify_template: "Submit",
});
} catch (error) {
return next({
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/modules/send/s3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function sendToS3(
if (!powerAutomateWebhookURL || !powerAutomateAPIKey) {
return next({
status: 400,
message: `Send to S3 is not enabled for this local authority (${localAuthority})`,
message: `Upload to S3 is not enabled for this local authority (${localAuthority})`,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ const EventsLog: React.FC<GetSubmissionsResponse> = ({
<Table sx={{ tableLayout: "fixed" }}>
<TableHead>
<TableRow>
<TableCell sx={{ width: 240 }}>
<TableCell sx={{ width: 250 }}>
<strong>Event</strong>
</TableCell>
<TableCell sx={{ width: 130 }}>
<strong>Status</strong>
</TableCell>
<TableCell sx={{ width: 130 }}>
<TableCell sx={{ width: 120 }}>
<strong>Date</strong>
</TableCell>
<TableCell sx={{ width: 350 }}>
Expand All @@ -81,8 +81,8 @@ const EventsLog: React.FC<GetSubmissionsResponse> = ({
</TableRow>
</TableHead>
<TableBody>
{submissions.map((submission) => (
<CollapsibleRow {...submission} />
{submissions.map((submission, i) => (
<CollapsibleRow {...submission} key={i} />
))}
</TableBody>
</Table>
Expand All @@ -94,7 +94,7 @@ const CollapsibleRow: React.FC<Submission> = (submission) => {
const [open, setOpen] = useState<boolean>(false);

return (
<React.Fragment key={submission.eventId}>
<React.Fragment key={`${submission.eventId}-${submission.createdAt}`}>
<TableRow sx={{ "& > *": { borderBottom: "unset" } }}>
<TableCell>
<Box
Expand All @@ -106,7 +106,7 @@ const CollapsibleRow: React.FC<Submission> = (submission) => {
>
{submission.eventType === "Pay" ? <Payment /> : <Send />}
<Typography variant="body2" ml={1}>
{submission.eventType}
{submission.eventType} {submission.retry && ` [Retry]`}
</Typography>
</Box>
</TableCell>
Expand All @@ -116,13 +116,6 @@ const CollapsibleRow: React.FC<Submission> = (submission) => {
) : (
<Chip label={submission.status} size="small" color="error" />
)}
{submission.retry && (
<Chip
label="Retry"
size="small"
sx={{ marginTop: 0.5, background: "#ddd" }}
/>
)}
</TableCell>
<TableCell>
{format(new Date(submission.createdAt), "dd/MM/yy hh:mm:ss")}
Expand Down

0 comments on commit 10236d2

Please sign in to comment.