Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Wrap routes in suspense wrapper that haven't done so in child data components #2211

Merged
merged 2 commits into from
Sep 23, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={true} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={true} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// 🚩 flagging that for shared routes between roles, `Operator` code is a component for code maintainability
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

import Operator from "@/administration/app/components/operators/Operator";

export default async function Page() {
return <Operator />;
return (
<Suspense fallback={<Loading />}>
<Operator />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { UUID } from "crypto";
import FacilityPage from "@/administration/app/components/facilities/FacilityPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params,
}: {
params: Readonly<{ operationId: UUID }>;
}) {
return <FacilityPage operationId={params.operationId} />;
return (
<Suspense fallback={<Loading />}>
<FacilityPage operationId={params.operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import OperationInformationPage from "@/administration/app/components/operations/OperationInformationPage";
import { UUID } from "crypto";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params: { operationId },
}: Readonly<{
params: { operationId: UUID };
}>) {
return <OperationInformationPage operationId={operationId} />;
return (
<Suspense fallback={<Loading />}>
<OperationInformationPage operationId={operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page() {
return <ContactPage />;
return (
<Suspense fallback={<Loading />}>
<ContactPage />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={true} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={true} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// 🚩 flagging that for shared routes between roles, `Operator` code is a component for code maintainability

import Operator from "@/administration/app/components/operators/Operator";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page() {
return <Operator />;
return (
<Suspense fallback={<Loading />}>
<Operator />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { UUID } from "crypto";
import FacilityPage from "@/administration/app/components/facilities/FacilityPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params,
}: {
params: Readonly<{ operationId: UUID }>;
}) {
return <FacilityPage operationId={params.operationId} />;
return (
<Suspense fallback={<Loading />}>
<FacilityPage operationId={params.operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import OperationInformationPage from "@/administration/app/components/operations/OperationInformationPage";
import { UUID } from "crypto";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params: { operationId },
}: Readonly<{
params: { operationId: UUID };
}>) {
return <OperationInformationPage operationId={operationId} />;
return (
<Suspense fallback={<Loading />}>
<OperationInformationPage operationId={operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={false} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={false} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "apps/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={false} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={false} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import OperationRegistrationPage from "apps/registration/app/components/operations/OperationRegistrationPage";

import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";
import { UUID } from "crypto";

export default function Page({
Expand All @@ -11,10 +12,12 @@ export default function Page({
}) {
const { operation, step } = params;
return (
<OperationRegistrationPage
step={parseInt(step)}
operation={operation}
searchParams={searchParams}
/>
<Suspense fallback={<Loading />}>
<OperationRegistrationPage
step={parseInt(step)}
operation={operation}
searchParams={searchParams}
/>
</Suspense>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import OperationRegistrationPage from "@/registration/app/components/operations/OperationRegistrationPage";
import { UUID } from "crypto";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params,
Expand All @@ -11,12 +13,12 @@ export default async function Page({
searchParams: any;
}) {
return (
<>
<Suspense fallback={<Loading />}>
<OperationRegistrationPage
step={1}
operation={params?.operation}
searchParams={searchParams}
/>
</>
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import OperationRegistrationPage from "apps/registration/app/components/operations/OperationRegistrationPage";

import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";
import { UUID } from "crypto";

export default function Page({
Expand All @@ -11,10 +12,12 @@ export default function Page({
}) {
const { operation, step } = params;
return (
<OperationRegistrationPage
step={parseInt(step)}
operation={operation}
searchParams={searchParams}
/>
<Suspense fallback={<Loading />}>
<OperationRegistrationPage
step={parseInt(step)}
operation={operation}
searchParams={searchParams}
/>
</Suspense>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import OperationRegistrationPage from "@/registration/app/components/operations/OperationRegistrationPage";
import { UUID } from "crypto";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params,
Expand All @@ -11,12 +13,12 @@ export default async function Page({
searchParams: any;
}) {
return (
<>
<Suspense fallback={<Loading />}>
<OperationRegistrationPage
step={1}
operation={params?.operation}
searchParams={searchParams}
/>
</>
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import FacilityReviewFormData from "@reporting/src/app/components/facility/FacilityReviewFormData";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params,
}: {
params: { version_id: number; facility_id: number };
}) {
return (
<FacilityReviewFormData
version_id={params.version_id}
facility_id={params.facility_id}
/>
<Suspense fallback={<Loading />}>
<FacilityReviewFormData
version_id={params.version_id}
facility_id={params.facility_id}
/>
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import OperationReviewFormData from "../../../../../components/operations/OperationReviewFormData";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params,
}: {
params: { version_id: number };
}) {
return <OperationReviewFormData version_id={params.version_id} />;
return (
<Suspense fallback={<Loading />}>
<OperationReviewFormData version_id={params.version_id} />
</Suspense>
);
}
Loading