fix(ui): block multiple paging req while fetching data (#18436)

This commit is contained in:
Chirag Madlani 2024-10-30 14:05:44 +05:30 committed by GitHub
parent 4c3a784f7c
commit 289404748a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 33 additions and 3 deletions

View File

@ -521,9 +521,10 @@ const ClassificationDetails = forwardRef(
size="small"
/>
{showPagination && !isTagsLoading && (
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isTagsLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleTagsPageChange}

View File

@ -183,6 +183,7 @@ const DataModelTable = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleDataModelPageChange}

View File

@ -344,6 +344,7 @@ export const TestSuites = () => {
<NextPrevious
isNumberBased
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleTestSuitesPageChange}

View File

@ -206,6 +206,7 @@ export const DatabaseSchemaTable = ({
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
isNumberBased={Boolean(searchValue)}
pageSize={pageSize}
paging={paging}

View File

@ -176,6 +176,7 @@ export const QualityTab = () => {
<NextPrevious
isNumberBased
currentPage={currentPage}
isLoading={isTestsLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleTestCasePageChange}

View File

@ -631,6 +631,7 @@ const AssetsTabs = forwardRef(
<NextPrevious
isNumberBased
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={({ currentPage }: PagingHandlerParams) =>

View File

@ -308,6 +308,7 @@ const AppRunsHistory = forwardRef(
<NextPrevious
isNumberBased
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleAppHistoryPageChange}

View File

@ -317,6 +317,7 @@ const BotListV1 = ({
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={loading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleBotPageChange}

View File

@ -362,6 +362,7 @@ function IngestionListTable({
<Col span={24}>
<NextPrevious
currentPage={ingestionPagingInfo.currentPage}
isLoading={isLoading}
isNumberBased={isNumberBasedPaging}
pageSize={ingestionPagingInfo.pageSize}
paging={ingestionPagingInfo.paging}

View File

@ -525,6 +525,7 @@ const Services = ({ serviceName }: ServicesProps) => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
isNumberBased={!isEmpty(searchTerm)}
pageSize={pageSize}
paging={paging}

View File

@ -401,6 +401,7 @@ export const UserTab = ({
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
isNumberBased={Boolean(searchText)}
pageSize={pageSize}
paging={paging}

View File

@ -27,6 +27,7 @@ interface BasicProps {
pageSize: number;
currentPage: number;
isNumberBased?: boolean;
isLoading?: boolean;
}
export interface PagingProps {

View File

@ -37,6 +37,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
pageSize,
isNumberBased = false,
currentPage = 1,
isLoading,
...pagingProps
}: NextPreviousProps) => {
const { t } = useTranslation();
@ -91,7 +92,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
ghost
className="hover-button text-sm flex-center"
data-testid="previous"
disabled={computePrevDisableState()}
disabled={computePrevDisableState() || isLoading}
icon={<ArrowLeftOutlined />}
type="primary"
onClick={onPreviousHandler}>
@ -105,7 +106,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
ghost
className="hover-button text-sm flex-center"
data-testid="next"
disabled={computeNextDisableState()}
disabled={computeNextDisableState() || isLoading}
type="primary"
onClick={onNextHandler}>
<span> {t('label.next')}</span>
@ -113,6 +114,7 @@ const NextPrevious: FC<NextPreviousProps> = ({
</Button>
{onShowSizeChange && (
<Dropdown
disabled={isLoading}
menu={{
items: pageSizeOptions.map((size) => ({
label: `${size} / Page`,

View File

@ -185,6 +185,7 @@ function APIEndpointsTab({
<Col span={24}>
<NextPrevious
currentPage={currentEndpointsPage}
isLoading={apiEndpointsLoading}
pageSize={PAGE_SIZE}
paging={apiEndpoints.paging}
pagingHandler={endpointPaginationHandler}

View File

@ -199,6 +199,7 @@ const ApplicationPage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleApplicationPageChange}

View File

@ -211,6 +211,7 @@ export const CustomPageSettings = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handlePersonaPageChange}

View File

@ -251,6 +251,7 @@ const KPIList = () => {
<Col span={24}>
<NextPrevious
currentPage={kpiPage}
isLoading={isLoading}
pageSize={PAGE_SIZE_MEDIUM}
paging={kpiPaging}
pagingHandler={kpiPagingHandler}

View File

@ -176,6 +176,7 @@ function SchemaTablesTab({
<Col span={24}>
<NextPrevious
currentPage={currentTablesPage}
isLoading={tableDataLoading}
pageSize={PAGE_SIZE}
paging={tableData.paging}
pagingHandler={tablePaginationHandler}

View File

@ -153,6 +153,7 @@ const MarketPlacePage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handleMarketPlacePageChange}

View File

@ -291,6 +291,7 @@ const MetricListPage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={loadingMore}
pageSize={pageSize}
paging={paging}
pagingHandler={onPageChange}

View File

@ -275,6 +275,7 @@ const NotificationListPage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={loadingCount > 0}
pageSize={pageSize}
paging={paging}
pagingHandler={onPageChange}

View File

@ -242,6 +242,7 @@ const ObservabilityAlertsPage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={loading}
pageSize={pageSize}
paging={paging}
pagingHandler={onPageChange}

View File

@ -162,6 +162,7 @@ export const PersonaPage = () => {
<Col span={24}>
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handlePersonaPageChange}

View File

@ -337,6 +337,7 @@ const PoliciesListPage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handlePaging}

View File

@ -335,6 +335,7 @@ const RolesListPage = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={handlePaging}

View File

@ -214,6 +214,7 @@ function ServiceMainTabContent({
!isEmpty(data) && (
<NextPrevious
currentPage={currentPage}
isLoading={isServiceLoading}
pageSize={PAGE_SIZE}
paging={paging}
pagingHandler={pagingHandler}

View File

@ -94,6 +94,7 @@ function ServiceVersionMainTabContent({
!isEmpty(data) && (
<NextPrevious
currentPage={currentPage}
isLoading={isServiceLoading}
pageSize={PAGE_SIZE}
paging={paging}
pagingHandler={pagingHandler}

View File

@ -157,6 +157,7 @@ const StoredProcedureTab = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isLoading}
pageSize={pageSize}
paging={paging}
pagingHandler={storedProcedurePagingHandler}

View File

@ -476,6 +476,7 @@ const UserListPageV1 = () => {
{showPagination && (
<NextPrevious
currentPage={currentPage}
isLoading={isDataLoading}
isNumberBased={Boolean(searchValue)}
pageSize={pageSize}
paging={paging}