• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / crdc-datahub-ui / 15497092546

06 Jun 2025 06:19PM UTC coverage: 65.179% (+2.5%) from 62.708%
15497092546

push

github

web-flow
Merge pull request #726 from CBIIT/CRDCDH-2817

CRDCDH-2817 Vite/Vitest Migration & Upgrade dependencies

3529 of 3882 branches covered (90.91%)

Branch coverage included in aggregate %.

167 of 224 new or added lines in 82 files covered. (74.55%)

7620 existing lines in 126 files now uncovered.

22012 of 35304 relevant lines covered (62.35%)

101.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

19.28
/src/components/Questionnaire/Repository.tsx
1
import React, { FC } from "react";
2
import { Grid, styled } from "@mui/material";
1✔
3
import RemoveCircleIcon from "@mui/icons-material/RemoveCircle";
1✔
4
import TextInput from "./TextInput";
1✔
5
import { Status as FormStatus, useFormContext } from "../Contexts/FormContext";
1✔
6
import AddRemoveButton from "../AddRemoveButton";
1✔
7
import SelectInput from "./SelectInput";
1✔
8
import DataTypes from "../../config/DataTypesConfig";
1✔
9

10
const GridContainer = styled(Grid)(() => ({
1✔
UNCOV
11
  border: "0.5px solid #DCDCDC !important",
×
UNCOV
12
  borderRadius: "10px",
×
UNCOV
13
  padding: "18px 15px",
×
14
}));
1✔
15

16
export const repositoryDataTypesOptions = [
1✔
17
  DataTypes.clinicalTrial,
1✔
18
  DataTypes.genomics,
1✔
19
  DataTypes.imaging,
1✔
20
  DataTypes.proteomics,
1✔
21
];
22

23
type Props = {
24
  idPrefix?: string;
25
  index: number;
26
  repository: Repository | null;
27
  readOnly?: boolean;
28
  onDelete: () => void;
29
};
30

31
/**
32
 * Additional Contact Form Group
33
 *
34
 * @param {Props} props
35
 * @returns {JSX.Element}
36
 */
37
const Repository: FC<Props> = ({ idPrefix = "", index, repository, readOnly, onDelete }: Props) => {
1✔
38
  const { status } = useFormContext();
×
39

40
  const { name, studyID, dataTypesSubmitted, otherDataTypesSubmitted } = repository || {};
×
41

42
  return (
×
UNCOV
43
    <GridContainer container>
×
UNCOV
44
      <Grid container item xs={12} rowSpacing={0} columnSpacing={1.5}>
×
UNCOV
45
        <TextInput
×
UNCOV
46
          id={idPrefix.concat(`repository-${index}-name`)}
×
UNCOV
47
          label="Repository Name"
×
UNCOV
48
          name={`study[repositories][${index}][name]`}
×
UNCOV
49
          value={name}
×
UNCOV
50
          placeholder="Enter Repository Name"
×
UNCOV
51
          maxLength={50}
×
UNCOV
52
          gridWidth={6}
×
UNCOV
53
          tooltipText="Name of the repository (e.g., GEO, EGA, etc.)"
×
UNCOV
54
          required
×
UNCOV
55
          readOnly={readOnly}
×
56
        />
UNCOV
57
        <TextInput
×
UNCOV
58
          id={idPrefix.concat(`repository-${index}-study-id`)}
×
UNCOV
59
          label="Study ID"
×
UNCOV
60
          name={`study[repositories][${index}][studyID]`}
×
UNCOV
61
          value={studyID}
×
UNCOV
62
          placeholder="Enter ID"
×
UNCOV
63
          maxLength={50}
×
UNCOV
64
          gridWidth={6}
×
UNCOV
65
          tooltipText="Associated repository study identifier"
×
UNCOV
66
          required
×
UNCOV
67
          readOnly={readOnly}
×
68
        />
UNCOV
69
        <SelectInput
×
UNCOV
70
          id={idPrefix.concat(`repository-${index}-data-types-submitted`)}
×
UNCOV
71
          label="Data Type(s) Submitted"
×
UNCOV
72
          name={`study[repositories][${index}][dataTypesSubmitted]`}
×
73
          options={repositoryDataTypesOptions.map((option) => ({
×
UNCOV
74
            label: option.label,
×
UNCOV
75
            value: option.name,
×
UNCOV
76
          }))}
×
UNCOV
77
          placeholder="Select types"
×
UNCOV
78
          value={dataTypesSubmitted}
×
UNCOV
79
          multiple
×
UNCOV
80
          tooltipText="Data type(s) submitted"
×
UNCOV
81
          required
×
UNCOV
82
          readOnly={readOnly}
×
83
        />
UNCOV
84
        <TextInput
×
UNCOV
85
          id={idPrefix.concat(`repository-${index}-other-data-types-submitted`)}
×
UNCOV
86
          label="Other Data Type(s)"
×
UNCOV
87
          tooltipText='Enter additional Data Types, separated by pipes ("|").'
×
UNCOV
88
          name={`study[repositories][${index}][otherDataTypesSubmitted]`}
×
UNCOV
89
          value={otherDataTypesSubmitted}
×
UNCOV
90
          placeholder="Other, specify as free text"
×
UNCOV
91
          maxLength={100}
×
UNCOV
92
          gridWidth={6}
×
UNCOV
93
          readOnly={readOnly}
×
94
        />
UNCOV
95
      </Grid>
×
UNCOV
96
      <Grid item xs={12}>
×
UNCOV
97
        <AddRemoveButton
×
UNCOV
98
          id={idPrefix.concat(`repository-${index}-remove-repository-button`)}
×
UNCOV
99
          label="Remove Repository"
×
UNCOV
100
          placement="start"
×
UNCOV
101
          onClick={onDelete}
×
UNCOV
102
          startIcon={<RemoveCircleIcon />}
×
UNCOV
103
          iconColor="#E74040"
×
UNCOV
104
          disabled={readOnly || status === FormStatus.SAVING}
×
105
        />
UNCOV
106
      </Grid>
×
UNCOV
107
    </GridContainer>
×
108
  );
UNCOV
109
};
×
110

111
export default Repository;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc