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

Upgrade Ant Design to v4 #5068

Merged
merged 58 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
936fbcb
Upgrade React
gabrieldutra Jul 26, 2020
cb3b701
Upgrade antd
gabrieldutra Jul 26, 2020
195cb28
TextArea autosize -> autoSize
gabrieldutra Jul 27, 2020
ee95434
Tmp: use Ant compatible for DynamicForm
gabrieldutra Jul 27, 2020
0dedb18
Update Antd Icons usage to v4
gabrieldutra Jul 27, 2020
1764523
.ant-tabs-content -> .ant-tabs-content-holder
gabrieldutra Jul 29, 2020
b8d29f4
Add Icon suffix to icons
gabrieldutra Jul 29, 2020
00e4116
Use Antd icons for Table viz sorting
gabrieldutra Jul 29, 2020
32a6969
Update Icon for visualizations
gabrieldutra Jul 29, 2020
9e9cb4c
Refactor DynamicForm
gabrieldutra Jul 31, 2020
31ec9e7
Remove @ant-design/compatible
gabrieldutra Jul 31, 2020
df2b0b5
Replace Admin Tabs with Menu
gabrieldutra Jul 31, 2020
d83d25b
Fix tables without scroll in admin pages
gabrieldutra Jul 31, 2020
6e58d80
FIx Table dataIndex
gabrieldutra Jul 31, 2020
cbb0377
Merge branch 'master' into antd-v4
gabrieldutra Aug 1, 2020
418680b
Update Pagination sizeChanger default
gabrieldutra Aug 1, 2020
fb59386
Use table footer for Search
gabrieldutra Aug 5, 2020
22c2f78
Add some gutter to viz editor tabs
gabrieldutra Aug 5, 2020
5b6cbf5
Update Query Tabs styling
gabrieldutra Aug 6, 2020
840a7bd
Keep font weight normal for query tabs
gabrieldutra Aug 6, 2020
14fab99
Revert "Use table footer for Search"
gabrieldutra Aug 6, 2020
f53ac0d
Use first header column as searchInput
gabrieldutra Aug 6, 2020
e356144
Merge branch 'master' into antd-v4
gabrieldutra Aug 6, 2020
65c6d72
Update Cypress
gabrieldutra Aug 7, 2020
57b41a4
Prevent ResizeObserver error from failing tests
gabrieldutra Aug 7, 2020
fbc1840
Cypress: Fix tags specs
gabrieldutra Aug 8, 2020
3e15010
Cypress: Fix Filters specs
gabrieldutra Aug 8, 2020
a7cf7b2
Update Forms onSubmit -> onFinish
gabrieldutra Aug 8, 2020
51a3df1
Cypress: Fix dropdown parameters specs
gabrieldutra Aug 9, 2020
cb6069a
Update params dirty indicator
gabrieldutra Aug 11, 2020
3e0a49e
Fix Date and Date Range parameters
gabrieldutra Aug 11, 2020
8dc83d5
Make sure Multiple select has room for icons
gabrieldutra Aug 11, 2020
9472c1e
Cypress: Update Date[Range] param tests
gabrieldutra Aug 11, 2020
fbe19e8
Cypress: Force tags input
gabrieldutra Aug 11, 2020
50cc63a
Add missing data-test to DynamicForm
gabrieldutra Aug 11, 2020
8e6314a
Cypress: Fix Pivot and Table specs
gabrieldutra Aug 11, 2020
cb4545d
Make sure view only group ids is not required
gabrieldutra Aug 11, 2020
11c9bc6
Update Jest tests
gabrieldutra Aug 11, 2020
abfdd68
Fix lint error
gabrieldutra Aug 11, 2020
6c30dcd
Cypress: Remove should from click commands
gabrieldutra Aug 11, 2020
7e22d9a
Update viz-lib jest tests
gabrieldutra Aug 12, 2020
90903f7
ScheduleDialog test: click -> mouseDown
gabrieldutra Aug 12, 2020
71eb2ca
Merge branch 'master' into antd-v4
gabrieldutra Aug 12, 2020
ed9713e
Cypress: Force table spec
gabrieldutra Aug 12, 2020
5722d5a
Fix CodeBlock Icon
gabrieldutra Aug 12, 2020
1554fe2
Fix Beacon consent HelpTrigger spacing
gabrieldutra Aug 12, 2020
79558b5
Update DatabricksSchemaBrowser
gabrieldutra Aug 12, 2020
94ac6b6
Cypress: Use wait instead of force
gabrieldutra Aug 12, 2020
e06ee04
Merge branch 'master' into antd-v4
gabrieldutra Aug 17, 2020
a6eb1e2
Fix multi-column arrows in table viz
gabrieldutra Aug 17, 2020
8c49512
Update Fixed header with antd v4
gabrieldutra Aug 17, 2020
cbd3a7f
Separate DynamicFormField into their own files
gabrieldutra Aug 18, 2020
b8a3472
Create 'ContentField'
gabrieldutra Aug 18, 2020
f117fd7
Merge branch 'master' into antd-v4
gabrieldutra Aug 19, 2020
fcad6bb
Update package-lock
gabrieldutra Aug 19, 2020
bad5b7f
Merge branch 'master' into antd-v4
gabrieldutra Aug 25, 2020
892d1de
.ant-form-explain -> .ant-form-item-explain
gabrieldutra Aug 25, 2020
76fc4c6
Small Percy adjustments
gabrieldutra Aug 25, 2020
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
12 changes: 11 additions & 1 deletion client/app/assets/less/ant.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@import "~antd/lib/pagination/style/index";
@import "~antd/lib/table/style/index";
@import "~antd/lib/popover/style/index";
@import "~antd/lib/icon/style/index";
@import "~antd/lib/tag/style/index";
@import "~antd/lib/grid/style/index";
@import "~antd/lib/switch/style/index";
Expand Down Expand Up @@ -402,3 +401,14 @@
.@{checkbox-prefix-cls} + span {
padding-right: 0;
}

