Skip to content

feat: Add user menu on users table #1222

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

Merged
merged 3 commits into from
May 2, 2022
Merged

Conversation

BrunoQuaresma
Copy link
Collaborator

No description provided.

@BrunoQuaresma BrunoQuaresma requested a review from presleyp April 29, 2022 16:59
@BrunoQuaresma BrunoQuaresma self-assigned this Apr 29, 2022
@BrunoQuaresma BrunoQuaresma requested a review from a team as a code owner April 29, 2022 16:59
@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #1222 (1f562a3) into main (365c96c) will increase coverage by 0.14%.
The diff coverage is 84.00%.

@@            Coverage Diff             @@
##             main    #1222      +/-   ##
==========================================
+ Coverage   65.58%   65.73%   +0.14%     
==========================================
  Files         269      272       +3     
  Lines       17337    17791     +454     
  Branches      162      216      +54     
==========================================
+ Hits        11371    11695     +324     
- Misses       4774     4872      +98     
- Partials     1192     1224      +32     
Flag Coverage Δ
unittest-go-macos-latest 53.08% <ø> (+0.26%) ⬆️
unittest-go-postgres- 64.81% <ø> (+0.15%) ⬆️
unittest-go-ubuntu-latest 55.67% <ø> (+0.27%) ⬆️
unittest-go-windows-2022 ?
unittest-js 70.69% <84.00%> (+1.84%) ⬆️
Impacted Files Coverage Δ
site/src/components/TableRowMenu/TableRowMenu.tsx 73.33% <73.33%> (ø)
site/src/components/Table/Table.tsx 100.00% <100.00%> (ø)
site/src/components/TableHeaders/TableHeaders.tsx 100.00% <100.00%> (ø)
site/src/components/UsersTable/UsersTable.tsx 100.00% <100.00%> (ø)
provisionersdk/serve.go 35.13% <0.00%> (-8.11%) ⬇️
site/src/pages/UsersPage/UsersPage.tsx 75.00% <0.00%> (-7.36%) ⬇️
cli/configssh.go 62.04% <0.00%> (-5.87%) ⬇️
pty/ptytest/ptytest.go 86.95% <0.00%> (-4.35%) ⬇️
coderd/userauth.go 54.16% <0.00%> (-4.17%) ⬇️
cli/templateinit.go 58.62% <0.00%> (-3.45%) ⬇️
... and 37 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 365c96c...1f562a3. Read the comment docs.

@@ -16,6 +17,8 @@ export const TableHeaders: React.FC<TableHeadersProps> = ({ columns }) => {
{c}
</TableCell>
))}
{/* 1% is a hack to make the table cell width fits the content */}
{hasMenu && <TableCell width="1%" />}
Copy link
Contributor

@greyscaled greyscaled Apr 29, 2022

Choose a reason for hiding this comment

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

Aside: Added ticket for storybook here: #1224

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we need to have a storybook for each table component, I think one for "Table" is good enough since it will use all the others. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

@BrunoQuaresma In general I agree, but I can think of a reason it might be useful to storybook subcomponents: if they take props that make them render differently, a story for the subcomponent will allow you to play with those props and make different stories for them, whereas it's a little harder to do that in a story for just the composite component.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm... I think that is ok when the component can be used outside of the "main" component but in this case, the TableHeader should be used inside of the Table component and it also does not have states or multiple behaviors 🤔. But I'm ok with doing the storybook for this component, we can discuss it better in a FE Variety meeting.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we decide against it and close the ticket, no harm is done. Wasn't intending to add context or weight here, just noticed it and made a ticket and moved on.

Co-authored-by: G r e y <grey@coder.com>
Copy link
Contributor

@greyscaled greyscaled left a comment

Choose a reason for hiding this comment

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

Approving with the recommendation to unnest UserMenu and add Langauge for the hard-coded Suspend operation ✅

@@ -16,6 +17,8 @@ export const TableHeaders: React.FC<TableHeadersProps> = ({ columns }) => {
{c}
</TableCell>
))}
{/* 1% is a hack to make the table cell width fits the content */}
{hasMenu && <TableCell width="1%" />}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we decide against it and close the ticket, no harm is done. Wasn't intending to add context or weight here, just noticed it and made a ticket and moved on.

@BrunoQuaresma
Copy link
Collaborator Author

@vapurrmaid, not a problem! I assigned all of them to me already.

@BrunoQuaresma BrunoQuaresma enabled auto-merge (squash) May 2, 2022 14:50
@BrunoQuaresma BrunoQuaresma merged commit 7534328 into main May 2, 2022
@BrunoQuaresma BrunoQuaresma deleted the bq/add-action-dropdown branch May 2, 2022 14:58
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
kylecarbs pushed a commit that referenced this pull request Jun 10, 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.

4 participants