From 4590467260a783e7d83adb20631c3b575d7e4cd3 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Tue, 30 Jun 2020 15:25:08 +0530 Subject: beginning sharing interface ui rework --- src/client/util/SharingManager.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/util') diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index 127ee33ce..903f6e23e 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -296,7 +296,7 @@ export default class SharingManager extends React.Component<{}> { onCloseButtonClick={action(() => this.groupToView = undefined)} /> : null} -
Manage the public link to {this.focusOn("this document...")}
+ {/*Manage the public link to {this.focusOn("this document...")}
{!this.linkVisible ? (null) :Privately share {this.focusOn("this document")} with an individual...
+Privately share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))} with an individual...
Privately share {this.focusOn("this document")} with a group...
+Privately share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))} with a group...
Manage the public link to {this.focusOn("this document...")}
@@ -327,76 +376,95 @@ export default class SharingManager extends React.Component<{}> {Privately share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))} with an individual...
-Share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))}
+Privately share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))} with a group...
-Share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))}
-Share {this.focusOn(StrCast(this.targetDoc?.title, "this document"))}
+ !docList.includes(d));
+ console.log("here");
+ const effectiveAcl = getEffectiveAcl(this.dataDoc);
if (added.length) {
- if (this.dataDoc[AclSym] === AclReadonly) {
+ if (effectiveAcl === AclReadonly) {
return false;
- } else if (this.dataDoc[AclSym] === AclAddonly) {
+ } else if (effectiveAcl === AclAddonly) {
added.map(doc => Doc.AddDocToList(targetDataDoc, this.annotationKey, doc));
} else {
added.map(doc => doc.context = this.props.Document);
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 26abd2529..0dfe9c52a 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -17,7 +17,7 @@ import { listSpec } from '../../../fields/Schema';
import { ComputedField, ScriptField } from '../../../fields/ScriptField';
import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from '../../../fields/Types';
import { ImageField } from '../../../fields/URLField';
-import { TraceMobx } from '../../../fields/util';
+import { TraceMobx, getEffectiveAcl } from '../../../fields/util';
import { emptyFunction, emptyPath, returnEmptyFilter, returnFalse, returnOne, returnZero, setupMoveUpEvents, Utils } from '../../../Utils';
import { Docs, DocUtils } from '../../documents/Documents';
import { DocumentType } from '../../documents/DocumentTypes';
@@ -132,10 +132,12 @@ export class CollectionView extends Touchable
!docList.includes(d));
- console.log("here");
const effectiveAcl = getEffectiveAcl(this.dataDoc);
if (added.length) {
if (effectiveAcl === AclReadonly) {
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index a3a023164..45d53a5f5 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -22,6 +22,7 @@ import { DocumentView } from "./nodes/DocumentView";
import { DocumentLinksButton } from "./nodes/DocumentLinksButton";
import PDFMenu from "./pdf/PDFMenu";
import { ContextMenu } from "./ContextMenu";
+import GroupManager from "../util/GroupManager";
const modifiers = ["control", "meta", "shift", "alt"];
type KeyHandler = (keycode: string, e: KeyboardEvent) => KeyControlInfo | Promise !docList.includes(d));
- const effectiveAcl = getEffectiveAcl(this.dataDoc);
+ const effectiveAcl = GetEffectiveAcl(this.dataDoc);
if (added.length) {
if (effectiveAcl === AclReadonly) {
return false;
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 032012b2d..7448ae002 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -17,7 +17,7 @@ import { listSpec } from '../../../fields/Schema';
import { ComputedField, ScriptField } from '../../../fields/ScriptField';
import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from '../../../fields/Types';
import { ImageField } from '../../../fields/URLField';
-import { TraceMobx, getEffectiveAcl } from '../../../fields/util';
+import { TraceMobx, GetEffectiveAcl } from '../../../fields/util';
import { emptyFunction, emptyPath, returnEmptyFilter, returnFalse, returnOne, returnZero, setupMoveUpEvents, Utils } from '../../../Utils';
import { Docs, DocUtils } from '../../documents/Documents';
import { DocumentType } from '../../documents/DocumentTypes';
@@ -132,7 +132,7 @@ export class CollectionView extends Touchable
+ { this.toggle("solidFill"); this.editProperties(this._currFill, "fill"); })} />
+ Solid Fill
+
+
+ {this._solidFill ? "Color" : ""}
+ {this._solidFill ? this.fillButton : ""}
+ {this._fillBtn && this._solidFill ? this.fillPicker : ""}
+
+
+
+ { this.toggle("arrowEnd"); this.editProperties(this._arrowEnd ? "arrowEnd" : "none", "arrowEnd"); })} />
+ Arrow End
+
>;
+ const lineCheck =
+ { this.toggle("solidLine"); this.editProperties(this._currColor, "color"); this.editProperties("0", "dash"); })} />
+ Solid Line
+
+ { this.toggle("dashLine"); this.editProperties(this._currColor, "color"); this.editProperties("2", "dash"); })} />
+ Dash Line
+
+
+ {(this._solidLine || this._dashLine) ? "Color" : ""}
+ {(this._solidLine || this._dashLine) ? this.lineButton : ""}
+ {this._lineBtn && (this._solidLine || this._dashLine) ? this.linePicker : ""}
+
+ {(this._solidLine || this._dashLine) ? "Width" : ""}
+ {(this._solidLine || this._dashLine) ? this.widthInput : ""}
+
+
+ {(this._solidLine || this._dashLine) ? arrows : ""}
+
+
+
+
+
+ Width {this.sizeWidthInput}
+
+
+
+ { this.toggle("lock"); })} />
+ Lock Ratio
+
+
+
+
+ Rotation {this.rotationInput}
+
+
+
+
+
+
+
+ Vertical {this.positionVerticalInput}
+
+
+
+
+
+
>;
+ return fillButton;
+ }
+ @computed get fillPicker() {
+ const fillPicker =
+
>;
+ return lineButton;
+ }
+ @computed get linePicker() {
+ const linePicker =
+ >;
+ return widthInput;
+ }
+ @computed get sizeHeightInput() {
+ const sizeHeightInput = <>
+ this.onChange(e.target.value, "sizeHeight")}
+ autoFocus>
+
+
+
+ >;
+ return sizeHeightInput;
+ }
+
+ @computed get sizeWidthInput() {
+ const sizeWidthInput = <>
+ this.onChange(e.target.value, "sizeWidth")}
+ autoFocus>
+
+
+ >;
+ return sizeWidthInput;
+ }
+
+ @computed get rotationInput() {
+ const rotationInput =
+ <>
+ this.onChange(e.target.value, "rotation")}
+ autoFocus>
+
+
+ >;
+ return rotationInput;
+ }
+
+ @computed get positionHorizontalInput() {
+ const positionHorizontalInput =
+ <> this.onChange(e.target.value, "positionHorizontal")}
+ autoFocus>
+
+
+ >;
+ return positionHorizontalInput;
+ }
+
+ @computed get positionVerticalInput() {
+ const positionVerticalInput =
+ <> this.onChange(e.target.value, "positionVertical")}
+ autoFocus>
+
+
+ >;
+ return positionVerticalInput;
+ }
+
+
+ @action
+ onChange = (val: string, property: string): void => {
+ if (!Number.isNaN(Number(val)) && Number(val) !== null && val !== " ") {
+
+ // if (val === "") {
+ // val = "0";
+ // }
+ switch (property) {
+ case "width":
+ this._currWidth = val;
+ if (val !== "") {
+ this.editProperties(this._currWidth, "width");
+ }
+ break;
+ case "sizeHeight":
+ this._currSizeHeight = val;
+ if (val !== "") {
+ this.editProperties(this._currSizeHeight, "heightSize");
+ }
+ break;
+ case "sizeWidth":
+ this._currSizeWidth = val;
+ if (val !== "") {
+
+ this.editProperties(this._currSizeWidth, "widthSize");
+ }
+ break;
+ case "rotation":
+
+ this._currRotation = val;
+ if (val !== "") {
+
+ this.rotate(Number(val));
+ }
+ break;
+ case "positionHorizontal":
+ this._currPositionHorizontal = val; if (val !== "") {
+
+ this.editProperties(this._currPositionHorizontal, "horizontal");
+ }
+
+ break;
+ case "positionVertical":
+ this._currPositionVertical = val;
+ if (val !== "") {
+
+ this.editProperties(this._currPositionVertical, "vertical");
+ }
+
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+
+
+
+ // @action
+ // changeWidth = (event: React.ChangeEvent
+
+
-
-