Skip to content

Commit b7df4aa

Browse files
committed
ui: upgrade to ant-design v4
INSPIR-3203 * upgrades to antd to v4 * upgrades to react@16.13.10 * upgrades to react-router to v5 Unresolved: * `componentWillReceiveProps` warnings from `react-vis` uber/react-vis#1253 * search name space truncates some options like `conferen...` ant-design/ant-design#21754 * `componentWillMount` warnings from `react-helmet` nfl/react-helmet#413 * `componentWillMount` warnings from `react-loadable` jamiebuilds/react-loadable#220 * `Cannot update a component from inside the function body of a different component.` worning from `antd` ant-design/ant-design#21800
1 parent ceb8566 commit b7df4aa

File tree

143 files changed

+1003
-1349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1003
-1349
lines changed

e2e/utils/form.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class FormSubmitter {
4343
}
4444

4545
async fill(data) {
46+
await this.page.waitFor('form');
4647
await this.fillAnyField(null, data);
4748
await this.page.click('form');
4849
}
@@ -63,6 +64,9 @@ class FormSubmitter {
6364
case 'string':
6465
await this.fillNumberOrStringField(path, data);
6566
break;
67+
case 'suggester':
68+
await this.fillSuggesterField(path, data);
69+
break;
6670
case 'single-select':
6771
await this.fillSingleSelectField(path, data);
6872
break;
@@ -142,6 +146,12 @@ class FormSubmitter {
142146
}
143147
}
144148

149+
async fillSuggesterField(path, value) {
150+
const fieldSelector = `[${ID_ATTRIBUTE}="${path}"]`;
151+
const innerInputSelector = `${fieldSelector} input`;
152+
await this.page.type(innerInputSelector, value);
153+
}
154+
145155
async fillNumberOrStringField(path, value) {
146156
const fieldSelector = `[${ID_ATTRIBUTE}="${path}"]`;
147157
await this.page.type(fieldSelector, value);
@@ -158,7 +168,7 @@ class FormSubmitter {
158168
}
159169

160170
async selectDateOnActivePicker(date) {
161-
const dateSelector = `[title="${moment(date).format('MMMM D, YYYY')}"]`;
171+
const dateSelector = `[title="${date}"]`;
162172
await this.page.waitFor(dateSelector);
163173
await this.page.click(dateSelector);
164174
}

ui/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "inspire-next-react",
33
"license": "GPL-2.0",
44
"version": "0.1.19",
5-
"proxy": "localhost:8000",
5+
"proxy": "http://localhost:8000",
66
"bundlesize": [
77
{
88
"path": "./build/**/*.js",
@@ -23,10 +23,11 @@
2323
"./node_modules/eslint/bin/eslint.js ./src --ext .js,.jsx --config .eslintrc"
2424
},
2525
"dependencies": {
26+
"@ant-design/icons": "^4.0.0",
2627
"@babel/runtime": "7.0.0-beta.55",
2728
"@craco/craco": "^3.1.0",
2829
"@sentry/browser": "^4.3.0",
29-
"antd": "^3.4.1",
30+
"antd": "^4.0.0",
3031
"axios": "^0.18.0",
3132
"classnames": "^2.2.6",
3233
"connected-react-router": "^6.4.0",
@@ -58,7 +59,7 @@
5859
"react-piwik": "^1.6.0",
5960
"react-quill": "^1.3.3",
6061
"react-redux": "^6.0.0",
61-
"react-router-dom": "^4.2.2",
62+
"react-router-dom": "^5.1.0",
6263
"react-sanitized-html": "^2.0.0",
6364
"react-scripts": "2.0.3",
6465
"react-vis": "^1.9.2",

ui/src/App.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
}
4747
}
4848

49-
.mb4-important {
50-
margin-bottom: 4px !important;
51-
}
52-
5349
.secondary-color {
5450
color: $secondary-color;
5551
}
@@ -119,6 +115,10 @@
119115
}
120116
}
121117

