mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-25 09:28:23 +00:00
fix(ui): block multiple paging req while fetching data (#18436)
This commit is contained in:
parent
4c3a784f7c
commit
289404748a
@ -521,9 +521,10 @@ const ClassificationDetails = forwardRef(
|
|||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{showPagination && !isTagsLoading && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isTagsLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleTagsPageChange}
|
pagingHandler={handleTagsPageChange}
|
||||||
|
@ -183,6 +183,7 @@ const DataModelTable = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleDataModelPageChange}
|
pagingHandler={handleDataModelPageChange}
|
||||||
|
@ -344,6 +344,7 @@ export const TestSuites = () => {
|
|||||||
<NextPrevious
|
<NextPrevious
|
||||||
isNumberBased
|
isNumberBased
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleTestSuitesPageChange}
|
pagingHandler={handleTestSuitesPageChange}
|
||||||
|
@ -206,6 +206,7 @@ export const DatabaseSchemaTable = ({
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
isNumberBased={Boolean(searchValue)}
|
isNumberBased={Boolean(searchValue)}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
|
@ -176,6 +176,7 @@ export const QualityTab = () => {
|
|||||||
<NextPrevious
|
<NextPrevious
|
||||||
isNumberBased
|
isNumberBased
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isTestsLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleTestCasePageChange}
|
pagingHandler={handleTestCasePageChange}
|
||||||
|
@ -631,6 +631,7 @@ const AssetsTabs = forwardRef(
|
|||||||
<NextPrevious
|
<NextPrevious
|
||||||
isNumberBased
|
isNumberBased
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={({ currentPage }: PagingHandlerParams) =>
|
pagingHandler={({ currentPage }: PagingHandlerParams) =>
|
||||||
|
@ -308,6 +308,7 @@ const AppRunsHistory = forwardRef(
|
|||||||
<NextPrevious
|
<NextPrevious
|
||||||
isNumberBased
|
isNumberBased
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleAppHistoryPageChange}
|
pagingHandler={handleAppHistoryPageChange}
|
||||||
|
@ -317,6 +317,7 @@ const BotListV1 = ({
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={loading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleBotPageChange}
|
pagingHandler={handleBotPageChange}
|
||||||
|
@ -362,6 +362,7 @@ function IngestionListTable({
|
|||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={ingestionPagingInfo.currentPage}
|
currentPage={ingestionPagingInfo.currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
isNumberBased={isNumberBasedPaging}
|
isNumberBased={isNumberBasedPaging}
|
||||||
pageSize={ingestionPagingInfo.pageSize}
|
pageSize={ingestionPagingInfo.pageSize}
|
||||||
paging={ingestionPagingInfo.paging}
|
paging={ingestionPagingInfo.paging}
|
||||||
|
@ -525,6 +525,7 @@ const Services = ({ serviceName }: ServicesProps) => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
isNumberBased={!isEmpty(searchTerm)}
|
isNumberBased={!isEmpty(searchTerm)}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
|
@ -401,6 +401,7 @@ export const UserTab = ({
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
isNumberBased={Boolean(searchText)}
|
isNumberBased={Boolean(searchText)}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
|
@ -27,6 +27,7 @@ interface BasicProps {
|
|||||||
pageSize: number;
|
pageSize: number;
|
||||||
currentPage: number;
|
currentPage: number;
|
||||||
isNumberBased?: boolean;
|
isNumberBased?: boolean;
|
||||||
|
isLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PagingProps {
|
export interface PagingProps {
|
||||||
|
@ -37,6 +37,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
|
|||||||
pageSize,
|
pageSize,
|
||||||
isNumberBased = false,
|
isNumberBased = false,
|
||||||
currentPage = 1,
|
currentPage = 1,
|
||||||
|
isLoading,
|
||||||
...pagingProps
|
...pagingProps
|
||||||
}: NextPreviousProps) => {
|
}: NextPreviousProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -91,7 +92,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
|
|||||||
ghost
|
ghost
|
||||||
className="hover-button text-sm flex-center"
|
className="hover-button text-sm flex-center"
|
||||||
data-testid="previous"
|
data-testid="previous"
|
||||||
disabled={computePrevDisableState()}
|
disabled={computePrevDisableState() || isLoading}
|
||||||
icon={<ArrowLeftOutlined />}
|
icon={<ArrowLeftOutlined />}
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={onPreviousHandler}>
|
onClick={onPreviousHandler}>
|
||||||
@ -105,7 +106,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
|
|||||||
ghost
|
ghost
|
||||||
className="hover-button text-sm flex-center"
|
className="hover-button text-sm flex-center"
|
||||||
data-testid="next"
|
data-testid="next"
|
||||||
disabled={computeNextDisableState()}
|
disabled={computeNextDisableState() || isLoading}
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={onNextHandler}>
|
onClick={onNextHandler}>
|
||||||
<span> {t('label.next')}</span>
|
<span> {t('label.next')}</span>
|
||||||
@ -113,6 +114,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
|
|||||||
</Button>
|
</Button>
|
||||||
{onShowSizeChange && (
|
{onShowSizeChange && (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
|
disabled={isLoading}
|
||||||
menu={{
|
menu={{
|
||||||
items: pageSizeOptions.map((size) => ({
|
items: pageSizeOptions.map((size) => ({
|
||||||
label: `${size} / Page`,
|
label: `${size} / Page`,
|
||||||
|
@ -185,6 +185,7 @@ function APIEndpointsTab({
|
|||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentEndpointsPage}
|
currentPage={currentEndpointsPage}
|
||||||
|
isLoading={apiEndpointsLoading}
|
||||||
pageSize={PAGE_SIZE}
|
pageSize={PAGE_SIZE}
|
||||||
paging={apiEndpoints.paging}
|
paging={apiEndpoints.paging}
|
||||||
pagingHandler={endpointPaginationHandler}
|
pagingHandler={endpointPaginationHandler}
|
||||||
|
@ -199,6 +199,7 @@ const ApplicationPage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleApplicationPageChange}
|
pagingHandler={handleApplicationPageChange}
|
||||||
|
@ -211,6 +211,7 @@ export const CustomPageSettings = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handlePersonaPageChange}
|
pagingHandler={handlePersonaPageChange}
|
||||||
|
@ -251,6 +251,7 @@ const KPIList = () => {
|
|||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={kpiPage}
|
currentPage={kpiPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={PAGE_SIZE_MEDIUM}
|
pageSize={PAGE_SIZE_MEDIUM}
|
||||||
paging={kpiPaging}
|
paging={kpiPaging}
|
||||||
pagingHandler={kpiPagingHandler}
|
pagingHandler={kpiPagingHandler}
|
||||||
|
@ -176,6 +176,7 @@ function SchemaTablesTab({
|
|||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentTablesPage}
|
currentPage={currentTablesPage}
|
||||||
|
isLoading={tableDataLoading}
|
||||||
pageSize={PAGE_SIZE}
|
pageSize={PAGE_SIZE}
|
||||||
paging={tableData.paging}
|
paging={tableData.paging}
|
||||||
pagingHandler={tablePaginationHandler}
|
pagingHandler={tablePaginationHandler}
|
||||||
|
@ -153,6 +153,7 @@ const MarketPlacePage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handleMarketPlacePageChange}
|
pagingHandler={handleMarketPlacePageChange}
|
||||||
|
@ -291,6 +291,7 @@ const MetricListPage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={loadingMore}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={onPageChange}
|
pagingHandler={onPageChange}
|
||||||
|
@ -275,6 +275,7 @@ const NotificationListPage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={loadingCount > 0}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={onPageChange}
|
pagingHandler={onPageChange}
|
||||||
|
@ -242,6 +242,7 @@ const ObservabilityAlertsPage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={loading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={onPageChange}
|
pagingHandler={onPageChange}
|
||||||
|
@ -162,6 +162,7 @@ export const PersonaPage = () => {
|
|||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handlePersonaPageChange}
|
pagingHandler={handlePersonaPageChange}
|
||||||
|
@ -337,6 +337,7 @@ const PoliciesListPage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handlePaging}
|
pagingHandler={handlePaging}
|
||||||
|
@ -335,6 +335,7 @@ const RolesListPage = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={handlePaging}
|
pagingHandler={handlePaging}
|
||||||
|
@ -214,6 +214,7 @@ function ServiceMainTabContent({
|
|||||||
!isEmpty(data) && (
|
!isEmpty(data) && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isServiceLoading}
|
||||||
pageSize={PAGE_SIZE}
|
pageSize={PAGE_SIZE}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={pagingHandler}
|
pagingHandler={pagingHandler}
|
||||||
|
@ -94,6 +94,7 @@ function ServiceVersionMainTabContent({
|
|||||||
!isEmpty(data) && (
|
!isEmpty(data) && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isServiceLoading}
|
||||||
pageSize={PAGE_SIZE}
|
pageSize={PAGE_SIZE}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={pagingHandler}
|
pagingHandler={pagingHandler}
|
||||||
|
@ -157,6 +157,7 @@ const StoredProcedureTab = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isLoading}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
pagingHandler={storedProcedurePagingHandler}
|
pagingHandler={storedProcedurePagingHandler}
|
||||||
|
@ -476,6 +476,7 @@ const UserListPageV1 = () => {
|
|||||||
{showPagination && (
|
{showPagination && (
|
||||||
<NextPrevious
|
<NextPrevious
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
|
isLoading={isDataLoading}
|
||||||
isNumberBased={Boolean(searchValue)}
|
isNumberBased={Boolean(searchValue)}
|
||||||
pageSize={pageSize}
|
pageSize={pageSize}
|
||||||
paging={paging}
|
paging={paging}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user