-
Notifications
You must be signed in to change notification settings - Fork 3
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(LogSheet): Update UI of log download links #670
Conversation
ce8d2a8
to
97ea84c
Compare
dashboard/src/lib/string.ts
Outdated
const protocolRe = /^\w+:\/\//; | ||
const searchParamsRe = /\?.*$/; |
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.
const protocolRe = /^\w+:\/\//; | |
const searchParamsRe = /\?.*$/; | |
const protocolRegex = /^\w+:\/\//; | |
const searchParamsRegex = /\?.*$/; |
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.
Done
let replacedUrl = url.replace(protocolRe, ''); | ||
replacedUrl = replacedUrl.replace(searchParamsRe, ''); | ||
const splittedUrl = replacedUrl.split('/'); | ||
const hostname = splittedUrl[0]; |
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.
const hostname = splittedUrl[0]; | |
const hostname = splittedUrl[0] ?? ''; |
typescript strict mode doesn't check array index
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.
I'm checking for undefined below
@@ -202,7 +205,7 @@ export const LogSheet = ({ | |||
skeletonClassname="h-[3rem]" | |||
customError={ | |||
<div className="p-4 text-center"> | |||
This log url is not supported in the log viewer yet | |||
You can download your logs here |
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.
I now this wasn't on a message but please put this on a message
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.
Completely forgot it, you are right
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.
Looks good, just some minor pointers
97ea84c
to
f42d3d6
Compare
dashboard/src/lib/string.ts
Outdated
let replacedUrl = url.replace(protocolRegex, ''); | ||
replacedUrl = replacedUrl.replace(searchParamsRegex, ''); |
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.
let replacedUrl = url.replace(protocolRegex, ''); | |
replacedUrl = replacedUrl.replace(searchParamsRegex, ''); | |
let replacedUrl = url.replace(protocolRegex, '').replace(searchParamsRegex, ''); |
@@ -202,7 +205,7 @@ export const LogSheet = ({ | |||
skeletonClassname="h-[3rem]" | |||
customError={ | |||
<div className="p-4 text-center"> | |||
This log url is not supported in the log viewer yet | |||
<FormattedMessage id="logSheet.logQueryCustomError" /> |
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.
This message is for the log downloader, I don't think we should change it to a download info here; maybe change it above in the place of "Index of"
20b3d45
to
38f4d90
Compare
- Added a new function `truncateUrl` used to truncate the URL in the log viewer - Changed the title of the download log table to "Full logs" - Changed the messaged of the QuerySwitcher to "Download your logs here" - Changed the style of the log links, making their font size greater and their color blue with an underline hover effect Closes #655
38f4d90
to
a73b1a1
Compare
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.
Looks great
truncateUrl
used to truncate the URL in the log viewerCloses #655
Visual Reference
Before
After