aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index 686b21283..bbf8e2bbf 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -90,9 +90,27 @@ export class SchemaTableCell extends React.Component<SchemaTableCellProps> {
addDocTab: returnFalse,
pinToPres: returnZero,
};
+ let protoCount = 0;
+ let doc: Doc | undefined = this.props.Document;
+ while (doc) {
+ if (Object.keys(doc).includes(this.props.fieldKey)) {
+ break;
+ }
+ protoCount++;
+ doc = doc.proto;
+ }
+ const parenCount = Math.max(0, protoCount - 1);
+ const color = protoCount === 0 ? 'black' : 'blue';
return (
- <div className="schemacell-edit-wrapper" style={{ cursor: !this.readOnly ? 'text' : 'default', pointerEvents: !this.readOnly && this.props.isRowActive() ? 'all' : 'none' }}>
+ <div
+ className="schemacell-edit-wrapper"
+ style={{
+ color,
+ textDecoration: parenCount ? 'underline' : undefined,
+ cursor: !this.readOnly ? 'text' : 'default',
+ pointerEvents: !this.readOnly && this.props.isRowActive() ? 'all' : 'none',
+ }}>
<EditableView
ref={ref => (this._editorRef = ref)}
contents={<FieldView {...props} />}