From f0a7ef50f0389d27c0e5114615ce86514962cfa8 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Tue, 7 Sep 2021 11:26:51 +0530 Subject: [PATCH] added index attribute to search data to differentiate entities (#414) --- .../ui/src/components/searched-data/SearchedData.tsx | 5 +---- .../src/main/resources/ui/src/interface/types.d.ts | 1 + .../src/main/resources/ui/src/pages/explore/index.tsx | 1 - .../src/main/resources/ui/src/utils/APIUtils.js | 1 + 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/catalog-rest-service/src/main/resources/ui/src/components/searched-data/SearchedData.tsx b/catalog-rest-service/src/main/resources/ui/src/components/searched-data/SearchedData.tsx index 2206a08842b..01de4fcbabf 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/searched-data/SearchedData.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/searched-data/SearchedData.tsx @@ -20,7 +20,6 @@ import { FormatedTableData } from 'Models'; import PropTypes from 'prop-types'; import React, { ReactNode } from 'react'; import { PAGE_SIZE } from '../../constants/constants'; -import { SearchIndex } from '../../enums/search.enum'; import { pluralize } from '../../utils/CommonUtils'; import { getOwnerFromId, @@ -43,7 +42,6 @@ type SearchedDataProp = { showResultCount?: boolean; searchText?: string; showOnboardingTemplate?: boolean; - indexType?: string; }; const SearchedData: React.FC = ({ children, @@ -56,7 +54,6 @@ const SearchedData: React.FC = ({ searchText, totalValue, fetchLeftPanel, - indexType = SearchIndex.TABLE, }: SearchedDataProp) => { const highlightSearchResult = () => { return data.map((table, index) => { @@ -73,7 +70,7 @@ const SearchedData: React.FC = ({ { currentPage={currentPage} data={data} fetchLeftPanel={fetchLeftPanel} - indexType={searchIndex} isLoading={isLoading} paginate={paginate} searchText={searchText} diff --git a/catalog-rest-service/src/main/resources/ui/src/utils/APIUtils.js b/catalog-rest-service/src/main/resources/ui/src/utils/APIUtils.js index 87d2cb020e8..436a29f863f 100644 --- a/catalog-rest-service/src/main/resources/ui/src/utils/APIUtils.js +++ b/catalog-rest-service/src/main/resources/ui/src/utils/APIUtils.js @@ -6,6 +6,7 @@ import { getRelativeTime } from './TimeUtils'; export const formatDataResponse = (hits) => { const formattedData = hits.map((hit) => { const newData = {}; + newData.index = hit._index; newData.id = hit._source.table_id || hit._source.topic_id || hit._source.dashboard_id; newData.name =