Skip to content

Commit 06c56b8

Browse files
authored
Merge pull request #233 from oslabs-beta/master
Update to v.18
2 parents 6db4bee + f225b27 commit 06c56b8

File tree

251 files changed

+5813
-57913
lines changed

Some content is hidden

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

251 files changed

+5813
-57913
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ server/RootCA.srl
498498

499499

500500
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn
501+
501502
/test-results/
502503
/playwright-report/
503504
/playwright/.cache/
@@ -524,4 +525,7 @@ amplifytools.xcconfig
524525
**.sample
525526
#amplify-do-not-edit-end
526527

527-
/amplify/team-provider-info.json
528+
/amplify/team-provider-info.json
529+
530+
#TypeScript coverage report
531+
coverage-ts/

.travis.yml

-17
This file was deleted.

CHANGE_LOG.md

+41
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,47 @@
33
<h1 align="center">ReacType Change Log</h1>
44
</p>
55

6+
**Version 18.0.0 Changes**
7+
8+
Changes:<br>
9+
10+
- Developer Improvements:
11+
- Typescript conversion continued and now sits at ~90%
12+
- Dev Bug Fixes:
13+
- Deleted ts-coverage files and added folder to git.ignore so TS conversion status is properly reflected on the GitHub repository.
14+
- Cleaned up outdated code and removed multiple unused and duplicate files, particularly those related to the now-obsolete Dark Mode functionality and some other lingering code from the v.17 migration.
15+
- Modularity:
16+
- Migrated large portions of RoomContainer functionality into smaller components to improve the reusability of code.
17+
- Created more interface types for reusability to multiple parts of the applications.
18+
- User Features:
19+
- Collaboration Room:
20+
- Implemented room functionality where multiple users can see and interact with the same canvas state in real time.
21+
- Dynamically handles the host logic of the collab room, where the oldest connected client is the one serving the room's state.
22+
- Fixed backend web socket connections with the clients, allowing full duplex connections between multiple clients and servers.
23+
- User List:
24+
- List that displays all connected users in a particular room.
25+
- Dynamically updates when users join or leave a room.
26+
- Automatically updates new host in the room to the next oldest user.
27+
- Join/Nickname Button:
28+
- Allows users to specify which room to join, and what name to display upon joining the room.
29+
- Button only shows when user is not connected to room, requires both fields to be filled out.
30+
31+
Recommendations for Future Enhancements:<br>
32+
33+
- Chat functionality so users in the same room can discuss their projects.
34+
- List of active rooms so users can simply pick one to join. Will likely be paired with a password feature for security, so only users with the proper credentials can join a particular room.
35+
- True real-time rendering so users can see components as they're being dragged onto the canvas, rather than only when they're placed.
36+
- Optimize performance of room state updates
37+
- v.17 recommendations regarding the Marketplace are still undeveloped.
38+
- Solve residual bugs. Undo & Redo buttons on customization page not functioning as expected. Backend bugs persist as seen in the console when running the dev environment. Persistent Redux error that causes page to rerender more often than necessary.
39+
- Resolve electron app functionality to coincide with web app functionality.
40+
- For the state manager option in the data table there is a MuiData-menu that is not visible when clicking it and after the filter option is clicked it creates a white space in the bottom of the page.
41+
- Expand testing coverage. Continue fixing old tests which rely on outdated dependencies, and implementing new tests.
42+
- Continue modularizing code. Many large, unwieldy files that should be broken up into more modular components still exist.
43+
- Continue Typescript conversion. Consider toggling noImplicitAny to find all 'any' cases that can be addressed.
44+
- Continue cleanup of outdated and unused code and files.
45+
46+
647
**Version 17.0.0 Changes**
748

