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

refactor: move CTAS/CVAS field II #13877

Merged
merged 27 commits into from
Apr 5, 2021
Merged

refactor: move CTAS/CVAS field II #13877

merged 27 commits into from
Apr 5, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Mar 30, 2021

SUMMARY

Moved CTAS/CVAS Schema Field Closer to the "Allow Create Table As" In Edit Datasource Modal. This required nested conditional rendering, so I had to use some useState/useEffect in order to hold that state at a higher level for all functions to run properly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Field before:

ctascvas-before

#### Field after:

ctascvas-after-1

ctascvas-after-2

ctascvas-after-3

TEST PLAN

Tests will ensure that all elements are rendered in their respectively appropriate conditions.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@hughhhh hughhhh changed the title Implemented testing on DatabaseModal_spec refactor: move CTAS/CVAS field #13810 Mar 30, 2021
@hughhhh hughhhh changed the title refactor: move CTAS/CVAS field #13810 refactor: move CTAS/CVAS field II Mar 30, 2021
@hughhhh hughhhh closed this Mar 31, 2021
@hughhhh hughhhh reopened this Mar 31, 2021
@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #13877 (72768d8) into master (4187d9e) will increase coverage by 0.44%.
The diff coverage is 88.23%.

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

@@            Coverage Diff             @@
##           master   #13877      +/-   ##
==========================================
+ Coverage   77.91%   78.36%   +0.44%     
==========================================
  Files         934      934              
  Lines       47350    47369      +19     
  Branches     5941     5946       +5     
==========================================
+ Hits        36894    37121     +227     
+ Misses      10308    10104     -204     
+ Partials      148      144       -4     
Flag Coverage Δ
cypress 56.03% <74.41%> (+2.80%) ⬆️
javascript 66.38% <86.27%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
...end/src/views/CRUD/data/database/DatabaseModal.tsx 78.94% <86.95%> (+19.20%) ⬆️
...-frontend/src/components/IndeterminateCheckbox.tsx 100.00% <100.00%> (+5.26%) ⬆️
...set-frontend/src/dashboard/util/getDropPosition.js 90.90% <0.00%> (-1.52%) ⬇️
superset-frontend/src/SqlLab/actions/sqlLab.js 63.26% <0.00%> (+0.20%) ⬆️
superset-frontend/src/reduxUtils.ts 81.01% <0.00%> (+1.26%) ⬆️
...-frontend/src/dashboard/actions/dashboardLayout.js 98.03% <0.00%> (+1.96%) ⬆️
...frontend/src/dashboard/reducers/dashboardLayout.js 99.00% <0.00%> (+2.00%) ⬆️
superset-frontend/src/views/routes.tsx 56.81% <0.00%> (+2.27%) ⬆️
...-frontend/src/dashboard/reducers/dashboardState.js 85.71% <0.00%> (+3.57%) ⬆️
...et-frontend/src/components/EditableTitle/index.tsx 75.30% <0.00%> (+3.70%) ⬆️
... and 19 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 4187d9e...cedabe2. Read the comment docs.

@@ -480,6 +480,8 @@ export const initialState = {
DEFAULT_SQLLAB_LIMIT: 1000,
SQL_MAX_ROW: 100000,
DISPLAY_MAX_ROW: 100,
SQLALCHEMY_DOCS_URL: 'test_SQLALCHEMY_DOCS_URL',
SQLALCHEMY_DISPLAY_TEXT: 'test_SQLALCHEMY_DISPLAY_TEXT',
Copy link
Member

Choose a reason for hiding this comment

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

wasn't this part of a previous PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure but we wanted to update the fixture to make sure it has all the config items

// When clicked, "Expose in SQL Lab" becomes unchecked
userEvent.click(exposeInSqlLab);

// While unchecked, only "Expose in SQL Lab" should display
Copy link
Member

Choose a reason for hiding this comment

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

Are the comments still aligned with the code? This says unchecked, while the assertion below is checked.

expect(exposeInSqlLab).toBeChecked();
const checkboxes = screen
.getAllByRole('checkbox')
.filter(checkbox => !checkbox.checked);
Copy link
Member

Choose a reason for hiding this comment

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

nice

// Uncheck both "Allow CTAS" and "Allow CVAS" to hide schema field again
userEvent.click(allowCTAS);
// Both checkboxes go unchecked, so the field should no longer render
userEvent.click(allowCVAS);
Copy link
Member

Choose a reason for hiding this comment

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

nit, but I would move this up a line with the other click to be more in line with the comments.

@eschutho
Copy link
Member

We changed some functionality of the indeterminate checkbox, so we'll need to test across the site cc @rusackas @junlincc
I'm doing some visual testing now.

@eschutho
Copy link
Member

eschutho commented Mar 31, 2021

Screen.Recording.2021-03-31.mov

Other checkboxes:
existing:
Screenshot_3_31_21__3_57_PM
new:
Screenshot_3_31_21__3_57_PM
existing:
_DEV__Superset
new:
Superset

@eschutho
Copy link
Member

@hughhhh @lyndsiWilliams indeterminate checkboxes are only on this modal and the list views. The list views looked ok. I would just make sure that all of the checkboxes in the modal are passing in the label and then just do a check on updating any styles.

@hughhhh hughhhh force-pushed the hugh/move-ctas-cvas-fields branch from aca7984 to e9d9be7 Compare April 2, 2021 16:35
@hughhhh
Copy link
Member Author

hughhhh commented Apr 2, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2021

@hughhhh Ephemeral environment creation is currently limited to committers.

@hughhhh hughhhh force-pushed the hugh/move-ctas-cvas-fields branch from 5faef21 to 9febdce Compare April 2, 2021 18:04
@hughhhh
Copy link
Member Author

hughhhh commented Apr 2, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2021

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

@eschutho
Copy link
Member

eschutho commented Apr 2, 2021

looks great! I rebased this recently and saw that an earlier commit had a few trims on database_name in the DatabaseModal file. Do we need to add those in?
db.database_name.trim()
Here's the PR if you want to make sure that they changes are represented here: https://github.com/apache/superset/pull/13800/files

@eschutho
Copy link
Member

eschutho commented Apr 2, 2021

tested in ephemeral environment, too, and it looks good. I wasn't able to test save functionality b/c of sqllite but I had tested it locally previously.

@hughhhh
Copy link
Member Author

hughhhh commented Apr 5, 2021

looks great! I rebased this recently and saw that an earlier commit had a few trims on database_name in the DatabaseModal file. Do we need to add those in?
db.database_name.trim()
Here's the PR if you want to make sure that they changes are represented here: #13800 (files)

Those changes we need are currently on the branch already, the other database_name reference don't need to have trim. We can add them if want the consistency

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Nice!

@hughhhh hughhhh merged commit d006178 into master Apr 5, 2021
@hughhhh hughhhh deleted the hugh/move-ctas-cvas-fields branch April 5, 2021 20:57
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2021

Ephemeral environment shutdown and build artifacts deleted.

lyndsiWilliams added a commit to preset-io/superset that referenced this pull request Apr 7, 2021
Co-authored-by: lyndsiWilliams <kcatgirl@gmail.com>
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
Co-authored-by: lyndsiWilliams <kcatgirl@gmail.com>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
Co-authored-by: lyndsiWilliams <kcatgirl@gmail.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 size/XL 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants