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: Explore "Change Dataset" UX Enhancements #12006

Merged
merged 34 commits into from
Dec 14, 2020

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Dec 10, 2020

SUMMARY
On changing dataset in explore view, the tableview will include both virtual and physical tables, and will prompt users to make sure they are okay we with changing dataset for the explore view.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

change_datasets_ux

TEST PLAN

  1. Goto explore view
  2. Click Change Datasets
  3. Search for a dataset and click link
  4. Click Proceed on the modal

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

@codecov-io
Copy link

codecov-io commented Dec 10, 2020

Codecov Report

Merging #12006 (ffd5226) into master (6311a9e) will increase coverage by 0.02%.
The diff coverage is 77.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12006      +/-   ##
==========================================
+ Coverage   67.71%   67.73%   +0.02%     
==========================================
  Files         952      952              
  Lines       46686    46703      +17     
  Branches     4577     4578       +1     
==========================================
+ Hits        31614    31636      +22     
+ Misses      14959    14955       -4     
+ Partials      113      112       -1     
Flag Coverage Δ
cypress 53.24% <7.54%> (+0.01%) ⬆️
javascript 62.69% <77.96%> (+0.04%) ⬆️
python 64.59% <ø> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...-frontend/src/datasource/ChangeDatasourceModal.tsx 80.26% <76.92%> (+6.02%) ⬆️
superset-frontend/src/explore/exploreUtils.js 65.97% <85.71%> (+1.00%) ⬆️
superset/db_engine_specs/presto.py 82.40% <0.00%> (+0.64%) ⬆️
...set-frontend/src/dashboard/util/getDropPosition.js 93.65% <0.00%> (+1.58%) ⬆️

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 6311a9e...ffd5226. Read the comment docs.

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.

LGTM, I just left a few comments on nits.

import { getClientErrorObject } from '../utils/getClientErrorObject';
import Loading from '../components/Loading';
import withToasts from '../messageToasts/enhancers/withToasts';

const CONFIRM_WARNING_MESSAGE = t(
'Warning! Changing the dataset may break the chart if the metadata does not exist in the target dataset',
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what this message means, can we clarify what metadata is necessary?

const CHANGE_WARNING_MSG = t(
'Changing the dataset may break the chart if the chart relies ' +
'on columns or metadata that does not exist in the target dataset',
);

const useDebouncedEffect = (effect: any, delay: number) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's move this to some utils.ts module, so it can be used by other components.

} = useListViewResource<Dataset>('dataset', t('dataset'), addDangerToast);

const selectDatasource = useCallback(
(datasource: { type: string; id: number; uid: string }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's make this a type, so that you don't have to declare it as <any> when creating the state in line 100.

Comment on lines 138 to 143
await fetchData({
pageIndex: 0,
pageSize: 20,
filters: [],
sortBy: [{ id: 'changed_on_delta_humanized' }],
});
Copy link
Member

Choose a reason for hiding this comment

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

Nit: you might want to move this to a const, eg:

const emptyRequest = {
  pageIndex: 0,
  pageSize: 20,
  filters: [],
  sortBy: [{ id: 'change_on_delta_humanized' }],
};

Then in your useDebounceEffect you can reuse it too:

fetchData({
  ...emptyRequest,
  filters: [{ id: 'table_name', 'operator': 'ct', value: 'filter' }],
});

/>
{!confirmChange && (
<>
<Alert bsStyle="warning">
Copy link
Member

Choose a reason for hiding this comment

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

I like the warning message here, I should use it in the overwrite confirmation dialog!

.btn-container {
display: flex;
justify-content: flex-end;
padding: 0px 15px;
Copy link
Member

Choose a reason for hiding this comment

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

might be able to use some of the theme gridunits here

@hughhhh hughhhh merged commit 3d56f58 into master Dec 14, 2020
@hughhhh hughhhh deleted the hugh/so-1119-virtual-ds-modal-refactor branch December 14, 2020 18:17
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.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/L 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants