Skip to content

Commit 83d330b

Browse files
authored
Merge pull request #9 from oslabs-beta/muiv4tov6
Final Demo With Style Fixes
2 parents 8e57dd0 + e3109f6 commit 83d330b

Some content is hidden

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

65 files changed

+24629
-27420
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ yarn.lock
44
### Linux ###
55
*~
66

7+
RT.zip
78
# temporary files which can be created if a process still has a handle open of a deleted file
89
.fuse_hidden*
910

CHANGE_LOG.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,31 @@
55

66
## Version 22.0.0 Changes
77

8-
### Potential Changes:
9-
10-
- Export code does not actually build what it says it does - Bug fix: tags which are nested do not display accurate code in code preview
11-
- Fully retire jest tests
12-
- Complete Vitest testing suite
13-
- Make bottom panel only display context-relevant tabs
14-
- Moving chat link from bottom panel to upper right (would this require making it into a pop up?)
15-
- Migrate more state pieces into redux store??
16-
- Decluttering by adding right click and hover functionality
17-
- Move elements of tutorial into hover functionality
18-
- Add built-in component templates to the marketplace
19-
208
### Changes:
219

22-
- Deleted all electron-related files and dependencies
23-
- Deleted all webpack-related files and dependencies
24-
- Deleted all babel-related files and dependencies (SL)
25-
- Deleted all jest-related files and dependencies (SL)
26-
- Migrated create create custom HTML component to left panel and completely removed from bottom panel (SL)
27-
- Migrated create create custom module component to left panel and completely removed from bottom panel (SL)
28-
- Migrated clear canvas to canvas container from nav bar and completely removed from nav bar (SL)
29-
- Removed page up and page down buttons and code from canvas container (SL)
10+
- Deleted depreciated electron-related files and dependencies
11+
- Deleted depreciated webpack-related files and dependencies
12+
- Deleted depreciated babel-related files and dependencies
13+
- Deleted depreciated jest-related files and dependencies
14+
- Migrated create create custom HTML component to left panel and completely removed from bottom panel
15+
- Migrated create create custom module component to left panel and completely removed from bottom panel
16+
- Migrated clear canvas to canvas container from nav bar and completely removed from nav bar
17+
- Removed page up and page down buttons and code from canvas container
18+
- Added right click functionality to component customization and removed from bottom panel
3019
- OAuth fully functional
3120

3221
### Recommendations for Future Enhancements:
3322
- Unify styling, we utilized a lot of inline styling to override prior version styling due to time
3423
- Light/Dark mode, suggest removing current code regarding it and reimplement from the ground up for light/dark themes
24+
- Export code does not actually build what it says it does - Bug fix: tags which are nested do not display accurate code in code preview
25+
- Fully retire jest tests
26+
- Complete Vitest testing suite
27+
- Make bottom panel only display context-relevant tabs
28+
- Moving chat link from bottom panel to upper right
29+
- Migrate more state pieces into redux store
30+
- Move elements of tutorial into hover functionality
31+
- Add built-in component templates to the marketplace
32+
- Reimplement VideoSDK (will need VIDEOSDK token in .env), changes made for v22 prevented VideoSDK from working with the collab feature, the code however still exists
3533

3634
## Version 21.0.0 Changes
3735

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ COPY ../server ./server
5555

5656
# these things build dosent have so dont copy them through
5757
COPY package*.json ./
58-
COPY .env .env
58+
#COPY .env .env
5959
COPY ./config.js ./config.js
6060

6161

README.md

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,35 @@
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/v21 MUI Canvas.png">
54+
<img width="1000" src="./resources/v22 MUI 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 21.0.0
61+
## Changes with Version 22.0.0
6262

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 273 JSDoc comment blocks throughout the codebase.
67-
- **Cleanup**: Removed unused code, fixed bugs, and made major performance improvements.
63+
- **UI/UX Updates**: Updated the UI/UX to be more intuitive and user friendly, decreasing learning curve and improving accessibility.
64+
- **Cleanup**: Removed depreciated dependencies and unused code, migrated code and components to align with UI/UX direction, and cleaned up styling.
65+
- **OAuth**: Implemented OAuth with Google and Github for streamlined login and secure user accounts.
6866
- **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!
6967

7068
<p align="center">
71-
<img width="1000" src="./resources/v21 code preview.png">
69+
<img width="1000" src="./resources/v22 code preview.png">
7270
</p>
7371

7472
## Preview
7573

7674
Get a glimpse of how ReacType works!
7775

7876
<p align="center">
79-
<img width="1000" src="./resources/v21 Preview.gif">
77+
<img width="1000" src="./resources/v22 Preview.gif">
8078
</p>
8179