118+
.mb2-important {
119+
margin-bottom: 0.5rem !important;
120+
}
121+
122122
.ant-drawer-body {
123123
@media (max-width: $screen-xs-max) {
124124
padding: $drawer-body-padding / 2 !important;

ui/src/authors/components/AuthorEmailsAction.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { List } from 'immutable';
4-
import { Menu, Icon, Tooltip } from 'antd';
4+
import { MailOutlined } from '@ant-design/icons';
5+
import { Menu, Tooltip } from 'antd';
56

67
import ExternalLink from '../../common/components/ExternalLink';
78
import ActionsDropdownOrAction from '../../common/components/ActionsDropdownOrAction';
@@ -26,7 +27,7 @@ function renderEmailAction(email, title) {
2627

2728
const ACTION_TITLE = (
2829
<Tooltip title="Contact author">
29-
<Icon type="mail" />
30+
<MailOutlined />
3031
</Tooltip>
3132
);
3233

ui/src/authors/components/AuthorLinkedinAction.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Icon, Tooltip } from 'antd';
3+
import { LinkedinOutlined } from '@ant-design/icons';
4+
import { Tooltip } from 'antd';
45

56
import ListItemAction from '../../common/components/ListItemAction';
67
import ExternalLink from '../../common/components/ExternalLink';
@@ -13,7 +14,7 @@ class AuthorLinkedinAction extends Component {
1314
<ListItemAction>
1415
<Tooltip title="LinkedIn">
1516
<ExternalLink href={href}>
16-
<Icon type="linkedin" />
17+
<LinkedinOutlined />
1718
</ExternalLink>
1819
</Tooltip>
1920
</ListItemAction>

ui/src/authors/components/AuthorOrcid/AuthorOrcid.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ class AuthorOrcid extends Component {
1010
render() {
1111
const { orcid } = this.props;
1212
return (
13-
<Tooltip title="ORCID">
14-
<OrcidProfileLink className="__AuthorOrcid__" orcid={orcid}>
13+
<OrcidProfileLink className="__AuthorOrcid__" orcid={orcid}>
14+
<Tooltip title="ORCID">
1515
<img src={orcidLogo} alt="ORCID" />
16-
</OrcidProfileLink>
17-
</Tooltip>
16+
</Tooltip>
17+
</OrcidProfileLink>
1818
);
1919
}
2020
}
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`AuthorOrcid renders with orcid 1`] = `
4-
<Tooltip
5-
arrowPointAtCenter={false}
6-
autoAdjustOverflow={true}
7-
mouseEnterDelay={0.1}
8-
mouseLeaveDelay={0.1}
9-
placement="top"
10-
title="ORCID"
11-
transitionName="zoom-big-fast"
4+
<OrcidProfileLink
5+
className="__AuthorOrcid__"
6+
orcid="0000-0001-8058-0014"
127
>
13-
<OrcidProfileLink
14-
className="__AuthorOrcid__"
15-
orcid="0000-0001-8058-0014"
8+
<Tooltip
9+
arrowPointAtCenter={false}
10+
autoAdjustOverflow={true}
11+
mouseEnterDelay={0.1}
12+
mouseLeaveDelay={0.1}
13+
placement="top"
14+
title="ORCID"
15+
transitionName="zoom-big-fast"
1616
>
1717
<img
1818
alt="ORCID"
1919
src="orcid.svg"
2020
/>
21-
</OrcidProfileLink>
22-
</Tooltip>
21+
</Tooltip>
22+
</OrcidProfileLink>
2323
`;

ui/src/authors/components/AuthorTwitterAction.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Icon, Tooltip } from 'antd';
3+
import { TwitterOutlined } from '@ant-design/icons';
4+
import { Tooltip } from 'antd';
45

56
import ListItemAction from '../../common/components/ListItemAction';
67
import ExternalLink from '../../common/components/ExternalLink';
@@ -13,7 +14,7 @@ class AuthorTwitterAction extends Component {
1314
<ListItemAction>
1415
<Tooltip title="Twitter">
1516
<ExternalLink href={href}>
16-
<Icon type="twitter" />
17+
<TwitterOutlined />
1718
</ExternalLink>
1819
</Tooltip>
1920
</ListItemAction>

ui/src/authors/components/AuthorWebsitesAction.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { useMemo } from 'react';
22
import PropTypes from 'prop-types';
33
import { List } from 'immutable';
4-
import { Menu, Icon, Tooltip } from 'antd';
4+
import { LinkOutlined } from '@ant-design/icons';
5+
import { Menu, Tooltip } from 'antd';
56

67
import ExternalLink from '../../common/components/ExternalLink';
78
import { removeProtocolAndWwwFromUrl } from '../../common/utils';
@@ -48,7 +49,7 @@ function renderWebsiteAction(website, title) {
4849

4950
const ACTION_TITLE = (
5051
<Tooltip title="Personal website">
51-
<Icon type="link" />
52+
<LinkOutlined />
5253
</Tooltip>
5354
);
5455

ui/src/authors/components/UserSettingsAction.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useCallback, useState } from 'react';
22
import { Button } from 'antd';
3+
import { SettingOutlined } from '@ant-design/icons';
34

45
import ListItemAction from '../../common/components/ListItemAction';
56
import IconText from '../../common/components/IconText';
@@ -18,7 +19,7 @@ function UserSettingsAction() {
1819
<>
1920
<ListItemAction>
2021
<Button onClick={onClick}>
21-
<IconText text="settings" type="setting" />
22+
<IconText text="settings" icon={<SettingOutlined />} />
2223
</Button>
2324
</ListItemAction>
2425
<UserSettingsModal

0 commit comments

Comments
 (0)