-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Submissions log styles update #3155
Merged
ianjon3s
merged 4 commits into
jess/submissions-log-v2
from
jess/submissions-log-v2--tidy
May 16, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ import KeyboardArrowDown from "@mui/icons-material/KeyboardArrowDown"; | |
import KeyboardArrowUp from "@mui/icons-material/KeyboardArrowUp"; | ||
import Payment from "@mui/icons-material/Payment"; | ||
import Send from "@mui/icons-material/Send"; | ||
import Avatar from "@mui/material/Avatar"; | ||
import Box from "@mui/material/Box"; | ||
import Chip from "@mui/material/Chip"; | ||
import Collapse from "@mui/material/Collapse"; | ||
import IconButton from "@mui/material/IconButton"; | ||
import { styled } from "@mui/material/styles"; | ||
|
@@ -54,19 +54,22 @@ const EventsLog: React.FC<GetSubmissionsResponse> = ({ | |
|
||
return ( | ||
<TableContainer> | ||
<Table> | ||
<Table sx={{ tableLayout: "fixed" }}> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell sx={{ width: 300 }}> | ||
<TableCell sx={{ width: 240 }}> | ||
<strong>Event</strong> | ||
</TableCell> | ||
<TableCell sx={{ width: 200 }}> | ||
<TableCell sx={{ width: 110 }}> | ||
<strong>Status</strong> | ||
</TableCell> | ||
<TableCell sx={{ width: 120 }}> | ||
<strong>Date</strong> | ||
</TableCell> | ||
<TableCell> | ||
<TableCell sx={{ width: 380 }}> | ||
<strong>Session ID</strong> | ||
</TableCell> | ||
<TableCell></TableCell> | ||
<TableCell sx={{ width: 60 }}></TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
|
@@ -85,30 +88,26 @@ const CollapsibleRow: React.FC<Submission> = (submission) => { | |
return ( | ||
<React.Fragment key={submission.eventId}> | ||
<TableRow sx={{ "& > *": { borderBottom: "unset" } }}> | ||
<TableCell | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
}} | ||
> | ||
<Avatar | ||
<TableCell> | ||
<Box | ||
sx={{ | ||
background: "none", | ||
marginRight: (theme) => theme.spacing(1), | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
}} | ||
> | ||
{submission.eventType === "Pay" ? ( | ||
<Payment | ||
color={submission.status === "Success" ? "success" : "error"} | ||
/> | ||
) : ( | ||
<Send | ||
color={submission.status === "Success" ? "success" : "error"} | ||
/> | ||
)} | ||
</Avatar> | ||
{submission.eventType} | ||
{submission.eventType === "Pay" ? <Payment /> : <Send />} | ||
<Typography variant="body2" ml={1}> | ||
{submission.eventType} | ||
</Typography> | ||
</Box> | ||
</TableCell> | ||
<TableCell> | ||
{submission.status === "Success" ? ( | ||
<Chip label="Success" size="small" color="success" /> | ||
) : ( | ||
<Chip label="Error" size="small" color="error" /> | ||
)} | ||
</TableCell> | ||
<TableCell> | ||
{format(new Date(submission.createdAt), "dd/MM/yy hh:mm:ss")} | ||
|
@@ -125,8 +124,17 @@ const CollapsibleRow: React.FC<Submission> = (submission) => { | |
</TableCell> | ||
</TableRow> | ||
<TableRow sx={{ background: (theme) => theme.palette.background.paper }}> | ||
<TableCell sx={{ paddingBottom: 0, paddingTop: 0 }} colSpan={4}> | ||
<Collapse in={open} timeout="auto" unmountOnExit> | ||
<TableCell sx={{ padding: 0, border: "none" }} colSpan={5}> | ||
<Collapse | ||
in={open} | ||
timeout="auto" | ||
unmountOnExit | ||
sx={{ | ||
borderBottom: (theme) => | ||
`1px solid ${theme.palette.border.light}`, | ||
padding: (theme) => theme.spacing(0, 1.5), | ||
}} | ||
> | ||
<FormattedResponse {...submission} /> | ||
</Collapse> | ||
</TableCell> | ||
|
@@ -153,6 +161,7 @@ const FormattedResponse: React.FC<Submission> = (submission) => { | |
margin: 1, | ||
maxWidth: "contentWrap", | ||
overflowWrap: "break-word", | ||
whiteSpace: "pre-wrap", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👀 💡 thank you!! |
||
}} | ||
> | ||
{submission.status === "Success" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'm not sure I'm sold on the double icon, it feels quite awkward to me.
If success/failure isn't actually clear enough by red/green color of
eventType
icon alone would it be better to just add a column to the table where we print the actual value ofsubmission.status
- eg "Success" or "Failed (XXX)"? Would have additional benefit of providing additional context of status code on fail? Could use red/green coloured chips to emphasize or just plain text?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eg columns: "Event", "Status", "Date", "Session ID" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ideas, I've updated