-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add run details pop out page #1335
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (isFunctionRunStatus(trace.status)) { | ||
if (trace.status === 'CANCELLED') { | ||
text = 'Cancelled'; | ||
} else if (trace.status === 'COMPLETED') { | ||
text = 'Completed'; | ||
} else if (trace.status === 'FAILED') { | ||
text = 'Failed'; | ||
} |
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.
suggestion (non-blocking): Since we're importing a function to check the type then use a switch-like statement to return the text, we could also just put this entire thing into a util fn if we use it in multiple places like: getStatusText(trace.status)
. Also, it would be ideal to check equality against constants and avoid string matching.
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.
Where's a good spot for that? ui/packages/components/src/types/functionRun.ts
doesn't seem right since the user-facing status text is copy and not a type
ended: toMaybeDate(trace.endedAt)?.getTime() ?? null, | ||
max: maxTime.getTime(), | ||
min: minTime.getTime(), | ||
queued: new Date(trace.queuedAt).getTime(), | ||
started: toMaybeDate(trace.startedAt)?.getTime() ?? null, |
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.
Much cleaner!
Description
Add a new
/env/production/runs/[runID]
route that shows the new run details. This will be the "pop out" page where users can look at run details outside of the run list.Testing
Type of change (choose one)
Checklist
Check our Pull Request Guidelines