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

refactor: Bootstrap to AntD - Form - iteration 3 #14502

Merged
merged 1 commit into from May 8, 2021

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Migrates Form components from Bootstrap to AntD (iteration 3).

See: #10254

@rusackas @junlincc @pkdotson

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2021-04-28 at 9 35 36 AM

Screen Shot 2021-04-28 at 9 34 10 AM

Screen Shot 2021-04-28 at 10 03 32 AM

Screen Shot 2021-04-28 at 10 02 28 AM

Screen Shot 2021-04-28 at 10 08 07 AM

Screen Shot 2021-04-28 at 10 26 11 AM

Screen Shot 2021-04-28 at 10 33 47 AM

Screen Shot 2021-04-28 at 11 13 33 AM

Screen Shot 2021-04-28 at 11 23 44 AM

Screen Shot 2021-04-28 at 11 47 53 AM

TEST PLAN

1 - Access the touched components
2 - Check that the layouts and functionality are working

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #14502 (d2ba2be) into master (68058b0) will increase coverage by 0.16%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14502      +/-   ##
==========================================
+ Coverage   77.06%   77.23%   +0.16%     
==========================================
  Files         958      958              
  Lines       48242    48292      +50     
  Branches     6062     5658     -404     
==========================================
+ Hits        37179    37299     +120     
+ Misses      10862    10791      -71     
- Partials      201      202       +1     
Flag Coverage Δ
javascript 72.38% <75.00%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...src/dashboard/components/PropertiesModal/index.jsx 85.61% <ø> (ø)
.../src/explore/components/controls/BoundsControl.jsx 93.93% <ø> (ø)
...tend/src/SqlLab/components/ScheduleQueryButton.tsx 28.12% <50.00%> (-1.11%) ⬇️
superset-frontend/src/common/components/index.tsx 92.00% <60.00%> (-8.00%) ⬇️
...erset-frontend/src/SqlLab/components/SaveQuery.tsx 74.41% <71.42%> (-0.59%) ⬇️
superset-frontend/src/components/Form/FormItem.tsx 100.00% <100.00%> (ø)
.../src/explore/components/DataTableControl/index.tsx 86.00% <100.00%> (ø)
...ols/MetricControl/AdhocMetricEditPopover/index.jsx 80.15% <100.00%> (+1.52%) ⬆️
...ponents/controls/TimeSeriesColumnControl/index.jsx 100.00% <100.00%> (ø)
.../src/explore/components/ControlPanelsContainer.tsx 81.42% <0.00%> (-3.53%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68058b0...d2ba2be. Read the comment docs.

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

LGTM! Just some inputs/ideas

superset-frontend/src/components/Form/FormItem.tsx Outdated Show resolved Hide resolved
type="text"
placeholder={t('Label for your query')}
value={label}
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move away from having to set the values in the component state. The beauty of the Antd forms is that they can handle pretty much everything in the background. We could just set a name in the FormItem and pass the initialValues to the Form as an object. All the rest will be handled internally by Antd. This looks like the perfect case as there is no custom manipulation/side effects of the data. Other forms might gain the same benefit.

Copy link
Member Author

Choose a reason for hiding this comment

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

@geido I totally agree with you. I noticed that all screens were using forms just to reuse the layout spacing, but none were using validation, state management, etc. This problem is happening everywhere there is a form. The way I'm tackling this is to first get rid of Boostrap and try to avoid adding more refactoring to the components. After that phase, we can revisit all the form components focusing specifically on using the form benefits. This needs a discussion because we need to decide if we're going to use form validation.

@rusackas

@junlincc junlincc added the frontend:refactor Related to refactoring the frontend label May 8, 2021
@junlincc
Copy link
Member

junlincc commented May 8, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2021

@junlincc Ephemeral environment spinning up at http://34.222.126.21:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@rusackas rusackas merged commit 79ff962 into apache:master May 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2021

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina added this to In progress in AntD Transition (SIP-48) via automation Jun 28, 2021
@michael-s-molina michael-s-molina moved this from In progress to Done in AntD Transition (SIP-48) Jun 28, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels frontend:refactor Related to refactoring the frontend size/L 🚢 1.3.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants