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(rightmenu): Add Datasets to + Menu and Hide Databases when one has been connected #21530

Merged
merged 6 commits into from
Oct 24, 2022

Conversation

Antonio-RiveroMartnez
Copy link
Member

@Antonio-RiveroMartnez Antonio-RiveroMartnez commented Sep 20, 2022

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: Unnecessary queries when interacting with the menus #21569
  • Required feature flags:
  • 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 Sep 20, 2022

Codecov Report

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

❗ 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%) ⬆️

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%) ⬇️
...ontend/src/views/CRUD/data/dataset/DatasetList.tsx 57.73% <ø> (ø)
...perset-frontend/src/views/components/RightMenu.tsx 78.47% <74.19%> (+9.61%) ⬆️

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

@yousoph
Copy link
Member

yousoph commented Sep 23, 2022

/testenv up

@github-actions
Copy link
Contributor

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

@@ -0,0 +1,367 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

awesome a new test!!

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.

Looks great, and thanks for the speedy improvement on the dropdown menu, too!

@yousoph
Copy link
Member

yousoph commented Sep 23, 2022

/testenv up

@github-actions
Copy link
Contributor

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

@jinghua-qa
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2022

@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.

@jinghua-qa
Copy link
Member

LGTM!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

Ephemeral environment shutdown and build artifacts deleted.

@yousoph
Copy link
Member

yousoph commented Oct 13, 2022

/testenv up

@github-actions
Copy link
Contributor

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

- check whether user has connected to only examples DB , if so, the plus menu will show Connect Database

- If user has connected any other DB rather than just examples one, we show Connect dataset

- Add tests to right menu
- Change our tests so we can add assertions using the displayed dropdown menus instead of just the setState calls
- Putting back our useState hook
- Fix index used to render divider

- Force blue and pointer hover for other menus that are not anchors so they all render the same

- Stop querying the API to get DB info all the time when opening the menu, instead query the API only when opening Data menu
- Update our test file so we include tests for allow_file_upload
- Considering using the modal on pages with no SPA routes so CI doesn't fail
- Query non examples DB when user canDatabase OR canDataset
@jinghua-qa
Copy link
Member

/testenv up

@jinghua-qa
Copy link
Member

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.

Copy link
Member

@jinghua-qa jinghua-qa left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

@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.

@yousoph
Copy link
Member

yousoph commented Oct 20, 2022

/testenv up FEATURE_SCHEDULED_QUERIES = TRUE

@github-actions
Copy link
Contributor

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

@hughhhh hughhhh merged commit c19708b into apache:master Oct 24, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 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 size/XL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants