Skip to content

Upgrade Antd to version 5 #7522

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

Merged
merged 79 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
96be333
bump antd to version 4.24.15
hotzenklotz Dec 15, 2023
e5a7ed4
Merge branch 'master' into antd-4.24.15
hotzenklotz Jan 2, 2024
4c5960c
add version resolution for lib rc-tree for antd 4.24.15 update
hotzenklotz Jan 2, 2024
8f34fb3
prevent React event handler error
hotzenklotz Jan 3, 2024
d6ebf56
updated changelog
hotzenklotz Jan 3, 2024
07ae009
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Jan 3, 2024
a7af32d
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Jan 4, 2024
9d68487
codemod autoconvert
hotzenklotz Jan 4, 2024
e29c7da
fix deprecation warnings
hotzenklotz Jan 4, 2024
2f1a49e
add theme provider and enable css variables
hotzenklotz Jan 4, 2024
a7651ad
convert less variables to CSS variables
hotzenklotz Jan 4, 2024
656f5c1
fix Input.Group deprecations
hotzenklotz Jan 4, 2024
145be44
restore navbar layout
hotzenklotz Jan 4, 2024
c51dbd5
styling fixes
hotzenklotz Jan 4, 2024
a3baf7e
fix type errors
hotzenklotz Jan 4, 2024
36fd2b9
additional small fixes
hotzenklotz Jan 4, 2024
705955b
use antd 5 theme switching
hotzenklotz Jan 5, 2024
6db78fb
move theme provider into separate file
hotzenklotz Jan 5, 2024
6019837
wrap login, PW resets, sign up etc in <Card> to adapt to theming
hotzenklotz Jan 8, 2024
0d62008
adjust base color for dark mode
hotzenklotz Jan 8, 2024
bc14a6d
more CSS fixes
hotzenklotz Jan 8, 2024
c6fbcc2
use a type import to prevent cyclic dependencies
hotzenklotz Jan 8, 2024
cf0c6fe
use mocked window in theme.tsx when tests are executed
philippotto Jan 8, 2024
951b08f
mock matchMedia in jsdom which we use for e2e tests
philippotto Jan 9, 2024
7c3e83d
upgrade JSDOM to v 23.2.0
hotzenklotz Jan 9, 2024
661fafa
update nodeJS to v18 in CI
hotzenklotz Jan 9, 2024
62ef7b2
Update Dockerfile.dev
normanrz Jan 9, 2024
1230ad4
use custom WK blue as primary color
hotzenklotz Jan 9, 2024
957d636
Merge branch 'antd-5.x' of github.com:scalableminds/webknossos into a…
hotzenklotz Jan 9, 2024
8e738c4
restore WK blue/pruple as primary color
hotzenklotz Jan 9, 2024
02fd2fd
fix some margin errors
hotzenklotz Jan 9, 2024
8fab8da
fix more CSS variables errors
hotzenklotz Jan 9, 2024
9327f54
restore Nunito font
hotzenklotz Jan 9, 2024
c314a1f
more CSS fixes
hotzenklotz Jan 10, 2024
ea16a96
replaced .antd-legacy CSS class with <Space.Compact>
hotzenklotz Jan 11, 2024
087a6a4
set dark mode to regular black
hotzenklotz Jan 11, 2024
95bb054
fix several CSS variable names
hotzenklotz Jan 11, 2024
02cb81c
fix theming for <Layout.Sider>
hotzenklotz Jan 11, 2024
dc598eb
replace Less layout color with CSS variables
hotzenklotz Jan 11, 2024
3315ef9
fix theme propagation on load
hotzenklotz Jan 11, 2024
9855516
small style fixes
hotzenklotz Jan 15, 2024
1e81028
add margin to many icons
hotzenklotz Jan 15, 2024
1bc0593
moar icon fixes
hotzenklotz Jan 15, 2024
c1f82c0
moar icon margins
hotzenklotz Jan 15, 2024
558506b
remove ".without-icon-margin" class
hotzenklotz Jan 15, 2024
e47f7c6
fix viewport margin background colors
hotzenklotz Jan 15, 2024
7307ebd
fix InputNumber bordered deprecation warnings
hotzenklotz Jan 15, 2024
6982565
another dark mode fix
hotzenklotz Jan 15, 2024
4a1ae04
upgrade to antd v5.13.x
hotzenklotz Jan 15, 2024
8f7aabb
fix more stuff
hotzenklotz Jan 15, 2024
bdc3ac4
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Jan 16, 2024
aad601e
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Jan 23, 2024
aeeb076
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
philippotto Jan 23, 2024
e7f4f52
fix yarn.lock and hundreds of TS errors
philippotto Jan 23, 2024
9bb76c6
replace static Modal calls with useApp
hotzenklotz Jan 25, 2024
81730e5
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Jan 25, 2024
2926d8d
updated changelog
hotzenklotz Jan 25, 2024
64fce43
fix tests
hotzenklotz Jan 26, 2024
747db4b
fix styling issues
hotzenklotz Jan 26, 2024
efac65f
Update frontend/stylesheets/_variables.less
hotzenklotz Jan 29, 2024
e674f12
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Jan 29, 2024
6f24635
color navbar darkish gray
hotzenklotz Jan 29, 2024
54b60ce
fix icon spacing
hotzenklotz Jan 29, 2024
e35391b
Merge branch 'antd-5.x' of github.com:scalableminds/webknossos into a…
hotzenklotz Jan 29, 2024
5fbdbe0
renamed several wrong CSS variables names
hotzenklotz Jan 29, 2024
9d2ce1f
move color picker icons to parent menu component
hotzenklotz Jan 29, 2024
7ae6b69
fix CSS sizing issues
hotzenklotz Jan 29, 2024
baafa17
set default antd blue color to WK blue/purple
hotzenklotz Jan 30, 2024
16a9789
rephrase paid upgrades
hotzenklotz Jan 30, 2024
ec16c1a
fix tree background color and dropdown menu icon
hotzenklotz Jan 31, 2024
ad2e1ad
fix status bar toogle hints
hotzenklotz Jan 31, 2024
acca0ee
PR feedback
hotzenklotz Feb 2, 2024
78cb951
rephrase paid upgrades
hotzenklotz Feb 2, 2024
38b7bc5
fix save button corner radius
hotzenklotz Feb 2, 2024
d8dc63d
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Feb 2, 2024
b37902c
fix colorpicker hiding instantly
hotzenklotz Feb 2, 2024
bed093c
Merge branch 'master' of github.com:scalableminds/webknossos into ant…
hotzenklotz Feb 6, 2024
bf8d965
remove unused CSS styles
hotzenklotz Feb 6, 2024
b9e9669
Merge branch 'master' into antd-5.x
hotzenklotz Feb 7, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Datasets stored in WKW format are no longer loaded with memory mapping, reducing memory demands. [#7528](https://github.com/scalableminds/webknossos/pull/7528)
- WEBKNOSSOS now uses Java 21. [#7599](https://github.com/scalableminds/webknossos/pull/7599)


### Fixed
- Fixed rare SIGBUS crashes of the datastore module that were caused by memory mapping on unstable file systems. [#7528](https://github.com/scalableminds/webknossos/pull/7528)
- Fixed loading local datasets for organizations that have spaces in their names. [#7593](https://github.com/scalableminds/webknossos/pull/7593)
Expand All @@ -31,3 +32,4 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
### Removed

### Breaking Changes
- Updated antd UI library from version 4.24.15 to 5.13.2. Drop support for nodeJs version <18. [#7522](https://github.com/scalableminds/webknossos/pull/7522)
2 changes: 1 addition & 1 deletion DEV_INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For non-localhost deployments, check out the [installation guide in the document
* [Redis 5+](https://redis.io/)
* [Blosc](https://github.com/Blosc/c-blosc)
* [Brotli](https://github.com/google/brotli)
* [node.js 16 or 18](http://nodejs.org/download/)
* [node.js 18](http://nodejs.org/download/)
* [yarn package manager](https://yarnpkg.com/)
* [git](http://git-scm.com/downloads)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:21
ARG VERSION_NODE="16.x"
ARG VERSION_NODE="18.x"

RUN curl -sL "https://deb.nodesource.com/setup_${VERSION_NODE}" | bash - \
&& apt-get -y install libblosc1 libbrotli1 postgresql-client git nodejs \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM scalableminds/sbt:master__7785473656
ARG VERSION_NODE="16.x"
ARG VERSION_NODE="18.x"

ENV DEBIAN_FRONTEND noninteractive
ENV SBT_OPTS "${SBT_OPTS} -XX:MaxMetaspaceSize=512m -Xms1024m -Xmx1024m"
Expand Down
1 change: 1 addition & 0 deletions MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ archived if they do not contain relevant data. The following SQL query can be us
UPDATE webknossos.annotations_ SET state = 'Finished' WHERE _id IN (SELECT DISTINCT a._id AS nd_annotations_id FROM webknossos.annotations_ AS a INNER JOIN webknossos.datasets AS d ON a._dataset = d._id INNER JOIN webknossos.dataset_layer_additionalaxes AS dla ON d._id = dla._dataset)
```
- WEBKNOSSOS now uses Java 21 (up from Java 11). [#7599](https://github.com/scalableminds/webknossos/pull/7599)
- NodeJS version 18+ is required for snapshot tests with ShadowDOM elements from Antd v5. [#7522](https://github.com/scalableminds/webknossos/pull/7522)

### Postgres Evolutions:

Expand Down
7 changes: 6 additions & 1 deletion app/views/main.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
media="screen"
href="/assets/bundle/vendors~main.css?nocache=@(webknossos.BuildInfo.commitHash)"
/>
<script src="/assets/bundle/theme.js?nocache=@(webknossos.BuildInfo.commitHash)"></script>
<link
rel="stylesheet"
type="text/css"
media="screen"
href="/assets/bundle/main.css?nocache=@(webknossos.BuildInfo.commitHash)"
/>
<script
data-airbrake-project-id="@(conf.Airbrake.projectID)"
data-airbrake-project-key="@(conf.Airbrake.projectKey)"
Expand Down
20 changes: 7 additions & 13 deletions frontend/javascripts/admin/auth/auth_token_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
import { CopyOutlined, SwapOutlined } from "@ant-design/icons";
import { Input, Button, Col, Row, Spin, Form } from "antd";
import { Input, Button, Col, Row, Spin, Form, Space } from "antd";
import { getAuthToken, revokeAuthToken } from "admin/admin_rest_api";
import type { OxalisState } from "oxalis/store";
import Toast from "libs/toast";
Expand Down Expand Up @@ -59,19 +59,16 @@ function AuthTokenView() {
<h3>Auth Token</h3>
<Form form={form}>
<FormItem>
<Input.Group compact>
<Space.Compact>
<Input
value={currentToken}
style={{
width: "90%",
}}
readOnly
/>
<Button
onClick={copyTokenToClipboard}
icon={<CopyOutlined className="without-icon-margin" />}
/>
</Input.Group>
<Button onClick={copyTokenToClipboard} icon={<CopyOutlined />} />
</Space.Compact>
</FormItem>
<FormItem>
<Button icon={<SwapOutlined />} onClick={handleRevokeToken}>
Expand All @@ -84,19 +81,16 @@ function AuthTokenView() {
<h4>Organization ID</h4>
<Form>
<FormItem>
<Input.Group compact>
<Space.Compact>
<Input
value={activeUser.organization}
style={{
width: "90%",
}}
readOnly
/>
<Button
onClick={copyOrganizationNameToClipboard}
icon={<CopyOutlined className="without-icon-margin" />}
/>
</Input.Group>
<Button onClick={copyOrganizationNameToClipboard} icon={<CopyOutlined />} />
</Space.Compact>
</FormItem>
</Form>
</>
Expand Down
148 changes: 75 additions & 73 deletions frontend/javascripts/admin/auth/finish_reset_password_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row } from "antd";
import { Form, Input, Button, Col, Row, Card } from "antd";
import { LockOutlined } from "@ant-design/icons";
import Request from "libs/request";
import messages from "messages";
Expand Down Expand Up @@ -49,79 +49,81 @@ function FinishResetPasswordView(props: Props) {

return (
<Row className="login-view" justify="center" align="middle">
<Col className="login-content">
<h3>Reset Password</h3>
<Form onFinish={onFinish} form={form}>
<FormItem
hasFeedback
name={["password", "password1"]}
rules={[
{
required: true,
message: messages["auth.reset_new_password"],
},
{
min: 8,
message: messages["auth.registration_password_length"],
},
{
validator: (_, value: string) =>
checkPasswordsAreMatching(value, ["password", "password2"]),
},
]}
>
<Password
prefix={
<LockOutlined
style={{
fontSize: 13,
}}
/>
}
placeholder="New Password"
/>
</FormItem>
<FormItem
hasFeedback
name={["password", "password2"]}
rules={[
{
required: true,
message: messages["auth.reset_new_password2"],
},
{
min: 8,
message: messages["auth.registration_password_length"],
},
{
validator: (_, value: string) =>
checkPasswordsAreMatching(value, ["password", "password1"]),
},
]}
>
<Password
prefix={
<LockOutlined
style={{
fontSize: 13,
}}
/>
}
placeholder="Confirm New Password"
/>
</FormItem>
<FormItem>
<Button
type="primary"
htmlType="submit"
style={{
width: "100%",
}}
<Col>
<Card className="login-content">
<h3>Reset Password</h3>
<Form onFinish={onFinish} form={form}>
<FormItem
hasFeedback
name={["password", "password1"]}
rules={[
{
required: true,
message: messages["auth.reset_new_password"],
},
{
min: 8,
message: messages["auth.registration_password_length"],
},
{
validator: (_, value: string) =>
checkPasswordsAreMatching(value, ["password", "password2"]),
},
]}
>
Reset Password
</Button>
</FormItem>
</Form>
<Password
prefix={
<LockOutlined
style={{
fontSize: 13,
}}
/>
}
placeholder="New Password"
/>
</FormItem>
<FormItem
hasFeedback
name={["password", "password2"]}
rules={[
{
required: true,
message: messages["auth.reset_new_password2"],
},
{
min: 8,
message: messages["auth.registration_password_length"],
},
{
validator: (_, value: string) =>
checkPasswordsAreMatching(value, ["password", "password1"]),
},
]}
>
<Password
prefix={
<LockOutlined
style={{
fontSize: 13,
}}
/>
}
placeholder="Confirm New Password"
/>
</FormItem>
<FormItem>
<Button
type="primary"
htmlType="submit"
style={{
width: "100%",
}}
>
Reset Password
</Button>
</FormItem>
</Form>
</Card>
</Col>
</Row>
);
Expand Down
10 changes: 6 additions & 4 deletions frontend/javascripts/admin/auth/login_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Col, Row } from "antd";
import { Card, Col, Row } from "antd";
import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import React from "react";
Expand Down Expand Up @@ -29,9 +29,11 @@ function LoginView({ history, redirect }: Props) {

return (
<Row justify="center" align="middle" className="login-view">
<Col className="login-content">
<h3>Login</h3>
<LoginForm layout="horizontal" onLoggedIn={onLoggedIn} />
<Col>
<Card className="login-content">
<h3>Login</h3>
<LoginForm layout="horizontal" onLoggedIn={onLoggedIn} />
</Card>
</Col>
</Row>
);
Expand Down
10 changes: 6 additions & 4 deletions frontend/javascripts/admin/auth/registration_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ function RegistrationViewGeneric() {
return (
<Spin spinning={isLoading}>
<Row justify="center" align="middle" className="login-view">
<Col className="login-content drawing-signup" style={{ width: 1000 }}>
<h3>Sign Up</h3>
{content}
<Link to="/auth/login">Already have an account? Login instead.</Link>
<Col>
<Card className="login-content drawing-signup" style={{ width: 1000 }}>
<h3>Sign Up</h3>
{content}
<Link to="/auth/login">Already have an account? Login instead.</Link>
</Card>
</Col>
</Row>
</Spin>
Expand Down
74 changes: 38 additions & 36 deletions frontend/javascripts/admin/auth/start_reset_password_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row } from "antd";
import { Form, Input, Button, Col, Row, Card } from "antd";
import { MailOutlined } from "@ant-design/icons";
import Request from "libs/request";
import messages from "messages";
Expand All @@ -24,42 +24,44 @@ function StartResetPasswordView({ history }: Props) {

return (
<Row className="login-view" justify="center" align="middle">
<Col className="login-content">
<h3>Reset Password</h3>
<Form onFinish={onFinish} form={form}>
<FormItem
name="email"
rules={[
{
required: true,
type: "email",
message: messages["auth.registration_email_input"],
},
]}
>
<Input
prefix={
<MailOutlined
style={{
fontSize: 13,
}}
/>
}
placeholder="Email"
/>
</FormItem>
<FormItem>
<Button
type="primary"
htmlType="submit"
style={{
width: "100%",
}}
<Col>
<Card className="login-content">
<h3>Reset Password</h3>
<Form onFinish={onFinish} form={form}>
<FormItem
name="email"
rules={[
{
required: true,
type: "email",
message: messages["auth.registration_email_input"],
},
]}
>
Send Reset Email
</Button>
</FormItem>
</Form>
<Input
prefix={
<MailOutlined
style={{
fontSize: 13,
}}
/>
}
placeholder="Email"
/>
</FormItem>
<FormItem>
<Button
type="primary"
htmlType="submit"
style={{
width: "100%",
}}
>
Send Reset Email
</Button>
</FormItem>
</Form>
</Card>
</Col>
</Row>
);
Expand Down
Loading