Skip to content

Commit 98b89fa

Browse files
authored
Merge branch 'develop' into fix/keyword-syntax-highlighting-beginClip
2 parents c81629a + 982fcfc commit 98b89fa

File tree

10 files changed

+42
-110
lines changed

10 files changed

+42
-110
lines changed

.storybook/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const config = {
44
addons: [
55
'@storybook/addon-links',
66
'@storybook/addon-essentials',
7-
'@storybook/addon-interactions'
7+
'@storybook/addon-interactions',
8+
'@storybook/addon-mdx-gfm'
89
],
910
framework: {
1011
name: '@storybook/react-webpack5',

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Make your first sketch in the [p5.js Editor](https://editor.p5js.org/)! Learn mo
2222
If you have found a bug in the p5.js Web Editor, you can file it under the ["issues" tab](https://github.com/processing/p5.js-web-editor/issues). You can also request new features here. A set of templates for reporting issues and requesting features are provided to assist you (and us!). The p5.js Editor is maintained mostly by volunteers, so we thank you for your patience as we try to address your issues as soon as we can. Please post bugs and feature requests in the correct repository if you can:
2323

2424
* p5.js library: [https://github.com/processing/p5.js/issues](https://github.com/processing/p5.js/issues)
25-
* p5.accessibility: [https://github.com/processing/p5.accessibility/issues](https://github.com/processing/p5.accessibility/issues)
26-
* p5.sound: [https://github.com/processing/p5.js-sound/issues](https://github.com/processing/p5.js-sound/issues)
2725
* p5.js website: [https://github.com/processing/p5.js-website/issues](https://github.com/processing/p5.js-website/issues)
2826

2927

client/components/createRedirectWithUsername.jsx

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

client/index.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta } from '@storybook/addon-docs/blocks';
1+
import { Meta } from '@storybook/blocks';
22

33
<Meta title=" |Intro" />
44

client/modules/User/components/SignupForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { React, useState } from 'react';
1+
import React, { useState } from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { Form, Field } from 'react-final-form';
44
import { useDispatch } from 'react-redux';

client/routes.jsx

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ import NewPasswordView from './modules/User/pages/NewPasswordView';
1717
import AccountView from './modules/User/pages/AccountView';
1818
import CollectionView from './modules/User/pages/CollectionView';
1919
import DashboardView from './modules/User/pages/DashboardView';
20-
import RedirectToUser from './components/createRedirectWithUsername';
2120
import { getUser } from './modules/User/actions';
22-
import {
23-
userIsAuthenticated,
24-
userIsNotAuthenticated,
25-
userIsAuthorized
26-
} from './utils/auth';
2721

2822
/**
2923
* `params` is no longer a top-level route component prop in v4.
@@ -51,25 +45,19 @@ Route.propTypes = {
5145
const routes = (
5246
<Switch>
5347
<Route exact path="/" component={IDEView} />
54-
<Route path="/login" component={userIsNotAuthenticated(LoginView)} />
55-
<Route path="/signup" component={userIsNotAuthenticated(SignupView)} />
48+
<Route path="/login" component={LoginView} />
49+
<Route path="/signup" component={SignupView} />
5650
<Route
5751
path="/reset-password/:reset_password_token"
5852
component={NewPasswordView}
5953
/>
60-
<Route
61-
path="/reset-password"
62-
component={userIsNotAuthenticated(ResetPasswordView)}
63-
/>
54+
<Route path="/reset-password" component={ResetPasswordView} />
6455
<Route path="/verify" component={EmailVerificationView} />
6556
<Route path="/projects/:project_id" component={IDEView} />
6657
<Route path="/:username/full/:project_id" component={FullView} />
6758
<Route path="/full/:project_id" component={FullView} />
6859

69-
<Route
70-
path="/:username/assets"
71-
component={userIsAuthenticated(userIsAuthorized(DashboardView))}
72-
/>
60+
<Route path="/:username/assets" component={DashboardView} />
7361
<Route
7462
path="/:username/sketches/:project_id/add-to-collection"
7563
component={IDEView}
@@ -81,18 +69,10 @@ const routes = (
8169
component={CollectionView}
8270
/>
8371
<Route path="/:username/collections" component={DashboardView} />
84-
85-
<Route
86-
path="/sketches"
87-
component={() => <RedirectToUser url="/:username/sketches" />}
88-
/>
89-
<Route
90-
path="/assets"
91-
component={() => <RedirectToUser url="/:username/assets" />}
92-
/>
93-
<Route path="/account" component={userIsAuthenticated(AccountView)} />
72+
<Route path="/sketches" />
73+
<Route path="/assets" />
74+
<Route path="/account" component={AccountView} />
9475
<Route path="/about" component={IDEView} />
95-
9676
<Route path="/privacy-policy" component={PrivacyPolicy} />
9777
<Route path="/terms-of-use" component={TermsOfUse} />
9878
<Route path="/code-of-conduct" component={CodeOfConduct} />

client/utils/auth.js

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

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p5.js-web-editor",
3-
"version": "2.13.1",
3+
"version": "2.13.2",
44
"description": "The web editor for p5.js.",
55
"scripts": {
66
"clean": "rimraf dist",
@@ -96,16 +96,17 @@
9696
"@babel/plugin-transform-react-inline-elements": "^7.14.5",
9797
"@babel/preset-env": "^7.14.7",
9898
"@babel/preset-react": "^7.14.5",
99-
"@storybook/addon-actions": "^7.0.24",
100-
"@storybook/addon-docs": "^7.0.24",
101-
"@storybook/addon-essentials": "^7.0.27",
102-
"@storybook/addon-interactions": "^7.0.27",
103-
"@storybook/addon-links": "^5.3.21",
104-
"@storybook/addons": "^5.3.21",
105-
"@storybook/blocks": "^7.0.27",
106-
"@storybook/react": "^7.0.24",
107-
"@storybook/react-webpack5": "^7.0.27",
108-
"@storybook/testing-library": "^0.0.14-next.2",
99+
"@storybook/addon-actions": "^7.6.8",
100+
"@storybook/addon-docs": "^7.6.8",
101+
"@storybook/addon-essentials": "^7.6.8",
102+
"@storybook/addon-interactions": "^7.6.8",
103+
"@storybook/addon-links": "^7.6.8",
104+
"@storybook/addon-mdx-gfm": "^7.6.8",
105+
"@storybook/addons": "^7.6.8",
106+
"@storybook/blocks": "^7.6.8",
107+
"@storybook/react": "^7.6.8",
108+
"@storybook/react-webpack5": "^7.6.8",
109+
"@storybook/testing-library": "^0.2.2",
109110
"@svgr/webpack": "^6.2.1",
110111
"@testing-library/jest-dom": "^5.15.0",
111112
"@testing-library/react": "^12.1.2",
@@ -121,7 +122,7 @@
121122
"eslint-plugin-jsx-a11y": "^6.4.1",
122123
"eslint-plugin-prettier": "^3.4.0",
123124
"eslint-plugin-react": "^7.24.0",
124-
"eslint-plugin-storybook": "^0.6.12",
125+
"eslint-plugin-storybook": "^0.6.15",
125126
"file-loader": "^6.2.0",
126127
"husky": "^4.3.8",
127128
"jest": "^27.3.1",
@@ -140,8 +141,8 @@
140141
"rimraf": "^2.7.1",
141142
"sass": "^1.66.1",
142143
"sass-loader": "^12.6.0",
143-
"storybook": "^7.0.27",
144-
"storybook-addon-theme-playground": "^2.2.0",
144+
"storybook": "^7.6.8",
145+
"storybook-addon-theme-playground": "^3.1.0",
145146
"style-loader": "^3.3.1",
146147
"terser-webpack-plugin": "^5.3.1",
147148
"webpack-cli": "^4.9.2",

server/routes/server.routes.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ router.get('/login', (req, res) => {
7676
});
7777

7878
router.get('/reset-password', (req, res) => {
79-
res.send(renderIndex());
79+
if (req.user) {
80+
return res.redirect('/account');
81+
}
82+
return res.send(renderIndex());
8083
});
8184

8285
router.get('/reset-password/:reset_password_token', (req, res) => {
83-
res.send(renderIndex());
86+
if (req.user) {
87+
return res.redirect('/account');
88+
}
89+
return res.send(renderIndex());
8490
});
8591

8692
router.get('/verify', (req, res) => {
@@ -89,18 +95,18 @@ router.get('/verify', (req, res) => {
8995

9096
router.get('/sketches', (req, res) => {
9197
if (req.user) {
92-
res.send(renderIndex());
93-
} else {
94-
res.redirect('/login');
98+
const { username } = req.user;
99+
return res.redirect(`/${username}/sketches`);
95100
}
101+
return res.redirect('/login');
96102
});
97103

98104
router.get('/assets', (req, res) => {
99105
if (req.user) {
100-
res.send(renderIndex());
101-
} else {
102-
res.redirect('/login');
106+
const { username } = req.user;
107+
return res.redirect(`/${username}/assets`);
103108
}
109+
return res.redirect('/login');
104110
});
105111

106112
router.get('/:username/assets', async (req, res) => {

0 commit comments

Comments
 (0)