-
Notifications
You must be signed in to change notification settings - Fork 888
feat(site): add new filter to audit logs #7878
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
Conversation
value, | ||
id: "owner", | ||
getSelectedOption: async () => { | ||
const usersRes = await getUsers({ q: value, limit: 1 }) |
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.
We call getUsers
here, and also on line 48. Curious why we can't just make one call to grab all users and then filter on the user we want for getSelectedOption
.
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.
Good question, let's say we have a user called Wesley, Wesley is probably one of the last users to be queried in the database, so when we display the autocomplete options for the users, maybe Wesley is not shown because we only show the first 25 results. So making a separate query to get the selected value, in this case Wesley, is safer and we can be sure we are going to find it.
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.
Gotcha, thanks for explaining!
|
||
if (type === "workspace_build") { | ||
label = "Workspace Build" | ||
} |
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 is fine! We could probably shorten with a map if we wanted to, but not a blocker.
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.
Yeah, I just went to what Copilot suggested to me 😆 since this is not complex code I think it is ok to let to refactor this if we need to extract it into a function to be reused anywhere else.
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.
Nice work!
Screen.Recording.2023-06-06.at.15.46.06.mov