849
Changes:<br>

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
[![ContributorShield][contributors]][contributors-url]
2020
[![ForksShield][forks]][forks-url]
2121
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
22-
![Version: 17.0.0](https://img.shields.io/badge/version-17.0.0-orange)
22+
![Version: 18.0.0](https://img.shields.io/badge/version-18.0.0-orange)
2323

2424

2525
</div>
@@ -67,15 +67,15 @@ Follow [@ReacType](https://twitter.com/reactype) on Twitter for important announ
6767

6868
<!-- NEED TO REPLACE THE TUTORIAL LINK -->
6969

70-
## Changes with version 17.0.0
70+
## Changes with Version 18.0.0
7171

72-
- **Improved Testing Coverage**: Testing coverage now sits at ~60%.
73-
- **Typescript Conversion**: Typescript coverage now sits at ~80%.
74-
- **UI Overhaul**: Upgraded the UI of the application with a more modern style and better developer experience
75-
- **Marketplace Feature**: Implemented a dedicated area for developers to share their projects,
76-
- **And more:** See [change log](https://github.com/open-source-labs/ReacType/blob/master/CHANGE_LOG.md) for more details on what was changed from the previous versions as well as plans for upcoming features!
72+
- **Collaboration Rooms**: Implemented rooms which allow developers to colloborate together on a project.
73+
- **User List**: Designed and built a user list which updates in real time as clients join and exit.
74+
- **Typescript Conversion**: Typescript coverage is now increased to ~90%.
75+
- **Cleanup**: Removed unused code, fixed bugs, and refactored existing code to improve performance,
76+
- **And more:** See the [change log](https://github.com/open-source-labs/ReacType/blob/master/CHANGE_LOG.md) for more details on what was changed from the previous versions, as well as plans for upcoming features!
7777

78-
## File Structure of Reactype version 17.0.0
78+
## File Structure of ReacType Version 18.0.0
7979

8080
Here is the main file structure:
8181

@@ -89,7 +89,7 @@ Please refer to the Excalidraw provided by ReacType Version 14.0 for more detail
8989
## Run ReacType using CLI
9090

9191
- **Fork** and **Clone** Repository.
92-
- Open project directory
92+
- Open project directory.
9393
- Install dependencies.
9494

9595
```bash
@@ -151,7 +151,7 @@ npm run start
151151

152152
## Stack
153153

154-
Typescript, React.js, Redux Toolkit, Javascript, ESM, Node.js (Express), HTML, CSS, MUI, GraphQL, Next.js, Gatsby.js, Electron, NoSQL, Webpack, TDD (Jest, React Testing Library, Playwright), OAuth 2.0, Websocket, Continuous Integration (Github Actions), Docker, AWS (ECR, Elastic Beanstalk), Ace Editor, Google Charts, React DnD
154+
Typescript, React.js, Redux Toolkit, Javascript, ESM, Node.js (Express), HTML, CSS, MUI, GraphQL, Next.js, Gatsby.js, Electron, NoSQL, Webpack, TDD (Jest, React Testing Library, Playwright), OAuth 2.0, Websocket, SocketIO, Continuous Integration (Github Actions), Docker, AWS (ECR, Elastic Beanstalk), Ace Editor, Google Charts, React DnD
155155

156156
## Contributions
157157

__tests__/playwright/example.spec.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { test, expect } from '@playwright/test';
1+
// import { test, expect } from '@playwright/test';
22

3-
test('has title', async ({ page }) => {
4-
await page.goto('https://app.reactype.dev/#/');
3+
// test('has title', async ({ page }) => {
4+
// await page.goto('https://app.reactype.dev/#/');
55

6-
// Expect a title "to contain" a substring.
7-
await expect(page).toHaveTitle('ReacType');
8-
});
6+
// // Expect a title "to contain" a substring.
7+
// await expect(page).toHaveTitle('ReacType');
8+
// });
99

10-
test('get started link', async ({ page }) => {
11-
await page.goto('https://playwright.dev/');
10+
// test('get started link', async ({ page }) => {
11+
// await page.goto('https://playwright.dev/');
1212

13-
// Click the get started link.
14-
await page.getByRole('link', { name: 'Get started' }).click();
13+
// // Click the get started link.
14+
// await page.getByRole('link', { name: 'Get started' }).click();
1515

16-
// Expects the URL to contain intro.
17-
await expect(page).toHaveURL(/.*intro/);
18-
});
16+
// // Expects the URL to contain intro.
17+
// await expect(page).toHaveURL(/.*intro/);
18+
// });

__tests__/projects.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
const { Mongoose } = require('mongoose');
66
const request = require('supertest');
77
// initializes the project to be sent to server/DB
8-
import mockData from '../mockData'
9-
import app from ('../server/server');
10-
const http = require('http')
11-
const {state, projectToSave } = mockData
8+
import mockData from '../mockData';
9+
import app from '../server/server';
10+
const http = require('http');
11+
const { state, projectToSave } = mockData;
1212

1313
// save and get projects endpoint testing
1414
describe('Project endpoints tests', () => {

app/src/Dashboard/ProjectContainer.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { theme1, theme2 } from '../public/styles/theme';
1313

1414

1515
declare module '@mui/styles/defaultTheme' {
16-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
1716
interface DefaultTheme extends Theme {}
1817
}
1918

app/src/components/App.tsx

+25-27
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
setInitialState,
66
toggleLoggedIn
77
} from '../redux/reducers/slice/appStateSlice';
8-
//redux toolkit addition
98
import { useDispatch, useSelector } from 'react-redux';
109

1110
import AppContainer from '../containers/AppContainer';
@@ -17,34 +16,34 @@ import localforage from 'localforage';
1716
import { saveProject } from '../helperFunctions/projectGetSaveDel';
1817

1918
// Intermediary component to wrap main App component with higher order provider components
20-
export const App = (): JSX.Element => {
21-
const state = useSelector((store: RootState) => store.appState);
22-
23-
const [toggleAttempt, setToggleAttempt] = useState(false);
19+
export const App: React.FC = (): JSX.Element => {
20+
// const state = useSelector((store: RootState) => store.appState);
21+
2422
const dispatch = useDispatch();
2523
// checks if user is signed in as guest or actual user and changes loggedIn boolean accordingly
2624
useEffect(() => {
2725
if (window.localStorage.getItem('ssid') !== 'guest') {
2826
dispatch(toggleLoggedIn(true));
2927
}
30-
//setToggleAttempt(!toggleAttempt);
3128
}, []);
3229

33-
// following useEffect runs on first mount
30+
// FOR LOCAL FORAGE: still trying to get this to work
31+
32+
// // following useEffect runs on first mount
3433
// useEffect(() => {
35-
// // console.log('cookies.get in App', Cookies.get())
34+
// console.log('cookies.get in App', Cookies.get());
3635
// // if user is a guest, see if a project exists in localforage and retrieve it
37-
// // v17 May not currently work yet
36+
// // v17: May not currently work yet
3837
// if (!state.isLoggedIn) {
3938
// localforage.getItem('guestProject').then((project) => {
4039
// // if project exists, use dispatch to set initial state to that project
40+
// console.log('local forage get project', project);
4141
// if (project) {
4242
// dispatch(setInitialState(project));
4343
// }
4444
// });
4545
// } else {
4646
// // otherwise if a user is logged in, use a fetch request to load user's projects from DB
47-
4847
// let userId;
4948
// if (Cookies.get('ssid')) {
5049
// userId = Cookies.get('ssid');
@@ -63,24 +62,26 @@ export const App = (): JSX.Element => {
6362
// });
6463
// }
6564
// }, []);
65+
66+
// // New project save configuration to optimize server load and minimize Ajax requests
6667
// useEffect(() => {
6768
// // provide config properties to legacy projects so new edits can be auto saved
68-
// // if (state.config === undefined) {
69-
// // state.config = { saveFlag: true, saveTimer: false };
70-
// // }
71-
// // New project save configuration to optimize server load and minimize Ajax requests
69+
// if (state.config === undefined) {
70+
// state.config = { saveFlag: true, saveTimer: false };
71+
// }
72+
7273
// if (state.config.saveFlag) {
73-
// // state.config.saveFlag = false;
74-
// // state.config.saveTimer = true;
75-
// // dispatch(configToggle())
74+
// state.config.saveFlag = false;
75+
// state.config.saveTimer = true;
76+
// //dispatch(configToggle());
7677

7778
// let userId;
7879
// if (Cookies.get('ssid')) {
7980
// userId = Cookies.get('ssid');
8081
// } else {
8182
// userId = window.localStorage.getItem('ssid');
8283
// }
83-
// // if (state.isLoggedIn === false) {
84+
8485
// if (!state.isLoggedIn) {
8586
// localforage.setItem('guestProject', state);
8687
// } else if (state.name !== '') {
@@ -95,19 +96,16 @@ export const App = (): JSX.Element => {
9596
// }, 15000);
9697
// }
9798
// }, [state]);
98-
// uncomment below to log state
9999

100100
return (
101101
<div className="app">
102-
103-
<header
104-
style={{ height: '40px', width: '100%', backgroundColor: 'white' }}
105-
>
106-
ReacType
107-
</header>
102+
<header
103+
style={{ height: '40px', width: '100%', backgroundColor: 'white' }}
104+
>
105+
ReacType
106+
</header>
108107

109-
<AppContainer />
110-
108+
<AppContainer />
111109
</div>
112110
);
113111
};

app/src/components/ContextAPIManager/AssignTab/components/ComponentDropDrown.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ const ComponentDropDown = ({
1212
componentInput,
1313
setComponentInput
1414
}) => {
15-
const { state, isDarkMode } = useSelector((store: RootState) => ({
16-
state: store.appState,
17-
isDarkMode: store.darkMode.isDarkMode
15+
const { state } = useSelector((store: RootState) => ({
16+
state: store.appState
1817
}));
19-
const color = isDarkMode ? 'white' : 'black';
18+
2019
const onChange = (event, newValue) => {
2120
if (typeof newValue === 'string') {
2221
setComponentInput({
@@ -36,7 +35,6 @@ const ComponentDropDown = ({
3635
};
3736

3837
const filterOptions = (options, params) => {
39-
// setBtnDisabled(true);
4038
const filtered = filter(options, params);
4139
const { inputValue } = params;
4240
// Suggest the creation of a new contextInput
@@ -46,8 +44,6 @@ const ComponentDropDown = ({
4644
inputValue,
4745
name: `Add "${inputValue}"`
4846
});
49-
50-
// setBtnDisabled(false);
5147
}
5248

5349
return filtered;
@@ -67,7 +63,7 @@ const ComponentDropDown = ({
6763
};
6864

6965
const renderOption = (props, option) => (
70-
<li style={{ color: 'black', backgroundColor: 'none'}} {...props}>
66+
<li style={{ color: 'black', backgroundColor: 'none' }} {...props}>
7167
{option.name}
7268
</li>
7369
);

app/src/components/ContextAPIManager/AssignTab/components/ContextDropDown.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React, { Fragment, useState, useEffect } from 'react';
22
import TextField from '@mui/material/TextField';
33
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
44
import Box from '@mui/material/Box';
5-
import { useSelector } from 'react-redux';
6-
import { RootState } from '../../../../redux/store';
5+
76

87
const filter = createFilterOptions();
98

@@ -15,10 +14,6 @@ const ContextDropDown = ({
1514
}) => {
1615
const { allContext } = contextStore;
1716

18-
const isDarkMode = useSelector(
19-
(store: RootState) => store.darkMode.isDarkMode
20-
);
21-
const color = isDarkMode ? 'white' : 'black';
2217
const onChange = (event, newValue) => {
2318
if (typeof newValue === 'string') {
2419
setContextInput({
@@ -38,7 +33,6 @@ const ContextDropDown = ({
3833
};
3934

4035
const filterOptions = (options, params) => {
41-
// setBtnDisabled(true);
4236
const filtered = filter(options, params);
4337
const { inputValue } = params;
4438
// Suggest the creation of a new contextInput
@@ -48,8 +42,6 @@ const ContextDropDown = ({
4842
inputValue,
4943
name: `Add "${inputValue}"`
5044
});
51-
52-
// setBtnDisabled(false);
5345
}
5446

5547
return filtered;

app/src/components/ContextAPIManager/AssignTab/components/ContextTable.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ const rows = [
4545
createData('Cupcake', 305, 3.7, 67, 4.3),
4646
createData('Gingerbread', 356, 16.0, 49, 3.9)
4747
];
48-
{
49-
/* <Table style={{ width: 400, margin: 'auto' }}></Table> */
50-
}
48+
5149
export default function ContextTable() {
5250
return (
5351
<TableContainer component={Paper}>

0 commit comments

Comments
 (0)