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

feat(ui): logs search mvp #2106

Merged
merged 27 commits into from May 13, 2024
Merged

feat(ui): logs search mvp #2106

merged 27 commits into from May 13, 2024

Conversation

bodinsamuel
Copy link
Contributor

@bodinsamuel bodinsamuel commented May 6, 2024

Describe your changes

Contributes to NAN-908

  • Implement v0 of the UI
    It has listing and filtering on status. It's already huge (thanks react), so I don't want to commit to much and quickly this reviewed so I can add more stuff. I commented a few incomplete stuff.

http://localhost:3000/dev/logs

Screenshot 2024-05-10 at 16 14 41

@bodinsamuel bodinsamuel self-assigned this May 6, 2024
Base automatically changed from feat/logs-api-proto to master May 10, 2024 13:09
Copy link

gitguardian bot commented May 10, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10531125 Triggered Username Password 30e760b packages/logs/lib/es/client.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@bodinsamuel bodinsamuel changed the title feat(ui): logs search v2 feat(ui): logs search mvp May 10, 2024
})
}}
>
<MantineProvider theme={theme}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially started using Mantine for the new components so I upgraded it, but Radix was also already used and some stuff were missing/less convenient in Mantine

@@ -0,0 +1,45 @@
export const Show: React.FC = () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temp integration

@bodinsamuel bodinsamuel marked this pull request as ready for review May 10, 2024 14:35
Copy link
Collaborator

@TBonnin TBonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am probably underqualified to review React code. 😆 I'll let Khaliq approve it. Made a small comment

@@ -146,6 +146,27 @@ export function formatDateToUSFormat(dateString: string): string {
return formattedDate;
}

export function formatDateToIntFormat(dateString: string): string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick:
formatDateToIntlFormat maybe with a L. At first at read it as To Integer Format
or maybe something like

const Intl = {
    formatDate: (dateString: string): String { ...}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, I knew it was bad when writing it :D

@bodinsamuel
Copy link
Contributor Author

I am probably underqualified to review React code. 😆 I'll let Khaliq approve it. Made a small comment

Since he is a bit off in the next days, I'll appreciate an approval anyway ahah

@bodinsamuel
Copy link
Contributor Author

Thanks (just to be clear I didn't meant to request a blind approval :D)

@bodinsamuel bodinsamuel merged commit 94bb80b into master May 13, 2024
19 checks passed
@bodinsamuel bodinsamuel deleted the feat/logs-v2-ui branch May 13, 2024 14:16
Copy link

linear bot commented May 13, 2024

if (error) {
return (
<DashboardLayout selectedItem={LeftNavBarItems.Logs} marginBottom={60}>
<Info color={error.error.code === 'feature_disabled' ? 'orange' : 'red'} classNames="text-xs" size={20}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text is super small -- haven't checked the design but based on the app relative to everything else it seems too small IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes agreed, I have already mentioned that to Gabrielle


<div className="flex flex-col border border-zinc-500 rounded items-center text-white text-center py-24 gap-2">
<h2 className="text-xl">You don&apos;t have logs yet.</h2>
<div className="text-sm text-zinc-400">Note that logs older than 15days are automatically cleared.</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space between 15 and days


export const OperationRow: React.FC<{ row: Row<SearchLogsData> }> = ({ row }) => {
return (
<Drawer direction="right" snapPoints={['1034px']} handleOnly={true} noBodyStyles={true}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1034 is a new width? Should this be a const? Again, haven't checked designs so not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the only to get a fixed drawer unfortunately, probably should be a const yes

export const StatusTag: React.FC<{ state: SearchLogsData['state'] }> = ({ state }) => {
if (state === 'success') {
return (
<div className="inline-flex px-1 pt-[1px] bg-state-green-900 bg-opacity-30 rounded">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this pt when nothing else is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed thanks

@@ -30,6 +31,9 @@ module.exports = {
'dark-700': '#18181B',
'dark-800': '#09090B',
'bg-dark-blue': '#182633',
'state-green-900': '#84D65A',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does state green mean and why is 400 the same as 900?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lack of better word, it's used for the state (status) of logs.
good catch on 400 thx

@@ -30,6 +31,9 @@ module.exports = {
'dark-700': '#18181B',
'dark-800': '#09090B',
'bg-dark-blue': '#182633',
'state-green-900': '#84D65A',
'state-green-400': '#84D65A',
'row-hover': '#0d0d14',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

row-hover seems very generic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I lacked imagination happy to change if you have something. It's for the hover of table's row

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants