aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking/LinkEditor.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-17 14:07:09 -0400
committerbobzel <zzzman@gmail.com>2021-09-17 14:07:09 -0400
commitf097eefd91614d4efa2a89b3d8c7d1071d6c0b6f (patch)
tree817227c736afbfc38c0da81add1ae9b2a4704a31 /src/client/views/linking/LinkEditor.tsx
parenta75ccf3bd6c0029116d46436bd5a9d956b6e04e7 (diff)
added 'unset' docFilters. changed link doc views to use comparison box with title/caption. fixed linkEditor to write to data doc. generalized comparisonBox rendering to use parameterized fields. fixed pdf/web to honor pointerEvents none prop and fixed textAnnotations to get rendered once as an Annotation. moved filterIcon stuff into DocumentView
Diffstat (limited to 'src/client/views/linking/LinkEditor.tsx')
-rw-r--r--src/client/views/linking/LinkEditor.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/linking/LinkEditor.tsx b/src/client/views/linking/LinkEditor.tsx
index 240a71c3e..219f7d3a2 100644
--- a/src/client/views/linking/LinkEditor.tsx
+++ b/src/client/views/linking/LinkEditor.tsx
@@ -2,13 +2,14 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Tooltip } from "@material-ui/core";
import { action, computed, observable } from "mobx";
import { observer } from "mobx-react";
-import { Doc, StrListCast } from "../../../fields/Doc";
-import { DateCast, StrCast } from "../../../fields/Types";
+import { Doc, StrListCast, Field } from "../../../fields/Doc";
+import { DateCast, StrCast, Cast } from "../../../fields/Types";
import { LinkManager } from "../../util/LinkManager";
import { undoBatch } from "../../util/UndoManager";
import './LinkEditor.scss';
import { LinkRelationshipSearch } from "./LinkRelationshipSearch";
import React = require("react");
+import { ToString } from "../../../fields/FieldSymbols";
interface LinkEditorProps {
@@ -20,7 +21,7 @@ interface LinkEditorProps {
@observer
export class LinkEditor extends React.Component<LinkEditorProps> {
- @observable description = StrCast(LinkManager.currentLink?.description);
+ @observable description = Field.toString(LinkManager.currentLink?.description as any as Field);
@observable relationship = StrCast(LinkManager.currentLink?.linkRelationship);
@observable openDropdown: boolean = false;
@observable showInfo: boolean = false;
@@ -41,7 +42,7 @@ export class LinkEditor extends React.Component<LinkEditorProps> {
@undoBatch
setRelationshipValue = action((value: string) => {
if (LinkManager.currentLink) {
- LinkManager.currentLink.linkRelationship = value;
+ Doc.GetProto(LinkManager.currentLink).linkRelationship = value;
const linkRelationshipList = StrListCast(Doc.UserDoc().linkRelationshipList);
const linkColorList = StrListCast(Doc.UserDoc().linkColorList);
// if the relationship does not exist in the list, add it and a corresponding unique randomly generated color
@@ -79,7 +80,7 @@ export class LinkEditor extends React.Component<LinkEditorProps> {
@undoBatch
setDescripValue = action((value: string) => {
if (LinkManager.currentLink) {
- LinkManager.currentLink.description = value;
+ Doc.GetProto(LinkManager.currentLink).description = value;
this.buttonColor = "rgb(62, 133, 55)";
setTimeout(action(() => this.buttonColor = ""), 750);
return true;