feat(SQL Lab): Make SQL Lab explore use the default viz from the config file (#20056)

* Modified SQL Lab so it uses the default viz to explore a new dataset with

* Added a comment to the config file

* Remove trailing whitespace

* [CLDN-1312] Removed the 'viz_type' variable so that when it is undefinded in the back-end, it gets set to the default viz

* [CLDN-1312] Only sets the 'all_columns' variable if the default viz type is a 'table'

* Will only pop 'selectedColumns' out of 'form_data' if it is present

* [CLDN-1312] Updated files so that the default viz is now being used again in SQL Lab Explore
This commit is contained in:
cccs-Dustin
2022-06-22 13:33:44 -04:00
committed by GitHub
parent b66a617ed9
commit daded10992
4 changed files with 16 additions and 7 deletions

View File

@@ -159,9 +159,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
exploreChart({
...EXPLORE_CHART_DEFAULT,
datasource: `${datasetToOverwrite.datasetId}__table`,
all_columns: query.results.selected_columns.map(
(d: { name: string; type: string; is_dttm: boolean }) => d.name,
),
selected_columns: query.results.selected_columns,
});
};
@@ -243,8 +241,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
metrics: [],
groupby: [],
time_range: 'No filter',
viz_type: 'table',
all_columns: selectedColumns.map(c => c.name),
selectedColumns,
row_limit: 1000,
});
})