Skip to content

Commit 9185447

Browse files
committed
Merge master to fix/rename-file-set-unsaved
2 parents 6bf303d + 8114a88 commit 9185447

28 files changed

+1538
-537
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Don't know where to begin? Here are some suggestions to get started:
3333
- Front end: React/Redux, CSS/Sass, CodeMirror
3434
- Back end: Node, Express, MongoDB, Jest, AWS
3535
- DevOps: Travis CI, Jest, Docker, Kubernetes, AWS
36+
- Documentation
37+
- Translations: Application and documentation
3638
* Use the [p5.js Web Editor](https://editor.p5js.org)! Find a bug? Think of something you think would add to the project? Open an issue.
3739
* Expand an existing issue. Sometimes issues are missing steps to reproduce, or need suggestions for potential solutions. Sometimes they need another voice saying, "this is really important!"
3840
* Try getting the project running locally on your computer by following the [installation steps](./../developer_docs/installation.md).

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# [p5.js Web Editor](https://editor.p5js.org)
22

3+
4+
Documentation is also available in the following languages:
5+
6+
[한국어](https://github.com/processing/p5.js-web-editor/blob/master/translations/ko)
7+
8+
## Welcome! 👋👋🏿👋🏽👋🏻👋🏾👋🏼
9+
310
The p5.js Web Editor is a platform for creative coding, with a focus on making coding accessible for as many people as possible, including artists, designers, educators, beginners, and anyone who wants to learn. Simply by opening the website you can get started writing p5.js sketches without downloading or configuring anything. The editor is designed with simplicity in mind by limiting features and frills. We strive to listen to the community to drive the editor’s development, and to be intentional with every change. The editor is free and open-source.
411

512
We also strive to give the community as much ownership and control as possible. You can download your sketches so that you can edit them locally or host them elsewhere. You can also host your own version of the editor, giving you control over its data.

client/components/Nav.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class Nav extends React.PureComponent {
227227

228228
renderDashboardMenu(navDropdownState) {
229229
return (
230-
<ul className="nav__items-left" title="project-menu">
230+
<ul className="nav__items-left">
231231
<li className="nav__item-logo">
232232
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
233233
</li>
@@ -245,7 +245,7 @@ class Nav extends React.PureComponent {
245245

246246
renderProjectMenu(navDropdownState) {
247247
return (
248-
<ul className="nav__items-left" title="project-menu">
248+
<ul className="nav__items-left">
249249
<li className="nav__item-logo">
250250
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
251251
</li>

client/components/NavBasic.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NavBasic extends React.PureComponent {
1313
render() {
1414
return (
1515
<nav className="nav" title="main-navigation" ref={(node) => { this.node = node; }}>
16-
<ul className="nav__items-left" title="project-menu">
16+
<ul className="nav__items-left">
1717
<li className="nav__item-logo">
1818
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
1919
</li>

client/components/__test__/__snapshots__/Nav.test.jsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ exports[`Nav renders correctly 1`] = `
77
>
88
<ul
99
className="nav__items-left"
10-
title="project-menu"
1110
>
1211
<li
1312
className="nav__item-logo"

client/modules/IDE/actions/collections.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios';
2+
import { browserHistory } from 'react-router';
23
import * as ActionTypes from '../../../constants';
34
import { startLoader, stopLoader } from './loader';
45
import { setToastText, showToast } from './toast';
@@ -47,20 +48,22 @@ export function createCollection(collection) {
4748
});
4849
dispatch(stopLoader());
4950

50-
const collectionName = response.data.name;
51-
dispatch(setToastText(`Created "${collectionName}"`));
51+
const newCollection = response.data;
52+
dispatch(setToastText(`Created "${newCollection.name}"`));
5253
dispatch(showToast(TOAST_DISPLAY_TIME_MS));
5354

54-
return response.data;
55+
const pathname = `/${newCollection.owner.username}/collections/${newCollection.id}`;
56+
const location = { pathname, state: { skipSavingPath: true } };
57+
58+
browserHistory.push(location);
5559
})
5660
.catch((response) => {
61+
console.error('Error creating collection', response.data);
5762
dispatch({
5863
type: ActionTypes.ERROR,
5964
error: response.data
6065
});
6166
dispatch(stopLoader());
62-
63-
return response.data;
6467
});
6568
};
6669
}

client/modules/IDE/components/FileNode.jsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ export class FileNode extends React.Component {
230230
<ul title="file options">
231231
{ isFolder &&
232232
<React.Fragment>
233+
<li>
234+
<button
235+
aria-label="add folder"
236+
onClick={this.handleClickAddFolder}
237+
onBlur={this.onBlurComponent}
238+
onFocus={this.onFocusComponent}
239+
className="sidebar__file-item-option"
240+
>
241+
Create folder
242+
</button>
243+
</li>
233244
<li>
234245
<button
235246
aria-label="add file"
@@ -238,18 +249,20 @@ export class FileNode extends React.Component {
238249
onFocus={this.onFocusComponent}
239250
className="sidebar__file-item-option"
240251
>
241-
Add File
252+
Create file
242253
</button>
243254
</li>
244255
<li>
245256
<button
246-
aria-label="add folder"
247-
onClick={this.handleClickAddFolder}
257+
aria-label="upload file"
258+
onClick={() => {
259+
this.props.openUploadFileModal(this.props.id);
260+
setTimeout(this.hideFileOptions, 0);
261+
}}
248262
onBlur={this.onBlurComponent}
249263
onFocus={this.onFocusComponent}
250-
className="sidebar__file-item-option"
251264
>
252-
Add Folder
265+
Upload file
253266
</button>
254267
</li>
255268
</React.Fragment>
@@ -304,7 +317,8 @@ FileNode.propTypes = {
304317
newFolder: PropTypes.func.isRequired,
305318
showFolderChildren: PropTypes.func.isRequired,
306319
hideFolderChildren: PropTypes.func.isRequired,
307-
canEdit: PropTypes.bool.isRequired
320+
canEdit: PropTypes.bool.isRequired,
321+
openUploadFileModal: PropTypes.func.isRequired
308322
};
309323

310324
FileNode.defaultProps = {

client/modules/IDE/components/KeyboardShortcutModal.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ function KeyboardShortcutModal() {
7474
</span>
7575
<span>Turn off Accessible Output</span>
7676
</li>
77+
<li className="keyboard-shortcut-item">
78+
<span className="keyboard-shortcut__command">
79+
{metaKeyName} + B
80+
</span>
81+
<span>Toggle Sidebar</span>
82+
</li>
83+
<li className="keyboard-shortcut-item">
84+
<span className="keyboard-shortcut__command">
85+
Ctrl + `
86+
</span>
87+
<span>Toggle Console</span>
88+
</li>
7789
</ul>
7890
);
7991
}

client/modules/IDE/components/QuickAddList/QuickAddList.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const QuickAddList = ({
5353
{...item}
5454
onSelect={
5555
(event) => {
56-
event.target.blur();
56+
event.stopPropagation();
57+
event.currentTarget.blur();
5758
handleAction(item);
5859
}
5960
}

client/modules/IDE/components/Searchbar/Searchbar.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ class Searchbar extends React.Component {
2626

2727
handleSearchEnter = (e) => {
2828
if (e.key === 'Enter') {
29-
this.props.setSearchTerm(this.state.searchValue);
29+
this.searchChange();
3030
}
3131
}
3232

33-
searchChange = (value) => {
34-
this.props.setSearchTerm(this.state.searchValue);
33+
searchChange = () => {
34+
if (this.state.searchValue.trim().length === 0) return;
35+
this.props.setSearchTerm(this.state.searchValue.trim());
3536
};
3637

3738
handleSearchChange = (e) => {

0 commit comments

Comments
 (0)