Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- fix: date cell value not selected on double clicks (fn-faisal) [#1730](https://github.com/parse-community/parse-dashboard/pull/1730)

## Fixes

- Fixes: Unable to edit array of pointer field [#1770](https://github.com/parse-community/parse-dashboard/issues/1770) (Prerna Mehra) [#1771](https://github.com/parse-community/parse-dashboard/pull/1771)
# 2.2.0
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/2.1.0...2.2.0)

Expand Down
13 changes: 9 additions & 4 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,18 @@ export default class BrowserCell extends Component {
const object = new Parse.Object(v.className);
object.id = v.objectId;
array.push(
<a key={i} href='javascript:;' onClick={onPointerClick.bind(undefined, object)}>
<Pill value={v.objectId} />
</a>);
<Pill
key={v.objectId}
value={v.objectId}
onClick={onPointerClick.bind(undefined, object)}
followClick={true}
/>
);
});
this.copyableValue = content = <ul>
content = <ul>
{ array.map( a => <li>{a}</li>) }
</ul>
this.copyableValue = JSON.stringify(value);
if ( array.length > 1 ) {
classes.push(styles.hasMore);
}
Expand Down
8 changes: 7 additions & 1 deletion src/dashboard/Data/Browser/EditRowDialog.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import FileEditor from 'components/FileEditor/FileEditor.react';
import ObjectPickerDialog from 'dashboard/Data/Browser/ObjectPickerDialog.react';
import styles from 'dashboard/Data/Browser/Browser.scss';
import getFileName from 'lib/getFileName';
import encode from 'parse/lib/browser/encode';

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