Skip to content

Commit a54a306

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7f5737c + 1603be9 commit a54a306

File tree

6 files changed

+82
-35
lines changed

6 files changed

+82
-35
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
- Add CI check to add changelog entry (Manuel Trezza) [#1764](https://github.com/parse-community/parse-dashboard/pull/1764)
99
- Add Parse Issue Bot (Manuel Trezza) [#1766](https://github.com/parse-community/parse-dashboard/pull/1766)
1010
- Refactor: uniform issue templates across repos (Manuel Trezza) [#1767](https://github.com/parse-community/parse-dashboard/pull/1767)
11+
- fix: date cell value not selected on double clicks (fn-faisal) [#1730](https://github.com/parse-community/parse-dashboard/pull/1730)
1112

1213
## Fixes
14+
- Fixed bug when editing or copying a field containing an array of pointers [#1770](https://github.com/parse-community/parse-dashboard/issues/1770) (Prerna Mehra) [#1771](https://github.com/parse-community/parse-dashboard/pull/1771)
1315

1416
# 2.2.0
1517
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/2.1.0...2.2.0)

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"LICENSE"
3636
],
3737
"dependencies": {
38-
"@babel/runtime": "7.14.8",
38+
"@babel/runtime": "7.15.3",
3939
"bcryptjs": "2.3.0",
4040
"body-parser": "1.19.0",
4141
"codemirror-graphql": "github:timsuchanek/codemirror-graphql#details-fix",

src/components/BrowserCell/BrowserCell.react.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,18 @@ export default class BrowserCell extends Component {
273273
const object = new Parse.Object(v.className);
274274
object.id = v.objectId;
275275
array.push(
276-
<a key={i} href='javascript:;' onClick={onPointerClick.bind(undefined, object)}>
277-
<Pill value={v.objectId} />
278-
</a>);
276+
<Pill
277+
key={v.objectId}
278+
value={v.objectId}
279+
onClick={onPointerClick.bind(undefined, object)}
280+
followClick={true}
281+
/>
282+
);
279283
});
280-
this.copyableValue = content = <ul>
284+
content = <ul>
281285
{ array.map( a => <li>{a}</li>) }
282286
</ul>
287+
this.copyableValue = JSON.stringify(value);
283288
if ( array.length > 1 ) {
284289
classes.push(styles.hasMore);
285290
}

src/components/DateTimeEditor/DateTimeEditor.react.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,15 @@ export default class DateTimeEditor extends React.Component {
9898
</div>
9999
);
100100
}
101-
101+
102102
return (
103103
<div ref='editor' style={{ width: this.props.width }} className={styles.editor}>
104104
<input
105+
autoFocus
105106
type='text'
106107
ref='input'
107108
value={this.state.text}
109+
onFocus={e => e.target.select()}
108110
onClick={this.toggle.bind(this)}
109111
onChange={this.inputDate.bind(this)}
110112
onBlur={this.commitDate.bind(this)} />

src/dashboard/Data/Browser/EditRowDialog.react.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import FileEditor from 'components/FileEditor/FileEditor.react';
1515
import ObjectPickerDialog from 'dashboard/Data/Browser/ObjectPickerDialog.react';
1616
import styles from 'dashboard/Data/Browser/Browser.scss';
1717
import getFileName from 'lib/getFileName';
18+
import encode from 'parse/lib/browser/encode';
1819

1920
export default class EditRowDialog extends React.Component {
2021
constructor(props) {
@@ -57,7 +58,12 @@ export default class EditRowDialog extends React.Component {
5758
columns.forEach(column => {
5859
const { name, type } = column;
5960
if (['Array', 'Object'].indexOf(type) >= 0) {
60-
const stringifyValue = JSON.stringify(currentObject[name], null, 4);
61+
// This is needed to avoid unwanted conversions of objects to Parse.Objects.
62+
// "Parse._encoding" is responsible to convert Parse data into raw data.
63+
// Since array and object are generic types, we want to render them the way
64+
// they were stored in the database.
65+
let val = encode(currentObject[name], undefined, true);
66+
const stringifyValue = JSON.stringify(val, null, 4);
6167
currentObject[name] = stringifyValue;
6268
const rows = stringifyValue ? stringifyValue.split('\n').length : 1;
6369
expandedTextAreas[name] = { rows: rows, expanded: false };

0 commit comments

Comments
 (0)