Skip to content

Commit fcce6ca

Browse files
committed
debezium/dbz#1725 fix: Improve loading state management in Platform UI
Signed-off-by: Aravind <gmarav005@gmail.com>
1 parent 1760bc1 commit fcce6ca

11 files changed

Lines changed: 13 additions & 12 deletions

File tree

debezium-platform-stage/src/main.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ import { StrictMode, Suspense } from 'react';
88
import './i18n';
99

1010
// Create a client
11-
const queryClient = new QueryClient();
11+
const queryClient = new QueryClient({
12+
defaultOptions: {
13+
queries: {
14+
retry: 3,
15+
},
16+
},
17+
});
1218

1319
ReactDOM.createRoot(document.getElementById('root')!).render(
1420
<QueryClientProvider client={queryClient}>
15-
<Suspense fallback="loading">
21+
<Suspense fallback={null}>
1622
<StrictMode>
1723
<App />
1824
</StrictMode>

debezium-platform-stage/src/pages/Connection/Connections.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("Connections", () => {
8181
return { data: undefined, error: null, isLoading: false } as any;
8282
});
8383
render(<Connections />);
84-
expect(screen.getByText("Loading...")).toBeInTheDocument();
84+
expect(screen.getByRole("progressbar")).toBeInTheDocument();
8585
});
8686

8787
it("shows API error when connections query fails", () => {

debezium-platform-stage/src/pages/Connection/Connections.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ const Connections: React.FunctionComponent<IConnectionsProps> = () => {
177177
<>
178178
{isConnectionsLoading ? (
179179
<EmptyState
180-
titleText={t("Loading...")}
181180
headingLevel="h4"
182181
icon={Spinner}
183182
/>

debezium-platform-stage/src/pages/Destination/Destinations.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe("Destinations", () => {
7272
isLoading: true,
7373
} as any);
7474
render(<Destinations />);
75-
expect(screen.getByText("Loading...")).toBeInTheDocument();
75+
expect(screen.getByRole("progressbar")).toBeInTheDocument();
7676
});
7777

7878
it("displays error message when API fails", async () => {

debezium-platform-stage/src/pages/Destination/Destinations.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ const Destinations: React.FunctionComponent = () => {
128128
<>
129129
{isDestinationLoading ? (
130130
<EmptyState
131-
titleText={t("loading")}
132131
headingLevel="h4"
133132
icon={Spinner}
134133
/>

debezium-platform-stage/src/pages/Pipeline/Pipelines.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("Pipelines", () => {
6969

7070
render(<Pipelines />);
7171

72-
expect(screen.getByText("Loading...")).toBeInTheDocument();
72+
expect(screen.getByRole("progressbar")).toBeInTheDocument();
7373
});
7474

7575
it("filters pipelines based on search input", async () => {

debezium-platform-stage/src/pages/Pipeline/Pipelines.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ const Pipelines: React.FunctionComponent = () => {
287287
<>
288288
{pipelinesLoading ? (
289289
<EmptyState
290-
titleText={t("loading")}
291290
headingLevel="h4"
292291
icon={Spinner}
293292
/>

debezium-platform-stage/src/pages/Source/Sources.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("Sources", () => {
7070
isLoading: true,
7171
} as any);
7272
render(<Sources />);
73-
expect(screen.getByText("Loading...")).toBeInTheDocument();
73+
expect(screen.getByRole("progressbar")).toBeInTheDocument();
7474
});
7575

7676
it("displays error message when API fails", async () => {

debezium-platform-stage/src/pages/Source/Sources.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ const Sources: React.FunctionComponent<ISourceProps> = () => {
130130
<>
131131
{isSourceLoading ? (
132132
<EmptyState
133-
titleText="Loading..."
134133
headingLevel="h4"
135134
icon={Spinner}
136135
/>

debezium-platform-stage/src/pages/Transforms/Transforms.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("Transforms", () => {
7070
isLoading: true,
7171
} as any);
7272
render(<Transforms />);
73-
expect(screen.getByText("Loading...")).toBeInTheDocument();
73+
expect(screen.getByRole("progressbar")).toBeInTheDocument();
7474
});
7575

7676
it("displays error message when API fails", async () => {

0 commit comments

Comments
 (0)