diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-07-24 00:25:30 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-07-24 00:25:30 -0500 |
commit | 7d0778a9dd1d5e70bf5e4f51e264dcf2f86829d3 (patch) | |
tree | 019ea076d9fff0d983f18aa90c8acfcdca61901e | |
parent | 3c83787b8c55663484bee4b6fb03a6bc86d7fc49 (diff) |
two rows in settings and adjusting context menu
-rw-r--r-- | src/client/views/PropertiesButtons.tsx | 25 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 4 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx index 52e46147a..8488b553f 100644 --- a/src/client/views/PropertiesButtons.tsx +++ b/src/client/views/PropertiesButtons.tsx @@ -23,6 +23,7 @@ import { Template, Templates } from "./Templates"; import React = require("react"); import { Tooltip } from '@material-ui/core'; import { SelectionManager } from '../util/SelectionManager'; +import SharingManager from '../util/SharingManager'; const higflyout = require("@hig/flyout"); export const { anchorPoints } = higflyout; export const Flyout = higflyout.default; @@ -267,7 +268,7 @@ export class PropertiesButtons extends React.Component<{}, {}> { onCopy = () => { if (this.selectedDoc && this.selectedDocumentView) { - const copy = Doc.MakeCopy(this.selectedDoc, true); + const copy = Doc.MakeCopy(this.selectedDocumentView.props.Document, true); copy.x = NumCast(this.selectedDoc.x) + NumCast(this.selectedDoc._width); copy.y = NumCast(this.selectedDoc.y) + 30; this.selectedDocumentView.props.addDocument?.(copy); @@ -336,6 +337,23 @@ export class PropertiesButtons extends React.Component<{}, {}> { </Tooltip>; } + @computed + get sharingButton() { + const targetDoc = this.selectedDoc; + return !targetDoc ? (null) : <Tooltip + title={<><div className="dash-tooltip">{"Share Document"}</div></>}> + <div className={"documentButtonBar-linkButton-empty"} + onPointerDown={() => { + if (this.selectedDocumentView) { + SharingManager.Instance.open(this.selectedDocumentView); + } + }}> + {<FontAwesomeIcon className="documentdecorations-icon" + icon="users" size="sm" />} + </div> + </Tooltip>; + } + render() { if (!this.selectedDoc) return (null); @@ -343,7 +361,7 @@ export class PropertiesButtons extends React.Component<{}, {}> { const isText = this.selectedDoc[Doc.LayoutFieldKey(this.selectedDoc)] instanceof RichTextField; const considerPull = isText && this.considerGoogleDocsPull; const considerPush = isText && this.considerGoogleDocsPush; - return <div><div className="propertiesButtons"> + return <div><div className="propertiesButtons" style={{ paddingBottom: "5.5px" }}> <div className="propertiesButtons-button"> {this.templateButton} </div> @@ -367,6 +385,9 @@ export class PropertiesButtons extends React.Component<{}, {}> { </div> </div> <div className="propertiesButtons"> + <div className="propertiesButtons-button"> + {this.sharingButton} + </div> <div className="propertiesButtons-button" style={{ display: !considerPush ? "none" : "" }}> {this.considerGoogleDocsPush} </div> diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 02fe60255..30582a287 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -809,7 +809,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu moreItems.push({ description: "Copy ID", event: () => Utils.CopyText(Utils.prepend("/doc/" + this.props.Document[Id])), icon: "fingerprint" }); } GetEffectiveAcl(this.props.Document) === AclEdit && moreItems.push({ description: "Delete", event: this.deleteClicked, icon: "trash" }); - moreItems.push({ description: "Share", event: () => SharingManager.Instance.open(this), icon: "external-link-alt" }); + //moreItems.push({ description: "Share", event: () => SharingManager.Instance.open(this), icon: "external-link-alt" }); !more && cm.addItem({ description: "More...", subitems: moreItems, icon: "hand-point-right" }); cm.moveAfter(cm.findByDescription("More...")!, cm.findByDescription("OnClick...")!); @@ -817,7 +817,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu const helpItems: ContextMenuProps[] = help && "subitems" in help ? help.subitems : []; //!Doc.UserDoc().novice && helpItems.push({ description: "Text Shortcuts Ctrl+/", event: () => this.props.addDocTab(Docs.Create.PdfDocument(Utils.prepend("/assets/cheat-sheet.pdf"), { _width: 300, _height: 300 }), "onRight"), icon: "keyboard" }); !Doc.UserDoc().novice && helpItems.push({ description: "Show Fields ", event: () => this.props.addDocTab(Docs.Create.KVPDocument(this.props.Document, { _width: 300, _height: 300 }), "onRight"), icon: "layer-group" }); - cm.addItem({ description: "Help...", noexpand: true, subitems: helpItems, icon: "question" }); + //cm.addItem({ description: "Help...", noexpand: true, subitems: helpItems, icon: "question" }); // const existingAcls = cm.findByDescription("Privacy..."); // const aclItems: ContextMenuProps[] = existingAcls && "subitems" in existingAcls ? existingAcls.subitems : []; |