fix: Explore "Change Dataset" UX Enhancements#12006
Conversation
…into hugh/so-1119-virtual-ds
…into hugh/so-1119-virtual-ds
…into hugh/so-1119-virtual-ds
…into hugh/so-1119-virtual-ds
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
betodealmeida
left a comment
There was a problem hiding this comment.
LGTM, I just left a few comments on nits.
| 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', |
There was a problem hiding this comment.
I'm not sure what this message means, can we clarify what metadata is necessary?
| 'on columns or metadata that does not exist in the target dataset', | ||
| ); | ||
|
|
||
| const useDebouncedEffect = (effect: any, delay: number) => { |
There was a problem hiding this comment.
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 }) => { |
There was a problem hiding this comment.
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.
| await fetchData({ | ||
| pageIndex: 0, | ||
| pageSize: 20, | ||
| filters: [], | ||
| sortBy: [{ id: 'changed_on_delta_humanized' }], | ||
| }); |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
might be able to use some of the theme gridunits here
…into hugh/so-1119-virtual-ds-modal-refactor
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
TEST PLAN
Change DatasetsProceedon the modalADDITIONAL INFORMATION