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(db-connection-ui): Show Preferred DBs #14951

Merged

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Jun 2, 2021

SUMMARY

Added starter Step 1 for preferred dbs render. User will now see the preferred DBs set in the superset_config file, and will be in a top section to make it easier for people to get to the connection page (step 2)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

https://www.loom.com/share/ab848326e2884b19bd248303e50f4da0

TESTING INSTRUCTIONS

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 Jun 2, 2021

Codecov Report

Merging #14951 (c21987f) into pexdax/db-connection-ui (b8e6687) will increase coverage by 0.11%.
The diff coverage is 90.62%.

❗ Current head c21987f differs from pull request most recent head 4aa2428. Consider uploading reports for the commit 4aa2428 to get more accurate results
Impacted file tree graph

@@                     Coverage Diff                     @@
##           pexdax/db-connection-ui   #14951      +/-   ##
===========================================================
+ Coverage                    77.52%   77.63%   +0.11%     
===========================================================
  Files                          965      964       -1     
  Lines                        49530    49361     -169     
  Branches                      6272     6229      -43     
===========================================================
- Hits                         38398    38322      -76     
+ Misses                       10929    10840      -89     
+ Partials                       203      199       -4     
Flag Coverage Δ
hive 81.35% <ø> (-0.01%) ⬇️
mysql 81.63% <ø> (-0.01%) ⬇️
postgres 81.66% <ø> (-0.01%) ⬇️
presto 81.34% <ø> (-0.01%) ⬇️
python 82.18% <ø> (-0.01%) ⬇️
sqlite 81.27% <ø> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...erset-frontend/src/components/IconButton/index.tsx 100.00% <ø> (ø)
.../database/DatabaseModal/DatabaseConnectionForm.tsx 54.54% <ø> (+8.83%) ⬆️
superset/config.py 91.09% <ø> (ø)
...c/views/CRUD/data/database/DatabaseModal/index.tsx 76.12% <89.65%> (+16.36%) ⬆️
...c/views/CRUD/data/database/DatabaseModal/styles.ts 97.36% <100.00%> (+8.03%) ⬆️
...d/src/dashboard/components/gridComponents/Tabs.jsx 76.31% <0.00%> (-11.07%) ⬇️
...nd/src/dashboard/containers/DashboardComponent.jsx 84.84% <0.00%> (-7.46%) ⬇️
...nd/src/dashboard/components/nativeFilters/utils.ts 81.63% <0.00%> (-4.62%) ⬇️
...et-frontend/src/dashboard/actions/nativeFilters.ts 76.59% <0.00%> (-4.26%) ⬇️
...ts/nativeFilters/FiltersConfigModal/FilterTabs.tsx 84.61% <0.00%> (-2.06%) ⬇️
... and 34 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 b8e6687...4aa2428. Read the comment docs.

@hughhhh hughhhh force-pushed the pexdax/db-connection-ui branch from a380629 to d5c5167 Compare June 3, 2021 16:45
@pull-request-size pull-request-size bot added size/L and removed size/XL labels Jun 3, 2021
@hughhhh hughhhh requested a review from betodealmeida June 3, 2021 17:31
@@ -1075,10 +1075,10 @@ def CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC(
# use the "engine_name" attribute of the corresponding DB engine spec
# in `superset/db_engine_specs/`.
PREFERRED_DATABASES: List[str] = [
Copy link
Member Author

Choose a reason for hiding this comment

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

will remove before merging

@hughhhh
Copy link
Member Author

hughhhh commented Jun 3, 2021

/testenv up

@hughhhh hughhhh changed the title Pexdax/db connection UI show preferred feat(db-connection-ui): Show Preferred DBs Jun 3, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2021

@hughhhh Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2021

@hughhhh Ephemeral environment creation failed. Please check the Actions logs for details.

@@ -340,5 +355,30 @@ export const EditHeaderSubtitle = styled.div`
`;

export const SelectDatabaseStyles = styled.div`
margin: ${({ theme }) => theme.gridUnit * 4}px;
margin: 0 16px;
Copy link
Member

Choose a reason for hiding this comment

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

use gridUnit

@@ -299,6 +301,73 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
}
};

const setDatabaseModel = option => {
Copy link
Member

Choose a reason for hiding this comment

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

can the param be "engine" if it's just a string? Maybe a type on that would help, too.

engine: option,
},
});
console.log('isDynamic', isDynamic);
Copy link
Member

Choose a reason for hiding this comment

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

nit remove

console.log('isDynamic', isDynamic);
};

const renderAvailableSelector = () => (
Copy link
Member

Choose a reason for hiding this comment

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

can we move step one into a separate file?


const renderModalFooter = () =>
db // if db show back + connect
? [
Copy link
Member

Choose a reason for hiding this comment

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

db && (
<>

would that work instead?

@eschutho
Copy link
Member

eschutho commented Jun 3, 2021

This is looking good @hughhhh!

@hughhhh hughhhh merged commit d05814c into pexdax/db-connection-ui Jun 4, 2021
@rusackas rusackas deleted the pexdax/db-connection-ui-show-preferred branch January 30, 2023 19:21
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.

4 participants