Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion src/hooks/usePaginatedQuery/usePaginatedQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const usePaginatedQuery = <T,>({
};

const queryResult = useQuery({
queryKey: [...queryKeyBase, queryParams],
queryKey: [...queryKeyBase, new URLSearchParams(queryParams).toString()],
Comment thread
peter-hammans marked this conversation as resolved.
Outdated
queryFn: () => queryFn(queryParams),
placeholderData: keepPreviousData,
enabled,
Expand Down
4 changes: 3 additions & 1 deletion src/modules/InvitesTable/InvitesTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ describe("<InvitesTable />", () => {
});

expect(screen.getByText(pendingInvite.user.name)).toBeInTheDocument();
expect(screen.getByText("Invited")).toBeInTheDocument();
expect(
screen.getByText("Safe People Registry account created")
).toBeInTheDocument();
});

it("has no accessibility violations", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/InvitesTable/InvitesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function InvitesTable({
cell: info => formatDisplayLongDate(info.getValue()),
}),
createDefaultColumn("status", {
accessorKey: "user.unclaimed",
accessorKey: "status",
cell: info => renderRegistered(info.getValue()),
}),
];
Expand Down
58 changes: 29 additions & 29 deletions src/organisms/Projects/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,35 @@ export default function Projects({
}}
/>
</PageSection>
<PageSection data-cy="projects">
{showSponsorship && isSponsorship && (
<Typography variant="h6" component="h2" mb={2}>
{t("ownProjectsTitle")}
</Typography>
)}
<ProjectsTable
total={total}
last_page={last_page}
setPage={setPage}
data={projectsData}
queryState={queryState}
isPaginated
extraColumns={extraColumns}
t={t}
variant={variant}
includeColumns={[
"title",
"laySummary",
"startDate",
"endDate",
"users",
"status",
"organisationStatus",
"validationStatus",
]}
paginationProps={{ "aria-label": "Projects table pagination" }}
Comment thread
peter-hammans marked this conversation as resolved.
/>
</PageSection>
{showSponsorship && isSponsorship && (
<PageSection data-cy="projects-sponsorship">
<Typography variant="h6" component="h2" mb={2}>
Expand Down Expand Up @@ -170,35 +199,6 @@ export default function Projects({
/>
</PageSection>
)}
<PageSection data-cy="projects">
{showSponsorship && isSponsorship && (
<Typography variant="h6" component="h2" mb={2}>
{t("ownProjectsTitle")}
</Typography>
)}
<ProjectsTable
total={total}
last_page={last_page}
setPage={setPage}
data={projectsData}
queryState={queryState}
isPaginated
extraColumns={extraColumns}
t={t}
variant={variant}
includeColumns={[
"title",
"laySummary",
"startDate",
"endDate",
"users",
"status",
"organisationStatus",
"validationStatus",
]}
paginationProps={{ "aria-label": "Projects table pagination" }}
/>
</PageSection>
</>
);
}
6 changes: 3 additions & 3 deletions src/utils/cells.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Status } from "@/consts/application";
import { PendingInvite, Status } from "@/consts/application";
import { Link } from "@/i18n/routing";
import { getName, injectParamsIntoPath } from "@/utils/application";
import WarningAmberOutlinedIcon from "@mui/icons-material/WarningAmberOutlined";
Expand Down Expand Up @@ -49,10 +49,10 @@ function renderAffiliationDateRangeCell<T extends ResearcherAffiliation>(
);
}

const renderRegistered = (unclaimed: boolean) => {
const renderRegistered = (status: PendingInvite) => {
return (
<Typography>
{unclaimed ? (
{status === PendingInvite.PENDING ? (
<ChipStatus status={Status.INVITED} />
) : (
<ChipStatus status={Status.REGISTERED} />
Expand Down
Loading