Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions debezium-platform-stage/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ import { StrictMode, Suspense } from 'react';
import './i18n';

// Create a client
const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: 3,
},
},
});

ReactDOM.createRoot(document.getElementById('root')!).render(
<QueryClientProvider client={queryClient}>
<Suspense fallback="loading">
<Suspense fallback={null}>
<StrictMode>
<App />
</StrictMode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("Connections", () => {
return { data: undefined, error: null, isLoading: false } as any;
});
render(<Connections />);
expect(screen.getByText("Loading...")).toBeInTheDocument();
expect(screen.getByRole("progressbar")).toBeInTheDocument();
});

it("shows API error when connections query fails", () => {
Expand Down
6 changes: 3 additions & 3 deletions debezium-platform-stage/src/pages/Connection/Connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const Connections: React.FunctionComponent<IConnectionsProps> = () => {
data: connectionsList = [],
error,
isLoading: isConnectionsLoading,
failureCount: connectionsFailureCount,
} = useQuery<Connection[], Error>(
"connections",
() => fetchData<Connection[]>(`${API_URL}/api/connections`),
Expand Down Expand Up @@ -155,10 +156,10 @@ const Connections: React.FunctionComponent<IConnectionsProps> = () => {
return (
<div data-tour="connection-page" style={{ flex: 1, display: "flex", flexDirection: "column" }}>

{error ? (
{(!!error || connectionsFailureCount >= 3) ? (
<ApiError
errorType="large"
errorMsg={error.message}
errorMsg={error?.message ?? "Network error"}
secondaryActions={
<>
<Button variant="link" onClick={() => navigateTo("/pipeline")}>
Expand All @@ -177,7 +178,6 @@ const Connections: React.FunctionComponent<IConnectionsProps> = () => {
<>
{isConnectionsLoading ? (
<EmptyState
titleText={t("Loading...")}
headingLevel="h4"
icon={Spinner}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("Destinations", () => {
isLoading: true,
} as any);
render(<Destinations />);
expect(screen.getByText("Loading...")).toBeInTheDocument();
expect(screen.getByRole("progressbar")).toBeInTheDocument();
});

it("displays error message when API fails", async () => {
Expand Down
10 changes: 5 additions & 5 deletions debezium-platform-stage/src/pages/Destination/Destinations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const Destinations: React.FunctionComponent = () => {
data: destinationsList = [],
error,
isLoading: isDestinationLoading,
failureCount: destinationsFailureCount,
} = useQuery<Destination[], Error>(
"destinations",
() => fetchData<Destination[]>(`${API_URL}/api/destinations`),
Expand Down Expand Up @@ -109,10 +110,10 @@ const Destinations: React.FunctionComponent = () => {

return (
<div data-tour="destination-page" style={{ flex: 1, display: "flex", flexDirection: "column" }}>
{error ? (
{(!!error || destinationsFailureCount >= 3) ? (
<ApiError
errorType="large"
errorMsg={error.message}
errorMsg={error?.message ?? "Network error"}
secondaryActions={
<>
<Button variant="link" onClick={() => navigateTo("/source")}>
Expand All @@ -128,7 +129,6 @@ const Destinations: React.FunctionComponent = () => {
<>
{isDestinationLoading ? (
<EmptyState
titleText={t("loading")}
headingLevel="h4"
icon={Spinner}
/>
Expand Down Expand Up @@ -184,8 +184,8 @@ const Destinations: React.FunctionComponent = () => {
</ToolbarContent>
</Toolbar>
<div data-tour="destination-table">
<SourceSinkTable
data={searchResult}
<SourceSinkTable
data={searchResult}
tableType="destination"
onClear={onClear}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe("Pipelines", () => {

render(<Pipelines />);

expect(screen.getByText("Loading...")).toBeInTheDocument();
expect(screen.getByRole("progressbar")).toBeInTheDocument();
});

it("filters pipelines based on search input", async () => {
Expand Down
6 changes: 3 additions & 3 deletions debezium-platform-stage/src/pages/Pipeline/Pipelines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const Pipelines: React.FunctionComponent = () => {
data: pipelinesList = [],
error: pipelinesError,
isLoading: pipelinesLoading,
failureCount: pipelinesFailureCount,
} = useQuery<Pipeline[], Error>(
"pipelines",
() => fetchData<Pipeline[]>(`${API_URL}/api/pipelines`),
Expand Down Expand Up @@ -263,11 +264,11 @@ const Pipelines: React.FunctionComponent = () => {

return (
<>
{pipelinesError ? (
{(!!pipelinesError || pipelinesFailureCount >= 3) ? (
<PageSection isWidthLimited>
<ApiError
errorType="large"
errorMsg={pipelinesError.message}
errorMsg={pipelinesError?.message ?? "Network error"}
secondaryActions={
<>
<Button variant="link" onClick={() => navigateTo("/source")}>
Expand All @@ -287,7 +288,6 @@ const Pipelines: React.FunctionComponent = () => {
<>
{pipelinesLoading ? (
<EmptyState
titleText={t("loading")}
headingLevel="h4"
icon={Spinner}
/>
Expand Down
2 changes: 1 addition & 1 deletion debezium-platform-stage/src/pages/Source/Sources.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe("Sources", () => {
isLoading: true,
} as any);
render(<Sources />);
expect(screen.getByText("Loading...")).toBeInTheDocument();
expect(screen.getByRole("progressbar")).toBeInTheDocument();
});

it("displays error message when API fails", async () => {
Expand Down
6 changes: 3 additions & 3 deletions debezium-platform-stage/src/pages/Source/Sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const Sources: React.FunctionComponent<ISourceProps> = () => {
data: sourcesList = [],
error,
isLoading: isSourceLoading,
failureCount: sourcesFailureCount,
} = useQuery<Source[], Error>(
"sources",
() => fetchData<Source[]>(`${API_URL}/api/sources`),
Expand Down Expand Up @@ -111,10 +112,10 @@ const Sources: React.FunctionComponent<ISourceProps> = () => {
);
return (
<div data-tour="source-page" style={{ flex: 1, display: "flex", flexDirection: "column" }}>
{error ? (
{(!!error || sourcesFailureCount >= 3) ? (
<ApiError
errorType="large"
errorMsg={error.message}
errorMsg={error?.message ?? "Network error"}
secondaryActions={
<>
<Button variant="link" onClick={() => navigateTo("/destination")}>
Expand All @@ -130,7 +131,6 @@ const Sources: React.FunctionComponent<ISourceProps> = () => {
<>
{isSourceLoading ? (
<EmptyState
titleText="Loading..."
headingLevel="h4"
icon={Spinner}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe("Transforms", () => {
isLoading: true,
} as any);
render(<Transforms />);
expect(screen.getByText("Loading...")).toBeInTheDocument();
expect(screen.getByRole("progressbar")).toBeInTheDocument();
});

it("displays error message when API fails", async () => {
Expand Down
6 changes: 3 additions & 3 deletions debezium-platform-stage/src/pages/Transforms/Transforms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const Transforms: React.FunctionComponent<ITransformsProps> = () => {
data: transformsList = [],
error,
isLoading: isTransformsLoading,
failureCount: transformsFailureCount,
} = useQuery<TransformData[], Error>(
"transforms",
() => fetchData<TransformData[]>(`${API_URL}/api/transforms`),
Expand Down Expand Up @@ -192,11 +193,11 @@ const Transforms: React.FunctionComponent<ITransformsProps> = () => {
return (
<div data-tour="transform-page" style={{ flex: 1, display: "flex", flexDirection: "column" }}>
<>
{error ? (
{(!!error || transformsFailureCount >= 3) ? (
<PageSection isWidthLimited>
<ApiError
errorType="large"
errorMsg={error.message}
errorMsg={error?.message ?? "Network error"}
secondaryActions={
<>
<Button variant="link" onClick={() => navigateTo("/source")}>
Expand All @@ -216,7 +217,6 @@ const Transforms: React.FunctionComponent<ITransformsProps> = () => {
<>
{isTransformsLoading ? (
<EmptyState
titleText={t("loading")}
headingLevel="h4"
icon={Spinner}
/>
Expand Down
Loading