Skip to content

Commit 0410b57

Browse files
committed
Merge branch 'merge/test' into dev-dep
2 parents e67d018 + 50460f6 commit 0410b57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+685
-91311
lines changed

__tests__/enzyme.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { shallow} from 'enzyme';
2-
import { configure } from 'enzyme';
2+
// import { configure } from 'enzyme';
33
import Adapter from 'enzyme-adapter-react-16'
44
import React from 'react';
55
import { DndProvider } from 'react-dnd';
@@ -17,8 +17,8 @@ import HTMLItem from '../app/src/components/left/HTMLItem';
1717
import LeftContainer from '../app/src/containers/LeftContainer';
1818
import AppContainer from '../app/src/containers/AppContainer';
1919
import NavBar from '../app/src/components/top/NavBar';
20-
import MenuItem from '@material-ui/core/MenuItem';
21-
import Tab from '@material-ui/core/Tab';
20+
import MenuItem from '@mui/material/MenuItem';
21+
import Tab from '@mui/material/Tab';
2222
import LoginButton from '../app/src/components/right/LoginButton';
2323
import customizationPanel from '../app/src/containers/CustomizationPanel'
2424

app/src/Dashboard/NavbarDash.tsx

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
import React, { useState, useContext } from 'react';
2-
import {
3-
withStyles, //added
4-
createStyles,
5-
makeStyles,
6-
Theme,
7-
} from '@material-ui/core/styles';
8-
import AppBar from '@material-ui/core/AppBar';
9-
import Avatar from '@material-ui/core/Avatar';
10-
import Brightness3Icon from '@material-ui/icons/Brightness3';
11-
import Brightness5Icon from '@material-ui/icons/Brightness5';
12-
import Button from '@material-ui/core/Button';
13-
import EventNoteIcon from '@material-ui/icons/EventNote';
14-
import HomeIcon from '@material-ui/icons/Home';
15-
import Toolbar from '@material-ui/core/Toolbar';
16-
import Typography from '@material-ui/core/Typography';
2+
import { Theme } from '@mui/material/styles';
3+
import withStyles from '@mui/styles/withStyles';
4+
import createStyles from '@mui/styles/createStyles';
5+
import makeStyles from '@mui/styles/makeStyles';
6+
import AppBar from '@mui/material/AppBar';
7+
import Avatar from '@mui/material/Avatar';
8+
import Brightness3Icon from '@mui/icons-material/Brightness3';
9+
import Brightness5Icon from '@mui/icons-material/Brightness5';
10+
import Button from '@mui/material/Button';
11+
import EventNoteIcon from '@mui/icons-material/EventNote';
12+
import HomeIcon from '@mui/icons-material/Home';
13+
import Toolbar from '@mui/material/Toolbar';
14+
import Typography from '@mui/material/Typography';
1715
import { Link } from 'react-router-dom';
1816
import { styleContext } from '../containers/AppContainer';
19-
import Menu from '@material-ui/core/Menu';
20-
import MenuItem from '@material-ui/core/MenuItem';
21-
import SortIcon from '@material-ui/icons/Sort';
22-
import StarBorderIcon from '@material-ui/icons/StarBorder';
23-
import PersonIcon from '@material-ui/icons/Person';
17+
import Menu from '@mui/material/Menu';
18+
import MenuItem from '@mui/material/MenuItem';
19+
import SortIcon from '@mui/icons-material/Sort';
20+
import StarBorderIcon from '@mui/icons-material/StarBorder';
21+
import PersonIcon from '@mui/icons-material/Person';
2422
import greenLogo from '../public/icons/png/512x512.png';
2523

2624
// NavBar text and button styling

app/src/Dashboard/Project.tsx

