aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking/LinkEditor.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-02-21 09:32:23 -0500
committerBob Zeleznik <zzzman@gmail.com>2020-02-21 09:32:23 -0500
commit8274233572d5ff299e13868c86bd2436f4c276fc (patch)
tree9127a4e7c396110d4e03626a46f5a57dbd7b2eb4 /src/client/views/linking/LinkEditor.tsx
parent72892f0811f03dae096ebea2dcac24b56d661b07 (diff)
fixed link naming and exposed link database (at least for testing)
Diffstat (limited to 'src/client/views/linking/LinkEditor.tsx')
-rw-r--r--src/client/views/linking/LinkEditor.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/linking/LinkEditor.tsx b/src/client/views/linking/LinkEditor.tsx
index 6cdd11430..913a04d66 100644
--- a/src/client/views/linking/LinkEditor.tsx
+++ b/src/client/views/linking/LinkEditor.tsx
@@ -206,13 +206,13 @@ export class LinkGroupEditor extends React.Component<LinkGroupEditorProps> {
constructor(props: LinkGroupEditorProps) {
super(props);
- const groupMdKeys = LinkManager.Instance.getMetadataKeysInGroup(StrCast(props.groupDoc.title));
+ const groupMdKeys = LinkManager.Instance.getMetadataKeysInGroup(StrCast(props.groupDoc.linkRelationship));
groupMdKeys.forEach(key => this._metadataIds.set(key, Utils.GenerateGuid()));
}
@action
setGroupType = (groupType: string): void => {
- this.props.groupDoc.title = groupType;
+ Doc.GetProto(this.props.groupDoc).linkRelationship = groupType;
}
removeGroupFromLink = (groupType: string): void => {
@@ -241,7 +241,7 @@ export class LinkGroupEditor extends React.Component<LinkGroupEditorProps> {
renderMetadata = (): JSX.Element[] => {
const metadata: Array<JSX.Element> = [];
const groupDoc = this.props.groupDoc;
- const groupType = StrCast(groupDoc.title);
+ const groupType = StrCast(groupDoc.linkRelationship);
const groupMdKeys = LinkManager.Instance.getMetadataKeysInGroup(groupType);
groupMdKeys.forEach((key) => {
@@ -254,7 +254,7 @@ export class LinkGroupEditor extends React.Component<LinkGroupEditorProps> {
}
render() {
- const groupType = StrCast(this.props.groupDoc.title);
+ const groupType = StrCast(this.props.groupDoc.linkRelationship);
// if ((groupType && LinkManager.Instance.getMetadataKeysInGroup(groupType).length > 0) || groupType === "") {
let buttons = <button className="linkEditor-button" disabled={groupType === ""} onClick={() => this.deleteGroup(groupType)} title="Delete Relationship from all links"><FontAwesomeIcon icon="trash" size="sm" /></button>;
let addButton = <button className="linkEditor-addbutton" onClick={() => this.addMetadata(groupType)} disabled={groupType === ""} title="Add metadata to relationship"><FontAwesomeIcon icon="plus" size="sm" /></button>;
@@ -293,7 +293,7 @@ export class LinkEditor extends React.Component<LinkEditorProps> {
const destination = LinkManager.Instance.getOppositeAnchor(this.props.linkDoc, this.props.sourceDoc);
const groups = [this.props.linkDoc].map(groupDoc => {
- return <LinkGroupEditor key={"gred-" + StrCast(groupDoc.title)} linkDoc={this.props.linkDoc} sourceDoc={this.props.sourceDoc} groupDoc={groupDoc} />;
+ return <LinkGroupEditor key={"gred-" + StrCast(groupDoc.linkRelationship)} linkDoc={this.props.linkDoc} sourceDoc={this.props.sourceDoc} groupDoc={groupDoc} />;
});
return !destination ? (null) : (