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

Upgrade Ant Design to v4 #5068

merged 58 commits into from
Aug 25, 2020

Conversation

gabrieldutra
Copy link
Member

@gabrieldutra gabrieldutra commented Jul 27, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Other

Description

This huge PR updates our Ant Design version to v4, mostly following the migration doc.

Although it looks big, the changes in code are not that much. There are a lot of small changes, so I tried to comment on the highlights I see. Also it should be important to keep track of the changes for any code that extends Redash.

Biggest changes from the Ant Migration in Redash

  1. Updated all Ant Icon calls
  2. Refactored DynamicForm
  3. Updates on QueryVisualizationTabs (we have a bigger customization on top of Antd Tabs and their structure has changed)
  4. Table Visualization updates -> Search Feature moved to the top and some structure updates
  5. Dynamic Date[Ranges] buttons
  6. Updates on Jest and Cypress tests. Cypress ones (+ Percy) were really helpful again to track bugs during the migration.

What was done

  • Upgrade React version
  • Upgrade icons
  • Check Ant Tabs auto-height breaking (for Query source and view pages)
  • Add Icon suffix to Icon elements
  • Fix table visualization sort
  • Visualization Library updates
  • Refactor DynamicForm (the only Form.create usage)
  • Check List pages not rendering "Last updated at"/"Created At" (or any other Date)
  • Outdated Query page breaking
  • Fix search feature for Table viz (currently using a hack with the footer)
  • Fix styling for Query page tabs
  • Fix all Tabs padding (Check visualization editor as an example)
  • Use column group for Table viz instead of footer
  • Resync master
  • Fix Date[Range] Parameters
  • Fix Dropdown parameters styling (dirty, arrow position, etc)
  • Check Dropdown parameter styling diff (Antd issue: Multiselect with icons don't have padding)
  • Update Cypress tests
  • [Extra] Update Cypress version
  • Percy fixes (See a full diff here)
  • Update Databricks Schema Browser
  • Tests, tests and tests

Related Tickets & Documents

#4908 (not fixed yet, need to remove dropdownMatchSelectWidth prop)

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Overall the app should remain the same, but there are a few changes that either came from Ant Design default or they was just of easier implementation.

Table Visualization

Header Height

Before After
Screen Shot 2020-08-12 at 11 47 27 Screen Shot 2020-08-12 at 11 46 56

Search Position

Before After
Screen Shot 2020-08-12 at 11 44 41 Screen Shot 2020-08-12 at 11 43 24

(Was simpler to implement this way)

Databricks Schema Browser

Options width

Before After
Screen Shot 2020-08-12 at 15 04 35 Screen Shot 2020-08-12 at 15 05 07

(Since we have windowing now, it was not possible to keep it flexible with items width. I default it to 50vw of width to make sure long names are displayed)


(I'll add more relevant visual differences as I notice them)

For more visual differences check Percy Diff

Links for testing
Current master
Antd v4 Redash

@gabrieldutra gabrieldutra self-assigned this Aug 6, 2020
@gabrieldutra gabrieldutra changed the title Upgrade Antd to v4 Upgrade Ant Design to v4 Aug 12, 2020
@gabrieldutra gabrieldutra marked this pull request as ready for review August 12, 2020 14:54
@@ -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.

@@ -141,7 +141,7 @@ export default class ItemsTable extends React.Component {

return extend(omit(column, ["field", "orderByField", "render"]), {
key: "column" + index,
dataIndex: "item[" + JSON.stringify(column.field) + "]",
dataIndex: ["item", column.field],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Amazing 🎉

@kravets-levko
Copy link
Collaborator

I still want to check it on preview before approving, but ATM I have no other comments to the code - stunning work @gabrieldutra!

Copy link
Collaborator

@kravets-levko kravets-levko left a comment

Choose a reason for hiding this comment

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

🌟

@gabrieldutra gabrieldutra merged commit a31196a into master Aug 25, 2020
@gabrieldutra gabrieldutra deleted the antd-v4 branch August 25, 2020 17:24
@gabrieldutra
Copy link
Member Author

Let's do it 🚀

I rechecked Percy, fixed some minor margin issues, we may see more of those (hopefully nothing critical), but we can fix as it goes.

gabrieldutra added a commit that referenced this pull request Aug 30, 2020
@gabrieldutra gabrieldutra mentioned this pull request Aug 31, 2020
2 tasks
andrewdever pushed a commit to andrewdever/redash that referenced this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants