= ({
{tabItems.length > 0 && (
-
-
+
+
+ {t('label.data-asset-plural')}
+
+ {searchQueryParam ? (
+
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.test.tsx
index 74c3fbe7284..66ad4057a7f 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.test.tsx
@@ -123,20 +123,16 @@ describe('ExploreV1', () => {
render();
expect(screen.getByTestId('explore-page')).toBeInTheDocument();
- expect(screen.getByText('Tables')).toBeInTheDocument();
- expect(screen.getByText('Stored Procedures')).toBeInTheDocument();
- expect(screen.getByText('Databases')).toBeInTheDocument();
- expect(screen.getByText('Database Schemas')).toBeInTheDocument();
- expect(screen.getByText('Pipelines')).toBeInTheDocument();
- expect(screen.getByText('Ml Models')).toBeInTheDocument();
- expect(screen.getByText('Topics')).toBeInTheDocument();
- expect(screen.getByText('Containers')).toBeInTheDocument();
- expect(screen.getByText('Tags')).toBeInTheDocument();
- expect(screen.getByText('Glossaries')).toBeInTheDocument();
- expect(screen.getByText('Dashboards')).toBeInTheDocument();
- expect(screen.getByText('Data Models')).toBeInTheDocument();
- expect(screen.getByText('Search Indexes')).toBeInTheDocument();
- expect(screen.getByText('Data Products')).toBeInTheDocument();
+
+ expect(screen.getByText('label.database-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.dashboard-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.pipeline-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.ml-model-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.topic-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.container-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.search-index-plural')).toBeInTheDocument();
+ expect(screen.getByText('label.governance')).toBeInTheDocument();
+ expect(screen.getByText('label.domain-plural')).toBeInTheDocument();
});
it('changes sort order when sort button is clicked', () => {
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less
index 2d17963f77a..a6ce604f6ea 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less
+++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less
@@ -87,6 +87,11 @@
.explore-tree {
height: @explore-page-height;
overflow: auto;
+ .ant-tree-switcher-icon {
+ width: 12px;
+ height: 12px;
+ color: @grey-4;
+ }
.ant-tree-switcher:hover {
background-color: @grey-2;
}
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.component.tsx
index 5490a6d7ad2..ff71fc2df56 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.component.tsx
@@ -36,6 +36,7 @@ const DataAssetCard = ({ service: { key, doc_count } }: DataAssetCardProps) => {
extraParameters: {
page: '1',
quickFilter: getServiceTypeExploreQueryFilter(key),
+ defaultServiceType: key,
},
}),
[key]
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.test.tsx
index 0755b5e68a2..c18c93eaab5 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/DataAssetsWidget/DataAssetCard/DataAssetCard.test.tsx
@@ -65,6 +65,7 @@ describe('DataAssetCard', () => {
extraParameters: {
page: '1',
quickFilter: filterQuery,
+ defaultServiceType: 'mysql',
},
tab: 'tables',
});
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx
index 71412f5eea8..d6dd42dd313 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx
@@ -30,7 +30,6 @@ import {
SearchHitCounts,
UrlParams,
} from '../../components/Explore/ExplorePage.interface';
-import { useExploreStore } from '../../components/Explore/useExplore.store';
import ExploreV1 from '../../components/ExploreV1/ExploreV1.component';
import { getExplorePath, PAGE_SIZE } from '../../constants/constants';
import {
@@ -60,7 +59,6 @@ import searchClassBase from '../../utils/SearchClassBase';
import { escapeESReservedCharacters } from '../../utils/StringsUtils';
import { showErrorToast } from '../../utils/ToastUtils';
import {
- ExploreSidebarTab,
QueryFieldInterface,
QueryFilterInterface,
} from './ExplorePage.interface';
@@ -81,8 +79,6 @@ const ExplorePageV1: FunctionComponent = () => {
const [searchResults, setSearchResults] =
useState>();
- const { sidebarActiveTab, setSidebarActiveTab } = useExploreStore();
-
const [showIndexNotFoundAlert, setShowIndexNotFoundAlert] =
useState(false);
@@ -237,7 +233,7 @@ const ExplorePageV1: FunctionComponent = () => {
};
const searchIndex = useMemo(() => {
- if (sidebarActiveTab === ExploreSidebarTab.TREE) {
+ if (!searchQueryParam) {
return SearchIndex.DATA_ASSET;
}
@@ -253,7 +249,7 @@ const ExplorePageV1: FunctionComponent = () => {
return !isNil(tabInfo)
? (tabInfo[0] as ExploreSearchIndex)
: SearchIndex.TABLE;
- }, [tab, searchHitCounts, sidebarActiveTab]);
+ }, [tab, searchHitCounts, searchQueryParam]);
const tabItems = useMemo(() => {
const items = Object.entries(tabsInfo).map(
@@ -377,36 +373,35 @@ const ExplorePageV1: FunctionComponent = () => {
setUpdatedAggregations(res.aggregations);
});
- const countAPICall = searchQuery({
- query: escapeESReservedCharacters(searchQueryParam),
- pageNumber: 0,
- pageSize: 0,
- queryFilter: combinedQueryFilter,
- searchIndex: SearchIndex.ALL,
- includeDeleted: showDeleted,
- trackTotalHits: true,
- fetchSource: false,
- filters: '',
- }).then((res) => {
- const buckets = res.aggregations['entityType'].buckets;
- const counts: Record = {};
-
- buckets.forEach((item) => {
- const searchIndexKey =
- item && EntityTypeSearchIndexMapping[item.key as EntityType];
-
- if (
- TABS_SEARCH_INDEXES.includes(searchIndexKey as ExploreSearchIndex)
- ) {
- counts[searchIndexKey ?? ''] = item.doc_count;
- }
- });
- setSearchHitCounts(counts as SearchHitCounts);
- });
-
const apiCalls = [searchAPICall];
- if (sidebarActiveTab !== ExploreSidebarTab.TREE) {
+ if (searchQueryParam) {
+ const countAPICall = searchQuery({
+ query: escapeESReservedCharacters(searchQueryParam),
+ pageNumber: 0,
+ pageSize: 0,
+ queryFilter: combinedQueryFilter,
+ searchIndex: SearchIndex.ALL,
+ includeDeleted: showDeleted,
+ trackTotalHits: true,
+ fetchSource: false,
+ filters: '',
+ }).then((res) => {
+ const buckets = res.aggregations['entityType'].buckets;
+ const counts: Record = {};
+
+ buckets.forEach((item) => {
+ const searchIndexKey =
+ item && EntityTypeSearchIndexMapping[item.key as EntityType];
+
+ if (
+ TABS_SEARCH_INDEXES.includes(searchIndexKey as ExploreSearchIndex)
+ ) {
+ counts[searchIndexKey ?? ''] = item.doc_count;
+ }
+ });
+ setSearchHitCounts(counts as SearchHitCounts);
+ });
apiCalls.push(countAPICall);
}
@@ -424,10 +419,6 @@ const ExplorePageV1: FunctionComponent = () => {
.finally(() => setIsLoading(false));
};
- useEffect(() => {
- setSidebarActiveTab(ExploreSidebarTab.ASSETS);
- }, []);
-
useEffect(() => {
if (isTourOpen) {
setSearchHitCounts(MOCK_EXPLORE_PAGE_COUNT);
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/ExploreUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/ExploreUtils.ts
index c76fd324947..13d25d92599 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/ExploreUtils.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/ExploreUtils.ts
@@ -227,3 +227,19 @@ export const updateTreeData = (
return node;
});
+
+export const getQuickFilterObject = (
+ bucketKey: EntityFields,
+ bucketValue: string
+) => {
+ return {
+ label: bucketKey,
+ key: bucketKey,
+ value: [
+ {
+ key: bucketValue,
+ label: bucketValue,
+ },
+ ],
+ };
+};
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts
index 54b66056b4e..386e78ea89e 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts
@@ -19,6 +19,7 @@ import { ReactComponent as GlossaryIcon } from '../assets/svg/glossary.svg';
import { ReactComponent as DashboardIcon } from '../assets/svg/ic-dashboard.svg';
import { ReactComponent as DataProductIcon } from '../assets/svg/ic-data-product.svg';
import { ReactComponent as DatabaseIcon } from '../assets/svg/ic-database.svg';
+import { ReactComponent as DomainIcon } from '../assets/svg/ic-domain.svg';
import { ReactComponent as MlModelIcon } from '../assets/svg/ic-ml-model.svg';
import { ReactComponent as PipelineIcon } from '../assets/svg/ic-pipeline.svg';
import { ReactComponent as SchemaIcon } from '../assets/svg/ic-schema.svg';
@@ -228,6 +229,8 @@ class SearchClassBase {
icon: GlossaryIcon,
data: {
entityType: EntityType.GLOSSARY_TERM,
+ isStatic: true,
+ dataId: 'Glossaries',
},
},
{
@@ -237,6 +240,26 @@ class SearchClassBase {
icon: ClassificationIcon,
data: {
entityType: EntityType.TAG,
+ isStatic: true,
+ dataId: 'Tags',
+ },
+ },
+ ],
+ },
+ {
+ title: i18n.t('label.domain-plural'),
+ key: 'Domain',
+ data: { isRoot: true },
+ icon: DomainIcon,
+ children: [
+ {
+ title: i18n.t('label.data-product-plural'),
+ key: '6',
+ isLeaf: true,
+ icon: DataProductIcon,
+ data: {
+ entityType: EntityType.DATA_PRODUCT,
+ isStatic: true,
},
},
],
@@ -244,6 +267,20 @@ class SearchClassBase {
];
}
+ public getExploreTreeKey(tab: ExplorePageTabs) {
+ const tabMapping: Record = {
+ [ExplorePageTabs.TABLES]: [SearchIndex.DATABASE],
+ [ExplorePageTabs.DASHBOARDS]: [SearchIndex.DASHBOARD],
+ [ExplorePageTabs.TOPICS]: [SearchIndex.TOPIC],
+ [ExplorePageTabs.CONTAINERS]: [SearchIndex.CONTAINER],
+ [ExplorePageTabs.PIPELINES]: [SearchIndex.PIPELINE],
+ [ExplorePageTabs.MLMODELS]: [SearchIndex.MLMODEL],
+ [ExplorePageTabs.SEARCH_INDEX]: [SearchIndex.SEARCH_INDEX],
+ };
+
+ return tabMapping[tab] || [SearchIndex.DATABASE];
+ }
+
public getTabsInfo(): Record {
return {
[SearchIndex.TABLE]: {