Skip to content

Commit 1cf7e43

Browse files
authored
Merge pull request #16 from oslabs-beta/feature/drawer
Feature/drawer
2 parents 7c82050 + 2410297 commit 1cf7e43

Some content is hidden

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

45 files changed

+2232
-1216
lines changed

CHANGE_LOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,53 @@
33
<h1 align="center">ReacType Change Log</h1>
44
</p>
55

6+
## Version 21.0.0 Changes
7+
8+
### Changes:
9+
10+
- **Developer Improvement:**
11+
- Fixed testing suite compatability issues and added 30 new tests for new features
12+
- Added 264 JSDoc comment blocks throughout the codebase
13+
- **User Features:**
14+
- **Material UI Components:**
15+
- Integrated 49 new, pre-styled Material UI components
16+
- Completely overhauled the code preview functionality to manage import statements, state, event handlers, and other essential variables and functions
17+
- Revamped iFrame implementation to allow users to interact seamlessly with state-dependent Material UI components
18+
- **UI updates to enhance user experience:**
19+
- Updated left panel to include Material UI tab
20+
- Made additional UI tweaks to accommodate additional components
21+
- Introduced UI elements that organized components for easier navigation
22+
- Added slider at bottom right-hand corner to allow resize of iframe
23+
- **Bugs Fixed:**
24+
- Forgotten Password - Forgotten Password page now properly renders and enables a user to reset their password
25+
- Customization Panel - Fixed numerous rendering issues to establish consistent performance and UI layout
26+
- Tutorial Page - Fixed Link / Re-Route to Tutorial
27+
28+
### Recommendations for Future Enhancements:
29+
30+
- Implement Shadcn/UI or other libraries in addition to MUI so that users have more pre-styled elements
31+
- Create customizable props for MUI Components (check MUI props branch for foundation)
32+
- Bug fix for marketplace preview display
33+
- Allow users to modify code dynamically in the code preview and reflect visual components in real time
34+
- Add zoom in and zoom out / scroll functionality to code preview and component tree
35+
- Bug fix: tags which are nested do not display accurate code in code preview
36+
- Add more functionality to the nav bar
37+
- Clean up unnecessary code / comments and deprecated libraries
38+
- Eliminate all Webpack associated files/folders/dependencies/etc... now that we run on Vite
39+
- Remove the many deprecated dependencies
40+
- Add additional features to the live chat (Links, reactions, raise hand feature etc)
41+
- Allow live chat to be a popup and draggable outside of the app
42+
- List all active meeting rooms to join
43+
- Make the app mobile responsive. Right now it does not work/look good on mobile
44+
- Light/Dark mode
45+
- Update links in the footer of the landing page
46+
- Update Tutorial Page UI/UX to reflect new changes
47+
- Fix test's / refactor to not use database rather create a mock database using Vitest
48+
- Update Electron for use (unknown if it's in use / working, a lot of code is deprecated)
49+
- Add more Testing
50+
- Update slider to more user-friendly resize iframe
51+
- Deny MUI library for gatsby, ensure Next.js works with MUI
52+
653
## Version 20.0.0 Changes
754

855
### Changes:

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
[![ContributorShield][contributors]][contributors-url]
2222
[![ForksShield][forks]][forks-url]
2323
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
24-
![Version: 20.0.0](https://img.shields.io/badge/version-20.0.0-orange)
24+
![Version: 21.0.0](https://img.shields.io/badge/version-21.0.0-orange)
2525

2626
</div>
2727

@@ -36,7 +36,7 @@
3636
![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
3737
![Redux](https://img.shields.io/badge/redux-%23593d88.svg?style=for-the-badge&logo=redux&logoColor=white)
3838
![Socket.io](https://img.shields.io/badge/Socket.io-black?style=for-the-badge&logo=socket.io&badgeColor=010101)
39-
![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white)
39+
![Vitest](https://img.shields.io/badge/-vitest-%23008000?style=for-the-badge&logo=vitest&logoColor=white)
4040
![Babel](https://img.shields.io/badge/Babel-F9DC3e?style=for-the-badge&logo=babel&logoColor=black)
4141
![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white)
4242
![MUI](https://img.shields.io/badge/MUI-%230081CB.svg?style=for-the-badge&logo=mui&logoColor=white)
@@ -51,42 +51,42 @@
5151
**ReacType** is a React prototyping tool that allows users _visualize_ their application architecture dynamically, employing an interactive drop and drag display with real-time component code preview and a collaboration room that features live video and chat functionality. Generated code can be exported as a **React** app for developers employing React component architecture alongside the comprehensive type-checking of **TypeScript**. In other words, **you can draw prototypes and export React / TypeScript code!**
5252

5353
<p align="center">
54-
<img width="1000" src="./resources/v20 empty canvas.png">
54+
<img width="1000" src="./resources/v21 empty canvas.png">
5555
</p>
5656

5757
Visit [reactype.dev](https://reactype.dev) to learn more about the product.
5858

5959
Follow [@ReacType](https://twitter.com/reactype) on Twitter for important announcements.
6060

61-
## Changes with Version 20.0.0
61+
## Changes with Version 21.0.0
6262

63-
- **Collaboration Rooms**: Official launch of v2 collaboration rooms - Now featuring a secure live collaborative chat room with video and cursor tracking functionality!
64-
- **UI Updates**: The UI now features a new logo, zoom and scroll functionality to the canvas, and numerous updates to styling to reflect a more modern and user friendly experience.
65-
- **DX Updates**: Migrated from WebPack to Vite, drastically reducing HMR time. Now deployed via Heroku instead of AWS.
66-
- **Typescript Conversion**: Typescript coverage is at 95%.
63+
- **MUI Components**: Material UI can now be used to Create / Style your Applications
64+
- **UI Updates**: The UI now features a more modern and user friendly experience to reflect the newly added Components.
65+
- **DX Updates**: Migrated from Jest to Vitest to allow better compatibility, as well as to reduce complexity and streamline the Development Workflow.
66+
- **JS DOCS**: Added 264 JSDoc comment blocks throughout the codebase.
6767
- **Cleanup**: Removed unused code, fixed bugs, and made major performance improvements.
6868
- **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!
6969

7070
<p align="center">
71-
<img width="1000" src="./resources/v20 collab room.png">
71+
<img width="1000" src="./resources/v21 code preview.png">
7272
</p>
7373

7474
## Preview
7575

7676
Get a glimpse of how ReacType works!
7777

7878
<p align="center">
79-
<img width="1000" src="./resources/canvasDemoV20.gif">
79+
<img width="1000" src="./resources/"> // update w/ gif previewing MUI components
8080
</p>
8181

8282
<!-- NEED TO REPLACE THE TUTORIAL LINK -->
8383

84-
## File Structure of ReacType Version 20.0.0
84+
## File Structure of ReacType Version 21.0.0
8585

8686
Here is the main file structure:
8787

8888
<p align="center">
89-
<img width="1000" src="./resources/v19filestructure.png">
89+
<img width="1000" src="./resources/v19filestructure.png"> // update with updated file structure
9090
</p>
9191

9292
Given to us courtesy of our friends over at React Relay
@@ -121,6 +121,7 @@ npm run dev
121121

122122
- Note that DEV_PORT, NODE_ENV flag (=production or development) and VIDEOSDK token are needed in the .env file.
123123
- Please note that the development build is not connected to the production server. `npm run dev` should spin up the development server from the server folder of this repo. For additional information, the readme is [here](https://github.com/open-source-labs/ReacType/blob/master/server/README.md). Alternatively, you can select "Continue as guest" on the login page of the app, which will not use any features that rely on the server (authentication and saving project data.)
124+
- If there are any errors on spin-up related to MONGO_DB, GITHUB_CLIENT, GITHUB_SECRET, GOOGLE_CLIENT, GOOGLE_SECRET, and SESSION_SECRET, those variables will have to be added to the .env file. To get Google and GitHub credentials, addtional information can be found at the following links: Google [here](https://support.google.com/cloud/answer/6158849?hl=en) and GitHub [here](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app).
124125

125126
- To run the development build of electron app
126127

@@ -154,7 +155,7 @@ npm run start
154155

155156
## Stack
156157

157-
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, Vite
158+
Typescript, React.js, Redux Toolkit, Javascript, ESM, Node.js (Express), HTML, CSS, MUI, GraphQL, Next.js, Gatsby.js, Electron, NoSQL, Webpack, TDD (Vitest, React Testing Library, Playwright), OAuth 2.0, Websocket, SocketIO, Continuous Integration (Github Actions), Docker, AWS (ECR, Elastic Beanstalk), Ace Editor, Google Charts, React DnD, Vite
158159

159160
## Contributions
160161

__tests__/DragAndDrop.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @viit-enviroment jsdom
2-
// import '@testing-library/jest-dom';
31
import { describe, it, expect } from 'vitest';
42
import { fireEvent, render, screen } from '@testing-library/react';
53

__tests__/componentBuilder.test.tsx

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import { describe, it, expect, vi } from 'vitest';
2+
import React from 'react';
3+
import { render } from '@testing-library/react';
4+
import componentBuilder from '../app/src/helperFunctions/componentBuilder';
5+
import { ChildElement, MUIComponent } from '../app/src/interfaces/Interfaces';
6+
7+
// Mock MUITypes data
8+
const MUITypes = [
9+
{
10+
tag: 'mui button',
11+
componentData: {
12+
name: 'mui button',
13+
props: { children: 'Click me' }
14+
}
15+
}
16+
];
17+
vi.mock('../redux/MUITypes', () => MUITypes);
18+
19+
describe('componentBuilder', () => {
20+
it('renders a simple input component', () => {
21+
const elements: Array<ChildElement> = [
22+
{
23+
type: 'HTML Element',
24+
typeId: 1,
25+
name: 'input',
26+
childId: 1,
27+
style: {},
28+
attributes: { cssClasses: 'test-class' },
29+
events: {},
30+
stateProps: [],
31+
passedInProps: [],
32+
children: []
33+
}
34+
];
35+
const result = componentBuilder(elements, 1);
36+
render(<>{result}</>);
37+
// Using vitest's expect function to assert if the input element is rendered
38+
expect(document.querySelector('input')).toBeTruthy();
39+
});
40+
41+
it('handles MUI components', () => {
42+
const elements: Array<MUIComponent> = [
43+
{
44+
type: 'MUI Component',
45+
typeId: 2,
46+
name: 'mui button',
47+
childId: 2,
48+
style: {},
49+
attributes: {},
50+
events: {},
51+
stateProps: [],
52+
passedInProps: [],
53+
children: []
54+
}
55+
];
56+
const result = componentBuilder(elements, 2);
57+
render(<>{result}</>);
58+
// Assuming 'Click me' is rendered text for Button
59+
expect(result[0]).toEqual(
60+
JSON.stringify({
61+
type: 'Button',
62+
props: {
63+
variant: 'contained',
64+
color: 'primary',
65+
sx: { m: 1 },
66+
key: 3
67+
},
68+
children: 'Click Me'
69+
})
70+
);
71+
});
72+
73+
it('skips separators and continues rendering', () => {
74+
const elements: Array<ChildElement> = [
75+
{
76+
type: 'HTML Element',
77+
typeId: 1,
78+
name: 'separator',
79+
childId: 1,
80+
style: {},
81+
attributes: {},
82+
events: {},
83+
stateProps: [],
84+
passedInProps: [],
85+
children: []
86+
},
87+
{
88+
type: 'HTML Element',
89+
typeId: 1,
90+
name: 'img',
91+
childId: 2,
92+
style: {},
93+
attributes: { compLink: 'http://example.com/image.png' },
94+
events: {},
95+
stateProps: [],
96+
passedInProps: [],
97+
children: []
98+
}
99+
];
100+
const result = componentBuilder(elements, 3);
101+
render(<>{result}</>);
102+
// Using vitest's expect function to assert if the img element has the correct src attribute
103+
expect(document.querySelector('img')?.getAttribute('src')).toBe(
104+
'http://example.com/image.png'
105+
);
106+
});
107+
108+
it('renders nested components', () => {
109+
const elements: Array<ChildElement> = [
110+
{
111+
type: 'HTML Element',
112+
typeId: 1,
113+
name: 'div',
114+
childId: 3,
115+
style: {},
116+
attributes: { cssClasses: 'container' },
117+
events: {},
118+
stateProps: [],
119+
passedInProps: [],
120+
children: [
121+
{
122+
type: 'HTML Element',
123+
typeId: 1,
124+
name: 'p',
125+
childId: 4,
126+
style: {},
127+
attributes: { compText: 'Hello, world!' },
128+
events: {},
129+
stateProps: [],
130+
passedInProps: [],
131+
children: []
132+
}
133+
]
134+
}
135+
];
136+
const result = componentBuilder(elements, 4);
137+
render(<>{result}</>);
138+
// Using vitest's expect function to assert if the text 'Hello, world!' is rendered within the container div
139+
expect(document.querySelector('.container')).toBeTruthy();
140+
expect(document.querySelector('.container')?.textContent).toContain(
141+
'Hello, world!'
142+
);
143+
});
144+
});

0 commit comments

Comments
 (0)