mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-28 10:56:02 +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 { Space, Typography } from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { ROUTES } from 'constants/constants';
|
||||||
import { lowerCase } from 'lodash';
|
import { lowerCase } from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
FunctionComponent,
|
FunctionComponent,
|
||||||
@ -27,7 +28,7 @@ import React, {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { getSampleDataByTableId } from 'rest/tableAPI';
|
import { getSampleDataByTableId } from 'rest/tableAPI';
|
||||||
import { WORKFLOWS_PROFILER_DOCS } from '../../constants/docs.constants';
|
import { WORKFLOWS_PROFILER_DOCS } from '../../constants/docs.constants';
|
||||||
import { Table, TableData } from '../../generated/entity/data/table';
|
import { Table, TableData } from '../../generated/entity/data/table';
|
||||||
@ -55,6 +56,7 @@ interface Props {
|
|||||||
|
|
||||||
const SampleDataTable: FunctionComponent<Props> = ({ tableId }: Props) => {
|
const SampleDataTable: FunctionComponent<Props> = ({ tableId }: Props) => {
|
||||||
const tableRef = useRef<HTMLDivElement>(null);
|
const tableRef = useRef<HTMLDivElement>(null);
|
||||||
|
const location = useLocation();
|
||||||
const [sampleData, setSampleData] = useState<SampleData>();
|
const [sampleData, setSampleData] = useState<SampleData>();
|
||||||
const [scrollOffset, setScrollOffSet] = useState<number>(0);
|
const [scrollOffset, setScrollOffSet] = useState<number>(0);
|
||||||
const [containerWidth, setContainerWidth] = useState<number>(0);
|
const [containerWidth, setContainerWidth] = useState<number>(0);
|
||||||
@ -121,7 +123,7 @@ const SampleDataTable: FunctionComponent<Props> = ({ tableId }: Props) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
if (tableId) {
|
if (tableId && !location.pathname.includes(ROUTES.TOUR)) {
|
||||||
fetchSampleData();
|
fetchSampleData();
|
||||||
} else {
|
} else {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
@ -18,6 +18,7 @@ import SampleDataTable from './SampleDataTable.component';
|
|||||||
|
|
||||||
jest.mock('react-router-dom', () => ({
|
jest.mock('react-router-dom', () => ({
|
||||||
Link: jest.fn().mockImplementation(({ children }) => <span>{children}</span>),
|
Link: jest.fn().mockImplementation(({ children }) => <span>{children}</span>),
|
||||||
|
useLocation: jest.fn().mockImplementation(() => ({ pathname: 'test' })),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('rest/tableAPI', () => ({
|
jest.mock('rest/tableAPI', () => ({
|
||||||
|
@ -98,6 +98,8 @@ const TableProfilerChart = ({ selectedTimeRange }: TableProfilerChartProps) => {
|
|||||||
datasetFQN,
|
datasetFQN,
|
||||||
PROFILER_FILTER_RANGE[selectedTimeRange].days
|
PROFILER_FILTER_RANGE[selectedTimeRange].days
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
}, [datasetFQN, selectedTimeRange]);
|
}, [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)
|
searchData(text, page, PAGE_SIZE_MEDIUM, '', '', '', SearchIndex.USER)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = getFilterUserData(
|
const data = getFilterUserData(
|
||||||
@ -150,7 +150,7 @@ const AddUsersModalV1 = ({
|
|||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
setSearchText(searchValue);
|
setSearchText(searchValue);
|
||||||
if (searchValue) {
|
if (searchValue) {
|
||||||
searchUsers(searchValue, currentPage);
|
searchUsers(searchValue);
|
||||||
} else {
|
} else {
|
||||||
fetchAllUsers();
|
fetchAllUsers();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user