From 5b7a0804fa2bd4b956b3617501619737814bd28b Mon Sep 17 00:00:00 2001 From: eperelm2 Date: Fri, 30 Jun 2023 14:47:41 -0400 Subject: contexts work now --- src/client/views/PropertiesDocContextSelector.tsx | 3 +++ src/client/views/PropertiesView.scss | 14 +++++++++++--- src/client/views/PropertiesView.tsx | 16 ++++++++++------ 3 files changed, 24 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/PropertiesDocContextSelector.tsx b/src/client/views/PropertiesDocContextSelector.tsx index e1279c9a7..ea3bb434b 100644 --- a/src/client/views/PropertiesDocContextSelector.tsx +++ b/src/client/views/PropertiesDocContextSelector.tsx @@ -19,6 +19,7 @@ type PropertiesDocContextSelectorProps = { @observer export class PropertiesDocContextSelector extends React.Component { + @computed get _docs() { if (!this.props.DocView) return []; const target = this.props.DocView.props.Document; @@ -39,6 +40,8 @@ export class PropertiesDocContextSelector extends React.Component()) .keys() ); + console.log("embeddings " + embeddings.length); + return doclayouts .filter(doc => !Doc.AreProtosEqual(doc, CollectionDockingView.Instance?.props.Document)) .filter(doc => !Doc.IsSystem(doc)) diff --git a/src/client/views/PropertiesView.scss b/src/client/views/PropertiesView.scss index a9577b232..023e08e6a 100644 --- a/src/client/views/PropertiesView.scss +++ b/src/client/views/PropertiesView.scss @@ -443,12 +443,20 @@ .propertiesView-fields-checkbox { float: right; height: 20px; - margin-top: -9px; + margin-top: -4px; + //margin-top: -9px; + display: flex; + flex-direction: column; + align-items: center; + color:black; + // justify-content: center; .propertiesView-fields-checkbox-text { font-size: 7px; - margin-top: -10px; - margin-left: 6px; + text-align: center; + margin-right: 6px; + margin-top: -10px; + // margin-left: 6px; } } diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 60e93cdfd..585076b67 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -198,7 +198,7 @@ export class PropertiesView extends React.Component { }); rows.push( -
+
''} SetValue={this.setKeyValue} />
); @@ -257,9 +257,12 @@ export class PropertiesView extends React.Component { } @computed get contextCount(){ - if (this.selectedDoc != undefined){ - const aliases = DocListCast(this.selectedDoc.aliases) - return aliases.length + console.log("in context count"); + if (this.selectedDocumentView){ + const target = (this.selectedDocumentView.props.Document) + const embeddings = DocListCast(target.proto_embeddings) + console.log(embeddings.length -1 ); + return (embeddings.length - 1) } else{ return 0; } @@ -462,6 +465,7 @@ export class PropertiesView extends React.Component { } @computed get fieldsCheckbox() { + // color= "primary" return ; } @@ -1301,7 +1305,7 @@ export class PropertiesView extends React.Component { {!Doc.noviceMode && this.openFields ? (
{this.fieldsCheckbox} -
Layout
+
Embedding
) : null} {!this.openFields ? null :
{Doc.noviceMode ? this.noviceFields : this.expandedField}
} @@ -1342,7 +1346,7 @@ export class PropertiesView extends React.Component {
- {!this.openContexts ? null : this.contextCount > 0 ?
{this.contexts}
:
There are no other contexts.
} + {!this.openContexts ? null : this.contextCount > 0 ?
{this.contexts}
:
There are no other contexts.
} ); } -- cgit v1.2.3-70-g09d2