-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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: save database with new dynamic form #14583
Conversation
This PR includes #14456 |
Codecov Report
@@ Coverage Diff @@
## master #14583 +/- ##
==========================================
- Coverage 77.45% 77.42% -0.04%
==========================================
Files 959 960 +1
Lines 48719 48791 +72
Branches 6115 6122 +7
==========================================
+ Hits 37736 37777 +41
- Misses 10777 10811 +34
+ Partials 206 203 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
9e31ec2
to
18af9ca
Compare
antDTabsStyles, | ||
antDModalStyles(theme), | ||
antDModalNoPaddingStyles, | ||
formHelperStyles(theme), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a future version, I'd like to pass a prop to the modal for theming, or use something like Modal.noPadding to make the changes more global. Inspired by @rusackas.
040821f
to
429a793
Compare
429a793
to
7244ec3
Compare
7244ec3
to
6eae68c
Compare
// the values should align with the database | ||
// model enum in superset/superset/models/core.py | ||
export enum CONFIGURATION_METHOD { | ||
SQLALCHEMY_URI = 'sqlalchemy_form', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
This was changed to SQLALCHEMY_FORM in the backend:
https://github.com/preset-io/superset/blob/master/superset/models/core.py#L103
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it shouldn't matter what the key is on the front end, but yeah, maybe for consistency I'll change it in a future iteration. Thanks for pointing that out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup! I meant for just consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also figure out a way to centralize this enum across the backend and frontend
}; | ||
|
||
const FORM_FIELD_MAP = { | ||
host: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: go with component based mapping like @betodealmeida was mentioning in our meeting this can be a later iteration but definitely think we implement this pattern
https://app.clubhouse.io/preset/story/15898/make-databaseconnectionform-tsx-have-component-based-mapping
* master: (163 commits) fix(native-filters): Manage default value of filters by superset (apache#14785) fix: Additional ResultSet tests (apache#14741) chore: added BasicParametersMixin to Redshift (apache#14752) fix: make dataset list sort case insensitive (apache#14528) fix: use encodeURIComponent when getting table metadata (apache#14790) fix: ensure engine is outside parameters (apache#14787) database modal should close on connect with tab layout (apache#14771) feat(native-filters): add search all filter options (apache#14710) fix: extra query in Dashboard when native filter enabled (apache#14770) chore: Improves the native filters UI/UX - iteration 2 (apache#14753) fix(native filters): Fix explore state (apache#14779) fix(explore): DndColumnSelect not handling controls with "multi: false" (apache#14737) feat: Create BigQuery Parameters for DatabaseModal (apache#14721) feat: enable user impersonation in GSheets (apache#14767) fix: add DB should not say it's Postgres (apache#14766) Revert "fix(dashboard): multiple query trigger when native filter enabled (apache#14734)" (apache#14762) feat: save database with new dynamic form (apache#14583) fix: save non-parameter DBs (apache#14759) chore: Removes ColorSchemeControl.less (apache#14199) fix(explore): Icons width (apache#14717) ...
* split db modal file * split db modal file * hook up available databases * add comment
* split db modal file * split db modal file * hook up available databases * add comment
* split db modal file * split db modal file * hook up available databases * add comment
SUMMARY
This PR loads the form dynamically and saves the database with the new form. The dynamic form is hidden behind a local flag, so it does not currently show up in the UI.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
existing visualization is mostly the same with a few small tweaks
The tabs now reach across the fill width of the modal
Display name used to say "Name your dataset" as the placeholder. It's changed to "Name your database"
with button enabled (same as before)
Screen.Recording.2021-05-12.at.5.04.51.PM.mov
Go from dynamic form to SQLAlchemy form
Screen.Recording.2021-05-20.at.5.55.30.PM.mov
Tab animation
To test this locally with the dynamic form change this value:
to
CONFIGURATION_METHOD.DYNAMIC_FORM
NEW FORM (hidden behind the hard-coded value above)
On creation/form load
Required fields are filled out and button is enabled
After "connect"
TEST PLAN
new unit tests.. because some values are still hard coded, we can't test the new flow too much yet.
ADDITIONAL INFORMATION