Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b13eb03
WIP
hotzenklotz Jun 30, 2025
d15a14b
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jun 30, 2025
81e8ac2
fix loading loop
hotzenklotz Jun 30, 2025
d714bce
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jun 30, 2025
36e3cab
WIP rework dataset settings as individual routes
hotzenklotz Jun 30, 2025
92e78b8
renamed Settingscard props
hotzenklotz Jun 30, 2025
b550de4
WIP restyle the dataset settings form
hotzenklotz Jun 30, 2025
3eecbeb
WIP
hotzenklotz Jun 30, 2025
c9e4ecc
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jun 30, 2025
131598d
WIP
hotzenklotz Jul 1, 2025
63c9131
Merge branch 'functional_dataset_settings' of github.com:scalablemind…
hotzenklotz Jul 11, 2025
fd6f247
add useQuery to fro dataset sharing token
hotzenklotz Jul 11, 2025
b5b2da1
formatting and types
hotzenklotz Jul 11, 2025
14e50ab
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jul 14, 2025
4181f86
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jul 15, 2025
5ed5cc7
fix error indicators
hotzenklotz Jul 15, 2025
da587d5
stuff
hotzenklotz Jul 15, 2025
446695e
extract dataset_add_remote_view sub components into separate files
hotzenklotz Jul 16, 2025
eb64a5e
use form data in case of remote uploads
hotzenklotz Jul 16, 2025
5c61740
sync dataset rotation between JSON and UI
hotzenklotz Jul 16, 2025
cadc4b0
remove sync related stuff from dataset upload view
hotzenklotz Jul 16, 2025
f04e77d
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jul 16, 2025
637c7e0
use dataset name for remote ds
hotzenklotz Jul 16, 2025
eef34b3
use correct import for useWatch
hotzenklotz Jul 16, 2025
2c9e711
changelog
hotzenklotz Jul 16, 2025
a1ccd43
Update frontend/javascripts/dashboard/dataset/dataset_settings_provid…
hotzenklotz Jul 16, 2025
80adef9
apply CodeRabbit feedback
hotzenklotz Jul 16, 2025
6bfad04
Merge branch 'dataset_settings_context' of github.com:scalableminds/w…
hotzenklotz Jul 16, 2025
3c752d8
Merge branch 'functional_dataset_settings' into dataset_settings_context
hotzenklotz Jul 22, 2025
b0e18a1
apply PR feedback
hotzenklotz Jul 22, 2025
a1e04ad
restore color layer ordering
hotzenklotz Jul 22, 2025
5eb1bb3
resolve cyclic dependency
hotzenklotz Jul 22, 2025
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
20 changes: 8 additions & 12 deletions frontend/javascripts/admin/account/account_auth_token_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, Col, Row, Spin, Typography } from "antd";
import { useWkSelector } from "libs/react_hooks";
import Toast from "libs/toast";
import { useEffect, useState } from "react";
import { SettingsCard } from "./helpers/settings_card";
import { SettingsCard, type SettingsCardProps } from "./helpers/settings_card";
import { SettingsTitle } from "./helpers/settings_title";

const { Text } = Typography;
Expand Down Expand Up @@ -41,20 +41,20 @@ function AccountAuthTokenView() {
}
};

const APIitems = [
const APIitems: SettingsCardProps[] = [
{
title: "Auth Token",
value: (
content: (
<Text code copyable>
{currentToken}
</Text>
),
},
{
title: "Token Revocation",
explanation:
tooltip:
"Revoke your token if it has been compromised or if you suspect someone else has gained access to it. This will invalidate all active sessions.",
value: (
content: (
<Button icon={<SwapOutlined />} type="primary" ghost onClick={handleRevokeToken}>
Revoke and Generate New Token
</Button>
Expand All @@ -64,7 +64,7 @@ function AccountAuthTokenView() {
? [
{
title: "Organization ID",
value: (
content: (
<Text code copyable>
{activeUser.organization}
</Text>
Expand All @@ -74,7 +74,7 @@ function AccountAuthTokenView() {
: []),
{
title: "API Documentation",
value: (
content: (
<a href="https://docs.webknossos.org/webknossos-py/index.html">
Read the docs <ExportOutlined />
</a>
Expand All @@ -92,11 +92,7 @@ function AccountAuthTokenView() {
<Row gutter={[24, 24]} style={{ marginBottom: 24 }}>
{APIitems.map((item) => (
<Col span={12} key={item.title}>
<SettingsCard
title={item.title}
description={item.value}
explanation={item.explanation}
/>
<SettingsCard title={item.title} content={item.content} tooltip={item.tooltip} />
</Col>
))}
</Row>
Expand Down
10 changes: 5 additions & 5 deletions frontend/javascripts/admin/account/account_password_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useState } from "react";
import { useNavigate } from "react-router-dom";
import { logoutUserAction } from "viewer/model/actions/user_actions";
import Store from "viewer/store";
import { SettingsCard } from "./helpers/settings_card";
import { SettingsCard, type SettingsCardProps } from "./helpers/settings_card";
import { SettingsTitle } from "./helpers/settings_title";
const FormItem = Form.Item;
const { Password } = Input;
Expand Down Expand Up @@ -155,10 +155,10 @@ function AccountPasswordView() {
setResetPasswordVisible(true);
}

const passKeyList = [
const passKeyList: SettingsCardProps[] = [
{
title: "Coming soon",
value: "Passwordless login with passkeys is coming soon",
content: "Passwordless login with passkeys is coming soon",
// action: <Button type="default" shape="circle" icon={<DeleteOutlined />} size="small" />,
action: undefined,
},
Expand All @@ -171,7 +171,7 @@ function AccountPasswordView() {
<Col span={12}>
<SettingsCard
title="Password"
description={getPasswordComponent()}
content={getPasswordComponent()}
action={
<Button
type="default"
Expand All @@ -189,7 +189,7 @@ function AccountPasswordView() {
<Row gutter={[24, 24]} style={{ marginBottom: 24 }}>
{passKeyList.map((item) => (
<Col span={12} key={item.title}>
<SettingsCard title={item.title} description={item.value} action={item.action} />
<SettingsCard title={item.title} content={item.content} action={item.action} />
</Col>
))}
</Row>
Expand Down
22 changes: 9 additions & 13 deletions frontend/javascripts/admin/account/account_profile_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { formatUserName } from "viewer/model/accessors/user_accessor";
import { setThemeAction } from "viewer/model/actions/ui_actions";
import { setActiveUserAction } from "viewer/model/actions/user_actions";
import Store from "viewer/store";
import { SettingsCard } from "./helpers/settings_card";
import { SettingsCard, type SettingsCardProps } from "./helpers/settings_card";
import { SettingsTitle } from "./helpers/settings_title";

function AccountProfileView() {
Expand Down Expand Up @@ -56,29 +56,29 @@ function AccountProfileView() {
},
];

const profileItems = [
const profileItems: SettingsCardProps[] = [
{
title: "Name",
value: formatUserName(activeUser, activeUser),
content: formatUserName(activeUser, activeUser),
},
{
title: "Email",
value: activeUser.email,
content: activeUser.email,
},
{
title: "Organization",
value: activeOrganization?.name || activeUser.organization,
content: activeOrganization?.name || activeUser.organization,
},
{
title: "Role",
value: role,
explanation: (
content: role,
tooltip: (
<a href="https://docs.webknossos.org/webknossos/users/access_rights.html">Learn More</a>
),
},
{
title: "Theme",
value: (
content: (
<Dropdown.Button menu={{ items: themeItems }} trigger={["click"]} icon={<DownOutlined />}>
{themeItems.find((item) => item.key === selectedTheme)?.label}
</Dropdown.Button>
Expand All @@ -95,11 +95,7 @@ function AccountProfileView() {
<Row gutter={[24, 24]} style={{ marginBottom: 24 }}>
{profileItems.map((item) => (
<Col span={12} key={item.title}>
<SettingsCard
title={item.title}
description={item.value}
explanation={item.explanation}
/>
<SettingsCard title={item.title} content={item.content} tooltip={item.tooltip} />
</Col>
))}
</Row>
Expand Down
6 changes: 5 additions & 1 deletion frontend/javascripts/admin/account/account_settings_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ const MENU_ITEMS: MenuItemGroupType[] = [
function AccountSettingsView() {
const location = useLocation();
const navigate = useNavigate();
const selectedKey = location.pathname.split("/").filter(Boolean).pop() || "profile";
const selectedKey =
location.pathname
.split("/")
.filter((p) => p.length > 0)
.pop() || "profile";

const breadcrumbItems = [
{
Expand Down
25 changes: 13 additions & 12 deletions frontend/javascripts/admin/account/helpers/settings_card.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import { InfoCircleOutlined } from "@ant-design/icons";
import { Card, Flex, Popover, Typography } from "antd";
import { Card, Flex, Tooltip, Typography } from "antd";

interface SettingsCardProps {
export type SettingsCardProps = {
title: string;
description: React.ReactNode;
explanation?: React.ReactNode;
content: React.ReactNode;
tooltip?: React.ReactNode;
action?: React.ReactNode;
}
style?: React.CSSProperties;
};

export function SettingsCard({ title, description, explanation, action }: SettingsCardProps) {
export function SettingsCard({ title, content, tooltip, action, style }: SettingsCardProps) {
return (
<Card style={{ minHeight: 105 }}>
<Card style={{ minHeight: 105, ...style }}>
<Typography.Text type="secondary" style={{ fontSize: 14 }}>
<Flex justify="space-between">
<div>
{title}

{explanation != null ? (
<Popover content={explanation}>
<InfoCircleOutlined style={{ marginLeft: 4 }} />
</Popover>
{tooltip != null ? (
<Tooltip title={tooltip}>
<InfoCircleOutlined style={{ marginLeft: 8 }} />
</Tooltip>
) : null}
</div>
{action}
</Flex>
</Typography.Text>
<div style={{ fontSize: 16, marginTop: 4 }}>{description}</div>
<div style={{ fontSize: 16, marginTop: 4 }}>{content}</div>
</Card>
);
}
Loading