Skip to content

Commit ca4699f

Browse files
authored
Merge pull request #29 from oslabs-beta/master-holder
Finalise alpha release
2 parents 23cf8c2 + 337104f commit ca4699f

37 files changed

+7054
-14360
lines changed

README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,28 @@ Visit our website here 👉 https://fflow.dev
103103
<p align="right">(<a href="#top">back to top</a>)</p>
104104

105105
### Loading Screen
106+
106107
<img src="./src/assets/splashDemo.gif">
107108

108109
### Light and Dark Mode
110+
109111
<img src="./src/assets/darkMode.gif">
110112

111113
### Create Custom Components and Nest HTML elements
114+
112115
<img src="./src/assets/customComps.gif">
113116

114-
### Edit CSS directly in the App (Feature Coming Soon)
117+
### Edit CSS directly in the App (Currently only on Mac version)
118+
119+
💫💫 Coming soon to Windows 💫💫
115120
<img src="./src/assets/cssEditor.gif">
116121

117122
### Export Working Project
123+
118124
<img src="./src/assets/export.gif">
119125

120126
### Clear canvas to start from scratch
127+
121128
<img src="./src/assets/clearCanvas.gif">
122129

123130
## Getting Started
@@ -141,25 +148,13 @@ Please download the latest release of fflow for [MacOS](https://github.com/oslab
141148

142149
<!-- - **Linux users**: Run the application as a super user in order to read and write files. -->
143150

144-
<!-- #### Drag, Drop, Reorder and Delete HTML Tags onto Canvas
145-
146-
#### Nest HTML Tags and Components within custom React Components
147-
148-
#### Style your project
149-
150-
Add styles to your HTML elements and React Components by editing directly in the CSS Editor. This will then be exported with your app.
151-
152-
#### Clearing the Canvas
153-
154-
## Development Mode -->
155-
156151
#### Clone this repo
157152

158153
1. Clone this repo `git clone https://github.com/oslabs-beta/fflow`
159154
2. Install the dependencies `npm install`
160155
3. Copy and run this in your terminal (`./node_modules/.bin/electron-rebuild`) or `.\node_modules\.bin\electron-rebuild.cmd` for Windows
161156
4. Run script for development mode `npm run start`
162-
5. Build the app (automatic) `npm run build`
157+
5. Build the app (automatic) `npm run package`
163158
6. Test the app (after `npm run build` || `yarn run build`) `npm run prod`
164159

165160
#### Current issues

__tests__/LeftPanel.test.js

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,19 @@
11
import React from 'react';
22
import { render, screen, fireEvent } from '../src/test-utils.js';
33
import '@testing-library/jest-dom/extend-expect';
4-
// import DnD from '../src/components/DnD';
54
import CompCreator from '../src/components/CompCreator';
65
import Tree from '../src/components/Tree';
7-
// import TreeRecursive from '../src/components/TreeRecursive';
8-
import TreeFile from '../src/components/TreeFile';
96

107
describe('Left Panel', () => {
11-
test('renders CompCreator component with input field and add button', () => {
12-
const { getByTestId } = render(<CompCreator />);
13-
expect(screen.getByText('React Component')).toBeInTheDocument();
14-
expect(screen.getByRole('textbox')).toBeInTheDocument();
15-
const addButton = getByTestId('add-button');
16-
expect(addButton).toBeInTheDocument();
17-
// const mockFunction = jest.fn(() => true);
18-
// fireEvent.click(addButton);
19-
// expect(mockFunction()).toBe(true);
20-
});
21-
228
test('value of comp creator input field changes', () => {
239
const { queryByPlaceholderText } = render(<CompCreator />);
2410
const input = queryByPlaceholderText('Component Name');
2511
fireEvent.change(input, { target: { value: 'test' } });
26-
expect(input.value).toBe('test');
12+
expect(input.value).toBe('test');
2713
});
2814

2915
test('renders the tree component which displays file tree', () => {
3016
const { getByTestId } = render(<Tree />);
3117
expect(getByTestId('filetree')).toBeInTheDocument();
3218
});
33-
34-
// test('renders the tree folders with on click functionality', () => {
35-
// const { getByTestId } = render(<TreeRecursive />);
36-
// expect(getByTestId('folder')).toBeInTheDocument();
37-
// });
38-
39-
// test('renders the tree files with on click functionality', () => {
40-
// const { getByTestId } = render(<TreeFile />);
41-
// expect(getByTestId('file')).toBeInTheDocument();
42-
// });
43-
44-
//HAVING ISSUES WITH TESTS INVOLVING DND DUE TO PROVIDER/STORE ISSUE WITH REACT TESTING LIBRARY
45-
46-
// test('renders fflow logo with on click functionality', () => {
47-
// const { getByTestId } = render(<DnD />);
48-
// const appLogo = getByTestId('app-logo');
49-
// expect(appLogo).toBeInTheDocument();
50-
// const mockFunction = jest.fn(() => true);
51-
// fireEvent.click(appLogo);
52-
// expect(mockFunction()).toBe(true);
53-
// });
54-
55-
// test('renders tree component', () => {
56-
// render(<DnD />);
57-
// expect(screen.getByText('FOLDERS')).toBeInTheDocument();
58-
// });
5919
});

__tests__/Navigation.test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ describe('Navigation', () => {
2222
expect(mockFunction()).toBe(true);
2323
});
2424

25-
test('renders Navigation component with save icon button with on click functionality', () => {
26-
const { getByTestId } = render(<Navigation />);
27-
const saveButton = getByTestId('save-button');
28-
expect(saveButton).toBeInTheDocument();
29-
const mockFunction = jest.fn(() => true);
30-
fireEvent.click(saveButton);
31-
expect(mockFunction()).toBe(true);
32-
});
33-
3425
test('renders Navigation component with export icon button with on click functionality', () => {
3526
const { getByTestId } = render(<Navigation />);
3627
const exportButton = getByTestId('export-button');

__tests__/redux.test.js

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import reducer, { addComponent, clearProject, createComponent, deleteComponent, reorderComponent, saveComponentCode, setCurrentFile } from '../src/redux/canvasSlice';
1+
import reducer, { addComponent, clearProject, createComponent, reorderComponent, setCurrentFile } from '../src/redux/canvasSlice';
22

33
describe('canvasSlice reducers', () => {
44
let initialState;
@@ -26,6 +26,32 @@ describe('canvasSlice reducers', () => {
2626
initialState = {
2727
components: [],
2828
code: '',
29+
cssCode: `html {
30+
box-sizing: border-box;
31+
height: 100%;
32+
}
33+
body {
34+
margin: 0;
35+
padding-top: 20%;
36+
overflow: hidden;
37+
background-color: #272727;
38+
font-family: "Helvetica Neue";
39+
display: flex;
40+
justify-content: center;
41+
text-align: center;
42+
height: 100%;
43+
}
44+
h1 {
45+
color: white;
46+
font-size: 3rem;
47+
}
48+
p {
49+
color: white;
50+
font-size: 1.5rem;
51+
}
52+
.default-spans {
53+
color: #4338ca;
54+
}`,
2955
tags: [],
3056
customComponents: [],
3157
imports: ["import React from 'react';\n"],
@@ -57,6 +83,14 @@ describe('canvasSlice reducers', () => {
5783
fileImports: [],
5884
fileComponents: [],
5985
},
86+
{
87+
type: 'file',
88+
name: 'styles.css',
89+
fileCode: '',
90+
fileTags: [],
91+
fileImports: [],
92+
fileComponents: [],
93+
},
6094
],
6195
currentFile: 'App.js',
6296
};
@@ -83,13 +117,6 @@ describe('canvasSlice reducers', () => {
83117
});
84118
});
85119

86-
// describe('deleteComponent:', () => {
87-
// test('should remove from middle of array', () => {
88-
// const action = createAction(1, 'Anchor');
89-
// expect(reducer(initialState, deleteComponent(action))).toEqual({...initialState, components: ['Div', 'Button']});
90-
// });
91-
// });
92-
93120
describe('reorderComponent:', () => {
94121
test('should swap 2 items', () => {
95122
const action = createAction(1, 'Button', 2);
@@ -131,6 +158,14 @@ describe('canvasSlice reducers', () => {
131158
fileImports: [],
132159
fileComponents: [],
133160
},
161+
{
162+
type: 'file',
163+
name: 'styles.css',
164+
fileCode: '',
165+
fileTags: [],
166+
fileImports: [],
167+
fileComponents: [],
168+
},
134169
{
135170
type: 'file',
136171
name: 'TestFile.jsx',
@@ -150,23 +185,4 @@ describe('canvasSlice reducers', () => {
150185
expect(reducer(initialState, setCurrentFile('TestFile.jsx'))).toEqual({ ...initialState, currentFile: 'TestFile.jsx' });
151186
});
152187
});
153-
154-
// describe('saveComponentCode:', () => {
155-
// test('should save state into files', () => {
156-
// initialState.files.push({
157-
// type: 'file',
158-
// name: 'TestFile.jsx',
159-
// fileCode: `import React from 'react';\n\nconst TestFile = () => {\n\treturn (\n\t\t<div>\n\t\t</div>\n\t)\n}\nexport default TestFile;`,
160-
// fileTags: [],
161-
// fileImports: ["import React from 'react';\n"],
162-
// fileComponents: [],
163-
// });
164-
165-
// initialState.currentFile = 'TestFile.jsx';
166-
167-
// const newState = {...initialState, code: 'test'}
168-
169-
// expect(reducer(initialState, saveComponentCode())).toEqual({newState});
170-
// });
171-
// });
172188
});

main.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function createWindow() {
5050
height: 880,
5151
show: false,
5252
webPreferences: {
53-
preload: path.join(__dirname, './src/electron/preload.js'),
5453
nodeIntegration: true,
5554
contextIsolation: false,
5655
},
@@ -95,7 +94,6 @@ function createWindow() {
9594
// We send incoming data to the Terminal
9695
ptyProcess.on('data', (data) => {
9796
mainWindow.webContents.send('terminal.sentData', data);
98-
console.log('data sent from main', data);
9997
});
10098
// in the main process, when data is received in the terminal,
10199
// main process will write and add to ptyProcess
@@ -140,7 +138,6 @@ function createWindow() {
140138
// in an array if your app supports multi windows, this is the time
141139
// when you should delete the corresponding element.
142140
// mainWindow.webContents.send('terminal.close', () => {
143-
// console.log('SENT CLOSE');
144141
// });
145142
ptyProcess.kill();
146143
mainWindow = null;

0 commit comments

Comments
 (0)