8280
<!-- NEED TO REPLACE THE TUTORIAL LINK -->
8381

84-
## File Structure of ReacType Version 21.0.0
82+
## File Structure of ReacType Version 22.0.0
8583

8684
Here is the main file structure:
8785

@@ -100,11 +98,16 @@ Given to us courtesy of our friends over at React Relay
10098
```bash
10199
npm install
102100
```
101+
- Compile for production
102+
103+
```bash
104+
npm run build
105+
```
103106

104107
- To run the production build
105108

106109
```bash
107-
npm run prod
110+
npm start
108111
```
109112

110113
- To run tests
@@ -119,40 +122,12 @@ npm run test
119122
npm run dev
120123
```
121124

122-
- Note that DEV_PORT, NODE_ENV flag (=production or development) and VIDEOSDK token are needed in the .env file.
125+
- Open browser and navigate to localhost at specified port
126+
127+
- Note that DEV_PORT and NODE_ENV flag (=production or development) are needed in the .env file.
123128
- 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.)
124129
- 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).
125130

126-
- To run the development build of electron app
127-
128-
```bash
129-
npm run dev
130-
npm run electron-dev
131-
```
132-
133-
## Run Exported App
134-
135-
- Open exported project directory
136-
- Install dependencies
137-
138-
```bash
139-
npm install
140-
```
141-
142-
- Build the app
143-
144-
```bash
145-
npm run build
146-
```
147-
148-
- Start an instance
149-
150-
```bash
151-
npm run start
152-
```
153-
154-
- Open browser and navigate to localhost at specified port
155-
156131
## Stack
157132

158133
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

__tests__/NavBar.test.tsx

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { describe, it, expect, vi, afterAll, beforeEach } from 'vitest';
22
import React from 'react';
33
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
44
import { MemoryRouter } from 'react-router-dom';
5-
import { ThemeProvider, createTheme } from '@mui/material/styles';
5+
import {
6+
ThemeProvider,
7+
createMuiTheme,
8+
makeStyles
9+
} from '@material-ui/core/styles';
610
import NavBar from '../app/src/components/top/NavBar';
711
import * as projectFunctions from '../app/src/helperFunctions/projectGetSaveDel';
812
import { Provider } from 'react-redux';
@@ -20,7 +24,7 @@ const mockHTMLTypes = [
2024
placeHolderShort: 'div',
2125
placeHolderLong: '',
2226
framework: 'reactClassic',
23-
nestable: true,
27+
nestable: true
2428
},
2529
{
2630
id: 1000,
@@ -30,7 +34,7 @@ const mockHTMLTypes = [
3034
placeHolderShort: '',
3135
placeHolderLong: '',
3236
framework: '',
33-
nestable: true,
37+
nestable: true
3438
},
3539
{
3640
id: 1,
@@ -40,13 +44,13 @@ const mockHTMLTypes = [
4044
placeHolderShort: 'image',
4145
placeHolderLong: '',
4246
framework: 'reactClassic',
43-
nestable: false,
44-
},
47+
nestable: false
48+
}
4549
];
4650

4751
// Mocking the theme
48-
const theme = createTheme({
49-
spacing: (value) => `${value}px`,
52+
const theme = createMuiTheme({
53+
spacing: (value) => `${value}px`
5054
});
5155

5256
// Mocking the logo
@@ -55,13 +59,13 @@ vi.mock('../../public/icons/win/logo.png', () => 'dummy-image-url');
5559
// Grabbing publish and unpublish functions
5660
vi.mock('../app/src/helperFunctions/projectGetSaveDel', () => ({
5761
publishProject: vi.fn(),
58-
unpublishProject: vi.fn(),
62+
unpublishProject: vi.fn()
5963
}));
6064

6165
//mock the file saver library
6266
vi.mock('file-saver', () => ({
6367
...vi.importActual('file-saver'),
64-
saveAs: vi.fn(),
68+
saveAs: vi.fn()
6569
}));
6670

6771
afterAll(() => {
@@ -84,61 +88,59 @@ const renderNavBar = (store) => {
8488
describe('NavBar Component', () => {
8589
let store;
8690

87-
beforeEach(() =>{
91+
beforeEach(() => {
8892
store = configureStore({
8993
reducer: rootReducer,
9094
preloadedState: {
9195
appState: {
9296
...appStateInitialState,
9397
isLoggedIn: true,
9498
name: 'Mock Project Name',
95-
HTMLTypes: mockHTMLTypes,
96-
},
97-
},
99+
HTMLTypes: mockHTMLTypes
100+
}
101+
}
98102
});
99-
})
103+
});
100104

101105
it('handles publish correctly with saved project', async () => {
102106
const publishProjectMock = vi.spyOn(projectFunctions, 'publishProject');
103107
publishProjectMock.mockResolvedValueOnce({
104108
_id: 'mockedId',
105109
name: 'Mocked Project',
106-
published: true,
110+
published: true
107111
});
108112

109-
renderNavBar(store)
113+
renderNavBar(store);
110114

111-
const publishButton = screen.getByText('Publish');
112-
fireEvent.click(publishButton);
115+
const publishButton = screen.getByText('Publish');
116+
fireEvent.click(publishButton);
113117

114118
await waitFor(() => {
115119
expect(publishProjectMock).toHaveBeenCalled();
116-
})
117-
120+
});
118121
});
119122

120123
it('handles publish correctly with new project', async () => {
121124
const publishProjectMock = vi.spyOn(projectFunctions, 'publishProject');
122125
publishProjectMock.mockResolvedValueOnce({
123126
_id: 'mockedId',
124-
name: 'My Project',
125-
published: true,
127+
name: 'My Project',
128+
published: true
126129
});
127-
130+
128131
renderNavBar(store);
129132

130-
// Check if the "Publish" button is present
131-
const publishButton = screen.getByText('Publish');
133+
// Check if the "Publish" button is present
134+
const publishButton = screen.getByText('Publish');
132135

133-
fireEvent.click(publishButton);
136+
fireEvent.click(publishButton);
134137

135-
await waitFor(() =>{
136-
expect(publishProjectMock).toHaveBeenCalled();
137-
})
138+
await waitFor(() => {
139+
expect(publishProjectMock).toHaveBeenCalled();
140+
});
138141
});
139142

140143
it('handles export correctly', async () => {
141-
142144
renderNavBar(store);
143145
// Find and click the export button
144146
const exportButton = screen.getByText('Export');
@@ -150,46 +152,40 @@ describe('NavBar Component', () => {
150152
expect(exportModal).toBeDefined();
151153
});
152154

153-
// Simulate clicking the export components
155+
// Simulate clicking the export components
154156
const exportComponentsOption = screen.getByText('Export components');
155157
fireEvent.click(exportComponentsOption);
156-
157158
});
158159

159160
it('handles dropdown menu correctly', async () => {
160161
const store = configureStore({
161162
reducer: rootReducer,
162163
preloadedState: {
163164
appState: {
164-
...appStateInitialState,
165-
},
166-
},
165+
...appStateInitialState
166+
}
167+
}
167168
});
168169

169170
renderNavBar(store);
170-
const dropdownMenu = screen.getAllByTestId('navDropDown')[0];
171-
expect(dropdownMenu.getAttribute('class')).toContain('hideNavDropDown');
172-
173-
174-
const moreVertButton = screen.getByTestId('more-vert-button');
175-
fireEvent.click(moreVertButton);
176-
171+
const dropdownMenu = screen.getAllByTestId('navDropDown')[0];
172+
expect(dropdownMenu.getAttribute('class')).toContain('hideNavDropDown');
177173

178-
expect(dropdownMenu.getAttribute('class')).toContain('navDropDown');
174+
const moreVertButton = screen.getByTestId('more-vert-button');
175+
fireEvent.click(moreVertButton);
179176

177+
expect(dropdownMenu.getAttribute('class')).toContain('navDropDown');
180178

181-
const clearCanvasMenuItem = screen.getByText('Clear Canvas');
182-
fireEvent.click(clearCanvasMenuItem);
183-
expect(dropdownMenu.getAttribute('class')).toContain('navDropDown');
179+
const clearCanvasMenuItem = screen.getByText('Clear Canvas');
180+
fireEvent.click(clearCanvasMenuItem);
181+
expect(dropdownMenu.getAttribute('class')).toContain('navDropDown');
184182

183+
const marketplaceMenuItem = screen.getByText('Marketplace');
184+
fireEvent.click(marketplaceMenuItem);
185+
expect(dropdownMenu.getAttribute('class')).toContain('navDropDown');
185186

186-
const marketplaceMenuItem = screen.getByText('Marketplace');
187-
fireEvent.click(marketplaceMenuItem);
188-
expect(dropdownMenu.getAttribute('class')).toContain('navDropDown');
187+
fireEvent.click(moreVertButton);
189188

190-
fireEvent.click(moreVertButton);
191-
192-
expect(dropdownMenu.getAttribute('class')).toContain('hideNavDropDown');
193-
});
189+
expect(dropdownMenu.getAttribute('class')).toContain('hideNavDropDown');
194190
});
195-
191+
});

0 commit comments

Comments
 (0)