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

CBIIT / crdc-datahub-ui / 16006182009

01 Jul 2025 05:32PM UTC coverage: 62.703% (-8.6%) from 71.278%
16006182009

Pull #756

github

web-flow
Merge pull request #755 from CBIIT/revert-omb-date

revert: OMB expiration update
Pull Request #756: Sync 3.4.0 with 3.3.0

3560 of 6102 branches covered (58.34%)

Branch coverage included in aggregate %.

4920 of 7422 relevant lines covered (66.29%)

227.7 hits per line

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

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

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

16
export const repositoryDataTypesOptions = [
2✔
17
  DataTypes.clinicalTrial,
18
  DataTypes.genomics,
19
  DataTypes.imaging,
20
  DataTypes.proteomics,
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) => {
2!
38
  const { status } = useFormContext();
×
39

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

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

111
export default Repository;
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