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

feat: style import button #15057

Merged
merged 3 commits into from
Jun 9, 2021
Merged

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Jun 9, 2021

SUMMARY

Use the antd Upload component when importing models. This allows us to style the button and have slightly better UX.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screenshot 2021-06-08 at 22-28-49 Superset

After:

style_import_button.mov

@yousoph @Steejay what do you think of the new modal?

TESTING INSTRUCTIONS

Imported database manually.

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

@yousoph
Copy link
Member

yousoph commented Jun 9, 2021

ooh loving how the file name looks after it's selected!

@betodealmeida betodealmeida mentioned this pull request Jun 9, 2021
8 tasks
@@ -16,10 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { FunctionComponent, useEffect, useRef, useState } from 'react';
import React, { FunctionComponent, useEffect, useState } from 'react';
import { Upload } from 'antd';
Copy link
Member

Choose a reason for hiding this comment

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

A few of us were just talking about antd imports the other day. Do you mind importing and exporting this component in the /superset-frontend/src/common/components/index.tsx file and pulling it in from there? We're going to try to clean all these up at some point for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I like having that abstraction layer for the day we move from antd to the new fancy component library. Will move.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

This new button looks great!

@betodealmeida betodealmeida added the need:merge The PR is ready to be merged label Jun 9, 2021
@junlincc
Copy link
Member

junlincc commented Jun 9, 2021

thanks for the improvement! is there any validation for invalid upload?
also the initial state with 3 buttons(1 standalone on the higher left, 2 at the bottom) in the modal looks a bit off balance visually, a centered drag and drop area will be ideal, eventually. @Steejay

Screen Shot 2021-06-09 at 1 20 34 PM

@betodealmeida
Copy link
Member Author

thanks for the improvement! is there any validation for invalid upload?

There is, the backend does a variety of validations, including:

  1. If the object exists, user needs to confirm overwrite.
  2. If the DB requires a password, user is prompted for it.
  3. Is the file format correct (ZIP, JSON, YAML, depending on the object)?
  4. For ZIP, are the contents valid?

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 9, 2021
@codecov
Copy link

codecov bot commented Jun 9, 2021

Codecov Report

Merging #15057 (9cefd7c) into master (3f527c7) will decrease coverage by 0.00%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15057      +/-   ##
==========================================
- Coverage   77.76%   77.75%   -0.01%     
==========================================
  Files         966      966              
  Lines       49628    49631       +3     
  Branches     6314     6312       -2     
==========================================
+ Hits        38591    38593       +2     
- Misses      10836    10837       +1     
  Partials      201      201              
Flag Coverage Δ
javascript 72.78% <62.50%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/common/components/index.tsx 100.00% <ø> (ø)
...rset-frontend/src/components/ImportModal/index.tsx 71.26% <62.50%> (-0.17%) ⬇️
...erset-frontend/src/datasource/DatasourceEditor.jsx 74.39% <0.00%> (ø)
...c/components/ErrorMessage/DatabaseErrorMessage.tsx 94.73% <0.00%> (ø)
.../components/ErrorMessage/ParameterErrorMessage.tsx 96.87% <0.00%> (ø)
...onents/ErrorMessage/ErrorMessageWithStackTrace.tsx 77.77% <0.00%> (ø)

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 3f527c7...9cefd7c. Read the comment docs.

@betodealmeida betodealmeida merged commit 256e145 into apache:master Jun 9, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* feat: style import button

* Update tests

* Update test
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* feat: style import button

* Update tests

* Update test
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* feat: style import button

* Update tests

* Update test
@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 need:merge The PR is ready to be merged size/L 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants