Fix: Search bar is searching in last active tab (#2081)

* Fix: Search bar is searching in last active tab

* Fix: Missing Sample data tab changes
This commit is contained in:
darth-coder00 2022-01-06 20:23:19 +05:30 committed by GitHub
parent eb01c55676
commit b866d8a73a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -200,6 +200,10 @@ const ExplorePage: FunctionComponent = () => {
fetchCounts(); fetchCounts();
}, [searchText]); }, [searchText]);
useEffect(() => {
AppState.explorePageTab = tab;
}, [tab]);
useEffect(() => { useEffect(() => {
fetchData([ fetchData([
{ {

View File

@ -16,6 +16,10 @@ export const datasetTableTabs = [
name: 'Schema', name: 'Schema',
path: 'schema', path: 'schema',
}, },
{
name: 'Sample Data',
path: 'sample_data',
},
{ {
name: 'Profiler', name: 'Profiler',
path: 'profiler', path: 'profiler',
@ -28,10 +32,6 @@ export const datasetTableTabs = [
name: 'DBT', name: 'DBT',
path: 'dbt', path: 'dbt',
}, },
{
name: 'Sample Data',
path: 'sample_data',
},
{ {
name: 'Manage', name: 'Manage',
path: 'manage', path: 'manage',
@ -41,20 +41,22 @@ export const datasetTableTabs = [
export const getCurrentDatasetTab = (tab: string) => { export const getCurrentDatasetTab = (tab: string) => {
let currentTab = 1; let currentTab = 1;
switch (tab) { switch (tab) {
case 'profiler': case 'sample_data':
currentTab = 2; currentTab = 2;
break; break;
case 'lineage':
case 'profiler':
currentTab = 3; currentTab = 3;
break; break;
case 'dbt':
case 'lineage':
currentTab = 4; currentTab = 4;
break; break;
case 'sample_data': case 'dbt':
currentTab = 5; currentTab = 5;
break; break;