Skip to content

Force pointer array items to always be pointers #1291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion src/components/BrowserRow/BrowserRow.react.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Parse from 'parse';
import encode from 'parse/lib/browser/encode';
import React, { Component } from 'react';

import BrowserCell from 'components/BrowserCell/BrowserCell.react';
Expand Down Expand Up @@ -46,7 +47,7 @@ export default class BrowserRow extends Component {
// "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.
attr = Parse._encode(obj.get(name));
attr = encode(obj.get(name), undefined, true);
}
}
let hidden = false;
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard/Data/Browser/BrowserTable.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Editor from 'dashboard/Data/Browser/Editor.react';
import EmptyState from 'components/EmptyState/EmptyState.react';
import Icon from 'components/Icon/Icon.react';
import Parse from 'parse';
import encode from 'parse/lib/browser/encode';
import React from 'react';
import styles from 'dashboard/Data/Browser/Browser.scss';
import Button from 'components/Button/Button.react';
Expand Down Expand Up @@ -198,7 +199,7 @@ export default class BrowserTable extends React.Component {
// "Parse._encoding" is responsible to convert Parse data into raw data.
// Since array and object are generic types, we want to edit them the way
// they were stored in the database.
value = Parse._encode(obj.get(name));
value = encode(obj.get(name), undefined, true);
} else {
value = obj.get(name);
}
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard/Data/Browser/Editor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import FileEditor from 'components/FileEditor/FileEditor.react';
import GeoPointEditor from 'components/GeoPointEditor/GeoPointEditor.react';
import NumberEditor from 'components/NumberEditor/NumberEditor.react';
import Parse from 'parse';
import decode from 'parse/lib/browser/decode';
import React from 'react';
import StringEditor from 'components/StringEditor/StringEditor.react';

Expand All @@ -30,7 +31,7 @@ let Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit }
} else if (type === 'Array' || type === 'Object') {
let encodeCommit = (json) => {
try {
let obj = JSON.parse(json);
let obj = decode(JSON.parse(json));
onCommit(obj);
} catch (e) {
onCommit(value);
Expand Down