From e889d785e972dcb3403229110dcbc79f73a04d38 Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Tue, 15 Oct 2024 13:38:55 -0400 Subject: [PATCH 01/11] Update getSubmission query and types to add collaborators --- src/graphql/getSubmission.ts | 12 ++++++++++++ src/types/Submissions.d.ts | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/graphql/getSubmission.ts b/src/graphql/getSubmission.ts index 1559253d..7bcac1c2 100644 --- a/src/graphql/getSubmission.ts +++ b/src/graphql/getSubmission.ts @@ -58,6 +58,18 @@ export const query = gql` dataType otherSubmissions nodeCount + collaborators { + collaboratorID + collaboratorName + Organization { + orgID + orgName + status + createdAt + updateAt + } + permission + } createdAt updatedAt } diff --git a/src/types/Submissions.d.ts b/src/types/Submissions.d.ts index 4f6f0e85..950b7315 100644 --- a/src/types/Submissions.d.ts +++ b/src/types/Submissions.d.ts @@ -63,6 +63,10 @@ type Submission = { * The total number of nodes in the Submission */ nodeCount: number; + /** + * A list of additional submitters who can view and/or edit the submission + */ + collaborators: Collaborator[]; createdAt: string; // ISO 8601 date time format with UTC or offset e.g., 2023-05-01T09:23:30Z updatedAt: string; // ISO 8601 date time format with UTC or offset e.g., 2023-05-01T09:23:30Z }; @@ -385,3 +389,12 @@ type SubmitButtonResult = { tooltip?: string; _identifier?: string; }; + +type CollaboratorPermissions = "Can View" | "Can Edit"; + +type Collaborator = { + collaboratorID: string; + collaboratorName: string; + Organization: OrgInfo; + permission: CollaboratorPermissions; +}; From 998235c7c99c79b9b223e02d710f32828915da90 Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Tue, 15 Oct 2024 13:40:27 -0400 Subject: [PATCH 02/11] Add collaborators property to baseSubmission for tests --- src/components/Contexts/SubmissionContext.test.tsx | 1 + src/components/DataSubmissions/CrossValidationButton.test.tsx | 1 + src/components/DataSubmissions/CrossValidationFilters.test.tsx | 1 + src/components/DataSubmissions/DataUpload.test.tsx | 1 + .../DataSubmissions/DeleteAllOrphanFilesButton.test.tsx | 1 + src/components/DataSubmissions/DeleteNodeDataButton.test.tsx | 1 + src/components/DataSubmissions/DeleteOrphanFileChip.test.tsx | 1 + .../DataSubmissions/ExportCrossValidationButton.test.tsx | 1 + src/components/DataSubmissions/ExportValidationButton.test.tsx | 1 + src/components/DataSubmissions/MetadataUpload.test.tsx | 1 + src/components/DataSubmissions/ValidationControls.test.tsx | 1 + src/components/DataSubmissions/ValidationStatistics.test.tsx | 1 + src/components/DataSubmissions/ValidationStatus.test.tsx | 1 + src/content/dataSubmissions/CrossValidation.test.tsx | 1 + src/content/dataSubmissions/DataActivity.test.tsx | 1 + src/content/dataSubmissions/QualityControl.test.tsx | 1 + src/utils/dataSubmissionUtils.test.ts | 1 + 17 files changed, 17 insertions(+) diff --git a/src/components/Contexts/SubmissionContext.test.tsx b/src/components/Contexts/SubmissionContext.test.tsx index c5cec710..04a84006 100644 --- a/src/components/Contexts/SubmissionContext.test.tsx +++ b/src/components/Contexts/SubmissionContext.test.tsx @@ -53,6 +53,7 @@ const baseSubmission: Submission = { createdAt: "", updatedAt: "", studyID: "", + collaborators: [], }; const TestChild: FC = () => { diff --git a/src/components/DataSubmissions/CrossValidationButton.test.tsx b/src/components/DataSubmissions/CrossValidationButton.test.tsx index 925e5694..c7d83cdb 100644 --- a/src/components/DataSubmissions/CrossValidationButton.test.tsx +++ b/src/components/DataSubmissions/CrossValidationButton.test.tsx @@ -54,6 +54,7 @@ const baseSubmission: Omit< studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseAuthCtx: AuthCtxState = { diff --git a/src/components/DataSubmissions/CrossValidationFilters.test.tsx b/src/components/DataSubmissions/CrossValidationFilters.test.tsx index 64829e38..ab98229c 100644 --- a/src/components/DataSubmissions/CrossValidationFilters.test.tsx +++ b/src/components/DataSubmissions/CrossValidationFilters.test.tsx @@ -52,6 +52,7 @@ const baseSubmission: Submission = { nodeCount: 0, createdAt: "", updatedAt: "", + collaborators: [], }; const baseBatch = { diff --git a/src/components/DataSubmissions/DataUpload.test.tsx b/src/components/DataSubmissions/DataUpload.test.tsx index 4f37c5f4..8b138cfd 100644 --- a/src/components/DataSubmissions/DataUpload.test.tsx +++ b/src/components/DataSubmissions/DataUpload.test.tsx @@ -56,6 +56,7 @@ const baseSubmission: Omit = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseUser: User = { diff --git a/src/components/DataSubmissions/DeleteAllOrphanFilesButton.test.tsx b/src/components/DataSubmissions/DeleteAllOrphanFilesButton.test.tsx index 5764481c..23efe1a7 100644 --- a/src/components/DataSubmissions/DeleteAllOrphanFilesButton.test.tsx +++ b/src/components/DataSubmissions/DeleteAllOrphanFilesButton.test.tsx @@ -54,6 +54,7 @@ const baseSubmission: Submission = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseContext: ContextState = { diff --git a/src/components/DataSubmissions/DeleteNodeDataButton.test.tsx b/src/components/DataSubmissions/DeleteNodeDataButton.test.tsx index d214ecf4..bb0ec3ab 100644 --- a/src/components/DataSubmissions/DeleteNodeDataButton.test.tsx +++ b/src/components/DataSubmissions/DeleteNodeDataButton.test.tsx @@ -50,6 +50,7 @@ const BaseSubmission: Submission = { validationType: [], deletingData: false, nodeCount: 0, + collaborators: [], }; const baseAuthCtx: AuthContextState = { diff --git a/src/components/DataSubmissions/DeleteOrphanFileChip.test.tsx b/src/components/DataSubmissions/DeleteOrphanFileChip.test.tsx index 8c2f0950..cceb9073 100644 --- a/src/components/DataSubmissions/DeleteOrphanFileChip.test.tsx +++ b/src/components/DataSubmissions/DeleteOrphanFileChip.test.tsx @@ -54,6 +54,7 @@ const baseSubmission: Submission = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseContext: ContextState = { diff --git a/src/components/DataSubmissions/ExportCrossValidationButton.test.tsx b/src/components/DataSubmissions/ExportCrossValidationButton.test.tsx index 9916b4f9..0d0300ca 100644 --- a/src/components/DataSubmissions/ExportCrossValidationButton.test.tsx +++ b/src/components/DataSubmissions/ExportCrossValidationButton.test.tsx @@ -49,6 +49,7 @@ const baseSubmission: Submission = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseCrossValidationResult: CrossValidationResult = { diff --git a/src/components/DataSubmissions/ExportValidationButton.test.tsx b/src/components/DataSubmissions/ExportValidationButton.test.tsx index b846895a..41bfd704 100644 --- a/src/components/DataSubmissions/ExportValidationButton.test.tsx +++ b/src/components/DataSubmissions/ExportValidationButton.test.tsx @@ -58,6 +58,7 @@ describe("ExportValidationButton cases", () => { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseQCResult: Omit = { diff --git a/src/components/DataSubmissions/MetadataUpload.test.tsx b/src/components/DataSubmissions/MetadataUpload.test.tsx index a139d522..08dec625 100644 --- a/src/components/DataSubmissions/MetadataUpload.test.tsx +++ b/src/components/DataSubmissions/MetadataUpload.test.tsx @@ -41,6 +41,7 @@ const baseSubmission: Omit< studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseContext: ContextState = { diff --git a/src/components/DataSubmissions/ValidationControls.test.tsx b/src/components/DataSubmissions/ValidationControls.test.tsx index 3e705c84..8fcd9958 100644 --- a/src/components/DataSubmissions/ValidationControls.test.tsx +++ b/src/components/DataSubmissions/ValidationControls.test.tsx @@ -54,6 +54,7 @@ const baseSubmission: Omit< studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseAuthCtx: AuthCtxState = { diff --git a/src/components/DataSubmissions/ValidationStatistics.test.tsx b/src/components/DataSubmissions/ValidationStatistics.test.tsx index 47d32cfc..6e00c6d5 100644 --- a/src/components/DataSubmissions/ValidationStatistics.test.tsx +++ b/src/components/DataSubmissions/ValidationStatistics.test.tsx @@ -34,6 +34,7 @@ const baseSubmission: Omit = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; describe("Accessibility", () => { diff --git a/src/components/DataSubmissions/ValidationStatus.test.tsx b/src/components/DataSubmissions/ValidationStatus.test.tsx index 561a1f56..4ad941bf 100644 --- a/src/components/DataSubmissions/ValidationStatus.test.tsx +++ b/src/components/DataSubmissions/ValidationStatus.test.tsx @@ -41,6 +41,7 @@ const BaseSubmission: Omit< studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; type TestParentProps = { diff --git a/src/content/dataSubmissions/CrossValidation.test.tsx b/src/content/dataSubmissions/CrossValidation.test.tsx index d39f79b7..5f1d3c01 100644 --- a/src/content/dataSubmissions/CrossValidation.test.tsx +++ b/src/content/dataSubmissions/CrossValidation.test.tsx @@ -58,6 +58,7 @@ const baseSubmission: Submission = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseCrossValidationResult: CrossValidationResult = { diff --git a/src/content/dataSubmissions/DataActivity.test.tsx b/src/content/dataSubmissions/DataActivity.test.tsx index 5192aa06..d7b361ae 100644 --- a/src/content/dataSubmissions/DataActivity.test.tsx +++ b/src/content/dataSubmissions/DataActivity.test.tsx @@ -43,6 +43,7 @@ const baseSubmission: Omit = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; type ParentProps = { diff --git a/src/content/dataSubmissions/QualityControl.test.tsx b/src/content/dataSubmissions/QualityControl.test.tsx index adf4c7f0..d70b2aa4 100644 --- a/src/content/dataSubmissions/QualityControl.test.tsx +++ b/src/content/dataSubmissions/QualityControl.test.tsx @@ -56,6 +56,7 @@ const baseSubmission: Submission = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; const baseQCResult: QCResult = { diff --git a/src/utils/dataSubmissionUtils.test.ts b/src/utils/dataSubmissionUtils.test.ts index 5cbfc558..fc002654 100644 --- a/src/utils/dataSubmissionUtils.test.ts +++ b/src/utils/dataSubmissionUtils.test.ts @@ -35,6 +35,7 @@ const baseSubmission: Submission = { studyID: "", deletingData: false, nodeCount: 0, + collaborators: [], }; describe("General Submit", () => { From 494efea99ee874258ee76db50f7c528bf918e104 Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Tue, 15 Oct 2024 15:07:40 -0400 Subject: [PATCH 03/11] Update spacing for copy icon --- src/components/DataSubmissions/CopyAdornment.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DataSubmissions/CopyAdornment.tsx b/src/components/DataSubmissions/CopyAdornment.tsx index 6bc7e8b4..389a7066 100644 --- a/src/components/DataSubmissions/CopyAdornment.tsx +++ b/src/components/DataSubmissions/CopyAdornment.tsx @@ -68,7 +68,7 @@ const CopyAdornment: FC = ({ _id }) => { }; return ( - + SUBMISSION ID: From 0a7f0add5f697ffa6453648a70307c37122a4e33 Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Tue, 15 Oct 2024 15:08:42 -0400 Subject: [PATCH 04/11] Update Data Submission Summary section to match new styling and structure --- .../DataSubmissions/DataSubmissionSummary.tsx | 150 ++++++++---------- .../SubmissionHeaderProperty.tsx | 25 ++- 2 files changed, 89 insertions(+), 86 deletions(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.tsx b/src/components/DataSubmissions/DataSubmissionSummary.tsx index bf0d8a05..8ad6f6cb 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.tsx @@ -1,29 +1,19 @@ import { Button, Divider, Grid, Stack, Typography, styled } from "@mui/material"; -import React, { FC, useEffect, useMemo, useRef, useState } from "react"; +import React, { FC, useMemo, useState } from "react"; import { isEqual } from "lodash"; import SubmissionHeaderProperty, { StyledValue } from "./SubmissionHeaderProperty"; -import Tooltip from "./Tooltip"; import { ReactComponent as EmailIconSvg } from "../../assets/icons/email_icon.svg"; import HistoryDialog from "../HistoryDialog"; import DataSubmissionIconMap from "./DataSubmissionIconMap"; import ReviewCommentsDialog from "../Shared/ReviewCommentsDialog"; import { SortHistory } from "../../utils"; +import TruncatedText from "../TruncatedText"; +import StyledTooltip from "../StyledFormComponents/StyledTooltip"; const StyledSummaryWrapper = styled("div")(() => ({ borderRadius: "8px 8px 0px 0px", textWrap: "nowrap", - padding: "21px 21px 31px 48px", -})); - -const StyledSubmissionTitle = styled(Typography)(() => ({ - color: "#187A90", - fontFamily: "'Nunito Sans', 'Rubik', sans-serif", - fontSize: "13px", - fontStyle: "normal", - fontWeight: 600, - lineHeight: "26px", - letterSpacing: "0.5px", - textTransform: "uppercase", + padding: "25px 119px 25px 51px", })); const StyledSubmissionStatus = styled(Typography)(() => ({ @@ -32,22 +22,22 @@ const StyledSubmissionStatus = styled(Typography)(() => ({ fontSize: "35px", fontStyle: "normal", fontWeight: 900, - lineHeight: "30px", - minHeight: "30px", + lineHeight: "40px", + minHeight: "40px", })); const StyledButtonWrapper = styled(Stack)(() => ({ flexDirection: "column", justifyContent: "flex-start", - alignItems: "flex-start", - gap: "9px", - paddingLeft: "5px", + alignItems: "center", + gap: "10px", + width: "100%", })); const StyledReviewCommentsButton = styled(Button)(() => ({ "&.MuiButton-root": { minWidth: "168px", - marginTop: "16px", + marginTop: "10px", padding: "11px 10px", border: "1px solid #B3B3B3", color: "#BE4511", @@ -97,41 +87,39 @@ const StyledSectionDivider = styled(Divider)(() => ({ display: "flex", alignSelf: "flex-start", width: "2px", - height: "159px", + height: "157px", background: "#6CACDA", - marginLeft: "44px", - marginTop: "9px", + marginLeft: "48px", + marginRight: "81px", }, })); -const StyledSubmitterName = styled(StyledValue)(() => ({ - whiteSpace: "nowrap", - overflow: "hidden", - textOverflow: "ellipsis", - maxWidth: "100%", - lineHeight: "19.6px", - flexShrink: 1, -})); - const StyledConciergeName = styled(StyledValue)(() => ({ maxWidth: "100%", lineHeight: "19.6px", flexShrink: 1, })); -const StyledTooltipSubmitterName = styled(StyledValue)(() => ({ - color: "#595959", - fontFamily: "'Nunito'", +const StyledCollaboratorsButton = styled(Button)({ + justifyContent: "flex-start", + padding: 0, + margin: 0, + color: "#0B7F99", + fontFamily: "'Nunito', 'Rubik', sans-serif", fontSize: "16px", fontStyle: "normal", - fontWeight: 400, + fontWeight: 700, lineHeight: "19.6px", - marginTop: "6px", -})); + minWidth: 0, + textDecoration: "underline", + "&:hover": { + textDecoration: "underline", + }, +}); const StyledGridContainer = styled(Grid)(({ theme }) => ({ "&.MuiGrid-container": { - marginLeft: "45px", + marginLeft: "0px", width: "100%", overflow: "hidden", }, @@ -145,6 +133,11 @@ const StyledGridContainer = styled(Grid)(({ theme }) => ({ }, })); +const StyledEmailWrapper = styled("a")({ + marginLeft: "22px !important", + lineHeight: "19.6px", +}); + type Props = { dataSubmission: Submission; }; @@ -152,7 +145,8 @@ type Props = { const DataSubmissionSummary: FC = ({ dataSubmission }) => { const [historyDialogOpen, setHistoryDialogOpen] = useState(false); const [reviewCommentsDialogOpen, setReviewCommentsDialogOpen] = useState(false); - const [hasEllipsis, setHasEllipsis] = useState(false); + + const numCollaborators = dataSubmission?.collaborators?.length || 0; const lastReview = useMemo( () => SortHistory(dataSubmission?.history).find( @@ -160,20 +154,6 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { ), [dataSubmission] ); - const textRef = useRef(null); - - useEffect(() => { - const checkEllipsis = () => { - if (textRef.current) { - setHasEllipsis(textRef.current.offsetWidth < textRef.current.scrollWidth); - } - }; - - checkEllipsis(); - - window.addEventListener("resize", checkEllipsis); - return () => window.removeEventListener("resize", checkEllipsis); - }, [dataSubmission?.name]); const handleOnHistoryDialogOpen = () => { setHistoryDialogOpen(true); @@ -209,11 +189,8 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { return ( - - - - SUBMISSION TYPE: {dataSubmission?.intention} - + + {dataSubmission?.status} @@ -242,31 +219,32 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { container flexDirection={{ xs: "column", lg: "row" }} rowSpacing={2} - columnSpacing={{ xs: 0, lg: 8.25 }} + columnSpacing={{ xs: 0 }} > + + + - {hasEllipsis ? ( - - {dataSubmission?.name} - - } - disableHoverListener - > - {dataSubmission?.name} - - ) : ( - {dataSubmission?.name} - )} - + + + {Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format( + numCollaborators + )} + + } /> - = ({ dataSubmission }) => { label="Primary Contact" value={ - {dataSubmission?.conciergeName} + + + {dataSubmission?.conciergeName && dataSubmission?.conciergeEmail && ( - - + )} } diff --git a/src/components/DataSubmissions/SubmissionHeaderProperty.tsx b/src/components/DataSubmissions/SubmissionHeaderProperty.tsx index 93067469..649b2776 100644 --- a/src/components/DataSubmissions/SubmissionHeaderProperty.tsx +++ b/src/components/DataSubmissions/SubmissionHeaderProperty.tsx @@ -1,5 +1,6 @@ import { Box, Grid, Stack, Typography, styled } from "@mui/material"; -import { FC } from "react"; +import { memo } from "react"; +import TruncatedText from "../TruncatedText"; const StyledLabel = styled(Typography)(() => ({ color: "#000000", @@ -24,17 +25,33 @@ export const StyledValue = styled(Typography)(() => ({ type Props = { label: string; value: string | JSX.Element; + truncateAfter?: number | false; }; -const SubmissionHeaderProperty: FC = ({ label, value }) => ( +const SubmissionHeaderProperty = ({ label, value, truncateAfter = 10 }: Props) => ( {label} - {typeof value === "string" ? {value} : value} + {typeof value === "string" ? ( + + {truncateAfter && truncateAfter > 0 ? ( + + ) : ( + value + )} + + ) : ( + value + )} ); -export default SubmissionHeaderProperty; +export default memo(SubmissionHeaderProperty); From 51d10ec04ab86bded8c76377f3cb696495102b8c Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Tue, 15 Oct 2024 15:39:39 -0400 Subject: [PATCH 05/11] Update tooltip to support tests, and updated tests --- .../DataSubmissionSummary.test.tsx | 320 ++++++++++++++++-- .../DataSubmissions/DataSubmissionSummary.tsx | 20 +- 2 files changed, 304 insertions(+), 36 deletions(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx index 8c0684d5..bbb5b4b7 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx @@ -1,12 +1,14 @@ -import { render, fireEvent, waitFor } from "@testing-library/react"; +import React, { FC, useMemo } from "react"; +import userEvent from "@testing-library/user-event"; +import { render, waitFor } from "@testing-library/react"; +import { isEqual } from "lodash"; import { BrowserRouter } from "react-router-dom"; -import { FC, useMemo } from "react"; import { axe } from "jest-axe"; import DataSubmissionSummary from "./DataSubmissionSummary"; import HistoryIconMap from "./DataSubmissionIconMap"; type Props = { - dataSubmission: object; + dataSubmission: RecursivePartial; }; const BaseComponent: FC = ({ dataSubmission = {} }: Props) => { @@ -26,10 +28,13 @@ const BaseComponent: FC = ({ dataSubmission = {} }: Props) => { describe("DataSubmissionSummary Accessibility Tests", () => { it("has no accessibility violations when there are review comments", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { reviewComment: "This is a review comment", + status: "New", + dateTime: "", + userID: "", }, ], }; @@ -40,12 +45,256 @@ describe("DataSubmissionSummary Accessibility Tests", () => { }); }); +describe("Basic Functionality", () => { + it("renders all property labels and corresponding values", () => { + const dataSubmission: RecursivePartial = { + name: "Test Submission", + intention: "Test Intention" as SubmissionIntention, + submitterName: "Submitter Test", + collaborators: [ + { + collaboratorID: "col-1", + collaboratorName: "", + Organization: { + orgID: "", + orgName: "", + status: "Active", + createdAt: "", + updateAt: "", + }, + permission: "Can View", + }, + { + collaboratorID: "col-2", + collaboratorName: "", + Organization: { + orgID: "", + orgName: "", + status: "Active", + createdAt: "", + updateAt: "", + }, + permission: "Can View", + }, + ], + studyAbbreviation: "AAAAAAAAAAA", + dataCommons: "Test Commons", + organization: { + _id: "", + name: "Test Organization", + }, + conciergeName: "Test Concierge", + conciergeEmail: "concierge@test.com", + }; + + const { getByText, getByLabelText } = render(); + + // Check labels + expect(getByText("Submission Name")).toBeVisible(); + expect(getByText("Submission Type")).toBeVisible(); + expect(getByText("Submitter")).toBeVisible(); + expect(getByText("Collaborators")).toBeVisible(); + expect(getByText("Study")).toBeVisible(); + expect(getByText("Data Commons")).toBeVisible(); + expect(getByText("Organization")).toBeVisible(); + expect(getByText("Primary Contact")).toBeVisible(); + + // Check values + expect(getByText("Test Submi...")).toBeVisible(); + expect(getByText("Test Intention")).toBeVisible(); // Not truncated + expect(getByText("Submitter...")).toBeVisible(); + expect(getByText("AAAAAAAAAA...")).toBeVisible(); + expect(getByText("Test Commo...")).toBeVisible(); + expect(getByText("Test Organ...")).toBeVisible(); + expect(getByText("Test Conci...")).toBeVisible(); + + expect(getByText("2")).toBeVisible(); + + const emailLink = getByLabelText("Email Primary Contact"); + expect(emailLink).toBeVisible(); + expect(emailLink).toHaveAttribute("href", "mailto:concierge@test.com"); + }); + + it("renders the Collaborators property with correct number and tooltip", async () => { + const dataSubmission: RecursivePartial = { + collaborators: [ + { + collaboratorID: "1", + collaboratorName: "", + Organization: { + orgID: "", + orgName: "", + status: "Active", + createdAt: "", + updateAt: "", + }, + permission: "Can View", + }, + { + collaboratorID: "2", + collaboratorName: "", + Organization: { + orgID: "", + orgName: "", + status: "Active", + createdAt: "", + updateAt: "", + }, + permission: "Can View", + }, + { + collaboratorID: "3", + collaboratorName: "", + Organization: { + orgID: "", + orgName: "", + status: "Active", + createdAt: "", + updateAt: "", + }, + permission: "Can View", + }, + ], + }; + + const { getByTestId } = render(); + + // Hover to trigger the tooltip + userEvent.hover(getByTestId("collaborators-button")); + + await waitFor(() => { + expect(getByTestId("collaborators-button-tooltip")).toBeVisible(); + expect(getByTestId("collaborators-button-tooltip")).toHaveTextContent( + "Click to add new collaborators or view existing ones." + ); + }); + }); + + it("renders the Primary Contact with name and email link when email is provided", () => { + const dataSubmission: RecursivePartial = { + conciergeName: "Test Concierge", + conciergeEmail: "concierge@test.com", + }; + + const { getByText, getByLabelText } = render(); + + expect(getByText("Primary Contact")).toBeVisible(); + expect(getByText("Test Conci...")).toBeVisible(); + + const emailLink = getByLabelText("Email Primary Contact"); + expect(emailLink).toBeVisible(); + expect(emailLink).toHaveAttribute("href", "mailto:concierge@test.com"); + }); + + it("renders the Primary Contact with name only when email is not provided", () => { + const dataSubmission: RecursivePartial = { + conciergeName: "Test Concierge", + conciergeEmail: null, + }; + + const { getByText, queryByLabelText } = render( + + ); + + expect(getByText("Primary Contact")).toBeVisible(); + expect(getByText("Test Conci...")).toBeVisible(); + + const emailLink = queryByLabelText("Email Primary Contact"); + expect(emailLink).toBeNull(); + }); +}); + +describe("DataSubmissionSummary Memoization Tests", () => { + it("does not re-render when props are equal due to memoization", () => { + const dataSubmission: RecursivePartial = { + name: "Test Submission", + }; + + const renderSpy = jest.fn(); + + // Create a wrapper component that increments the renderSpy + const MemoizedComponent = ({ dataSubmission }: Props) => { + React.useEffect(() => { + renderSpy(); + }); + return ; + }; + + // Wrap the MemoizedComponent with React.memo and custom comparison + const MemoizedComponentWithMemo = React.memo(MemoizedComponent, (prevProps, nextProps) => + isEqual(prevProps, nextProps) + ); + + const { rerender } = render( + + + + ); + + expect(renderSpy).toHaveBeenCalledTimes(1); + + // Re-render with the same props + rerender( + + + + ); + + // renderSpy should not have been called again + expect(renderSpy).toHaveBeenCalledTimes(1); + }); + + it("re-renders when props change due to memoization", () => { + const dataSubmission: RecursivePartial = { + name: "Test Submission", + }; + + const newDataSubmission: RecursivePartial = { + name: "Updated Submission", + }; + + const renderSpy = jest.fn(); + + const MemoizedComponent = ({ dataSubmission }: Props) => { + React.useEffect(() => { + renderSpy(); + }); + return ; + }; + + const MemoizedComponentWithMemo = React.memo(MemoizedComponent, (prevProps, nextProps) => + isEqual(prevProps, nextProps) + ); + + const { rerender } = render( + + + + ); + + expect(renderSpy).toHaveBeenCalledTimes(1); + + // Re-render with different props + rerender( + + + + ); + + // renderSpy should have been called again + expect(renderSpy).toHaveBeenCalledTimes(2); + }); +}); + describe("DataSubmissionSummary Review Comments Dialog Tests", () => { it("renders the Review Comments button if there is a review comment", () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { reviewComment: "This is a review comment", + status: "New", + dateTime: "", + userID: "", }, ], }; @@ -55,19 +304,20 @@ describe("DataSubmissionSummary Review Comments Dialog Tests", () => { }); it("shows the correct content in the Review Comments dialog", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { status: "Rejected", reviewComment: "This is the most recent review comment", dateTime: "2023-11-30T11:26:01Z", + userID: "", }, ], }; const { getByText } = render(); - fireEvent.click(getByText("Review Comments")); + userEvent.click(getByText("Review Comments")); await waitFor(() => { expect(getByText(/This is the most recent review comment/)).toBeVisible(); @@ -75,24 +325,26 @@ describe("DataSubmissionSummary Review Comments Dialog Tests", () => { }); it("only shows the review comment for the latest 'Rejected' submission, ignoring other statuses", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { status: "Rejected", reviewComment: "This is a rejected comment", dateTime: "2023-11-29T11:26:01Z", + userID: "", }, { status: "Submitted", reviewComment: "Admin Submit - This should not be displayed", dateTime: "2023-11-30T11:26:01Z", + userID: "", }, ], }; const { getByText } = render(); - fireEvent.click(getByText("Review Comments")); + userEvent.click(getByText("Review Comments")); await waitFor(() => { expect(getByText(/This is a rejected comment/)).toBeVisible(); @@ -101,34 +353,36 @@ describe("DataSubmissionSummary Review Comments Dialog Tests", () => { }); it("closes the Review Comments dialog with the close button", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { status: "Rejected", reviewComment: "Comment for closing test", dateTime: "2023-11-30T11:26:01Z", + userID: "", }, ], }; const { getByText, queryByText } = render(); - fireEvent.click(getByText("Review Comments")); + userEvent.click(getByText("Review Comments")); await waitFor(() => expect(getByText("Comment for closing test")).toBeVisible()); - fireEvent.click(getByText("Close")); + userEvent.click(getByText("Close")); await waitFor(() => expect(queryByText("Comment for closing test")).not.toBeInTheDocument()); }); it("closes the Review Comments dialog with the close icon button", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { status: "Rejected", reviewComment: "Another comment for close icon test", dateTime: "2023-11-30T11:26:01Z", + userID: "", }, ], }; @@ -137,12 +391,12 @@ describe("DataSubmissionSummary Review Comments Dialog Tests", () => { ); - fireEvent.click(getByText("Review Comments")); + userEvent.click(getByText("Review Comments")); await waitFor(() => expect(getByText("Another comment for close icon test")).toBeVisible()); const closeButton = getByTestId("review-comments-dialog-close-icon-button"); - fireEvent.click(closeButton); + userEvent.click(closeButton); await waitFor(() => expect(queryByText("Another comment for close icon test")).not.toBeInTheDocument() @@ -152,8 +406,14 @@ describe("DataSubmissionSummary Review Comments Dialog Tests", () => { describe("DataSubmissionSummary History Dialog Tests", () => { it("renders the Full History button if there are historical events", () => { - const dataSubmission = { - history: [{ dateTime: "2023-11-23T14:26:01Z" }], + const dataSubmission: RecursivePartial = { + history: [ + { + dateTime: "2023-11-23T14:26:01Z", + status: "New", + userID: "", + }, + ], }; const { getByText } = render(); @@ -170,7 +430,7 @@ describe("DataSubmissionSummary History Dialog Tests", () => { const { getByText } = render(); - fireEvent.click(getByText("Full History")); + userEvent.click(getByText("Full History")); await waitFor(() => { expect(getByText("SUBMITTED")).toBeVisible(); @@ -179,7 +439,7 @@ describe("DataSubmissionSummary History Dialog Tests", () => { }); it("renders the modal and displays history events in descending order", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { dateTime: "2023-01-02T10:00:00Z", status: "In Progress" }, { dateTime: "2023-01-01T10:00:00Z", status: "New" }, @@ -194,7 +454,7 @@ describe("DataSubmissionSummary History Dialog Tests", () => { const { getAllByTestId, getByText } = render(); - fireEvent.click(getByText("Full History")); + userEvent.click(getByText("Full History")); const dates = getAllByTestId(/history-item-\d-date/i); const statuses = getAllByTestId(/history-item-\d-status/i); @@ -207,23 +467,23 @@ describe("DataSubmissionSummary History Dialog Tests", () => { }); it("closes the History dialog with the close button", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [{ dateTime: "2023-11-30T11:26:01Z", status: "Submitted" }], }; const { getByText, queryByTestId } = render(); - fireEvent.click(getByText("Full History")); + userEvent.click(getByText("Full History")); await waitFor(() => expect(queryByTestId("history-dialog")).toBeVisible()); - fireEvent.click(queryByTestId("history-dialog-close")); + userEvent.click(queryByTestId("history-dialog-close")); await waitFor(() => expect(queryByTestId("history-dialog")).not.toBeInTheDocument()); }); it("sorts the historical events by date in descending order", async () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { dateTime: "2023-11-20T10:00:00Z", status: "New" }, { dateTime: "2023-11-22T10:00:00Z", status: "In Progress" }, @@ -233,7 +493,7 @@ describe("DataSubmissionSummary History Dialog Tests", () => { const { getByText, getAllByTestId } = render(); - fireEvent.click(getByText("Full History")); + userEvent.click(getByText("Full History")); await waitFor(() => { const items = getAllByTestId(/history-item-\d-date/); @@ -247,7 +507,7 @@ describe("DataSubmissionSummary History Dialog Tests", () => { }); it("renders only the most recent event with an icon", () => { - const dataSubmission = { + const dataSubmission: RecursivePartial = { history: [ { dateTime: "2023-11-24T01:25:45Z", status: "Rejected" }, { dateTime: "2023-11-22T15:36:01Z", status: "Completed" }, @@ -256,7 +516,7 @@ describe("DataSubmissionSummary History Dialog Tests", () => { const { getByTestId, getByText } = render(); - fireEvent.click(getByText("Full History")); + userEvent.click(getByText("Full History")); expect(getByTestId("history-item-0-icon")).toBeVisible(); expect(() => getByTestId("history-item-1-icon")).toThrow(); @@ -265,13 +525,13 @@ describe("DataSubmissionSummary History Dialog Tests", () => { it.each(Object.entries(HistoryIconMap))( "renders the correct icon for the status %s", (status, svg) => { - const dataSubmission = { - history: [{ dateTime: "2023-11-24T01:25:45Z", status }], + const dataSubmission: RecursivePartial = { + history: [{ dateTime: "2023-11-24T01:25:45Z", status: status as SubmissionStatus }], }; const { getByTestId, getByText } = render(); - fireEvent.click(getByText("Full History")); + userEvent.click(getByText("Full History")); const icon = getByTestId("history-item-0-icon"); diff --git a/src/components/DataSubmissions/DataSubmissionSummary.tsx b/src/components/DataSubmissions/DataSubmissionSummary.tsx index 8ad6f6cb..0265c842 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.tsx @@ -235,13 +235,21 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { placement="top" title="Click to add new collaborators or view existing ones." disableHoverListener={false} - data-testid="collaborators-button-tooltip" + slotProps={{ + tooltip: { "data-testid": "collaborators-button-tooltip" } as unknown, + }} > - - {Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format( - numCollaborators - )} - + + + {Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format( + numCollaborators + )} + + } /> From e26ba9cc116539dcf109ba125d977a922b457dde Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Tue, 15 Oct 2024 16:19:55 -0400 Subject: [PATCH 06/11] Add test coverage for the submission header property component --- .../SubmissionHeaderProperty.test.tsx | 63 +++++++++++++++++++ .../SubmissionHeaderProperty.tsx | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/components/DataSubmissions/SubmissionHeaderProperty.test.tsx diff --git a/src/components/DataSubmissions/SubmissionHeaderProperty.test.tsx b/src/components/DataSubmissions/SubmissionHeaderProperty.test.tsx new file mode 100644 index 00000000..5a1b4c15 --- /dev/null +++ b/src/components/DataSubmissions/SubmissionHeaderProperty.test.tsx @@ -0,0 +1,63 @@ +import { render } from "@testing-library/react"; +import SubmissionHeaderProperty from "./SubmissionHeaderProperty"; + +describe("Basic Functionality", () => { + it("renders the label correctly", () => { + const { getByText } = render( + + ); + + expect(getByText("Test Label")).toBeInTheDocument(); + }); + + it("renders the value correctly when value is a string", () => { + const { getByText } = render( + + ); + + expect(getByText("Test Value")).toBeInTheDocument(); + }); + + it("renders the truncated value when truncateAfter is provided", async () => { + const { getByText } = render( + + ); + + expect(getByText("Th...")).toBeInTheDocument(); + }); + + it("renders the value correctly when value is a JSX.Element", () => { + const valueElement = Custom Value; + + const { getByTestId } = render( + + ); + + expect(getByTestId("custom-element")).toBeInTheDocument(); + expect(getByTestId("custom-element")).toHaveTextContent("Custom Value"); + }); + + it("renders the full value when truncateAfter is false", () => { + const { getByText, queryByTestId } = render( + + ); + + expect(getByText("This is a very long value that should not be truncated")).toBeInTheDocument(); + expect(queryByTestId("truncated-text-label")).not.toBeInTheDocument(); + }); + + it("renders correctly when value is an empty string", () => { + const { getByTestId } = render(); + + expect(getByTestId("property-value")).toBeInTheDocument(); + expect(getByTestId("truncated-text-label")).toBeEmptyDOMElement(); + }); +}); diff --git a/src/components/DataSubmissions/SubmissionHeaderProperty.tsx b/src/components/DataSubmissions/SubmissionHeaderProperty.tsx index 649b2776..5f3491d2 100644 --- a/src/components/DataSubmissions/SubmissionHeaderProperty.tsx +++ b/src/components/DataSubmissions/SubmissionHeaderProperty.tsx @@ -34,7 +34,7 @@ const SubmissionHeaderProperty = ({ label, value, truncateAfter = 10 }: Props) = {label} {typeof value === "string" ? ( - + {truncateAfter && truncateAfter > 0 ? ( Date: Tue, 15 Oct 2024 16:28:17 -0400 Subject: [PATCH 07/11] Remove truncation from data commons property --- .../DataSubmissions/DataSubmissionSummary.test.tsx | 2 +- src/components/DataSubmissions/DataSubmissionSummary.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx index bbb5b4b7..938366d8 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx @@ -104,7 +104,7 @@ describe("Basic Functionality", () => { expect(getByText("Test Intention")).toBeVisible(); // Not truncated expect(getByText("Submitter...")).toBeVisible(); expect(getByText("AAAAAAAAAA...")).toBeVisible(); - expect(getByText("Test Commo...")).toBeVisible(); + expect(getByText("Test Commons")).toBeVisible(); // Not truncated expect(getByText("Test Organ...")).toBeVisible(); expect(getByText("Test Conci...")).toBeVisible(); diff --git a/src/components/DataSubmissions/DataSubmissionSummary.tsx b/src/components/DataSubmissions/DataSubmissionSummary.tsx index 0265c842..5aaceb8d 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.tsx @@ -254,7 +254,11 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { } /> - + Date: Tue, 15 Oct 2024 17:04:02 -0400 Subject: [PATCH 08/11] Added comments and minor change --- src/components/DataSubmissions/DataSubmissionSummary.tsx | 2 +- src/types/Submissions.d.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.tsx b/src/components/DataSubmissions/DataSubmissionSummary.tsx index 5aaceb8d..29785f4d 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.tsx @@ -219,7 +219,7 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { container flexDirection={{ xs: "column", lg: "row" }} rowSpacing={2} - columnSpacing={{ xs: 0 }} + columnSpacing={0} > Date: Wed, 16 Oct 2024 12:09:16 -0400 Subject: [PATCH 09/11] Update default truncate value to 16. Also updated tests --- .../DataSubmissionSummary.test.tsx | 35 +++++++++---------- .../DataSubmissions/DataSubmissionSummary.tsx | 2 +- .../SubmissionHeaderProperty.tsx | 2 +- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx index 938366d8..64fd2aba 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx @@ -48,9 +48,9 @@ describe("DataSubmissionSummary Accessibility Tests", () => { describe("Basic Functionality", () => { it("renders all property labels and corresponding values", () => { const dataSubmission: RecursivePartial = { - name: "Test Submission", - intention: "Test Intention" as SubmissionIntention, - submitterName: "Submitter Test", + name: "Test Submission AAAAAA", + intention: "Test Intention AAAAAA" as SubmissionIntention, + submitterName: "Submitter Test AAAAAA", collaborators: [ { collaboratorID: "col-1", @@ -77,13 +77,13 @@ describe("Basic Functionality", () => { permission: "Can View", }, ], - studyAbbreviation: "AAAAAAAAAAA", - dataCommons: "Test Commons", + studyAbbreviation: "AAAAAAAAAAAAAAAAA", + dataCommons: "Test Commons AAAAAA", organization: { _id: "", - name: "Test Organization", + name: "Test Organization AAAAAA", }, - conciergeName: "Test Concierge", + conciergeName: "Test Concierge AAAAAA", conciergeEmail: "concierge@test.com", }; @@ -100,13 +100,13 @@ describe("Basic Functionality", () => { expect(getByText("Primary Contact")).toBeVisible(); // Check values - expect(getByText("Test Submi...")).toBeVisible(); - expect(getByText("Test Intention")).toBeVisible(); // Not truncated - expect(getByText("Submitter...")).toBeVisible(); - expect(getByText("AAAAAAAAAA...")).toBeVisible(); - expect(getByText("Test Commons")).toBeVisible(); // Not truncated - expect(getByText("Test Organ...")).toBeVisible(); - expect(getByText("Test Conci...")).toBeVisible(); + expect(getByText("Test Submission...")).toBeVisible(); + expect(getByText("Test Intention AAAAAA")).toBeVisible(); // Not truncated + expect(getByText("Submitter Test A...")).toBeVisible(); + expect(getByText("AAAAAAAAAAAAAAAA...")).toBeVisible(); + expect(getByText("Test Commons AAAAAA")).toBeVisible(); // Not truncated + expect(getByText("Test Organizatio...")).toBeVisible(); + expect(getByText("Test Concierge A...")).toBeVisible(); expect(getByText("2")).toBeVisible(); @@ -179,7 +179,7 @@ describe("Basic Functionality", () => { const { getByText, getByLabelText } = render(); expect(getByText("Primary Contact")).toBeVisible(); - expect(getByText("Test Conci...")).toBeVisible(); + expect(getByText("Test Concierge")).toBeVisible(); const emailLink = getByLabelText("Email Primary Contact"); expect(emailLink).toBeVisible(); @@ -197,7 +197,7 @@ describe("Basic Functionality", () => { ); expect(getByText("Primary Contact")).toBeVisible(); - expect(getByText("Test Conci...")).toBeVisible(); + expect(getByText("Test Concierge")).toBeVisible(); const emailLink = queryByLabelText("Email Primary Contact"); expect(emailLink).toBeNull(); @@ -212,7 +212,6 @@ describe("DataSubmissionSummary Memoization Tests", () => { const renderSpy = jest.fn(); - // Create a wrapper component that increments the renderSpy const MemoizedComponent = ({ dataSubmission }: Props) => { React.useEffect(() => { renderSpy(); @@ -220,7 +219,6 @@ describe("DataSubmissionSummary Memoization Tests", () => { return ; }; - // Wrap the MemoizedComponent with React.memo and custom comparison const MemoizedComponentWithMemo = React.memo(MemoizedComponent, (prevProps, nextProps) => isEqual(prevProps, nextProps) ); @@ -233,7 +231,6 @@ describe("DataSubmissionSummary Memoization Tests", () => { expect(renderSpy).toHaveBeenCalledTimes(1); - // Re-render with the same props rerender( diff --git a/src/components/DataSubmissions/DataSubmissionSummary.tsx b/src/components/DataSubmissions/DataSubmissionSummary.tsx index 29785f4d..56241dae 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.tsx @@ -270,7 +270,7 @@ const DataSubmissionSummary: FC = ({ dataSubmission }) => { diff --git a/src/components/DataSubmissions/SubmissionHeaderProperty.tsx b/src/components/DataSubmissions/SubmissionHeaderProperty.tsx index 5f3491d2..af4cf999 100644 --- a/src/components/DataSubmissions/SubmissionHeaderProperty.tsx +++ b/src/components/DataSubmissions/SubmissionHeaderProperty.tsx @@ -28,7 +28,7 @@ type Props = { truncateAfter?: number | false; }; -const SubmissionHeaderProperty = ({ label, value, truncateAfter = 10 }: Props) => ( +const SubmissionHeaderProperty = ({ label, value, truncateAfter = 16 }: Props) => ( {label} From 1e10db6f3ee6d7e8e28af29e3ca6a1baf2db256d Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Wed, 16 Oct 2024 12:15:14 -0400 Subject: [PATCH 10/11] Remove unused properties from query, type, and tests --- .../DataSubmissionSummary.test.tsx | 15 --------------- src/graphql/getSubmission.ts | 3 --- src/types/Submissions.d.ts | 2 +- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx index 64fd2aba..7ed8f870 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.test.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.test.tsx @@ -58,9 +58,6 @@ describe("Basic Functionality", () => { Organization: { orgID: "", orgName: "", - status: "Active", - createdAt: "", - updateAt: "", }, permission: "Can View", }, @@ -70,9 +67,6 @@ describe("Basic Functionality", () => { Organization: { orgID: "", orgName: "", - status: "Active", - createdAt: "", - updateAt: "", }, permission: "Can View", }, @@ -124,9 +118,6 @@ describe("Basic Functionality", () => { Organization: { orgID: "", orgName: "", - status: "Active", - createdAt: "", - updateAt: "", }, permission: "Can View", }, @@ -136,9 +127,6 @@ describe("Basic Functionality", () => { Organization: { orgID: "", orgName: "", - status: "Active", - createdAt: "", - updateAt: "", }, permission: "Can View", }, @@ -148,9 +136,6 @@ describe("Basic Functionality", () => { Organization: { orgID: "", orgName: "", - status: "Active", - createdAt: "", - updateAt: "", }, permission: "Can View", }, diff --git a/src/graphql/getSubmission.ts b/src/graphql/getSubmission.ts index 7bcac1c2..b7b07e27 100644 --- a/src/graphql/getSubmission.ts +++ b/src/graphql/getSubmission.ts @@ -64,9 +64,6 @@ export const query = gql` Organization { orgID orgName - status - createdAt - updateAt } permission } diff --git a/src/types/Submissions.d.ts b/src/types/Submissions.d.ts index a9c2e13f..600864b5 100644 --- a/src/types/Submissions.d.ts +++ b/src/types/Submissions.d.ts @@ -401,6 +401,6 @@ type CollaboratorPermissions = "Can View" | "Can Edit"; type Collaborator = { collaboratorID: string; collaboratorName: string; - Organization: OrgInfo; + Organization: Pick; permission: CollaboratorPermissions; }; From 326be8f9c5077b1ed5e0170e323c7ef692c35e3c Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Wed, 16 Oct 2024 12:20:41 -0400 Subject: [PATCH 11/11] Remove redundant styling --- src/components/DataSubmissions/DataSubmissionSummary.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/DataSubmissions/DataSubmissionSummary.tsx b/src/components/DataSubmissions/DataSubmissionSummary.tsx index 56241dae..124c9ec9 100644 --- a/src/components/DataSubmissions/DataSubmissionSummary.tsx +++ b/src/components/DataSubmissions/DataSubmissionSummary.tsx @@ -105,9 +105,7 @@ const StyledCollaboratorsButton = styled(Button)({ padding: 0, margin: 0, color: "#0B7F99", - fontFamily: "'Nunito', 'Rubik', sans-serif", fontSize: "16px", - fontStyle: "normal", fontWeight: 700, lineHeight: "19.6px", minWidth: 0,