Skip to content
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

Mark owner in user list #6832

Merged
merged 5 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released

### Added
- Remote datasets can now also be streamed from Google Cloud Storage URIs (`gs://`). [#6775](https://github.com/scalableminds/webknossos/pull/6775)
- Highlight 'organization owner' in Admin>User page. [#6832](https://github.com/scalableminds/webknossos/pull/6832)

### Changed
- Limit paid team sharing features to respective organization plans. [#6767](https://github.com/scalableminds/webknossos/pull/6776)
Expand Down
52 changes: 22 additions & 30 deletions frontend/javascripts/admin/user/user_list_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class UserListView extends React.PureComponent<Props, State> {
title="Email"
dataIndex="email"
key="email"
width={350}
width={320}
Copy link
Member Author

@hotzenklotz hotzenklotz Feb 8, 2023

Choose a reason for hiding this comment

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

The user list is slightly too wide on a 15" screen and causes scrollbars to appear. Slightly making the default width of the email column smaller fits the table inside the available screen space

sorter={Utils.localeCompareBy(typeHint, (user) => user.email)}
render={(__, user: APIUser) =>
this.props.activeUser.isAdmin ? (
Expand Down Expand Up @@ -545,35 +545,27 @@ class UserListView extends React.PureComponent<Props, State> {
dataIndex="teams"
key="teams_"
width={250}
render={(teams: Array<APITeamMembership>, user: APIUser) => {
if (user.isAdmin) {
return (
<Tag key={`team_role_${user.id}`} color="red">
Admin - Access to all Teams
</Tag>
);
} else {
const teamTags = user.isDatasetManager
? [
<Tag key={`dataset_manager_${user.id}`} color="geekblue">
Dataset Manager - Edit all Datasets
</Tag>,
]
: [];
return teamTags.concat(
teams.map((team) => {
const roleName = team.isTeamManager ? "Team Manager" : "Member";
return (
<Tag
key={`team_role_${user.id}_${team.id}`}
color={stringToColor(roleName)}
>
{team.name}: {roleName}
</Tag>
);
}),
);
}
render={(_teams: APITeamMembership[], user: APIUser) => {
const tags = [
...(user.isOrganizationOwner ? [["Organization Owner", "cyan"]] : []),
...(user.isAdmin
? [["Admin - Access to all Teams", "red"]]
: [
...(user.isDatasetManager
? [["Dataset Manager - Edit all Datasets", "geekblue"]]
: []),
...user.teams.map((team) => {
const roleName = team.isTeamManager ? "Team Manager" : "Member";
return [`${team.name}: ${roleName}`, stringToColor(roleName)];
}),
]),
];

return tags.map(([text, color]) => (
<Tag key={`${text}_${user.id}`} color={color} style={{ marginBottom: 4 }}>
{text}
</Tag>
));
}}
/>
<Column
Expand Down