• 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

84.21
/src/components/SystemUseWarningOverlay/OverlayWindow.tsx
1
import React, { useEffect, useState } from "react";
2
import {
3
  Dialog,
4
  DialogContent,
5
  DialogContentText,
6
  Button,
7
  DialogTitle,
8
  Divider,
9
  List,
10
  ListItem,
11
  ListItemText,
12
  ListItemIcon,
13
  DialogActions,
14
} from "@mui/material";
15
import FiberManualRecordIcon from "@mui/icons-material/FiberManualRecord";
16
import { ThemeProvider, createTheme } from "@mui/material/styles";
17
import text from "./OverlayText";
18

19
const theme = createTheme({
2✔
20
  components: {
21
    MuiDialog: {
22
      styleOverrides: {
23
        paper: {
24
          width: "770px",
25
          height: "620px",
26
          borderRadius: "5px !important",
27
          backgroundColor: "#ffffff !important",
28
          padding: "0px 20px 0px 20px !important",
29
        },
30
      },
31
    },
32
    MuiTypography: {
33
      styleOverrides: {
34
        root: {
35
          fontSize: "14px !important",
36
          color: "#000000",
37
        },
38
      },
39
    },
40
    MuiDialogTitle: {
41
      styleOverrides: {
42
        root: {
43
          padding: "15px 15px 15px 0 !important",
44
          fontSize: "22px !important",
45
        },
46
      },
47
    },
48
    MuiDialogContent: {
49
      styleOverrides: {
50
        root: {
51
          color: "#000045",
52
          "& p": {
53
            fontSize: "14px",
54
            margin: "0px 0px 10px !important",
55
          },
56
          padding: "20px 0px 0px 0px !important",
57
          "& ul": {
58
            marginTop: "0px",
59
            paddingTop: "0px",
60
          },
61
        },
62
      },
63
    },
64
    MuiButton: {
65
      styleOverrides: {
66
        root: {
67
          width: "133px",
68
          height: "35px",
69
          backgroundColor: "#337ab7 !important",
70
          color: "#fff",
71
          textTransform: "capitalize !important" as "capitalize",
72
          boxShadow: "none !important",
73
          "&:hover": {
74
            backgroundColor: "#2e6da4 !important",
75
          },
76
        },
77
      },
78
    },
79
    MuiList: {
80
      styleOverrides: {
81
        root: {
82
          marginTop: "-15px !important",
83
          fontSize: "14px",
84
        },
85
        padding: {
86
          paddingTop: "0px !important",
87
        },
88
      },
89
    },
90
    MuiListItem: {
91
      styleOverrides: {
92
        root: {
93
          fontSize: "14px",
94
          padding: "2px 0px 0px 25px !important",
95
        },
96
        gutters: {
97
          paddingTop: "4px",
98
          paddingRight: "8px",
99
          paddingBottom: "4px",
100
          paddingLeft: "35px",
101
        },
102
      },
103
    },
104
    MuiListItemIcon: {
105
      styleOverrides: {
106
        root: {
107
          marginBottom: "auto",
108
          fontSize: "12px",
109
          color: "black",
110
          width: "10px",
111
          minWidth: "2px",
112
          paddingTop: "10px",
113
          marginRight: "4px",
114
        },
115
      },
116
    },
117
    MuiDialogContentText: {
118
      styleOverrides: {
119
        root: {
120
          color: "#000000",
121
          marginBottom: "10px",
122
          "& p.lastChild": {
123
            marginBottom: "0px",
124
          },
125
        },
126
      },
127
    },
128
    MuiBackdrop: {
129
      styleOverrides: {
130
        root: {
131
          backgroundColor: "#00000047",
132
        },
133
      },
134
    },
135
    MuiDialogActions: {
136
      styleOverrides: {
137
        root: {
138
          height: "75px",
139
          justifyContent: "right !important",
140
          padding: "30px 10px 25px 0px !important",
141
        },
142
      },
143
    },
144
  },
145
});
146

147
const OverlayWindow = () => {
2✔
148
  const [open, setOpen] = useState(false);
6✔
149

150
  const handleClose = () => {
6✔
151
    setOpen(false);
×
152
    sessionStorage.setItem("overlayLoad", "true");
×
153
  };
154

155
  useEffect(() => {
6✔
156
    if (!sessionStorage.length) {
4!
157
      setOpen(true);
4✔
158
    }
159
  }, [open]);
160

161
  const content = text.content.map((item, index) => {
6✔
162
    const textKey = `key_${index}`;
30✔
163
    return (
30✔
164
      <DialogContentText key={textKey} id="alert-dialog-description">
165
        {item}
166
      </DialogContentText>
167
    );
168
  });
169
  const list = text.list.map((item, index) => {
6✔
170
    const listKey = `key_${index}`;
12✔
171
    return (
12✔
172
      <ListItem key={listKey}>
173
        <ListItemIcon>
174
          <FiberManualRecordIcon style={{ fontSize: 8 }} />
175
        </ListItemIcon>
176
        <ListItemText>{item}</ListItemText>
177
      </ListItem>
178
    );
179
  });
180

181
  return (
6✔
182
    <ThemeProvider theme={theme}>
183
      <Dialog
184
        open={open}
185
        aria-labelledby="alert-dialog-title"
186
        aria-describedby="alert-dialog-description"
187
        data-testid="system-use-warning-dialog"
188
        maxWidth="md"
189
      >
190
        <DialogTitle id="alert-dialog-title">Warning</DialogTitle>
191
        <Divider />
192
        <DialogContent>
193
          {content}
194
          <List>{list}</List>
195
        </DialogContent>
196
        <Divider />
197
        <DialogActions>
198
          <Button onClick={handleClose} variant="contained">
199
            Continue
200
          </Button>
201
        </DialogActions>
202
      </Dialog>
203
    </ThemeProvider>
204
  );
205
};
206

207
export default OverlayWindow;
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