-
Notifications
You must be signed in to change notification settings - Fork 24
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
Added members to admin team page #6915
Conversation
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.
Works well 👍 The next step would probably be to allow adding a user to a team from that page, too. But obviously not a blocker. See my one suggestion about DRYing things a bit, though.
const tags = user.isAdmin | ||
? [["Admin - Access to all Teams", "red"]] | ||
: user.teams | ||
.filter((team) => team.id === highlightedTeam.id) | ||
.map((team) => { | ||
const roleName = team.isTeamManager ? "Team Manager" : "Member"; | ||
return [`${roleName}`, stringToColor(roleName)]; | ||
}); | ||
|
||
return tags.map(([text, color]) => ( | ||
<Tag key={`${text}_${user.id}`} color={color} style={{ marginBottom: 4 }}> | ||
{text} | ||
</Tag> | ||
)); |
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.
could you DRY this with the corresponding code in the user_list_view?
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.
That was my first thought too. But there are slight differences. On this page, the Dataset Manager
role is ignored/not display as it has no meaning for Teams. Also the the team name is also no part of the Tag, e.g. Member
vs Default - Member
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.
I see. How about moving the similar functions into the same module (could be either the team list view or user list view) so that they are next to each other? I think, it's better to keep them together, so that the chance of divergence is reduced.
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.
I move both render methods into one file. Please see commit c0546d3
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.
great 👍 feel free to merge.
…to team_members * 'team_members' of github.com:scalableminds/webknossos:
…x_login_styles * 'master' of github.com:scalableminds/webknossos: Added members to admin team page (#6915)
…pdown-menu * 'master' of github.com:scalableminds/webknossos: Fix download button for annotations when tiff export is disabled (#6931) Update PULL_REQUEST_TEMPLATE.md Prepare multi modality support (#6748) Improvements for terms-of-services modal (#6930) Fix creating task types with preferred mode (#6928) Fix styling for login pages for dark mode users (#6916) Added members to admin team page (#6915) Release 23.03.1 (#6917) Redesign Welcome UI (#6904) Fix race condition which could disable saving (#6914)
A quick PR to add the list of all team members to each team on the respective admin page. In a way it is the same information as in the user list just transposed.
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)