Skip to content

Commit 46eaf88

Browse files
authored
Merge branch 'develop' into piyush/fix-error-modal
2 parents 4bbd532 + 568be84 commit 46eaf88

File tree

13 files changed

+61
-28
lines changed

13 files changed

+61
-28
lines changed

client/modules/IDE/components/Editor/MobileEditor.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const EditorContainer = styled.div`
99
transform: ${(props) =>
1010
props.expanded ? 'translateX(50%)' : 'translateX(0)'};
1111
12-
> header {
12+
> div {
1313
display: flex;
1414
${prop('MobilePanel.secondary')}
1515
> span {

client/modules/IDE/components/Editor/index.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class Editor extends React.Component {
513513
{(matches) =>
514514
matches ? (
515515
<section className={editorSectionClass}>
516-
<header className="editor__header">
516+
<div className="editor__header">
517517
<button
518518
aria-label={this.props.t('Editor.OpenSketchARIA')}
519519
className="sidebar__contract"
@@ -538,7 +538,7 @@ class Editor extends React.Component {
538538
</span>
539539
<Timer />
540540
</div>
541-
</header>
541+
</div>
542542
<article
543543
ref={(element) => {
544544
this.codemirrorContainer = element;
@@ -555,7 +555,7 @@ class Editor extends React.Component {
555555
</section>
556556
) : (
557557
<EditorContainer expanded={this.props.isExpanded}>
558-
<header>
558+
<>
559559
<IconButton
560560
onClick={this.props.expandSidebar}
561561
icon={FolderIcon}
@@ -564,7 +564,7 @@ class Editor extends React.Component {
564564
{this.props.file.name}
565565
<UnsavedChangesIndicator />
566566
</span>
567-
</header>
567+
</>
568568
<section>
569569
<EditorHolder
570570
ref={(element) => {

client/modules/IDE/components/Header/Nav.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ const UnauthenticatedUserMenu = () => {
270270
</span>
271271
</Link>
272272
</li>
273-
<span className="nav__item-or">{t('Nav.LoginOr')}</span>
273+
<li className="nav__item-or">{t('Nav.LoginOr')}</li>
274274
<li className="nav__item">
275275
<Link to="/signup" className="nav__auth-button">
276276
<span className="nav__item-header" title="SignUp">

client/modules/IDE/components/Header/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const Header = (props) => {
1212
const isMobile = useIsMobile();
1313

1414
return (
15-
<header>
15+
<>
1616
<Nav />
1717
{!isMobile && (
1818
<Toolbar syncFileContent={props.syncFileContent} key={project.id} />
1919
)}
20-
</header>
20+
</>
2121
);
2222
};
2323

kubernetes_app.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
selector:
6666
matchLabels:
6767
app: web-editor
68-
replicas: 3
68+
replicas: 4
6969
template:
7070
metadata:
7171
labels:
@@ -99,8 +99,8 @@ metadata:
9999
name: web-editor-node
100100
namespace: production
101101
spec:
102-
maxReplicas: 6
103-
minReplicas: 2
102+
maxReplicas: 9
103+
minReplicas: 3
104104
scaleTargetRef:
105105
apiVersion: extensions/v1beta1
106106
kind: Deployment

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p5.js-web-editor",
3-
"version": "2.12.11",
3+
"version": "2.12.13",
44
"description": "The web editor for p5.js.",
55
"scripts": {
66
"clean": "rimraf dist",

server/controllers/user.controller.js

+10
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,16 @@ export async function updateSettings(req, res) {
295295
}
296296
user.username = req.body.username;
297297

298+
if (req.body.newPassword) {
299+
if (user.password === undefined) {
300+
user.password = req.body.newPassword;
301+
saveUser(res, user);
302+
}
303+
if (!req.body.currentPassword) {
304+
res.status(401).json({ error: 'Current password is not provided.' });
305+
return;
306+
}
307+
}
298308
if (req.body.currentPassword) {
299309
const isMatch = await user.comparePassword(req.body.currentPassword);
300310
if (!isMatch) {

server/domain-objects/createDefaultFiles.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function draw() {
99
export const defaultHTML = `<!DOCTYPE html>
1010
<html lang="en">
1111
<head>
12-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.3/p5.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.3/addons/p5.sound.min.js"></script>
12+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.js"></script>
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/addons/p5.sound.min.js"></script>
1414
<link rel="stylesheet" type="text/css" href="style.css">
1515
<meta charset="utf-8" />
1616

server/previewServer.js

+17-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,24 @@ const app = new Express();
1515
// This also works if you take out the mongoose connection
1616
// but i have no idea why
1717
const mongoConnectionString = process.env.MONGO_URL;
18+
1819
// Connect to MongoDB
19-
mongoose.Promise = global.Promise;
20-
mongoose.connect(mongoConnectionString, {
21-
useNewUrlParser: true,
22-
useUnifiedTopology: true
23-
});
20+
const connectToMongoDB = async () => {
21+
try {
22+
await mongoose.connect(mongoConnectionString, {
23+
useNewUrlParser: true,
24+
useUnifiedTopology: true,
25+
useCreateIndex: true,
26+
useFindAndModify: false
27+
});
28+
} catch (error) {
29+
console.error('Failed to connect to MongoDB: ', error);
30+
process.exit(1);
31+
}
32+
};
33+
34+
connectToMongoDB();
35+
2436
mongoose.set('useCreateIndex', true);
2537
mongoose.connection.on('error', () => {
2638
console.error(

server/server.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,22 @@ app.use('/', passportRoutes);
152152
require('./config/passport');
153153

154154
// Connect to MongoDB
155-
mongoose.Promise = global.Promise;
156-
mongoose.connect(mongoConnectionString, {
157-
useNewUrlParser: true,
158-
useUnifiedTopology: true
159-
});
155+
const connectToMongoDB = async () => {
156+
try {
157+
await mongoose.connect(mongoConnectionString, {
158+
useNewUrlParser: true,
159+
useUnifiedTopology: true,
160+
useCreateIndex: true,
161+
useFindAndModify: false
162+
});
163+
} catch (error) {
164+
console.error('Failed to connect to MongoDB: ', error);
165+
process.exit(1);
166+
}
167+
};
168+
169+
connectToMongoDB();
170+
160171
mongoose.set('useCreateIndex', true);
161172
mongoose.connection.on('error', () => {
162173
console.error(

translations/locales/hi/translations.json

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
"PrivacyPolicy": "गोपनीयता नीति",
110110
"TermsOfUse": "उपयोग की शर्तें",
111111
"CodeOfConduct": "आचार संहिता"
112-
"WebEditor": "वेब एडिटर"
113112
},
114113
"Toast": {
115114
"OpenedNewSketch": "नया स्केच खोला",

translations/locales/ja/translations.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@
358358
"Description": "ユーザー登録",
359359
"Or": "もしくは",
360360
"AlreadyHave": "既にアカウントをお持ちですか?",
361-
"Login": "ログイン"
361+
"Login": "ログイン",
362+
"Warning": "アカウント作成をすると、p5.js エディターの <0>利用規約</0> と <1>プライバシー ポリシー</1> に同意したことになります。"
362363
},
363364
"EmailVerificationView": {
364365
"Title": "p5.js ウェブエディター | メールアドレス認証",

0 commit comments

Comments
 (0)