diff --git a/.gitignore b/.gitignore
index 5dbbc37203..cb08935ec4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,6 @@ npm-debug.log
logs/
test_logs
+
+# visual studio code
+.vscode
diff --git a/README.md b/README.md
index 0e4b11f018..f14070003e 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,8 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
- [Run with Docker](#run-with-docker)
- [Features](#features)
- [Browse as User](#browse-as-user)
+ - [Change Pointer Key](#change-pointer-key)
+ - [Limitations](#limitations)
- [CSV Export](#csv-export)
- [Contributing](#contributing)
@@ -605,6 +607,19 @@ This feature allows you to use the data browser as another user, respecting that
> ⚠️ Logging in as another user will trigger the same Cloud Triggers as if the user logged in themselves using any other login method. Logging in as another user requires to enter that user's password.
+## Change Pointer Key
+
+▶️ *Core > Browser > Edit > Change pointer key*
+
+This feature allows you to change how a pointer is represented in the browser. By default, a pointer is represented by the `objectId` of the linked object. You can change this to any other column of the object class. For example, if class `Installation` has a field that contains a pointer to class `User`, the pointer will show the `objectId` of the user by default. You can change this to display the field `email` of the user, so that a pointer displays the user's email address instead.
+
+### Limitations
+
+- This does not work for an array of pointers; the pointer will always display the `objectId`.
+- System columns like `createdAt`, `updatedAt`, `ACL` cannot be set as pointer key.
+- This feature uses browser storage; switching to a different browser resets the pointer key to `objectId`.
+
+> ⚠️ For each custom pointer key in each row, a server request is triggered to resolve the custom pointer key. For example, if the browser shows a class with 50 rows and each row contains 3 custom pointer keys, a total of 150 separate server requests are triggered.
## CSV Export
▶️ *Core > Browser > Export*
diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js
index a2106503dd..8414e8f13d 100644
--- a/src/components/BrowserCell/BrowserCell.react.js
+++ b/src/components/BrowserCell/BrowserCell.react.js
@@ -15,6 +15,7 @@ import React, { Component } from 'react';
import styles from 'components/BrowserCell/BrowserCell.scss';
import { unselectable } from 'stylesheets/base.scss';
import Tooltip from '../Tooltip/PopperTooltip.react';
+import * as ColumnPreferences from 'lib/ColumnPreferences';
export default class BrowserCell extends Component {
constructor() {
@@ -23,13 +24,161 @@ export default class BrowserCell extends Component {
this.cellRef = React.createRef();
this.copyableValue = undefined;
this.state = {
- showTooltip: false
+ showTooltip: false,
+ content: null,
+ classes: []
+ };
+ }
+
+ async renderCellContent() {
+ let content = this.props.value;
+ let isNewRow = this.props.row < 0;
+ this.copyableValue = content;
+ let classes = [styles.cell, unselectable];
+ if (this.props.hidden) {
+ content = this.props.value !== undefined || !isNewRow ? '(hidden)' : this.props.isRequired ? '(required)' : '(undefined)';
+ classes.push(styles.empty);
+ } else if (this.props.value === undefined) {
+ if (this.props.type === 'ACL') {
+ this.copyableValue = content = 'Public Read + Write';
+ } else {
+ this.copyableValue = content = '(undefined)';
+ classes.push(styles.empty);
+ }
+ content = isNewRow && this.props.isRequired && this.props.value === undefined ? '(required)' : content;
+ } else if (this.props.value === null) {
+ this.copyableValue = content = '(null)';
+ classes.push(styles.empty);
+ } else if (this.props.value === '') {
+ content = ;
+ classes.push(styles.empty);
+ } else if (this.props.type === 'Pointer') {
+ const defaultPointerKey = await ColumnPreferences.getPointerDefaultKey(this.props.appId, this.props.value.className);
+ let dataValue = this.props.value.id;
+ if( defaultPointerKey !== 'objectId' ) {
+ dataValue = this.props.value.get(defaultPointerKey);
+ if ( dataValue && typeof dataValue === 'object' ){
+ if ( dataValue instanceof Date ) {
+ dataValue = dataValue.toLocaleString();
+ }
+ else {
+ if ( !this.props.value.id ) {
+ dataValue = this.props.value.id;
+ } else {
+ dataValue = '(undefined)';
+ }
+ }
+ }
+ if ( !dataValue ) {
+ if ( this.props.value.id ) {
+ dataValue = this.props.value.id;
+ } else {
+ dataValue = '(undefined)';
+ }
+ }
+ }
+
+ if (this.props.value && this.props.value.__type) {
+ const object = new Parse.Object(this.props.value.className);
+ object.id = this.props.value.objectId;
+ this.props.value = object;
+ }
+
+ content = this.props.onPointerClick ? (
+