Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add update user roles action#1361

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 18 commits intomainfrombq/fe/update-user-roles-action
May 10, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma commentedMay 10, 2022
edited
Loading

Closes#739

@BrunoQuaresmaBrunoQuaresma self-assigned thisMay 10, 2022
@BrunoQuaresmaBrunoQuaresma requested a review froma team as acode ownerMay 10, 2022 14:27
@codecov
Copy link

codecovbot commentedMay 10, 2022
edited
Loading

Codecov Report

Merging#1361 (9bd6ca5) intomain (e54324d) willincrease coverage by0.46%.
The diff coverage is88.63%.

@@            Coverage Diff             @@##             main    #1361      +/-   ##==========================================+ Coverage   66.49%   66.95%   +0.46%==========================================  Files         284      286       +2       Lines       18593    18752     +159       Branches      235      241       +6     ==========================================+ Hits        12363    12555     +192+ Misses       4964     4913      -51- Partials     1266     1284      +18
FlagCoverage Δ
unittest-go-macos-latest?
unittest-go-postgres-65.47% <ø> (+0.33%)⬆️
unittest-go-ubuntu-latest56.44% <ø> (+0.32%)⬆️
unittest-go-windows-202252.40% <ø> (+0.33%)⬆️
unittest-js74.24% <88.63%> (+0.56%)⬆️
Impacted FilesCoverage Δ
site/src/api/index.ts70.00% <57.14%> (-1.24%)⬇️
site/src/xServices/users/usersXService.ts72.91% <66.66%> (-2.09%)⬇️
site/src/xServices/roles/siteRolesXService.ts80.00% <80.00%> (ø)
site/src/components/UsersTable/UsersTable.tsx96.00% <94.73%> (-4.00%)⬇️
site/src/components/RoleSelect/RoleSelect.tsx100.00% <100.00%> (ø)
site/src/components/TableHeaders/TableHeaders.tsx91.66% <100.00%> (-8.34%)⬇️
site/src/pages/UsersPage/UsersPage.tsx86.84% <100.00%> (+10.98%)⬆️
site/src/pages/UsersPage/UsersPageView.tsx94.44% <100.00%> (+1.11%)⬆️
site/src/testHelpers/entities.ts100.00% <100.00%> (ø)
site/src/testHelpers/handlers.ts60.00% <100.00%> (+2.10%)⬆️
... and50 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatee54324d...9bd6ca5. Read thecomment docs.

BrunoQuaresmaand others added2 commitsMay 10, 2022 13:32
Co-authored-by: Presley Pizzo <1290996+presleyp@users.noreply.github.com>
Co-authored-by: Presley Pizzo <1290996+presleyp@users.noreply.github.com>
Copy link
Contributor

@presleyppresleyp left a comment

Choose a reason for hiding this comment

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

My brain is a little fried so I'm not looking as deeply at the XService as normal but this all looks good to me. I just have a question about youruseRoles hook - if it's taking effect at the same time as the otheruseEffect seems like we could put them together. If not then maybe the other one (that I wrote) has a bug.

Co-authored-by: Presley Pizzo <1290996+presleyp@users.noreply.github.com>
@BrunoQuaresma
Copy link
CollaboratorAuthor

@presleyp thanks for the review.

About theuseRoles hook. When I have to use an effect + state I like to encapsulate these into a hook, so I can make more explicit what I want to do with them and how they are connected. This article explains some pros of this "pattern" if you are interestedhttps://kyleshevlin.com/use-encapsulation

@presleyp
Copy link
Contributor

@BrunoQuaresma yeah, I think that's a strategy for addressing the thing that bothers me aboutuseEffect, which is that it's hard to tell over time what it's meant to do and when it's expected to run. Even with the custom hook, I think it would be helpful to add a comment that send never changes so this should only run on mount.

BrunoQuaresma reacted with thumbs up emoji

@BrunoQuaresmaBrunoQuaresmaenabled auto-merge (squash)May 10, 2022 19:05
@BrunoQuaresmaBrunoQuaresma merged commit2df92e6 intomainMay 10, 2022
@BrunoQuaresmaBrunoQuaresma deleted the bq/fe/update-user-roles-action branchMay 10, 2022 19:13
@@ -0,0 +1,24 @@
import { ComponentMeta, Story } from "@storybook/react"
import React from "react"
Copy link
Member

Choose a reason for hiding this comment

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

@BrunoQuaresma Just looking at merged PRs to learn - no action necessary here. Curious if there's a reason we're importing React given we're on version 17 instead ofsilencing the 'React must be in scope' warnings.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Good question, I think it is automatically added by an eslint role, but I'm not 100% sure.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Kira-PilotKira-PilotKira-Pilot left review comments

@presleyppresleyppresleyp approved these changes

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

Frontend User Update - Role
4 participants
@BrunoQuaresma@presleyp@Kira-Pilot@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp