Skip to content

Commit e489f9d

Browse files
Rework organization page (#8679)
This PR refreshes the layout and styling of the organization page to be in inline with the account setting page. <img width="1777" alt="Screenshot 2025-06-16 at 20 21 10" src="https://github.com/user-attachments/assets/bdb4e795-213b-440e-ad45-ffb599569ffb" /> <img width="1777" alt="Screenshot 2025-06-16 at 20 21 16" src="https://github.com/user-attachments/assets/d0cc6991-b581-4877-846b-7a2e23299c76" /> <img width="1777" alt="Screenshot 2025-06-16 at 20 21 25" src="https://github.com/user-attachments/assets/ce8fa335-ab7b-4d7a-b639-672c376b7af1" /> ### URL of deployed dev instance (used for testing): - https://___.webknossos.xyz ### Steps to test: - Make sure to test various orga configs: Basic, Team, Power and variations on too many users, too much storage space, subscription exceeded etc. - Check light/dark mode ### Issues: - related to #8672 ------ (Please delete unneeded items, merge only when none are left open) - [x] Updated [changelog](../blob/master/CHANGELOG.unreleased.md#unreleased) - [ ] Updated [migration guide](../blob/master/MIGRATIONS.unreleased.md#unreleased) if applicable - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [x] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment --------- Co-authored-by: Philipp Otto <philippotto@users.noreply.github.com>
1 parent 511c4fb commit e489f9d

24 files changed

+1248
-590
lines changed

app/controllers/OrganizationController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class OrganizationController @Inject()(
154154
_ <- Fox.fromBool(request.identity.isAdminOf(organization._id)) ?~> "notAllowed" ~> FORBIDDEN
155155
_ <- organizationDAO.updateFields(organization._id, name, newUserMailingList)
156156
updated <- organizationDAO.findOne(organization._id)
157-
organizationJson <- organizationService.publicWrites(updated)
157+
organizationJson <- organizationService.publicWrites(updated, Some(request.identity))
158158
} yield Ok(organizationJson)
159159
}
160160
}

frontend/javascripts/admin/account/account_auth_token_view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getAuthToken, revokeAuthToken } from "admin/rest_api";
33
import { Button, Descriptions, Popover, Spin, Typography } from "antd";
44
import { useWkSelector } from "libs/react_hooks";
55
import { useEffect, useState } from "react";
6-
import { AccountSettingsTitle } from "./account_profile_view";
6+
import { SettingsTitle } from "./helpers/settings_title";
77

88
const { Text } = Typography;
99

@@ -80,7 +80,7 @@ function AccountAuthTokenView() {
8080

8181
return (
8282
<div>
83-
<AccountSettingsTitle
83+
<SettingsTitle
8484
title="API Authorization"
8585
description="Access the WEBKNOSSO Python API with your API token"
8686
/>

frontend/javascripts/admin/account/account_password_view.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useState } from "react";
77
import { type RouteComponentProps, withRouter } from "react-router-dom";
88
import { logoutUserAction } from "viewer/model/actions/user_actions";
99
import Store from "viewer/store";
10-
import { AccountSettingsTitle } from "./account_profile_view";
10+
import { SettingsTitle } from "./helpers/settings_title";
1111
const FormItem = Form.Item;
1212
const { Password } = Input;
1313

@@ -186,7 +186,7 @@ function AccountPasswordView({ history }: Props) {
186186

187187
return (
188188
<div>
189-
<AccountSettingsTitle title="Password" description="Manage and update your password" />
189+
<SettingsTitle title="Password" description="Manage and update your password" />
190190
<Descriptions
191191
column={2}
192192
layout="vertical"
@@ -195,7 +195,7 @@ function AccountPasswordView({ history }: Props) {
195195
style={{ marginBottom: "3rem" }}
196196
/>
197197

198-
<AccountSettingsTitle title="Passkeys" description="Login passwordless with Passkeys" />
198+
<SettingsTitle title="Passkeys" description="Login passwordless with Passkeys" />
199199
<List
200200
className="demo-loadmore-list"
201201
itemLayout="horizontal"

frontend/javascripts/admin/account/account_profile_view.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CheckOutlined, DownOutlined } from "@ant-design/icons";
22
import { updateSelectedThemeOfUser } from "admin/rest_api";
3-
import { Descriptions, Divider, Dropdown, Typography } from "antd";
3+
import { Descriptions, Dropdown } from "antd";
44
import { useWkSelector } from "libs/react_hooks";
55
import * as Utils from "libs/utils";
66
import { getSystemColorTheme } from "theme";
@@ -9,23 +9,7 @@ import { formatUserName } from "viewer/model/accessors/user_accessor";
99
import { setThemeAction } from "viewer/model/actions/ui_actions";
1010
import { setActiveUserAction } from "viewer/model/actions/user_actions";
1111
import Store from "viewer/store";
12-
13-
const { Text } = Typography;
14-
15-
export function AccountSettingsTitle({
16-
title,
17-
description,
18-
}: { title: string; description: string }) {
19-
return (
20-
<div>
21-
<h2 style={{ marginBottom: 0 }}>{title}</h2>
22-
<Text type="secondary" style={{ display: "block" }}>
23-
{description}
24-
</Text>
25-
<Divider style={{ margin: "12px 0 32px 0" }} />
26-
</div>
27-
);
28-
}
12+
import { SettingsTitle } from "./helpers/settings_title";
2913

3014
function AccountProfileView() {
3115
const activeUser = useWkSelector((state) => state.activeUser);
@@ -100,7 +84,7 @@ function AccountProfileView() {
10084

10185
return (
10286
<div>
103-
<AccountSettingsTitle
87+
<SettingsTitle
10488
title="Profile"
10589
description="Manage your personal information and preferences"
10690
/>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { InfoCircleOutlined } from "@ant-design/icons";
2+
import { Card, Flex, Popover, Typography } from "antd";
3+
4+
interface SettingsCardProps {
5+
title: string;
6+
description: React.ReactNode;
7+
explanation?: React.ReactNode;
8+
action?: React.ReactNode;
9+
}
10+
11+
export function SettingsCard({ title, description, explanation, action }: SettingsCardProps) {
12+
return (
13+
<Card style={{ minHeight: 105 }}>
14+
<Typography.Text type="secondary" style={{ fontSize: 14 }}>
15+
<Flex justify="space-between">
16+
<div>
17+
{title}
18+
19+
{explanation != null ? (
20+
<Popover content={explanation}>
21+
<InfoCircleOutlined style={{ marginLeft: 4 }} />
22+
</Popover>
23+
) : null}
24+
</div>
25+
{action}
26+
</Flex>
27+
</Typography.Text>
28+
<div style={{ fontSize: 16, marginTop: 4 }}>{description}</div>
29+
</Card>
30+
);
31+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Divider, Typography } from "antd";
2+
3+
const { Text } = Typography;
4+
5+
export function SettingsTitle({
6+
title,
7+
description,
8+
}: {
9+
title: string;
10+
description: string;
11+
}) {
12+
return (
13+
<div>
14+
<h2 style={{ marginBottom: 0 }}>{title}</h2>
15+
<Text type="secondary" style={{ display: "block" }}>
16+
{description}
17+
</Text>
18+
<Divider style={{ margin: "12px 0 32px 0" }} />
19+
</div>
20+
);
21+
}

0 commit comments

Comments
 (0)