Skip to content

Fix issues with arrays contiaining null or pointers to users. Fixes #105. #109

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 1 commit into from
Mar 9, 2016
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
16 changes: 5 additions & 11 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ let BrowserCell = ({ type, value, hidden, width, current, onSelect, readonly, on
content = dateStringUTC(value);
} else if (type === 'Boolean') {
content = value ? 'True' : 'False';
} else if (type === 'Array' || type === 'Object') {
if (type === 'Array') {
let _value = [];
value.forEach((val) => {
_value.push(val.constructor === Parse.Object ? val.toPointer() : val);
});
content = JSON.stringify(_value);
} else {
content = JSON.stringify(value);
}
} else if (type === 'Array') {
content = JSON.stringify(value.map(val => val instanceof Parse.Object ? val.toPointer() : val))
} else if (type === 'Object') {
content = JSON.stringify(value);
} else if (type === 'File') {
if (value.url()) {
content = <a href={value.url()} target='_blank'><Pill value={getFileName(value)} /></a>;
Expand Down Expand Up @@ -85,7 +79,7 @@ let BrowserCell = ({ type, value, hidden, width, current, onSelect, readonly, on
</div>
);
}

if (current) {
classes.push(styles.current);
}
Expand Down
4 changes: 1 addition & 3 deletions src/dashboard/Data/Browser/BrowserTable.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ export default class BrowserTable extends React.Component {
value = '';
} else if (type === 'Array') {
if (value) {
value = value.map((val) => {
return val.constructor === Parse.Object ? val.toPointer() : val;
});
value = value.map(val => val instanceof Parse.Object ? val.toPointer() : val);
}
}
let wrapTop = Math.max(0, this.props.current.row * ROW_HEIGHT);
Expand Down