// make sure Multiple select has room for icons
.@{select-prefix-cls}-multiple {
&.@{select-prefix-cls}-show-arrow,
&.@{select-prefix-cls}-show-search,
&.@{select-prefix-cls}-loading {
.@{select-prefix-cls}-selector {
padding-right: 30px;
}
}
}
Comment on lines +405 to +414
Copy link
Member Author

Choose a reason for hiding this comment

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

This is actually an issue with Antd, I've created ant-design/ant-design#26147 for this.

4 changes: 4 additions & 0 deletions client/app/assets/less/inc/alert.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
padding: 5px 8px;
}

.ant-form-item-explain {
margin-top: 10px;
}

.alert-last-triggered {
color: @headings-color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ import { first } from "lodash";
import React, { useState } from "react";
import Button from "antd/lib/button";
import Menu from "antd/lib/menu";
import Icon from "antd/lib/icon";
import HelpTrigger from "@/components/HelpTrigger";
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
import { Auth, currentUser } from "@/services/auth";
import settingsMenu from "@/services/settingsMenu";
import logoUrl from "@/assets/images/redash_icon_small.png";

import DesktopOutlinedIcon from "@ant-design/icons/DesktopOutlined";
import CodeOutlinedIcon from "@ant-design/icons/CodeOutlined";
import AlertOutlinedIcon from "@ant-design/icons/AlertOutlined";
import PlusOutlinedIcon from "@ant-design/icons/PlusOutlined";
import QuestionCircleOutlinedIcon from "@ant-design/icons/QuestionCircleOutlined";
import SettingOutlinedIcon from "@ant-design/icons/SettingOutlined";
import MenuUnfoldOutlinedIcon from "@ant-design/icons/MenuUnfoldOutlined";
import MenuFoldOutlinedIcon from "@ant-design/icons/MenuFoldOutlined";

import VersionInfo from "./VersionInfo";
import "./DesktopNavbar.less";

Expand Down Expand Up @@ -46,23 +54,23 @@ export default function DesktopNavbar() {
{currentUser.hasPermission("list_dashboards") && (
<Menu.Item key="dashboards">
<a href="dashboards">
<Icon type="desktop" />
<DesktopOutlinedIcon />
<span>Dashboards</span>
</a>
</Menu.Item>
)}
{currentUser.hasPermission("view_query") && (
<Menu.Item key="queries">
<a href="queries">
<Icon type="code" />
<CodeOutlinedIcon />
<span>Queries</span>
</a>
</Menu.Item>
)}
{currentUser.hasPermission("list_alerts") && (
<Menu.Item key="alerts">
<a href="alerts">
<Icon type="alert" />
<AlertOutlinedIcon />
<span>Alerts</span>
</a>
</Menu.Item>
Expand All @@ -78,7 +86,7 @@ export default function DesktopNavbar() {
title={
<React.Fragment>
<span data-test="CreateButton">
<Icon type="plus" />
<PlusOutlinedIcon />
<span>Create</span>
</span>
</React.Fragment>
Expand Down Expand Up @@ -111,14 +119,14 @@ export default function DesktopNavbar() {
<NavbarSection inlineCollapsed={collapsed}>
<Menu.Item key="help">
<HelpTrigger showTooltip={false} type="HOME">
<Icon type="question-circle" />
<QuestionCircleOutlinedIcon />
<span>Help</span>
</HelpTrigger>
</Menu.Item>
{firstSettingsTab && (
<Menu.Item key="settings">
<a href={firstSettingsTab.path} data-test="SettingsLink">
<Icon type="setting" />
<SettingOutlinedIcon />
<span>Settings</span>
</a>
</Menu.Item>
Expand Down Expand Up @@ -158,7 +166,7 @@ export default function DesktopNavbar() {
</NavbarSection>

<Button onClick={() => setCollapsed(!collapsed)} className="desktop-navbar-collapse-button">
<Icon type={collapsed ? "menu-unfold" : "menu-fold"} />
{collapsed ? <MenuUnfoldOutlinedIcon /> : <MenuFoldOutlinedIcon />}
</Button>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { first } from "lodash";
import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";
import MenuOutlinedIcon from "@ant-design/icons/MenuOutlined";
import Dropdown from "antd/lib/dropdown";
import Menu from "antd/lib/menu";
import { Auth, currentUser } from "@/services/auth";
Expand Down Expand Up @@ -70,7 +70,7 @@ export default function MobileNavbar({ getPopupContainer }) {
</Menu>
}>
<Button className="mobile-navbar-toggle-button" ghost>
<Icon type="menu" />
<MenuOutlinedIcon />
</Button>
</Dropdown>
</div>
Expand Down
3 changes: 2 additions & 1 deletion client/app/components/CodeBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Tooltip from "antd/lib/tooltip";
import CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
import "./CodeBlock.less";

export default class CodeBlock extends React.Component {
Expand Down Expand Up @@ -59,7 +60,7 @@ export default class CodeBlock extends React.Component {

const copyButton = (
<Tooltip title={this.state.copied || "Copy"}>
<Button icon="copy" type="dashed" size="small" onClick={this.copy} />
<Button icon={<CopyOutlinedIcon />} type="dashed" size="small" onClick={this.copy} />
</Tooltip>
);

Expand Down
6 changes: 2 additions & 4 deletions client/app/components/EditParameterSettingsDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function EditParameterSettingsDialog(props) {
return true;
}

function onConfirm(e) {
function onConfirm() {
// update title to default
if (!param.title) {
// forced to do this cause param won't update in time for save
Expand All @@ -109,8 +109,6 @@ function EditParameterSettingsDialog(props) {
}

props.dialog.close(param);

e.preventDefault(); // stops form redirect
}

return (
Expand All @@ -132,7 +130,7 @@ function EditParameterSettingsDialog(props) {
{isNew ? "Add Parameter" : "OK"}
</Button>,
]}>
<Form layout="horizontal" onSubmit={onConfirm} id="paramForm">
<Form layout="horizontal" onFinish={onConfirm} id="paramForm">
Copy link
Member Author

Choose a reason for hiding this comment

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

Form onSubmit was renamed to onFinish (with event param removed).

{isNew && (
<NameInput
name={param.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import PropTypes from "prop-types";
import Dropdown from "antd/lib/dropdown";
import Menu from "antd/lib/menu";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";

import PlusCircleFilledIcon from "@ant-design/icons/PlusCircleFilled";
import ShareAltOutlinedIcon from "@ant-design/icons/ShareAltOutlined";
import FileOutlinedIcon from "@ant-design/icons/FileOutlined";
import FileExcelOutlinedIcon from "@ant-design/icons/FileExcelOutlined";
import EllipsisOutlinedIcon from "@ant-design/icons/EllipsisOutlined";

import QueryResultsLink from "./QueryResultsLink";

Expand All @@ -13,14 +18,14 @@ export default function QueryControlDropdown(props) {
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
<Menu.Item>
<a target="_self" onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
<Icon type="plus-circle" theme="filled" /> Add to Dashboard
<PlusCircleFilledIcon /> Add to Dashboard
</a>
</Menu.Item>
)}
{!props.query.isNew() && (
<Menu.Item>
<a onClick={() => props.showEmbedDialog(props.query, props.selectedTab)} data-test="ShowEmbedDialogButton">
<Icon type="share-alt" /> Embed Elsewhere
<ShareAltOutlinedIcon /> Embed Elsewhere
</a>
</Menu.Item>
)}
Expand All @@ -32,7 +37,7 @@ export default function QueryControlDropdown(props) {
queryResult={props.queryResult}
embed={props.embed}
apiKey={props.apiKey}>
<Icon type="file" /> Download as CSV File
<FileOutlinedIcon /> Download as CSV File
</QueryResultsLink>
</Menu.Item>
<Menu.Item>
Expand All @@ -43,7 +48,7 @@ export default function QueryControlDropdown(props) {
queryResult={props.queryResult}
embed={props.embed}
apiKey={props.apiKey}>
<Icon type="file" /> Download as TSV File
<FileOutlinedIcon /> Download as TSV File
</QueryResultsLink>
</Menu.Item>
<Menu.Item>
Expand All @@ -54,7 +59,7 @@ export default function QueryControlDropdown(props) {
queryResult={props.queryResult}
embed={props.embed}
apiKey={props.apiKey}>
<Icon type="file-excel" /> Download as Excel File
<FileExcelOutlinedIcon /> Download as Excel File
</QueryResultsLink>
</Menu.Item>
</Menu>
Expand All @@ -63,7 +68,7 @@ export default function QueryControlDropdown(props) {
return (
<Dropdown trigger={["click"]} overlay={menu} overlayClassName="query-control-dropdown-overlay">
<Button data-test="QueryControlDropdownButton">
<Icon type="ellipsis" rotate={90} />
<EllipsisOutlinedIcon rotate={90} />
</Button>
</Dropdown>
);
Expand Down
4 changes: 2 additions & 2 deletions client/app/components/EditVisualizationButton/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";
import FormOutlinedIcon from "@ant-design/icons/FormOutlined";

export default function EditVisualizationButton(props) {
return (
<Button
data-test="EditVisualization"
className="edit-visualization"
onClick={() => props.openVisualizationEditor(props.selectedTab)}>
<Icon type="form" />
<FormOutlinedIcon />
<span className="hidden-xs hidden-s hidden-m">Edit Visualization</span>
</Button>
);
Expand Down
4 changes: 2 additions & 2 deletions client/app/components/HelpTrigger.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from "prop-types";
import cx from "classnames";
import Tooltip from "antd/lib/tooltip";
import Drawer from "antd/lib/drawer";
import Icon from "antd/lib/icon";
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
import BigMessage from "@/components/BigMessage";
import DynamicComponent from "@/components/DynamicComponent";

Expand Down Expand Up @@ -174,7 +174,7 @@ export default class HelpTrigger extends React.Component {
)}
<Tooltip title="Close" placement="bottom">
<a onClick={this.closeDrawer}>
<Icon type="close" />
<CloseOutlinedIcon />
</a>
</Tooltip>
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/app/components/InputWithCopy.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import Input from "antd/lib/input";
import Icon from "antd/lib/icon";
import CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
import Tooltip from "antd/lib/tooltip";

export default class InputWithCopy extends React.Component {
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class InputWithCopy extends React.Component {
render() {
const copyButton = (
<Tooltip title={this.state.copied || "Copy"}>
<Icon type="copy" style={{ cursor: "pointer" }} onClick={this.copy} />
<CopyOutlinedIcon style={{ cursor: "pointer" }} onClick={this.copy} />
</Tooltip>
);

Expand Down
16 changes: 10 additions & 6 deletions client/app/components/ParameterMappingInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Select from "antd/lib/select";
import Table from "antd/lib/table";
import Popover from "antd/lib/popover";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";
import Tag from "antd/lib/tag";
import Input from "antd/lib/input";
import Radio from "antd/lib/radio";
Expand All @@ -19,6 +18,11 @@ import { ParameterMappingType } from "@/services/widget";
import { Parameter, cloneParameter } from "@/services/parameters";
import HelpTrigger from "@/components/HelpTrigger";

import QuestionCircleFilledIcon from "@ant-design/icons/QuestionCircleFilled";
import EditOutlinedIcon from "@ant-design/icons/EditOutlined";
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
import CheckOutlinedIcon from "@ant-design/icons/CheckOutlined";

import "./ParameterMappingInput.less";

const { Option } = Select;
Expand Down Expand Up @@ -181,7 +185,7 @@ export class ParameterMappingInput extends React.Component {
Existing dashboard parameter{" "}
{noExisting ? (
<Tooltip title="There are no dashboard parameters corresponding to this data type">
<Icon type="question-circle" theme="filled" />
<QuestionCircleFilledIcon />
</Tooltip>
) : null}
</Radio>
Expand Down Expand Up @@ -355,7 +359,7 @@ class MappingEditor extends React.Component {
visible={visible}
onVisibleChange={this.onVisibleChange}>
<Button size="small" type="dashed" data-test={`EditParamMappingButon-${mapping.param.name}`}>
<Icon type="edit" />
<EditOutlinedIcon />
</Button>
</Popover>
);
Expand Down Expand Up @@ -434,10 +438,10 @@ class TitleEditor extends React.Component {
autoFocus
/>
<Button size="small" type="dashed" onClick={this.hide}>
<Icon type="close" />
<CloseOutlinedIcon />
</Button>
<Button size="small" type="dashed" onClick={this.save}>
<Icon type="check" />
<CheckOutlinedIcon />
</Button>
</div>
);
Expand All @@ -460,7 +464,7 @@ class TitleEditor extends React.Component {
visible={this.state.showPopup}
onVisibleChange={this.onPopupVisibleChange}>
<Button size="small" type="dashed">
<Icon type="edit" />
<EditOutlinedIcon />
</Button>
</Popover>
);
Expand Down
7 changes: 4 additions & 3 deletions client/app/components/ParameterValueInput.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '~antd/lib/input-number/style/index'; // for ant @vars
@import "~antd/lib/input-number/style/index"; // for ant @vars

@input-dirty: #fffce1;

Expand All @@ -17,9 +17,10 @@
}

&[data-dirty] {
.@{ant-prefix}-input, // covers also ant date component
.@{ant-prefix}-input,
.@{ant-prefix}-input-number,
.@{ant-prefix}-select-selection {
.@{ant-prefix}-select-selector,
.@{ant-prefix}-picker {
Copy link
Member Author

Choose a reason for hiding this comment

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

The -input one no longer covers date component

background-color: @input-dirty;
}
}
Expand Down
Loading