diff options
| author | andrewdkim <adkim414@gmail.com> | 2019-07-29 12:24:03 -0400 | 
|---|---|---|
| committer | andrewdkim <adkim414@gmail.com> | 2019-07-29 12:24:03 -0400 | 
| commit | 10a5b5a99ae77d890412b3a3d25b6b85c935f25b (patch) | |
| tree | 506f98d8632df09cfc1f9d25bf0e81891575f623 /src/client/views/nodes/LinkMenuGroup.tsx | |
| parent | afe2355cd66c98e391965ebfe022d8f8607ac794 (diff) | |
| parent | e7ea2028f54787d6c92fb22b789f17b7268d3793 (diff) | |
Merged from master
Diffstat (limited to 'src/client/views/nodes/LinkMenuGroup.tsx')
| -rw-r--r-- | src/client/views/nodes/LinkMenuGroup.tsx | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/nodes/LinkMenuGroup.tsx b/src/client/views/nodes/LinkMenuGroup.tsx index ae97bed2f..0cb216aa6 100644 --- a/src/client/views/nodes/LinkMenuGroup.tsx +++ b/src/client/views/nodes/LinkMenuGroup.tsx @@ -14,12 +14,14 @@ import { Docs } from "../../documents/Documents";  import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";  import { UndoManager } from "../../util/UndoManager";  import { StrCast } from "../../../new_fields/Types"; +import { SchemaHeaderField, RandomPastel } from "../../../new_fields/SchemaHeaderField";  interface LinkMenuGroupProps {      sourceDoc: Doc;      group: Doc[];      groupType: string;      showEditor: (linkDoc: Doc) => void; +    addDocTab: (document: Doc, dataDoc: Doc | undefined, where: string) => void;  }  @observer @@ -70,7 +72,7 @@ export class LinkMenuGroup extends React.Component<LinkMenuGroupProps> {          let keys = LinkManager.Instance.getMetadataKeysInGroup(groupType);          let index = keys.indexOf("");          if (index > -1) keys.splice(index, 1); -        let cols = ["anchor1", "anchor2", ...[...keys]]; +        let cols = ["anchor1", "anchor2", ...[...keys]].map(c => new SchemaHeaderField(c));          let docs: Doc[] = LinkManager.Instance.getAllMetadataDocsInGroup(groupType);          let createTable = action(() => Docs.Create.SchemaDocument(cols, docs, { width: 500, height: 300, title: groupType + " table" }));          let ref = React.createRef<HTMLDivElement>(); @@ -82,6 +84,7 @@ export class LinkMenuGroup extends React.Component<LinkMenuGroupProps> {              let destination = LinkManager.Instance.getOppositeAnchor(linkDoc, this.props.sourceDoc);              if (destination && this.props.sourceDoc) {                  return <LinkMenuItem key={destination[Id] + this.props.sourceDoc[Id]} groupType={this.props.groupType} +                    addDocTab={this.props.addDocTab}                      linkDoc={linkDoc} sourceDoc={this.props.sourceDoc} destinationDoc={destination} showEditor={this.props.showEditor} />;              }          });  | 
