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 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, useMemo, useEffect, useCallback } from "react";
import { slice, without, filter, includes, get, find } from "lodash";
import { filter, includes, get, find } from "lodash";
import PropTypes from "prop-types";
import { useDebouncedCallback } from "use-debounce";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";
import SyncOutlinedIcon from "@ant-design/icons/SyncOutlined";
import Input from "antd/lib/input";
import Select from "antd/lib/select";
import Tooltip from "antd/lib/tooltip";
Expand All @@ -13,13 +13,6 @@ import useDatabricksSchema from "./useDatabricksSchema";

import "./DatabricksSchemaBrowser.less";

// Limit number of rendered options to improve performance until Antd v4
function getLimitedDatabases(databases, currentDatabaseName, limit = 1000) {
const limitedDatabases = slice(without(databases, currentDatabaseName), 0, limit);

return currentDatabaseName ? [...limitedDatabases, currentDatabaseName].sort() : limitedDatabases;
}

export default function DatabricksSchemaBrowser({
dataSource,
options,
Expand Down Expand Up @@ -63,10 +56,6 @@ export default function DatabricksSchemaBrowser({
() => filter(databases, database => includes(database.toLowerCase(), databaseFilterString.toLowerCase())),
[databases, databaseFilterString]
);
const limitedDatabases = useMemo(() => getLimitedDatabases(filteredDatabases, currentDatabaseName), [
filteredDatabases,
currentDatabaseName,
]);

const handleSchemaUpdate = useImmutableCallback(onSchemaUpdate);

Expand Down Expand Up @@ -116,17 +105,12 @@ export default function DatabricksSchemaBrowser({
<i className="fa fa-database m-r-5" /> Database
</>
}>
{limitedDatabases.map(database => (
{filteredDatabases.map(database => (
<Select.Option key={database}>
<i className="fa fa-database m-r-5" />
{database}
</Select.Option>
))}
{limitedDatabases.length < filteredDatabases.length && (
<Select.Option key="hidden_options" value={-1} disabled>
Some databases were hidden due to a large set, search to limit results.
</Select.Option>
)}
</Select>
}
/>
Expand All @@ -143,7 +127,7 @@ export default function DatabricksSchemaBrowser({
<div className="load-button">
<Tooltip title={!refreshing ? "Refresh Databases and Current Schema" : null}>
<Button type="link" onClick={refreshAll} disabled={refreshing}>
<Icon type="sync" spin={refreshing} />
<SyncOutlinedIcon spin={refreshing} />
</Button>
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.database-select-open .ant-input-group-addon {
background-color: #fff;

.ant-select-selection-selected-value {
.ant-select-selection-item {
visibility: hidden;
}
}
Expand All @@ -21,7 +21,11 @@
.ant-select {
width: 100%;

&.ant-select-focused .ant-select-selection {
.ant-select-selection-item {
text-align: left;
}

&.ant-select-focused .ant-select-selector {
color: inherit;
}
}
Expand Down Expand Up @@ -58,6 +62,5 @@
}

.databricks-schema-browser-db-dropdown {
width: auto !important;
max-width: 50vw;
width: 50vw !important;
Copy link
Member Author

Choose a reason for hiding this comment

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

Since we have windowing now, the auto width doesn't work with it. Also the prop dropdownMatchSelectWidth automatically disables the windowing.

}