aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-04-27 20:41:14 -0400
committerbobzel <zzzman@gmail.com>2023-04-27 20:41:14 -0400
commit08d94147eb855bbb3d7eb964ffa6a7a3248001a2 (patch)
treed10760b42c5cd8bef3bf062f9d82f84b21ebbb75 /src/client/views/collections/collectionSchema
parent51fbd118b00f4baebeed989bcd33000ac345ec8c (diff)
forced 'hidden' documents to appear in schema. added colorizing/underlining to schema cells to indicate if value is on layout, data, or proto
Diffstat (limited to 'src/client/views/collections/collectionSchema')
-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} />}