Skip to content

Commit

Permalink
Merge pull request #109 from ParsePlatform/array-of-null
Browse files Browse the repository at this point in the history
Fix issues with arrays contiaining null or pointers to users. Fixes #105.
  • Loading branch information
peterdotjs committed Mar 9, 2016
2 parents fb9c19d + 417654d commit dfeaab4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
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

0 comments on commit dfeaab4

Please sign in to comment.