Repository navigation
Akash/top bar and user page revamp - #75
Conversation
✅ Deploy Preview for juno-dashboard ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile SummaryThis PR modernizes the dashboard UI by adding a top bar with user avatar and logout dropdown, refactoring the sidebar to include branding, and enhancing the users page with a pending account requests section. Major changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
|
|
|
||
| const deleteResult = await deleteAccountRequest(request.id); | ||
| if (!deleteResult.success) { | ||
| console.error(`Failed to delete account request ${request.id}: ${deleteResult.error}`); |
There was a problem hiding this comment.
console.error left in production code - remove or handle differently
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
llam36
left a comment
There was a problem hiding this comment.
Please use react-query instead of plain useEffect to refetch data and trigger re-rendering more cleanly. Also, please use the Skeleton component to make the loading intention more explicit to future developers. Thanks a lot ;))
React-query sample code: https://github.com/GTBitsOfGood/juno-dashboard/blob/main/src/components/fileConfigTable/fileConfig-table.tsx
| {isLoading ? ( | ||
| <div className="divide-y"> | ||
| {[1, 2, 3].map((n) => ( | ||
| <div | ||
| key={n} | ||
| className="flex items-center gap-4 px-6 py-4 animate-pulse" | ||
| > | ||
| <div className="h-9 w-9 rounded-full bg-muted shrink-0" /> | ||
| <div className="flex-1 space-y-2"> | ||
| <div className="h-3 w-32 rounded bg-muted" /> | ||
| <div className="h-3 w-48 rounded bg-muted" /> | ||
| </div> | ||
| <div className="h-6 w-16 rounded bg-muted" /> | ||
| <div className="h-8 w-20 rounded bg-muted" /> | ||
| <div className="h-8 w-20 rounded bg-muted" /> | ||
| </div> | ||
| ))} | ||
| </div> |
There was a problem hiding this comment.
Maybe use shadcn Skeleton component here
| const [requests, setRequests] = useState<AccountRequest[]>([]); | ||
| const [isLoading, setIsLoading] = useState(true); | ||
| const [processingIds, setProcessingIds] = useState<Set<string>>(new Set()); | ||
|
|
||
| useEffect(() => { | ||
| async function fetchRequests() { | ||
| try { | ||
| const result = await getAccountRequests(); | ||
| if (result.success) { | ||
| setRequests(result.requests); | ||
| } else { | ||
| toast.error("Error", { | ||
| description: result.error ?? "Failed to fetch account requests.", | ||
| }); | ||
| } | ||
| } catch (err) { | ||
| console.error("Failed to load account requests:", err); | ||
| toast.error("Error", { | ||
| description: "Failed to load account requests.", | ||
| }); | ||
| } finally { | ||
| setIsLoading(false); | ||
| } | ||
| } | ||
|
|
||
| fetchRequests(); | ||
| }, []); |
There was a problem hiding this comment.
Please use @tanstack/react-query to auto cache fetch results and auto trigger re-rendering after data mutation (see example in src/components/fileConfigTable/fileConfig-table.tsx)
There was a problem hiding this comment.
Please use @tanstack/react-query to auto cache fetch results and auto trigger re-rendering after data mutation (see example in src/components/fileConfigTable/fileConfig-table.tsx). This should help with displaying new users in the table after accepting their request
* added top bar with logo and avatar * modified user table * changed topbar/sidebar styling * added pending accounts request section * Moved account requests to top of page * updated bun lock * fixed lint errors * Update src/components/user-dropdown.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Prettier fix * fix: styling touch up * fix: touch up styling for top and side bar * Added tanstack query for account req and added skeleton components in users page * Fixed prettier * Remove package-lock --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Long Lam <llam36@gatech.edu>
* feat(api-keys): create table to list created keys * feat(api-keys): implement three-card grid layout on api keys page * styles(api-keys): ensure consistency of table with design * feat(api-keys): make api key reveal UI look like editor' * feat(api-keys): reveal api key with mocked data * feat(api-keys): refactor cards to use generic dark-card component * fix: remove redundant ui component dark-card * chore: move reveal card to forms * styles: ensure styling consistency across cards used in juno-dashboard * chore: fix lint errors * chore: fix lint errors * styles: fix code style errors * remove debug statements from actions * styles: align descriptions with column headers * styles: fix code style issues * fix: remove console.error from catch block * fix unused error var * Update src/components/forms/CreateAPIKeyForm.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix: missing curly bracket * fix: touch up styling * Akash/top bar and user page revamp (#75) * added top bar with logo and avatar * modified user table * changed topbar/sidebar styling * added pending accounts request section * Moved account requests to top of page * updated bun lock * fixed lint errors * Update src/components/user-dropdown.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Prettier fix * fix: styling touch up * fix: touch up styling for top and side bar * Added tanstack query for account req and added skeleton components in users page * Fixed prettier * Remove package-lock --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Long Lam <llam36@gatech.edu> * New Request Account and Login Page (#76) * feat: enhance authentication pages for login and account creation with forms and branding * feat: redesign auth pages with seamless split layout and onboarding carousel * fix: format * fix: login styling touch up * fix: request account styling * fix: styling * fix: styling * fix: styling --------- Co-authored-by: Long Lam <llam36@gatech.edu> * fix: styling * fix: update logo * fix: styling * feat(api-keys): implement three-card grid layout on api keys page * fix: dup imports * feat: populate api keys table with data from backend * styles: fix lint errors * fix: styling * feat: edit layout * Davidgu/fetch migration (#78) * Updated imports * Made README better * Apply suggestion from @greptile-apps[bot] Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix: import path --------- Co-authored-by: Long Lam <lamhoanglong.3001@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Long Lam <llam36@gatech.edu> * fix: use juno-sdk 0.0.10 * feat(api-keys): implement three-card grid layout on api keys page * fix: styling * styles: fix lint errors * fix: lint errors * fix: build errors * fix: linter errors * fix: netlify build errors * fix: build errors on local machine * fix: lint and format errors * feat(auth): replace email/password auth with jwt auth * fix: lint errors * styles: make api key layout use same padding as other pages * styles: remove 'Request' from sdk function names * fix: invalid import in usertable * fix: improperly formatted files * chore: fix formatting issues * fix: only reset table row selection after all deletes succeed * fix pagination, clean up formatting, use badge ui for consistency --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Long Lam <llam36@gatech.edu> Co-authored-by: Akash Sarode <akashtechnion@gmail.com> Co-authored-by: Andrey Fernandez <andyfernandeznyc@gmail.com> Co-authored-by: David Gu <68869959+shaply@users.noreply.github.com> Co-authored-by: Long Lam <lamhoanglong.3001@gmail.com> Co-authored-by: aakashg00 <aakashbb@gmail.com>
Added topbar with avatar and logout dropdown and modified sidebar to include logo.
Added account request section and improved user table.
Demo (I realized that i needed the account requests to be on top of the user table, so i changed that after):
akash_ticket_1_demo.mp4