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

fix: Create dataset polish/bug fix #22262

Merged
merged 8 commits into from
Dec 20, 2022
Merged

Conversation

lyndsiWilliams
Copy link
Member

SUMMARY

This PR implements the following polishes:

  • Pagination on the table should be 25 by default (previously set to 10)
  • Align refresh buttons in the left panel
  • Align width of selected tables in left panel with search input
    • The width was only wrong when there was no scrollbar present. I implemented a function to detect if a scrollbar is present and apply padding only if there is no scrollbar
  • Remove save button and ... dropdown menu from the top right of the header
    • An editing prop was added in the header component so that it can be reused when building the edit dataset component
  • Brought the "Manage your databases here" blank state from SQL lab to the left panel
  • Fixed a bug where the table wouldn't take the full height of the dataset panel when there is no "This table already has a dataset" banner at the top

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:

createDSbefore

AFTER:

1234createDSpolish

5datasetDBselectorBlankState

TESTING INSTRUCTIONS

  • Go to http://localhost:9000/dataset/add/?testing
  • Select a database and a schema
    • Select a schema with over 25 pages to see default for pagination
  • Observe all the changes described above

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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 Nov 29, 2022

Codecov Report

Merging #22262 (985f6a9) into master (04b7a26) will increase coverage by 0.04%.
The diff coverage is 76.66%.

@@            Coverage Diff             @@
##           master   #22262      +/-   ##
==========================================
+ Coverage   66.86%   66.90%   +0.04%     
==========================================
  Files        1846     1847       +1     
  Lines       70510    71241     +731     
  Branches     7723     8039     +316     
==========================================
+ Hits        47144    47665     +521     
- Misses      21364    21534     +170     
- Partials     2002     2042      +40     
Flag Coverage Δ
hive 52.53% <ø> (ø)
javascript 54.04% <76.66%> (+0.25%) ⬆️
mysql ?
postgres 78.02% <ø> (ø)
presto 52.42% <ø> (ø)
python 81.20% <ø> (-0.05%) ⬇️
sqlite 76.49% <ø> (ø)
unit 50.92% <ø> (ø)

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

Impacted Files Coverage Δ
...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx 52.11% <ø> (+0.05%) ⬆️
...iews/CRUD/data/dataset/AddDataset/Header/index.tsx 57.14% <33.33%> (-24.68%) ⬇️
...s/CRUD/data/dataset/AddDataset/LeftPanel/index.tsx 84.61% <50.00%> (-2.06%) ⬇️
...erset-frontend/src/components/EmptyState/index.tsx 77.55% <75.00%> (-0.23%) ⬇️
...a/dataset/AddDataset/DatasetPanel/DatasetPanel.tsx 90.19% <100.00%> (-1.48%) ⬇️
...set-frontend/src/views/CRUD/data/dataset/styles.ts 100.00% <100.00%> (ø)
...d/src/views/CRUD/data/dataset/AddDataset/index.tsx 51.61% <0.00%> (-8.39%) ⬇️
superset-frontend/src/views/CRUD/data/hooks.ts 57.69% <0.00%> (-5.95%) ⬇️
superset/common/utils/dataframe_utils.py 90.47% <0.00%> (-4.77%) ⬇️
... and 44 more

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

@lyndsiWilliams
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

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

@@ -248,6 +258,9 @@ const DatasetPanel = ({
const theme = useTheme();
const hasColumns = columnList?.length > 0 ?? false;
const datasetNames = datasets?.map(dataset => dataset.table_name);
const tablesWithDatasets = datasets?.find(

Choose a reason for hiding this comment

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

should we rename this to singular? tablesWithDatasets -> tableWithDatasets since find only returns one element?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah that does make more sense, adjusted in this commit.

/>
) : (
<StyledCreateDatasetTitle>
{title ?? DEFAULT_TITLE}

Choose a reason for hiding this comment

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

Do we want to render empty string if passed as title? If not, we should change this to be ||

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call! Fixed in this commit.

Base automatically changed from lyndsi/tables-with-preexisting-datasets to master December 5, 2022 21:43
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Dec 5, 2022
columns={tableColumnDefinition}
data={columnList}
pageSizeOptions={pageSizeOptions}
defaultPageSize={25}
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 make this a constant at the top?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can do! Done in this commit.

Copy link
Member

@hughhhh hughhhh left a comment

Choose a reason for hiding this comment

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

LGTM, just update the page min to be a constant at the top

const MANAGE_YOUR_DATABASES_TEXT = t('Manage your databases');
const HERE_TEXT = t('here');

export const emptyStateComponent = (emptyResultsWithSearch: boolean) => (
Copy link
Member

Choose a reason for hiding this comment

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

If this is going to be exported, I think that we should move it out of the SQlEditorLeftBar? Where are the other empty state components stored? THat's where it should be.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good thinking! Done in this commit.

@AAfghahi AAfghahi merged commit 6b20e74 into master Dec 20, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@lyndsiWilliams lyndsiWilliams deleted the lyndsi/create-dataset-polish branch December 20, 2022 17:26
@mistercrunch mistercrunch added the 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels label 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/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants