Skip to content

Commit b3395a9

Browse files
authored
Merge pull request #32 from jonocr/prod
Cleaning Comments/Console logs and update authors list
2 parents 56089a2 + 72e17a7 commit b3395a9

34 files changed

+37
-136
lines changed

app/electron/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async function createWindow() {
7373
webPreferences: {
7474
zoomFactor: 0.7,
7575
// enable devtools when in development mode
76-
devTools: true,
76+
devTools: isDev,
7777
// crucial security feature - blocks rendering process from having access to node modules
7878
nodeIntegration: false,
7979
// web workers will not have access to node
@@ -91,7 +91,6 @@ async function createWindow() {
9191
nativeWindowOpen: true,
9292
},
9393
});
94-
win.webContents.openDevTools();
9594

9695
// Splash screen that appears while loading
9796
const hideSplashscreen = initSplashScreen({

app/src/Dashboard/ProjectContainer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const arrToComponent = arr => arr.map((proj, index) => <Project
4242
comments = {proj.comments}
4343
/>);
4444

45-
// Caret Start Pulled from materialUI to create a tab panel
45+
// Start Pulled from materialUI to create a tab panel
4646
const a11yProps = (index: any) => ({
4747
id: `vertical-tab-${index}`,
4848
'aria-controls': `vertical-tabpanel-${index}`,
@@ -95,7 +95,7 @@ const useStyles = makeStyles((theme) => ({
9595
borderRight: `1px solid ${theme.palette.divider}`,
9696
},
9797
}));
98-
// Caret End of prefab code to generate a tab panel
98+
// End of prefab code to generate a tab panel
9999

100100
const ProjectContainer = (): JSX.Element => {
101101
const classes = useStyles();
@@ -105,7 +105,7 @@ const ProjectContainer = (): JSX.Element => {
105105
setValue(newValue);
106106
};
107107

108-
// Start Caret of old code from project container
108+
// old code from project container
109109
const myVar = {};
110110
// Need this for the individual user dasboard, for now, dashboard shows all projects from all users
111111
const userSSID = window.localStorage.getItem('ssid') || 'unavailable';
@@ -165,7 +165,7 @@ const ProjectContainer = (): JSX.Element => {
165165
const userDisplay = arrToComponent(userProjects);
166166
// create an array of components Project that will be conditionally rendered
167167
const sortedDisplay = arrToComponent(sortedProjects);
168-
// Caret End of old code from Project Container
168+
// old code from Project Container
169169

170170
return (
171171
<div className={classes.root}>

app/src/components/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const App = (): JSX.Element => {
5858
}
5959
}, []);
6060

61-
// Caret Start Updated save cycle
61+
6262
useEffect(() => {
6363
// provide config properties to legacy projects so new edits can be auto saved
6464
if (state.config === undefined) {
@@ -88,7 +88,6 @@ export const App = (): JSX.Element => {
8888
}, 15000);
8989
}
9090
}, [state])
91-
// Caret End
9291

9392

9493
return (

app/src/components/bottom/StylesEditor.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ const StylesEditor: React.FC<{
4444
}
4545

4646
const saveFile = () => {
47-
console.log('saveFile: ', css);
48-
// const myHeaders = new Headers({
49-
// headers: { 'Content-Type': 'application/json' },
50-
// });
5147
fetch(`${serverURL}/user-styles/save`, {
5248
method: 'POST',
5349
headers: { 'Content-Type': 'application/json' },

app/src/components/form/Selector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 100% Caret
1+
22
import React from 'react';
33
import FormControl from '@material-ui/core/FormControl';
44
import Select from '@material-ui/core/Select';

app/src/components/left/DragDropPanel.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const DragDropPanel = (props): JSX.Element => {
4040

4141
// filter out separator so that it will not appear on the html panel
4242
const htmlTypesToRender = state.HTMLTypes.filter(type => type.name !== 'separator');
43-
console.log('Types', htmlTypesToRender)
4443
return (
4544
<div className="HTMLItems">
4645
<div id="HTMLItemsTopHalf">

app/src/components/left/HTMLItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const HTMLItem : React.FC<{
119119
})
120120
);
121121
};
122-
// Caret updated the id's to reflect the new element types input and label
122+
// updated the id's to reflect the new element types input and label
123123
return ( // HTML Elements
124124
<Grid item xs={5} key={`html-g${name}`}>
125125
{ id <= 16 &&

app/src/components/login/SignIn.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
7171

7272
// this useEffect will check for cookies and set an item in localstorage for github Oauth session validation
7373

74-
// Caret start
74+
7575
// Commented because window api is broken. Work in progress
7676
/* useEffect(() => {
7777
const githubCookie = setInterval(() => {
@@ -89,7 +89,6 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
8989
});
9090
}, 2000);
9191
}, []);*/
92-
// Caret end
9392

9493
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
9594
let inputVal = e.target.value;

app/src/components/main/Annotation.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Caret Start
1+
22
import React, {
33
useRef, useState, useContext, useEffect,
44
} from 'react';
@@ -107,4 +107,3 @@ function Annotation({
107107
}
108108

109109
export default Annotation;
110-
// Caret End

app/src/components/main/Canvas.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,6 @@ function Canvas() {
5959
}
6060
});
6161
}
62-
// Caret Start - This code is never used. Adding a new child element to an existing element
63-
// or moving existing element to nest in another element is handled by DirectChildHTMLNestable
64-
//
65-
//if item is not a new instance, change position of element dragged inside div so that the div is the new parent
66-
// else {
67-
// console.log("Changed Position, this is not doing shit");
68-
// dispatch({
69-
// type: 'CHANGE POSITION',
70-
// payload: {
71-
// // name: item.name,
72-
// currentChildId: item.childId,
73-
// newParentChildId: null
74-
// }
75-
// });
76-
// }
77-
// Caret End
7862
},
7963
collect: monitor => ({
8064
isOver: !!monitor.isOver()

app/src/components/main/DemoRender.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 100% Caret
1+
22
import React, {
33
useState, useCallback, useContext, useEffect,
44
} from 'react';
@@ -20,7 +20,6 @@ const DemoRender = (props): JSX.Element => {
2020
const componentsToRender = [];
2121
for (const element of array) {
2222
if (element.name !== 'separator') {
23-
// console.log('detail from children array', element);
2423
const elementType = element.name;
2524
const childId = element.childId;
2625
const elementStyle = element.style;
@@ -44,7 +43,6 @@ const DemoRender = (props): JSX.Element => {
4443
useEffect(() => {
4544
const focusIndex = state.canvasFocus.componentId - 1;
4645
const childrenArray = state.components[focusIndex].children;
47-
//console.log('Refrenced Children in State!!!', childrenArray);
4846
const renderedComponents = componentBuilder(childrenArray);
4947
setComponents(renderedComponents);
5048
}, [state.components, state.canvasFocus]);

app/src/components/main/DirectChildHTML.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { ItemTypes } from '../../constants/ItemTypes';
88
import StateContext from '../../context/context';
99
import { combineStyles } from '../../helperFunctions/combineStyles';
1010
import globalDefaultStyle from '../../public/styles/globalDefaultStyles';
11-
// Caret
1211
import Annotation from './Annotation'
1312

1413
function DirectChildHTML({
@@ -71,14 +70,12 @@ function DirectChildHTML({
7170
return (
7271
<div onClick={onClickHandler} style={combinedStyle} ref={drag} id={`canv${childId}`}>
7372
<strong>{HTMLType.placeHolderShort}</strong>
74-
{/* Caret start */}
7573
{` (${childId})`}
7674
<Annotation
7775
id={childId}
7876
name={name}
7977
annotations={annotations}
8078
/>
81-
{/* Caret end */}
8279
</div>
8380
);
8481
}

app/src/components/main/DirectChildHTMLNestable.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import StateContext from '../../context/context';
66
import { combineStyles } from '../../helperFunctions/combineStyles';
77
import globalDefaultStyle from '../../public/styles/globalDefaultStyles';
88
import renderChildren from '../../helperFunctions/renderChildren';
9-
// Caret
109
import Annotation from './Annotation'
1110
import validateNewParent from '../../helperFunctions/changePositionValidation'
1211
import componentNest from '../../helperFunctions/componentNestValidation'
@@ -84,7 +83,7 @@ const snapShotFunc = () => {
8483
}
8584
// if item is not a new instance, change position of element dragged inside div so that the div is the new parent
8685
else {
87-
// Caret check to see if the selected child is trying to nest within itself
86+
// check to see if the selected child is trying to nest within itself
8887
if (validateNewParent(state, item.childId, childId) === true) {
8988
dispatch({
9089
type: 'CHANGE POSITION',
@@ -136,15 +135,13 @@ const snapShotFunc = () => {
136135
return (
137136
<div onClick={onClickHandler} style={combinedStyle} ref={ref} id={`canv${childId}`}>
138137
<strong>{HTMLType.placeHolderShort}</strong>
139-
{/* Caret start */}
140138
{` ( ${childId} )`}
141139
<Annotation
142140
id={childId}
143141
name={name}
144142
annotations={annotations}
145143
/>
146144
{renderChildren(children)}
147-
{/* Caret end */}
148145
</div>
149146
);
150147
}

app/src/components/main/IndirectChild.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ function IndirectChild({ style, children, placeHolder, linkId, childId, name, an
2828

2929
return (
3030
<div style={combinedStyle}>
31-
{/* Caret start */}
3231
{` ( ${childId} )`}
3332
<Annotation
3433
id={childId}
3534
name={name}
3635
annotations={annotations}
3736
/>
38-
{/* Caret end */}
3937
{linkId ? (
4038
<div onClick={onClickHandlerRoute}>{linkName}</div>
4139
) : (

app/src/components/main/SeparatorChild.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function DirectChildHTMLNestable({
6868
}
6969
// if item is not a new instance, change position of element dragged inside separator so that separator is new parent (until replacement)
7070
else {
71-
// Caret check to see if the selected child is trying to nest within itself
71+
// check to see if the selected child is trying to nest within itself
7272
if (validateNewParent(state, item.childId, childId) === true) {
7373
dispatch({
7474
type: 'CHANGE POSITION',

app/src/components/right/ComponentPanel.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ const ComponentPanel = ({isThemeLight}): JSX.Element => {
111111

112112
const keyBindCreateComponent = useCallback((e) => {
113113

114-
// Caret
115114
if(e.key === 'Enter' && e.target.tagName !== "TEXTAREA") {
116115
e.preventDefault();
117116
document.getElementById('addComponentButton').click();
@@ -149,7 +148,7 @@ const ComponentPanel = ({isThemeLight}): JSX.Element => {
149148
color={'primary'}
150149
variant="outlined"
151150
className={isThemeLight ? `${classes.inputField} ${classes.lightThemeFontColor}` : `${classes.inputField} ${classes.darkThemeFontColor}`}
152-
// Caret inputprops and helpertext must be lowercase
151+
// inputprops and helpertext must be lowercase
153152
inputProps={{ className: classes.input }}
154153
value={compName}
155154
// Doesn't accept boolean value needs to be a string

app/src/components/right/StatePropsPanel.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// CARET
1+
22
import React, { useState, useContext, useCallback, useEffect } from "react";
33
import {
44
createStyles,
@@ -38,13 +38,6 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
3838
const currentId = state.canvasFocus.componentId;
3939
const currentComponent = state.components[currentId - 1];
4040

41-
// debug console button for development purposes
42-
const debug = () => {
43-
console.log("currentComponent:", currentComponent);
44-
console.log("currentComponent.stateProps:", currentComponent.stateProps);
45-
console.log("currentComponent.useStateCodes:", currentComponent.useStateCodes);
46-
};
47-
4841
// convert value to correct type based on user input
4942
const typeConversion = (value, type) => {
5043
switch (type) {
@@ -174,10 +167,6 @@ const StatePropsPanel = ({ isThemeLight }): JSX.Element => {
174167
</Select>
175168
<FormHelperText>Required</FormHelperText>
176169
</FormControl>
177-
{/* Commenting out the debug button for production */}
178-
{/* <MyButton type="submit" onClick={debug}>
179-
debug
180-
</MyButton> */}
181170
<br></br>
182171
<MyButton type="submit" onClick={submitNewState}>
183172
Save
@@ -294,7 +283,6 @@ const useStyles = makeStyles((theme: Theme) =>
294283
darkThemeFontColor: {
295284
color: "#fff",
296285
},
297-
// CARET
298286
formControl: {
299287
margin: theme.spacing(1),
300288
minWidth: 120,

app/src/components/right/TableStateProps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// CARET
1+
22
import React, { useState, useContext, useEffect } from 'react';
33
import {
44
DataGrid,

0 commit comments

Comments
 (0)