From 6d789877e2bec0812060fce9cfded2780d2e772b Mon Sep 17 00:00:00 2001 From: Lauren Choi Date: Thu, 4 Nov 2021 16:36:30 -0400 Subject: link relationships working --- src/client/views/PropertiesView.tsx | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index dd6e0e3e7..2d461f7ef 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -1077,13 +1077,9 @@ export class PropertiesView extends React.Component { ; } - @observable - description = Field.toString(LinkManager.currentLink?.description as any as Field); - // @observable - // linkRelationship = Field.toString(LinkManager.currentLink?.linkRelationship as any as Field); + @observable description = Field.toString(LinkManager.currentLink?.description as any as Field); @observable relationship = StrCast(LinkManager.currentLink?.linkRelationship); - @observable - private relationshipButtonColor: string = ""; + @observable private relationshipButtonColor: string = ""; // @action // handleDescriptionChange = (e: React.ChangeEvent) => { this.description = e.target.value; } @@ -1092,9 +1088,8 @@ export class PropertiesView extends React.Component { @undoBatch handleDescriptionChange = action((value: string) => { if (LinkManager.currentLink) { - // this.description = value; - console.log("changing description to " + value) this.selectedDoc.description = value; + this.description = value; return true; } }); @@ -1102,9 +1097,8 @@ export class PropertiesView extends React.Component { @undoBatch handleLinkRelationshipChange = action((value: string) => { if (LinkManager.currentLink) { - // this.relationship = value; - console.log("changing linkRelationship to " + value) - this.selectedDoc.relationship = value; + this.selectedDoc.linkRelationship = value; + this.relationship = value; return true; } }); @@ -1113,9 +1107,6 @@ export class PropertiesView extends React.Component { setDescripValue = action((value: string) => { if (LinkManager.currentLink) { Doc.GetProto(LinkManager.currentLink).description = value; - console.log("the link description was set to " + Doc.GetProto(LinkManager.currentLink).description) - // this.selectedDoc.description = value; - // this.description = value; return true; } }); @@ -1155,9 +1146,6 @@ export class PropertiesView extends React.Component { } this.relationshipButtonColor = "rgb(62, 133, 55)"; - console.log("the linkRelationship was set to " + Doc.GetProto(LinkManager.currentLink).linkRelationship) - // this.selectedDoc.relationship = value; - // this.relationship = value; setTimeout(action(() => this.relationshipButtonColor = ""), 750); return true; } @@ -1204,7 +1192,7 @@ export class PropertiesView extends React.Component { return this.handleLinkRelationshipChange(e.currentTarget.value)} -- cgit v1.2.3-70-g09d2