Lines changed: 62 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import {
77
PUBLISH_PROJECT,
88
ADD_COMMENT,
99
} from './gqlStrings';
10-
import CloseIcon from '@material-ui/icons/Close';
11-
import AddCommentIcon from '@material-ui/icons/AddComment';
12-
import ThumbUpAltIcon from '@material-ui/icons/ThumbUpAlt';
13-
import GetAppIcon from '@material-ui/icons/GetApp';
14-
import IconButton from '@material-ui/core/IconButton';
15-
import PublishIcon from '@material-ui/icons/Publish';
16-
import List from '@material-ui/core/List';
17-
import ListItem from '@material-ui/core/ListItem';
18-
import ListItemText from '@material-ui/core/ListItemText';
10+
import CloseIcon from '@mui/icons-material/Close';
11+
import AddCommentIcon from '@mui/icons-material/AddComment';
12+
import ThumbUpAltIcon from '@mui/icons-material/ThumbUpAlt';
13+
import GetAppIcon from '@mui/icons-material/GetApp';
14+
import IconButton from '@mui/material/IconButton';
15+
import PublishIcon from '@mui/icons-material/Publish';
16+
import List from '@mui/material/List';
17+
import ListItem from '@mui/material/ListItem';
18+
import ListItemText from '@mui/material/ListItemText';
1919
import createModal from '../components/right/createModal';
2020
// Variable validation using typescript
2121
type props = {
@@ -169,46 +169,62 @@ const Project = ({
169169
};
170170

171171
return (
172-
<div className = 'project'>
173-
<div className = 'header'>
174-
{ currUsername === username ?
175-
<IconButton tooltip = "Delete Project" onClick={ deleteProjectModal } style={{position: 'absolute', right: '0'}}>
176-
<CloseIcon/>
177-
</IconButton>
178-
: '' }
179-
<div className = 'projectInfo'>
180-
<b>
181-
<h2>Project: { name }</h2>
182-
<h3>Author: { username }</h3>
183-
<h3>Likes: { likes }</h3>
184-
</b>
185-
</div>
172+
<div className = 'project'>
173+
<div className = 'header'>
174+
{ currUsername === username ?
175+
<IconButton
176+
tooltip = "Delete Project"
177+
onClick={ deleteProjectModal }
178+
style={{position: 'absolute', right: '0'}}
179+
size="large">
180+
<CloseIcon/>
181+
</IconButton>
182+
: '' }
183+
<div className = 'projectInfo'>
184+
<b>
185+
<h2>Project: { name }</h2>
186+
<h3>Author: { username }</h3>
187+
<h3>Likes: { likes }</h3>
188+
</b>
189+
</div>
186190

187-
<div className = "icons">
188-
<IconButton tooltip="Like Template" style={noPointer} onClick = { handleLike }>
189-
<ThumbUpAltIcon fontSize='Large'/>
190-
</IconButton>
191-
{ currUsername !== username ?
192-
<IconButton tooltip ="Download Template" style={noPointer} onClick={ handleDownload }>
193-
<GetAppIcon fontSize="large" className="download"/>
194-
</IconButton>
195-
: '' }
196-
{ currUsername === username ?
197-
<IconButton tooltip ="Publish Template" style={noPointer} onClick={ handlePublish }>
198-
<PublishIcon fontSize="large"/>
199-
</IconButton>
200-
: '' }
191+
<div className = "icons">
192+
<IconButton
193+
tooltip="Like Template"
194+
style={noPointer}
195+
onClick = { handleLike }
196+
size="large">
197+
<ThumbUpAltIcon fontSize='Large'/>
198+
</IconButton>
199+
{ currUsername !== username ?
200+
<IconButton
201+
tooltip ="Download Template"
202+
style={noPointer}
203+
onClick={ handleDownload }
204+
size="large">
205+
<GetAppIcon fontSize="large" className="download"/>
206+
</IconButton>
207+
: '' }
208+
{ currUsername === username ?
209+
<IconButton
210+
tooltip ="Publish Template"
211+
style={noPointer}
212+
onClick={ handlePublish }
213+
size="large">
214+
<PublishIcon fontSize="large"/>
215+
</IconButton>
216+
: '' }
217+
</div>
201218
</div>
219+
<div className = "commentContainer">
220+
{recentComments}
221+
</div>
222+
<div className = 'commentInput'>
223+
<input type="text" placeholder="Add Comment" className="commentField" onChange={ handleChange }></input>
224+
<AddCommentIcon className='commentBtn' fontSize='Large' onClick={ handleComment } style={{position: 'absolute', right: '8', top: '13'}}/>
225+
</div>
226+
{modal}
202227
</div>
203-
<div className = "commentContainer">
204-
{recentComments}
205-
</div>
206-
<div className = 'commentInput'>
207-
<input type="text" placeholder="Add Comment" className="commentField" onChange={ handleChange }></input>
208-
<AddCommentIcon className='commentBtn' fontSize='Large' onClick={ handleComment } style={{position: 'absolute', right: '8', top: '13'}}/>
209-
</div>
210-
{modal}
211-
</div>
212228
);
213229
};
214230
export default Project;

app/src/Dashboard/ProjectContainer.tsx

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
import React, { useState, useContext, createContext } from 'react';
2-
import {
3-
MuiThemeProvider,
4-
makeStyles,
5-
useTheme
6-
} from '@material-ui/core/styles';
2+
import { ThemeProvider, Theme, StyledEngineProvider, useTheme } from '@mui/material/styles';
3+
import makeStyles from '@mui/styles/makeStyles';
74
import { useQuery } from '@apollo/client';
8-
import Tabs from '@material-ui/core/Tabs';
9-
import Tab from '@material-ui/core/Tab';
5+
import Tabs from '@mui/material/Tabs';
6+
import Tab from '@mui/material/Tab';
107

11-
import Box from '@material-ui/core/Box';
8+
import Box from '@mui/material/Box';
129
import { GET_PROJECTS } from './gqlStrings';
1310
import Project from './Project';
1411
import NavBarDash from './NavbarDash';
1512

1613
import { theme1, theme2 } from '../public/styles/theme';
14+
15+
16+
declare module '@mui/styles/defaultTheme' {
17+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
18+
interface DefaultTheme extends Theme {}
19+
}
20+
21+
1722
// Implement Apollo Client useQuery hook to retrieve data from the server through graphQL. This includes 2 steps:
1823
// 1) Impliment Apollo Provider in the top component in ./src/index.js, this allows children components access to the queried data
1924
// 2) useQuery hook will update the data stored in Apollo Client's cache and automatically trigger child components rendering
@@ -153,37 +158,39 @@ const ProjectContainer = (): JSX.Element => {
153158
// old code from Project Container
154159
return (
155160
<div className={classes.root}>
156-
<MuiThemeProvider theme={isThemeLight ? lightTheme : darkTheme}>
157-
<div className={'dashboardContainer'}>
158-
<NavBarDash
159-
setTheme={setTheme}
160-
styles={[style, setStyle]}
161-
isThemeLight={isThemeLight}
162-
optionClicked={optionClicked}
163-
/>
164-
<div className={'userDashboard'}>
165-
<Tabs
166-
variant="scrollable"
167-
orientation="vertical"
168-
value={value}
169-
onChange={handleChange}
170-
aria-label="Vertical tabs example"
171-
className={classes.tabs}
172-
>
173-
<LinkTab label="Shared Dashboard" {...a11yProps(0)} />
174-
<LinkTab label="Private Dashboard" {...a11yProps(1)} />
175-
</Tabs>
176-
<TabPanelItem className={'projectPanel'} value={value} index={0}>
177-
<h1> Shared Dashboard </h1>
178-
<div className="projectContainer">{sortedDisplay}</div>
179-
</TabPanelItem>
180-
<TabPanelItem className={'projectPanel'} value={value} index={1}>
181-
<h1> Private Dashboard </h1>
182-
<div className="projectContainer">{userDisplay}</div>
183-
</TabPanelItem>
161+
<StyledEngineProvider injectFirst>
162+
<ThemeProvider theme={isThemeLight ? lightTheme : darkTheme}>
163+
<div className={'dashboardContainer'}>
164+
<NavBarDash
165+
setTheme={setTheme}
166+
styles={[style, setStyle]}
167+
isThemeLight={isThemeLight}
168+
optionClicked={optionClicked}
169+
/>
170+
<div className={'userDashboard'}>
171+
<Tabs
172+
variant="scrollable"
173+
orientation="vertical"
174+
value={value}
175+
onChange={handleChange}
176+
aria-label="Vertical tabs example"
177+
className={classes.tabs}
178+
>
179+
<LinkTab label="Shared Dashboard" {...a11yProps(0)} />
180+
<LinkTab label="Private Dashboard" {...a11yProps(1)} />
181+
</Tabs>
182+
<TabPanelItem className={'projectPanel'} value={value} index={0}>
183+
<h1> Shared Dashboard </h1>
184+
<div className="projectContainer">{sortedDisplay}</div>
185+
</TabPanelItem>
186+
<TabPanelItem className={'projectPanel'} value={value} index={1}>
187+
<h1> Private Dashboard </h1>
188+
<div className="projectContainer">{userDisplay}</div>
189+
</TabPanelItem>
190+
</div>
184191
</div>
185-
</div>
186-
</MuiThemeProvider>
192+
</ThemeProvider>
193+
</StyledEngineProvider>
187194
</div>
188195
);
189196
};

app/src/components/ContextAPIManager/ContextManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react';
2-
import { makeStyles } from '@material-ui/styles';
2+
import { makeStyles } from '@mui/styles';
33
import Box from '@mui/material/Box';
44
import Tab from '@mui/material/Tab';
55
import TabContext from '@mui/lab/TabContext';

app/src/components/StateManagement/CreateTab/components/StatePropsPanel.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import React, { useState, useContext, useEffect } from "react";
2-
import {
3-
makeStyles,
4-
styled,
5-
Theme
6-
} from "@material-ui/core/styles";
2+
import { styled, Theme } from "@mui/material/styles";
3+
import makeStyles from '@mui/styles/makeStyles';
74
import {
85
FormControl,
96
FormHelperText,
@@ -12,7 +9,7 @@ import {
129
Select,
1310
TextField,
1411
Button
15-
} from "@material-ui/core";
12+
} from "@mui/material";
1613
import StateContext from "../../../../context/context";
1714
import TableStateProps from "./TableStateProps";
1815
import TableParentProps from "./TableParentProps";
@@ -443,13 +440,13 @@ const useStyles = makeStyles((theme: Theme) =>
443440
);
444441
// change to Button to keep styling consistent
445442
// const MyButton = styled(Button)({
446-
// background: "#0099E6",
447-
// border: 0,
448-
// borderRadius: 3,
449-
// boxShadow: "0 0px 0px 2px #1a1a1a",
450-
// color: "white",
451-
// height: 24,
452-
// width: 40,
453-
// padding: "0 30px",
443+
// background: "#0099E6",
444+
// border: 0,
445+
// borderRadius: 3,
446+
// boxShadow: "0 0px 0px 2px #1a1a1a",
447+
// color: "white",
448+
// height: 24,
449+
// width: 40,
450+
// padding: "0 30px",
454451
// });
455452
export default StatePropsPanel;

app/src/components/StateManagement/CreateTab/components/TableParentProps.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {
33
DataGrid,
44
GridEditRowsModel,
55
} from '@mui/x-data-grid';
6-
import Button from '@material-ui/core/Button';
6+
import Button from '@mui/material/Button';
77
import StateContext from "../../../../context/context";
8-
import { makeStyles } from '@material-ui/core/styles';
8+
import makeStyles from '@mui/styles/makeStyles';
99
import { StatePropsPanelProps } from '../../../../interfaces/Interfaces';
1010
import AddIcon from '@mui/icons-material/Add';
1111

app/src/components/StateManagement/CreateTab/components/TablePassedInProps.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {
33
DataGrid,
44
GridEditRowsModel,
55
} from '@mui/x-data-grid';
6-
import Button from '@material-ui/core/Button';
7-
import ClearIcon from '@material-ui/icons/Clear';
6+
import Button from '@mui/material/Button';
7+
import ClearIcon from '@mui/icons-material/Clear';
88
import StateContext from "../../../../context/context";
9-
import { makeStyles } from '@material-ui/core/styles';
9+
import makeStyles from '@mui/styles/makeStyles';
1010
import { StatePropsPanelProps } from '../../../../interfaces/Interfaces';
1111

1212
const TablePassedInProps = props => {

app/src/components/StateManagement/CreateTab/components/TableStateProps.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {
33
DataGrid,
44
GridEditRowsModel,
55
} from '@mui/x-data-grid';
6-
import Button from '@material-ui/core/Button';
7-
import ClearIcon from '@material-ui/icons/Clear';
6+
import Button from '@mui/material/Button';
7+
import ClearIcon from '@mui/icons-material/Clear';
88
import StateContext from "../../../../context/context";
9-
import { makeStyles } from '@material-ui/core/styles';
9+
import makeStyles from '@mui/styles/makeStyles';
1010
import { StatePropsPanelProps } from '../../../../interfaces/Interfaces';
1111

1212
const TableStateProps = props => {

app/src/components/StateManagement/StateManagement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react';
2-
import { makeStyles } from '@material-ui/styles';
2+
import { makeStyles } from '@mui/styles';
33
import Box from '@mui/material/Box';
44
import Tab from '@mui/material/Tab';
55
import TabContext from '@mui/lab/TabContext';

0 commit comments

Comments
 (0)