Skip to content

feat(site): Add Admin Dropdown menu - #885

Merged
presleyp merged 27 commits into
mainfrom
admin/presleyp/591
Apr 8, 2022
Merged

presleyp merged 27 commits into
mainfrom
admin/presleyp/591

Conversation

@presleyp

@presleyp presleyp commented Apr 6, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #591

  • Adds BorderedMenu, BorderedMenuRow, Typography from v1

  • Adds AdminDropdown, based on v1 ManageDropdown

  • extracts OpenDropdown and CloseDropdown - arrows we can reuse in dropdowns

  • some reorganization of files and storybook

  • stories for BorderedMenu (which includes BorderedMenuRow), Typography, and AdminDropdown

  • test for AdminDropdown - currently just testing links, wrote a ticket to add and test that only admins see it but I don't think we have that capability yet. It's currently guarded by whether you are literally admin@coder.com 😂

  • add AuthAndNav to routes

  • remove Settings? Tyler says to keep it

@presleyp presleyp self-assigned this Apr 6, 2022
@codecov

codecov Bot commented Apr 6, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #885 (1dfb981) into main (4c1ef38) will increase coverage by 0.17%.
The diff coverage is 82.07%.

@@            Coverage Diff             @@
##             main     #885      +/-   ##
==========================================
+ Coverage   65.92%   66.10%   +0.17%     
==========================================
  Files         228      238      +10     
  Lines       14126    14221      +95     
  Branches      105      115      +10     
==========================================
+ Hits         9313     9401      +88     
  Misses       3868     3868              
- Partials      945      952       +7     
Flag Coverage Δ
unittest-go-macos-latest 53.18% <ø> (-0.04%) ⬇️
unittest-go-postgres- 65.82% <ø> (-0.10%) ⬇️
unittest-go-ubuntu-latest 55.74% <ø> (+0.22%) ⬆️
unittest-go-windows-2022 52.53% <ø> (-0.06%) ⬇️
unittest-js 61.56% <82.07%> (+3.31%) ⬆️
Impacted Files Coverage Δ
site/src/AppRouter.tsx 0.00% <0.00%> (ø)
site/src/components/BorderedMenu/BorderedMenu.tsx 100.00% <ø> (ø)
site/src/components/TabPanel/TabSidebar.tsx 0.00% <0.00%> (ø)
site/src/pages/orgs/index.tsx 0.00% <0.00%> (ø)
site/src/pages/settings/index.tsx 0.00% <0.00%> (ø)
site/src/pages/users.tsx 0.00% <0.00%> (ø)
site/src/util/combineClasses.ts 100.00% <ø> (ø)
site/src/components/Navbar/NavbarView/index.tsx 93.33% <80.00%> (ø)
...src/components/BorderedMenuRow/BorderedMenuRow.tsx 88.00% <88.00%> (ø)
site/src/components/Typography/Typography.tsx 90.90% <90.90%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c1ef38...1dfb981. Read the comment docs.

@f0ssel

f0ssel commented Apr 6, 2022

Copy link
Copy Markdown
Member

So far on the backend we've removed a ton of settings in the "Admin UI" in favor of flags on the coder start command. At this time I can't think of any settings we'll need for MVP, so it seems fine to leave it off for now. I know Github Oauth will land on settings, but I think that's officially "not MVP". I think any work toward the page itself is fine, because we will probably need one eventually, but I wouldn't prioritize the work or link to it yet.

@greyscaled

Copy link
Copy Markdown
Contributor

Can you merge latest main into this branch so that we get the Chromatic workflow to run

@presleyp
presleyp marked this pull request as ready for review April 7, 2022 22:56
@presleyp
presleyp requested a review from a team as a code owner April 7, 2022 22:56

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Love seeing all the tests and stories!

@@ -0,0 +1,26 @@
import { fade, makeStyles, Theme } from "@material-ui/core/styles"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like how much more reusable these arrows are now.

path={entry.path}
title={entry.label}
variant="narrow"
onClick={() => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not something we need to address here but just a thought I had. I think all of the dropdown items as they exist in v1 could easily be NavLinks so I wonder if we should remove the ability to pass in an onClick and make path required. Maybe that would promote making sure nav items really are regular anchor-based nav items, too (in v1 trying to open "add organization" in a new tab by middle-mouse clicking for example does nothing because it utilizes onClick for page navigation instead of being a standard <a>).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good idea, can you make a chore ticket for it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will do. 🧹

@code-asher

code-asher commented Apr 8, 2022 •

Copy link
Copy Markdown
Member

remove Settings?

If reaching a decision takes a bit maybe we merge with it in and remove later if necessary (or the other way around works too I suppose).

Comment thread site/src/AppRouter.tsx Resolved
@presleyp
presleyp requested a review from greyscaled April 8, 2022 22:14
@presleyp
presleyp merged commit 3f21ea4 into main Apr 8, 2022
@presleyp
presleyp deleted the admin/presleyp/591 branch April 8, 2022 22:25
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
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.

Nav Bar - Create a view for Admins to see all the users and orgs in their site

5 participants