Skip to content

Commit 3850b69

Browse files
committed
Merge remote-tracking branch 'origin/fix/file-new' into fix/file-new
2 parents f9b1268 + 531d4db commit 3850b69

34 files changed

+111
-55
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you have found a bug in the p5.js Web Editor, you can file it under the ["iss
2929

3030
### How Do I Know My Issue or Pull Request is Getting Reviewed?
3131

32-
To see which pull requests and issues are currently being reviewed, check the [PR Review Board](https://github.com/processing/p5.js-web-editor/projects/9) or the following Milestones: [PATCH Release](https://github.com/processing/p5.js-web-editor/milestone/9), [MINOR Release](https://github.com/processing/p5.js-web-editor/milestone/8).
32+
To see which pull requests and issues are currently being reviewed, check the [PR Review Board](https://github.com/processing/p5.js-web-editor/projects/9) or the following Milestones: [PATCH Release](https://github.com/processing/p5.js-web-editor/milestone/10), [MINOR Release](https://github.com/processing/p5.js-web-editor/milestone/8).
3333

3434
Issues and Pull Requests categorized under the PATCH or MINOR Release Milestones will be prioritized since they are planned to be merged for the next release to Production. Please feel free to [comment on this pinned issue](https://github.com/processing/p5.js-web-editor/issues/2534) if you would like your issue to be considered for the next release!
3535

@@ -38,11 +38,9 @@ Issues and Pull Requests categorized under the PATCH or MINOR Release Milestones
3838

3939
We will aim to deploy on a 1-2 month basis. Here are some dates we’re working towards:
4040

41-
MINOR Release for [p5.js version 1.8.0](https://github.com/processing/p5.js/releases/tag/v1.8.0): By October 27, 2023
41+
2.9.3 PATCH Release: By November 17, 2023
4242

43-
PATCH Release: By November 2, 2023
44-
45-
MINOR Release: By November 30, 2023
43+
2.10.0 MINOR Release: By December 15, 2023
4644

4745
[You can read more about Semantic Versioning and the differences between a MINOR and PATCH release](https://semver.org/).
4846

client/modules/IDE/actions/project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import objectID from 'bson-objectid';
22
import each from 'async/each';
3-
import isEqual from 'lodash/isEqual';
3+
import { isEqual } from 'lodash';
44
import browserHistory from '../../../browserHistory';
55
import apiClient from '../../../utils/apiClient';
66
import getConfig from '../../../utils/getConfig';

client/modules/IDE/components/AddToCollectionSketchList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Helmet } from 'react-helmet';
44
import { connect } from 'react-redux';
55
import { bindActionCreators } from 'redux';
66
import { withTranslation } from 'react-i18next';
7-
// import find from 'lodash/find';
7+
// import { find } from 'lodash';
88
import * as ProjectsActions from '../actions/projects';
99
import * as CollectionsActions from '../actions/collections';
1010
import * as ToastActions from '../actions/toast';

client/modules/IDE/components/AssetList.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,16 @@ class AssetListRowBase extends React.Component {
107107
</button>
108108
</li>
109109
<li>
110-
<Link
111-
to={asset.url}
110+
<a
111+
href={asset.url}
112112
target="_blank"
113+
rel="noreferrer"
113114
onBlur={this.onBlurComponent}
114115
onFocus={this.onFocusComponent}
115116
className="asset-table__action-option"
116117
>
117118
{t('AssetList.OpenNewTab')}
118-
</Link>
119+
</a>
119120
</li>
120121
</ul>
121122
)}

client/modules/IDE/components/CollectionList/CollectionList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { withTranslation } from 'react-i18next';
55
import { connect } from 'react-redux';
66
import { bindActionCreators } from 'redux';
77
import classNames from 'classnames';
8-
import find from 'lodash/find';
8+
import { find } from 'lodash';
99
import * as ProjectActions from '../../actions/project';
1010
import * as ProjectsActions from '../../actions/projects';
1111
import * as CollectionsActions from '../../actions/collections';

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ Editor.propTypes = {
594594
linewrap: PropTypes.bool.isRequired,
595595
lintMessages: PropTypes.arrayOf(
596596
PropTypes.shape({
597-
severity: PropTypes.string.isRequired,
597+
severity: PropTypes.oneOf(['error', 'hint', 'info', 'warning'])
598+
.isRequired,
598599
line: PropTypes.number.isRequired,
599600
message: PropTypes.string.isRequired,
600601
id: PropTypes.number.isRequired

client/modules/IDE/components/EditorAccessibility.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ const EditorAccessibility = ({ lintMessages = [] }) => {
3737
EditorAccessibility.propTypes = {
3838
lintMessages: PropTypes.arrayOf(
3939
PropTypes.shape({
40-
severity: PropTypes.string.isRequired,
40+
severity: PropTypes.oneOf(['error', 'hint', 'info', 'warning'])
41+
.isRequired,
4142
line: PropTypes.number.isRequired,
4243
message: PropTypes.string.isRequired,
4344
id: PropTypes.number.isRequired
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react';
2+
3+
import { render, screen } from '../../../test-utils';
4+
5+
import EditorAccessibility from './EditorAccessibility';
6+
7+
describe('<EditorAccessibility />', () => {
8+
it('renders empty message with no lines', () => {
9+
render(<EditorAccessibility lintMessages={[]} />);
10+
11+
expect(
12+
screen.getByRole('listitem', {
13+
description: 'There are no lint messages'
14+
})
15+
).toBeInTheDocument();
16+
});
17+
18+
it('renders lint message', () => {
19+
render(
20+
<EditorAccessibility
21+
lintMessages={[
22+
{
23+
severity: 'info',
24+
line: '1',
25+
message: 'foo',
26+
id: '1a2b3c'
27+
}
28+
]}
29+
/>
30+
);
31+
32+
expect(
33+
screen.queryByText('There are no lint messages')
34+
).not.toBeInTheDocument();
35+
36+
const listItem = screen.getByRole('listitem');
37+
expect(listItem).toBeInTheDocument();
38+
expect(listItem.textContent).toEqual('info in line1 :foo');
39+
});
40+
});

client/modules/IDE/hooks/useKeyDownHandlers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import mapKeys from 'lodash/mapKeys';
1+
import { mapKeys } from 'lodash';
22
import PropTypes from 'prop-types';
33
import { useCallback, useEffect, useRef } from 'react';
44

client/modules/IDE/selectors/collections.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createSelector } from 'reselect';
22
import differenceInMilliseconds from 'date-fns/differenceInMilliseconds';
3-
import find from 'lodash/find';
4-
import orderBy from 'lodash/orderBy';
3+
import { find, orderBy } from 'lodash';
54
import { DIRECTION } from '../actions/sorting';
65

76
const getCollections = (state) => state.collections;

client/modules/IDE/selectors/projects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createSelector } from 'reselect';
22
import differenceInMilliseconds from 'date-fns/differenceInMilliseconds';
3-
import orderBy from 'lodash/orderBy';
3+
import { orderBy } from 'lodash';
44
import { DIRECTION } from '../actions/sorting';
55

66
const getSketches = (state) => state.sketches;

client/modules/Legal/components/PolicyContainer.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { remSize, prop } from '../../../theme';
77

88
const PolicyContainerMain = styled.main`
99
max-width: ${remSize(700)};
10+
min-height: 100vh;
1011
margin: 0 auto;
1112
padding: ${remSize(10)};
1213
line-height: 1.5em;

client/modules/User/components/APIKeyList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
3-
import orderBy from 'lodash/orderBy';
3+
import { orderBy } from 'lodash';
44
import { useTranslation } from 'react-i18next';
55

66
import { APIKeyPropType } from './APIKeyForm';

client/styles/components/_editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pre.CodeMirror-line {
9898
margin-left: 0;
9999
}
100100

101-
// z-index: 20;
101+
z-index: 1;
102102

103103
width: 580px;
104104
font-family: Montserrat, sans-serif;

client/styles/components/_modal.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
.modal-content {
1111
@extend %modal;
1212
min-height: #{150 / $base-font-size}rem;
13-
width: #{500 / $base-font-size}rem;
1413
padding: #{20 / $base-font-size}rem;
14+
15+
@media (min-width: 770px) {
16+
width: #{500 / $base-font-size}rem;
17+
18+
}
19+
1520
.modal--reduced & {
1621
//min-height: #{150 / $base-font-size}rem;
1722
}

client/styles/components/_preferences.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
flex-direction: column;
1111
outline: none;
1212
height: calc(80vh - #{65 / $base-font-size}rem);
13-
max-height: #{460 / $base-font-size}rem;
1413
& .react-tabs {
1514
max-height: 100%;
1615
display: flex;
@@ -19,6 +18,11 @@
1918
& .react-tabs__tab-panel {
2019
overflow-y: auto;
2120
}
21+
22+
@media (min-width: 770px) {
23+
max-height: #{460 / $base-font-size}rem;
24+
25+
}
2226
}
2327

2428
.preference__minus-button,

client/utils/codemirror-search.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,24 @@ function persistentDialog(cm, text, deflt, onEnter, replaceOpened, onKeyDown) {
9898

9999
var upArrow = dialog.getElementsByClassName("up-arrow")[0];
100100
CodeMirror.on(upArrow, "click", function () {
101-
cm.focus();
102-
CodeMirror.commands.findPrev(cm);
103-
searchField.blur();
101+
if (searchField.value.trim() === "") {
102+
searchField.focus();
103+
} else {
104+
cm.focus();
105+
CodeMirror.commands.findPrev(cm);
106+
searchField.blur();
107+
}
104108
});
105109

106110
var downArrow = dialog.getElementsByClassName("down-arrow")[0];
107111
CodeMirror.on(downArrow, "click", function () {
112+
if (searchField.value.trim() === "") {
113+
searchField.focus();
114+
}else{
108115
cm.focus();
109116
CodeMirror.commands.findNext(cm);
110117
searchField.blur();
118+
}
111119
});
112120

113121
var regexpButton = dialog.getElementsByClassName("CodeMirror-regexp-button")[0];
@@ -371,7 +379,7 @@ function doSearch(cm, rev, persistent, immediate, ignoreQuery) {
371379
startSearch(cm, state, q);
372380
findNext(cm, rev);
373381
}
374-
} else {
382+
} else {
375383
dialog(cm, queryDialog, 'Search for:', q, function (query) {
376384
if (query && !state.query)
377385
cm.operation(function () {

server/controllers/collection.controller/updateCollection.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import omitBy from 'lodash/omitBy';
2-
import isUndefined from 'lodash/isUndefined';
1+
import { omitBy, isUndefined } from 'lodash';
32
import Collection from '../../models/collection';
43

54
function removeUndefined(obj) {

server/controllers/user.controller/__tests__/apiKey.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* @jest-environment node */
22

3-
import last from 'lodash/last';
3+
import { last } from 'lodash';
44
import { Request, Response } from 'jest-express';
55

66
import User, { createMock, createInstanceMock } from '../../../models/user';

server/domain-objects/Project.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import isPlainObject from 'lodash/isPlainObject';
2-
import pick from 'lodash/pick';
1+
import { isPlainObject, pick } from 'lodash';
32
import Project from '../models/project';
43
import createId from '../utils/createId';
54
import createApplicationErrorClass from '../utils/createApplicationErrorClass';

server/domain-objects/__test__/Project.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import find from 'lodash/find';
1+
import { find } from 'lodash';
22

33
import {
44
containsRootHtmlFile,

translations/locales/de/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@
530530
"KeyUpLineNumber": "Zeile {{lineNumber}}"
531531
},
532532
"EditorAccessibility": {
533-
"NoLintMessages": "Keine Lint-Warnungen vorhanden ",
534-
"CurrentLine": " Aktuelle Zeile"
533+
"NoLintMessages": "Keine Lint-Warnungen vorhanden",
534+
"CurrentLine": "Aktuelle Zeile"
535535
},
536536
"Timer": {
537537
"SavedAgo": "Gesichert: {{timeAgo}}"

translations/locales/en-US/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@
538538
"KeyUpLineNumber": "line {{lineNumber}}"
539539
},
540540
"EditorAccessibility": {
541-
"NoLintMessages": "There are no lint messages ",
542-
"CurrentLine": " Current line"
541+
"NoLintMessages": "There are no lint messages",
542+
"CurrentLine": "Current line"
543543
},
544544
"Timer": {
545545
"SavedAgo": "Saved: {{timeAgo}}"

translations/locales/es-419/translations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@
530530
},
531531
"EditorAccessibility": {
532532
"NoLintMessages": "No hay mensajes de Lint",
533-
"CurrentLine": " Línea actual"
533+
"CurrentLine": "Línea actual"
534534
},
535535
"Timer": {
536536
"SavedAgo": "Guardado: {{timeAgo}}"

translations/locales/fr-CA/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@
532532
"KeyUpLineNumber": "ligne {{lineNumber}}"
533533
},
534534
"EditorAccessibility": {
535-
"NoLintMessages": "Il n'y a pas de messages lint ",
536-
"CurrentLine": " Ligne actuelle"
535+
"NoLintMessages": "Il n'y a pas de messages lint",
536+
"CurrentLine": "Ligne actuelle"
537537
},
538538
"Timer": {
539539
"SavedAgo": "Sauvegardé: {{timeAgo}}"

translations/locales/hi/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@
529529
"KeyUpLineNumber": "लाइन {{lineNumber}}"
530530
},
531531
"EditorAccessibility": {
532-
"NoLintMessages": "कोई लिंट मैसेज नहीं ",
533-
"CurrentLine": " वर्तमान लाइन"
532+
"NoLintMessages": "कोई लिंट मैसेज नहीं",
533+
"CurrentLine": "वर्तमान लाइन"
534534
},
535535
"Timer": {
536536
"SavedAgo": "सेव किया: {{timeAgo}}"

translations/locales/it/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@
535535
"KeyUpLineNumber": "linea {{lineNumber}}"
536536
},
537537
"EditorAccessibility": {
538-
"NoLintMessages": "Non ci sono messaggi ",
539-
"CurrentLine": " Linea attuale"
538+
"NoLintMessages": "Non ci sono messaggi",
539+
"CurrentLine": "Linea attuale"
540540
},
541541
"Timer": {
542542
"SavedAgo": "Salvato: {{timeAgo}}"

translations/locales/ja/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@
529529
"KeyUpLineNumber": "{{lineNumber}} 行"
530530
},
531531
"EditorAccessibility": {
532-
"NoLintMessages": "リントメッセージはありません ",
533-
"CurrentLine": " 現在の行"
532+
"NoLintMessages": "リントメッセージはありません",
533+
"CurrentLine": "現在の行"
534534
},
535535
"Timer": {
536536
"SavedAgo": "保存されました: {{timeAgo}}"

translations/locales/ko/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@
517517
"KeyUpLineNumber": "line {{lineNumber}}"
518518
},
519519
"EditorAccessibility": {
520-
"NoLintMessages": "There are no lint messages ",
521-
"CurrentLine": " Current line"
520+
"NoLintMessages": "There are no lint messages",
521+
"CurrentLine": "Current line"
522522
},
523523
"Timer": {
524524
"SavedAgo": "Saved: {{timeAgo}}"

translations/locales/pt-BR/translations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
"KeyUpLineNumber": "linha {{lineNumber}}"
530530
},
531531
"EditorAccessibility": {
532-
"NoLintMessages": "Não há mensagens de Lint ",
532+
"NoLintMessages": "Não há mensagens de Lint",
533533
"CurrentLine": "Linha atual"
534534
},
535535
"Timer": {

translations/locales/sv/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@
532532
"KeyUpLineNumber": "rad {{lineNumber}}"
533533
},
534534
"EditorAccessibility": {
535-
"NoLintMessages": "Det finns inga Lint-meddelanden ",
536-
"CurrentLine": " Aktuell rad"
535+
"NoLintMessages": "Det finns inga Lint-meddelanden",
536+
"CurrentLine": "Aktuell rad"
537537
},
538538
"Timer": {
539539
"SavedAgo": "Sparad: {{timeAgo}}"

translations/locales/tr/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@
535535
"KeyUpLineNumber": "{{lineNumber}}. satır"
536536
},
537537
"EditorAccessibility": {
538-
"NoLintMessages": "Lint mesajı yok ",
539-
"CurrentLine": " Şu anki satır"
538+
"NoLintMessages": "Lint mesajı yok",
539+
"CurrentLine": "Şu anki satır"
540540
},
541541
"Timer": {
542542
"SavedAgo": "Kaydedildi: {{timeAgo}}"

0 commit comments

Comments
 (0)