mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-06 15:43:04 +00:00
* Fixed #488 Explore page Entity tab issue * minor fix
This commit is contained in:
parent
96729e49e3
commit
cb5e2196be
@ -32,6 +32,7 @@ class AppState {
|
||||
userTeams: Array<UserTeam> = [];
|
||||
|
||||
inPageSearchText = '';
|
||||
explorePageTab = 'tables';
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
|
@ -141,7 +141,15 @@ const Appbar: React.FC = (): JSX.Element => {
|
||||
const target = e.target as HTMLInputElement;
|
||||
if (e.key === 'Enter') {
|
||||
setIsOpen(false);
|
||||
history.push(getExplorePathWithSearch(target.value));
|
||||
history.push(
|
||||
getExplorePathWithSearch(
|
||||
target.value,
|
||||
// this is for if user is searching from another page
|
||||
location.pathname.startsWith(ROUTES.EXPLORE)
|
||||
? appState.explorePageTab
|
||||
: 'tables'
|
||||
)
|
||||
);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
@ -92,7 +92,7 @@ const SearchedData: React.FC<SearchedDataProp> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageContainer leftPanelContent={fetchLeftPanel && fetchLeftPanel()}>
|
||||
<PageContainer leftPanelContent={fetchLeftPanel?.()}>
|
||||
<div className="container-fluid" data-testid="fluid-container">
|
||||
{isLoading ? (
|
||||
<Loader />
|
||||
@ -127,7 +127,10 @@ const SearchedData: React.FC<SearchedDataProp> = ({
|
||||
) : null}
|
||||
</>
|
||||
) : (
|
||||
<ErrorPlaceHolderES type="noData" />
|
||||
<>
|
||||
{children}
|
||||
<ErrorPlaceHolderES type="noData" />
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
@ -312,7 +312,7 @@ const DatabaseDetails: FunctionComponent = () => {
|
||||
</Link>
|
||||
</td>
|
||||
<td className="tableBody-cell">
|
||||
{table.description ? (
|
||||
{table.description.trim() ? (
|
||||
<RichTextEditorPreviewer
|
||||
markdown={table.description}
|
||||
/>
|
||||
|
@ -26,6 +26,7 @@ import {
|
||||
} from 'Models';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useHistory, useLocation, useParams } from 'react-router-dom';
|
||||
import AppState from '../../AppState';
|
||||
import { searchData } from '../../axiosAPIs/miscAPI';
|
||||
import { Button } from '../../components/buttons/Button/Button';
|
||||
import ErrorPlaceHolderES from '../../components/common/error-with-placeholder/ErrorPlaceHolderES';
|
||||
@ -471,6 +472,7 @@ const ExplorePage: React.FC = (): React.ReactElement => {
|
||||
};
|
||||
const onTabChange = (selectedTab: number) => {
|
||||
if (tabsInfo[selectedTab - 1].path !== tab) {
|
||||
AppState.explorePageTab = tabsInfo[selectedTab - 1].path;
|
||||
resetFilters();
|
||||
history.push({
|
||||
pathname: getExplorePathWithSearch(
|
||||
@ -511,14 +513,18 @@ const ExplorePage: React.FC = (): React.ReactElement => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setFilters(filterObject);
|
||||
setSearchText(searchQuery || '');
|
||||
setCurrentPage(1);
|
||||
setCurrentTab(getCurrentTab(tab));
|
||||
setSearchIndex(getCurrentIndex(tab));
|
||||
}, [searchQuery]);
|
||||
|
||||
useEffect(() => {
|
||||
setFilters(filterObject);
|
||||
setFieldList(tabsInfo[getCurrentTab(tab) - 1].sortingFields);
|
||||
setSortField(tabsInfo[getCurrentTab(tab) - 1].sortField);
|
||||
}, [searchQuery, tab]);
|
||||
setCurrentTab(getCurrentTab(tab));
|
||||
setSearchIndex(getCurrentIndex(tab));
|
||||
setCurrentPage(1);
|
||||
}, [tab]);
|
||||
|
||||
useEffect(() => {
|
||||
if (getFilterString(filters)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user