superset icon indicating copy to clipboard operation
superset copied to clipboard

feat(rightmenu): Add Datasets to + Menu and Hide Databases when one has been connected

Open Antonio-RiveroMartnez opened this issue 2 years ago • 1 comments

SUMMARY

We are adding some extra logic to RightMenu so it checks for what databases the user has connected before displaying options in the dropdown.

Plus menu logic:

Connect database: shows for users who can create databases, until their first non examples db is connected
Create dataset: shows for users who can create a dataset as soon as at least one non examples db is connected
[no change] Connect Google Sheet: shows for users who can create databases, always
[no change] Upload CSV, columnar, Excel: shows for users who can create databases all the time (tooltip when no csv uploads enabled, active when csv uploads enabled). For users who can upload but can't connect db, only shows once uploads are enabled on at least one db.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: error

After: test test

TESTING INSTRUCTIONS

  1. Login into the app
  2. Connect a database that is not example and check the logic form above
  3. Remove all connected databases and check the logic from above
  4. Clicking on the connect database menu should open the Connect Database modal
  5. Clicking on the create dataset menu should open the Create Dataset modal

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [X] 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

Antonio-RiveroMartnez avatar Sep 20 '22 13:09 Antonio-RiveroMartnez

Codecov Report

Merging #21530 (c3a8c3a) into master (54f6fd6) will increase coverage by 0.01%. The diff coverage is 62.16%.

:exclamation: Current head c3a8c3a differs from pull request most recent head 78a047d. Consider uploading reports for the commit 78a047d to get more accurate results

@@            Coverage Diff             @@
##           master   #21530      +/-   ##
==========================================
+ Coverage   66.90%   66.92%   +0.01%     
==========================================
  Files        1805     1805              
  Lines       69081    69106      +25     
  Branches     7378     7387       +9     
==========================================
+ Hits        46218    46246      +28     
+ Misses      20953    20952       -1     
+ Partials     1910     1908       -2     
Flag Coverage Δ
javascript 53.32% <62.16%> (+0.04%) :arrow_up:

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

Impacted Files Coverage Δ
...nd/src/views/CRUD/data/dataset/AddDatasetModal.tsx 39.13% <0.00%> (-5.06%) :arrow_down:
...ontend/src/views/CRUD/data/dataset/DatasetList.tsx 57.73% <ø> (ø)
...perset-frontend/src/views/components/RightMenu.tsx 78.47% <74.19%> (+9.61%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 20 '22 14:09 codecov[bot]

/testenv up

yousoph avatar Sep 23 '22 00:09 yousoph

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

github-actions[bot] avatar Sep 23 '22 00:09 github-actions[bot]

/testenv up

yousoph avatar Sep 23 '22 19:09 yousoph

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

github-actions[bot] avatar Sep 23 '22 19:09 github-actions[bot]

/testenv up

jinghua-qa avatar Oct 03 '22 16:10 jinghua-qa

@jinghua-qa Ephemeral environment spinning up at http://52.12.5.68:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Oct 03 '22 16:10 github-actions[bot]

LGTM!

jinghua-qa avatar Oct 04 '22 07:10 jinghua-qa

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Oct 05 '22 19:10 github-actions[bot]

/testenv up

yousoph avatar Oct 13 '22 17:10 yousoph

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

github-actions[bot] avatar Oct 13 '22 22:10 github-actions[bot]

/testenv up

jinghua-qa avatar Oct 20 '22 14:10 jinghua-qa

Test the alpha and gamma role in local env and verified alpha user can see create dataset in + menu when 1 non-example db is added.

jinghua-qa avatar Oct 20 '22 18:10 jinghua-qa

@jinghua-qa Ephemeral environment spinning up at http://52.38.189.221:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Oct 20 '22 19:10 github-actions[bot]

/testenv up FEATURE_SCHEDULED_QUERIES = TRUE

yousoph avatar Oct 20 '22 23:10 yousoph

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

github-actions[bot] avatar Oct 20 '22 23:10 github-actions[bot]

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Oct 24 '22 20:10 github-actions[bot]