-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow project search on admin dashboard #7882
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7882 +/- ##
==========================================
- Coverage 11.46% 10.20% -1.27%
==========================================
Files 20 18 -2
Lines 1177 1009 -168
==========================================
- Hits 135 103 -32
+ Misses 1039 905 -134
+ Partials 3 1 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
c83e9db
to
2596c2f
Compare
/werft run 👍 started the job as gitpod-build-laushinka-search-project-7636.39 |
/werft run 👍 started the job as gitpod-build-laushinka-search-project-7636.40 |
2596c2f
to
b07d844
Compare
74d0ba3
to
a5bbd44
Compare
af433c5
to
8226f87
Compare
@AlexTugarev I requested your review because we talked re the Prebuilds component already, so I thought it would make sense. But feel free to let me know in case your plate is full and I'll assign someone else 🤗 |
Looking at UX changes in this now! 👀 |
Trying out the project search I noticed that the state of the search input is lost when I click through to a project detail and then go back to the project list using the back button. This is a bit confusing because searching with no input the first time, returns a full list, but clicking the search button again after coming back from a project detail, appears to do nothing (the previous list remains unchanged). |
Q: Were you able validate that project searches won't trigger a full DB table scan (or if they do, it's ok when that happens)? |
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 looks really good - thanks @laushinka
I left 1 comment about search state on back-button, and a question about DB table scans.
I created an index for the cloneUrl so it shouldn't do a full table scan. |
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.
Thanks for adding this, @laushinka! 🔮
Left below some non-blocking comments about UX changes.
I also agree with @jldec's comment in #7636 (comment) about merging the first iteration of this without further changes. ✔️
Approving to unblock merging but holding in case someone from the team could take a closer look at the code changes. 🏀
/hold
</ItemField> | ||
</Item>)} | ||
</ItemsList> | ||
{(!isLoadingPrebuilds && prebuilds.length === 0 && props.isAdminDashboard) && | ||
<div className="mt-3">No prebuilds triggered yet.</div>} |
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.
praise: Thanks for including an empty state here, @laushinka! 🌟
<div className="flex flex-col w-4/12 truncate"> | ||
<div className="font-medium text-gray-800 dark:text-gray-100 truncate hover:text-blue-600 dark:hover:text-blue-400">{p.project.name}</div> | ||
</div> | ||
<div className="flex flex-col w-6/12 self-center truncate"> |
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.
praise: Thanks for adding all the truncation classes here! 💯
<Link key={'pr-' + p.project.name} to={'/admin/projects/' + p.project.id} data-analytics='{"button_type":"sidebar_menu"}'> | ||
<div className="rounded-xl whitespace-nowrap flex py-6 px-6 w-full justify-between hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gitpod-kumquat-light group"> | ||
<div className="flex flex-col w-4/12 truncate"> | ||
<div className="font-medium text-gray-800 dark:text-gray-100 truncate hover:text-blue-600 dark:hover:text-blue-400">{p.project.name}</div> |
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: Since this was also discussed for the upcoming new workspace input modal (#7715), we could re-use the same pattern which is non-existing yet to include a small indicator on hover that describes the action of the single-click open (see screenshot below). However, feel free to ignore this comment for now, bringing this up for visibility and future iterations.
Open workspace | View project |
---|---|
@@ -170,7 +188,7 @@ export default function () { | |||
<div className="py-3 pl-3"> | |||
<DropDown prefix="Prebuild Status: " contextMenuWidth="w-32" entries={statusFilterEntries()} /> | |||
</div> | |||
{(!isLoadingPrebuilds && prebuilds.length === 0) && | |||
{(!isLoadingPrebuilds && prebuilds.length === 0 && !props.isAdminDashboard) && |
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.
praise: Nice catch! I was just about to check this out. ⚾
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.
Ended up removing this check to also handle #5022.
<path fillRule="evenodd" clipRule="evenodd" d="M6 2a4 4 0 100 8 4 4 0 000-8zM0 6a6 6 0 1110.89 3.477l4.817 4.816a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 010 6z" fill="#A8A29E" /> | ||
</svg> | ||
</div> | ||
<input type="search" placeholder="Search Projects" onKeyDown={(k) => k.key === 'Enter' && search()} onChange={(v) => { setSearchTerm(v.target.value) }} /> |
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.
issue(non-blocking): The issue about state handling that @jldec mentioned in #7882 (comment) is valid but also visible when searching users or workspaces. If this is an online-fix let's include it here but probably not worth blocking this PR as it seems to be out of the scope of the changes 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.
ok - agree.
848e55c
to
2e13b83
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.
Thanks for the update, @laushinka! 🔮
UX LGTM. ✔️
Left some minor comments for the visuals. Feel free to ignore these if needed. ➿
</div> | ||
<div className="flex w-full mt-6"> | ||
<Property name="Incremental Prebuilds">{props.project.settings?.useIncrementalPrebuilds ? "Yes" : "No"}</Property> | ||
<Property name="Marked Deleted" >{props.project.markedDeleted ? "Yes" : "No"}</Property> |
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.
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.
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.
The extra padding shows up because of the missing third child element, right? Going through the code, I think we could simply drop the left padding, use right padding, and use it only for the values, which may overflow in workspace detail page, with almost no side effect in the final rendering. What do you think, @laushinka?
Here's a patch that could help:
diff --git a/components/dashboard/src/admin/ProjectDetail.tsx b/components/dashboard/src/admin/ProjectDetail.tsx
index 7c86c908..5066e041 100644
--- a/components/dashboard/src/admin/ProjectDetail.tsx
+++ b/components/dashboard/src/admin/ProjectDetail.tsx
@@ -18,7 +18,7 @@ export default function ProjectDetail(props: { project: Project, owner: string |
<p>{props.project.cloneUrl}</p>
</div>
</div>
- <div className="flex flex-col w-full -ml-3">
+ <div className="flex flex-col w-full">
<div className="flex w-full mt-6">
<Property name="Created">{moment(props.project.creationTime).format('MMM D, YYYY')}</Property>
<Property name="Repository"><a className="text-blue-400 dark:text-blue-600 hover:text-blue-600 dark:hover:text-blue-400 truncate" href={props.project.cloneUrl}>{props.project.name}</a></Property>
diff --git a/components/dashboard/src/admin/Property.tsx b/components/dashboard/src/admin/Property.tsx
index 6c68a442..ed29f000 100644
--- a/components/dashboard/src/admin/Property.tsx
+++ b/components/dashboard/src/admin/Property.tsx
@@ -7,11 +7,11 @@
import { ReactChild } from 'react';
function Property(p: { name: string, children: string | ReactChild, actions?: { label: string, onClick: () => void }[] }) {
- return <div className="ml-3 flex flex-col w-4/12 truncate">
+ return <div className="flex flex-col w-4/12 truncate">
<div className="text-base text-gray-500 truncate">
{p.name}
</div>
- <div className="text-lg text-gray-600 font-semibold truncate">
+ <div className="mr-3 text-lg text-gray-600 font-semibold truncate">
{p.children}
</div>
{(p.actions || []).map(a =>
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.
Sorry I think your comment came at the same time as the merging! Will do this as a drive-by in the next admin ticket 🙏🏽
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.
Thanks, @laushinka! Took a bias-for-action and opened #7960 for this minor fix.
2e13b83
to
3863d01
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.
Very nice work - I like this.
<path fillRule="evenodd" clipRule="evenodd" d="M6 2a4 4 0 100 8 4 4 0 000-8zM0 6a6 6 0 1110.89 3.477l4.817 4.816a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 010 6z" fill="#A8A29E" /> | ||
</svg> | ||
</div> | ||
<input type="search" placeholder="Search Projects" onKeyDown={(k) => k.key === 'Enter' && search()} onChange={(v) => { setSearchTerm(v.target.value) }} /> |
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.
ok - agree.
LGTM label has been added. Git tree hash: ea92d1cd6ef722adc601143a1a34ac73dcf73332
|
@gtsiolis I think this is ready to merge. |
@jldec I think you can remove the hold if you want. I haven't had any devs look at the code though. Maybe I'll ping @JanKoehnlein for a look if the others are busy? |
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.
@laushinka I've left one last minor comment regarding UX.
Other than that, UX looks good to merge. 🏁
I'd suggest to get at least one pair of eyes on the code changes before releasing the hold.
Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
LGTM |
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.
LGTM
LGTM label has been added. Git tree hash: f44654c76a2dc080c1977a892f947ab687ac7561
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JanKoehnlein, jldec Associated issue: #7636 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Related Issue(s)
Fixes #7636 and fixes #5022
How to test
Release Notes
Documentation