mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 18:36:08 +00:00
* Fixed: Openmetadata Tour Page Issue table is not present for dummy data #9725 * fixed failing unit test Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
This commit is contained in:
parent
22573ae600
commit
8aa6ffb10e
@ -19,6 +19,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { Space, Typography } from 'antd';
|
||||
import { AxiosError } from 'axios';
|
||||
import classNames from 'classnames';
|
||||
import { ROUTES } from 'constants/constants';
|
||||
import { lowerCase } from 'lodash';
|
||||
import React, {
|
||||
FunctionComponent,
|
||||
@ -27,7 +28,7 @@ import React, {
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { getSampleDataByTableId } from 'rest/tableAPI';
|
||||
import { WORKFLOWS_PROFILER_DOCS } from '../../constants/docs.constants';
|
||||
import { Table, TableData } from '../../generated/entity/data/table';
|
||||
@ -55,6 +56,7 @@ interface Props {
|
||||
|
||||
const SampleDataTable: FunctionComponent<Props> = ({ tableId }: Props) => {
|
||||
const tableRef = useRef<HTMLDivElement>(null);
|
||||
const location = useLocation();
|
||||
const [sampleData, setSampleData] = useState<SampleData>();
|
||||
const [scrollOffset, setScrollOffSet] = useState<number>(0);
|
||||
const [containerWidth, setContainerWidth] = useState<number>(0);
|
||||
@ -121,7 +123,7 @@ const SampleDataTable: FunctionComponent<Props> = ({ tableId }: Props) => {
|
||||
|
||||
useEffect(() => {
|
||||
setIsLoading(true);
|
||||
if (tableId) {
|
||||
if (tableId && !location.pathname.includes(ROUTES.TOUR)) {
|
||||
fetchSampleData();
|
||||
} else {
|
||||
setIsLoading(false);
|
||||
|
@ -18,6 +18,7 @@ import SampleDataTable from './SampleDataTable.component';
|
||||
|
||||
jest.mock('react-router-dom', () => ({
|
||||
Link: jest.fn().mockImplementation(({ children }) => <span>{children}</span>),
|
||||
useLocation: jest.fn().mockImplementation(() => ({ pathname: 'test' })),
|
||||
}));
|
||||
|
||||
jest.mock('rest/tableAPI', () => ({
|
||||
|
@ -98,6 +98,8 @@ const TableProfilerChart = ({ selectedTimeRange }: TableProfilerChartProps) => {
|
||||
datasetFQN,
|
||||
PROFILER_FILTER_RANGE[selectedTimeRange].days
|
||||
);
|
||||
} else {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}, [datasetFQN, selectedTimeRange]);
|
||||
|
||||
|
@ -88,7 +88,7 @@ const AddUsersModalV1 = ({
|
||||
});
|
||||
};
|
||||
|
||||
const searchUsers = (text: string, page: number) => {
|
||||
const searchUsers = (text: string, page = 1) => {
|
||||
searchData(text, page, PAGE_SIZE_MEDIUM, '', '', '', SearchIndex.USER)
|
||||
.then((res) => {
|
||||
const data = getFilterUserData(
|
||||
@ -150,7 +150,7 @@ const AddUsersModalV1 = ({
|
||||
setCurrentPage(1);
|
||||
setSearchText(searchValue);
|
||||
if (searchValue) {
|
||||
searchUsers(searchValue, currentPage);
|
||||
searchUsers(searchValue);
|
||||
} else {
|
||||
fetchAllUsers();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user