Skip to content

Commit 9f8eef2

Browse files
committed
Merge branch 'dev' into denton/link
2 parents add34a5 + a3d9759 commit 9f8eef2

File tree

4 files changed

+57
-18
lines changed

4 files changed

+57
-18
lines changed

app/src/components/left/HTMLPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const useStyles = makeStyles({
339339
border: '1px solid #186BB4'
340340
},
341341
lightThemeFontColor: {
342-
color: '#155084',
342+
color: 'white',
343343
'& .MuiInputBase-root': {
344344
color: 'rgba (0, 0, 0, 0.54)'
345345
}

app/src/components/marketplace/MarketplaceCard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import React from 'react';
1818
import imageSrc from '../../../../resources/marketplace_images/marketplace_image.png';
1919
import { red } from '@mui/material/colors';
2020
import axios from 'axios';
21+
import {useDispatch, useSelector} from 'react-redux'
22+
import { RootState } from '../../redux/store';
23+
import { saveProject } from '../../helperFunctions/projectGetSaveDel';
2124

2225
interface Project {
2326
forked: String,
@@ -36,6 +39,8 @@ const ITEM_HEIGHT = 48;
3639
const MarketplaceCard = ({proj} :{proj: Project}) => {
3740
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
3841
const open = Boolean(anchorEl);
42+
const state = useSelector((store:RootState) => store.appState);
43+
console.log('HEY', state)
3944
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
4045
setAnchorEl(event.currentTarget);
4146
};
@@ -50,7 +55,8 @@ const MarketplaceCard = ({proj} :{proj: Project}) => {
5055
};
5156
const handleClose = () => {
5257
setAnchorEl(null);
53-
}
58+
};
59+
5460

5561
return (
5662
<>

app/src/components/right/OpenProjects.tsx

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface ProjectDialogProps {
2424
function ProjectsDialog(props: ProjectDialogProps) {
2525
const classes = useStyles();
2626
const { onClose, open, projects } = props;
27+
console.log(projects)
2728
const state = useSelector((store:RootState) => store.appState);
2829
const dispatch = useDispatch();
2930
// If no projects selected, keep the name of the current displayed
@@ -40,6 +41,14 @@ function ProjectsDialog(props: ProjectDialogProps) {
4041
dispatch(openProject(selectedProject))
4142
onClose();
4243
};
44+
// these two filter between user projects and market projects
45+
// const userProjects = projects.filter((project: any) => {
46+
// project.forked === undefined
47+
// })
48+
// const marketProjects = projects.filter((project: any) => {
49+
// project.forked !== undefined
50+
// })
51+
4352
return (
4453
<Dialog
4554
onClose={handleClose}
@@ -48,20 +57,44 @@ function ProjectsDialog(props: ProjectDialogProps) {
4857
>
4958
<DialogTitle style={{ color: "#000" }} id="project-dialog-title">Open Project</DialogTitle>
5059
<List style={{ color: "#000" }}>
51-
{projects.map((project: any, index: number) => (
52-
<ListItem
53-
button
54-
onClick={() => handleListItemClick(project.name)}
55-
key={index}
56-
>
57-
<ListItemAvatar>
58-
<Avatar className={classes.avatar}>
59-
<FolderOpenIcon />
60-
</Avatar>
61-
</ListItemAvatar>
62-
<ListItemText primary={project.name} />
63-
</ListItem>
64-
))}
60+
{projects.filter((project: any) => project.forked === undefined).map((project: any, index: number) => {
61+
console.log("Logging something inside the map:", project.forked); // Add this line
62+
return (
63+
<ListItem
64+
button
65+
onClick={() => handleListItemClick(project.name)}
66+
key={index}
67+
>
68+
<ListItemAvatar>
69+
<Avatar className={classes.avatar}>
70+
<FolderOpenIcon />
71+
</Avatar>
72+
</ListItemAvatar>
73+
<ListItemText primary={project.name} />
74+
</ListItem>
75+
);
76+
})}
77+
</List>
78+
{/* this section handles the projects cloned from the marketplace */}
79+
<DialogTitle style={{ color: "#000" }} id="project-dialog-title">MP Projects</DialogTitle>
80+
<List style={{ color: "#000" }}>
81+
{projects.filter((project: any) => project.forked !== undefined).map((project: any, index: number) => {
82+
console.log("Logging something inside the second map:", project.forked); // Add this line
83+
return (
84+
<ListItem
85+
button
86+
onClick={() => handleListItemClick(project.name)}
87+
key={index}
88+
>
89+
<ListItemAvatar>
90+
<Avatar className={classes.avatar}>
91+
<FolderOpenIcon />
92+
</Avatar>
93+
</ListItemAvatar>
94+
<ListItemText primary={project.name} />
95+
</ListItem>
96+
);
97+
})}
6598
</List>
6699
</Dialog>
67100
);

server/models/reactypeModels.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ const sessionSchema = new Schema({
7878

7979
const projectSchema = new Schema(
8080
{
81-
name: String,
82-
forked: String,
81+
name: {type: String, required: true},
82+
forked: {type: String},
8383
likes: { type: Number, default: 0 },
8484
published: { type: Boolean, default: false },
8585
project: { type: Object, required: true },

0 commit comments

Comments
 (0)