Skip to content

Commit e8715ad

Browse files
authored
Merge pull request #12 from eddypjr/finalTest
Changed version number of package.json from 5.0 to 6.0 and reviewed for OS LAB final merge
2 parents 0701c10 + f53b5b2 commit e8715ad

File tree

15 files changed

+16
-529
lines changed

15 files changed

+16
-529
lines changed

__tests__/__snapshots__/enzyme.test.tsx.snap

Lines changed: 0 additions & 458 deletions
This file was deleted.

__tests__/enzyme.test.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ describe('Test AppContainer container', () => {
109109
});
110110
// testing for a RightContainer
111111
it('Should render RightContainer', () => {
112-
// This test doesnt work eventhough the component renders
113-
// expect(
114-
// target.contains(
115-
// <RightContainer isThemeLight={props.isThemeLight}/>
116-
// )).toBe(true);
117112
expect(
118113
target.find(RightContainer)
119114
).toHaveLength(1);

app/electron/main.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ async function createWindow() {
6060
// Create the browser window.
6161
win = new BrowserWindow({
6262
// full screen
63-
// width: 1920,
64-
// height: 1080,
65-
width: 1024,
66-
height: 576,
63+
width: 1920,
64+
height: 1080,
65+
6766
minWidth: 980,
6867
// window title
6968
title: 'ReacType',
@@ -203,15 +202,6 @@ app.on('ready', createWindow);
203202

204203
// TRYING ELECTRON-WINDOW-MANAGER When the application is ready
205204

206-
// app.on('ready', () => {
207-
// windowManager.setDefaultSetup({'width': 800, 'height': 450, 'position': 'right'});
208-
// // Open Dashboard window
209-
// const dashboard = windowManager.open('home', 'Welcome ...', 'http://localhost:5000/home.html');
210-
// dashboard.toggleDevTools(false);
211-
// // Load ReacType window
212-
// createWindow();
213-
// });
214-
215205
// Quit when all windows are closed.
216206
app.on('window-all-closed', () => {
217207
app.quit();

app/src/components/bottom/CodePreview.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import 'ace-builds/src-noconflict/theme-solarized_dark';
88
import 'ace-builds/src-noconflict/theme-solarized_light';
99
import 'ace-builds/src-noconflict/theme-terminal';
1010
import { Component } from '../../interfaces/Interfaces';
11-
import { EditorState } from 'draft-js';
12-
import { Editor } from 'react-draft-wysiwyg';
1311
import useResizeObserver from '../../tree/useResizeObserver';
1412
import { string } from 'prop-types';
1513

app/src/components/main/Canvas.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Component, DragItem } from '../../interfaces/Interfaces';
66
import { combineStyles } from '../../helperFunctions/combineStyles';
77
import renderChildren from '../../helperFunctions/renderChildren';
88

9-
109
function Canvas() {
1110
const [state, dispatch] = useContext(StateContext);
1211
// find the current component to render on the canvas
@@ -25,7 +24,7 @@ function Canvas() {
2524
changeFocus(state.canvasFocus.componentId, null);
2625
};
2726

28-
// stores a snapshot of state into the past array for UNDO
27+
// stores a snapshot of state into the past array for UNDO. snapShotFunc is also invoked for nestable elements in DirectChildHTMLNestable.tsx
2928
const snapShotFunc = () => {
3029
// make a deep clone of state
3130
const deepCopiedState = JSON.parse(JSON.stringify(state));

app/src/components/main/CanvasContainer.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ function CanvasContainer() {
99
border: '2px Solid grey',
1010
};
1111

12-
function onChangeHandler(event) {
13-
console.log('working', event.target);
14-
}
15-
1612
return (
1713
<div style={canvasContainerStyle}>
1814
<Canvas />

app/src/components/main/DirectChildHTMLNestable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function DirectChildHTMLNestable({
1717
}: ChildElement) {
1818
const [state, dispatch] = useContext(StateContext);
1919
const ref = useRef(null);
20-
// takes a snapshot of state to be used in UNDO and REDO cases
20+
21+
// takes a snapshot of state to be used in UNDO and REDO cases. snapShotFunc is also invoked in Canvas.tsx
2122
const snapShotFunc = () => {
2223
//makes a deep clone of state
2324
const deepCopiedState = JSON.parse(JSON.stringify(state));

app/src/components/top/NavBar.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ import createModal from '../right/createModal';
3232
import StateContext from '../../context/context';
3333
import logo from '../../public/icons/win/logo.png';
3434

35-
36-
// ROUTING TO DASHBOARD
37-
3835
// NavBar text and button styling
3936
const useStyles = makeStyles((theme: Theme) => createStyles({
4037
root: {

app/src/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,14 @@ import SignUp from './components/login/SignUp.tsx';
1515
import FBPassWord from './components/login/FBPassWord.tsx';
1616
import Tutorial from './tutorial/Tutorial.tsx';
1717
import TutorialPage from './tutorial/TutorialPage.tsx';
18-
19-
20-
/*
21-
* Dashboard
22-
*/
23-
// import TestDashboard from './Dashboard/FormsContainer.ts';
2418
import ProjectDashboard from './Dashboard/ProjectContainer.tsx';
25-
2619
import styles from './Dashboard/styles.css';
2720

2821
const client = new ApolloClient({
2922
uri: 'http://localhost:5000/graphql',
3023
cache: new InMemoryCache()
3124
});
3225

33-
/*
34-
*
35-
*/
36-
37-
3826
const PrivateRoute = ({ component: Component, ...rest }) => (
3927
<Route
4028
{...rest}
@@ -48,7 +36,6 @@ const PrivateRoute = ({ component: Component, ...rest }) => (
4836
/>
4937
);
5038

51-
5239
ReactDOM.render(
5340
<ApolloProvider client={client}>
5441
<Router>

app/src/reducers/componentReducer.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,6 @@ const reducer = (state: State, action: Action) => {
328328
if (directParent && directParent.name === 'separator')
329329
nextTopSeparatorId = manageSeparators.handleSeparators(addChildArray, 'add');
330330
components[canvasFocus.componentId-1].children = addChildArray;
331-
332-
// const realPast = [];
333331

334332
parentComponent.code = generateCode(
335333
components,
@@ -653,8 +651,9 @@ const reducer = (state: State, action: Action) => {
653651
//the children array of the focused component will equal the last element of the future array
654652
state.components[focusIndex].children = state.components[focusIndex].future[state.components[focusIndex].future.length - 1]
655653
//the last element of the future array gets pushed into the past
654+
const poppedEl = state.components[focusIndex].future.pop();
656655
//the last element of the future array gets popped out
657-
state.components[focusIndex].past.push(state.components[focusIndex].future.pop())
656+
state.components[focusIndex].past.push(poppedEl);
658657

659658
// generate code for the Code Preview
660659
state.components.forEach((el, i) => {

0 commit comments

Comments
 (0)