diff options
| author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-06 19:22:37 -0500 |
|---|---|---|
| committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-06 19:22:37 -0500 |
| commit | 915bb3796541116897dfc016a0ed3253c2f856cc (patch) | |
| tree | 7791ad12c815e98b929d09c19af925893b00ebd1 | |
| parent | 59a03f711c48aa51a53759dcece88cd6d6204010 (diff) | |
temporary fix for novice tools
| -rw-r--r-- | src/client/views/PropertiesButtons.tsx | 11 | ||||
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 11 | ||||
| -rw-r--r-- | src/client/views/nodes/FontIconBox.tsx | 5 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx index 29afd447f..837919a60 100644 --- a/src/client/views/PropertiesButtons.tsx +++ b/src/client/views/PropertiesButtons.tsx @@ -427,6 +427,17 @@ export class PropertiesButtons extends React.Component<{}, {}> { @action deleteDocument = () => { this.selectedDocumentView?.props.ContainingCollectionView?.removeDocument(this.selectedDocumentView?.props.Document); + const recent = Cast(Doc.UserDoc().myRecentlyClosed, Doc) as Doc; + const selected = SelectionManager.SelectedDocuments().slice(); + SelectionManager.DeselectAll(); + + selected.map(dv => { + const effectiveAcl = GetEffectiveAcl(dv.props.Document); + if (effectiveAcl === AclEdit || effectiveAcl === AclAdmin) { // deletes whatever you have the right to delete + recent && Doc.AddDocToList(recent, "data", dv.props.Document, undefined, true, true); + dv.props.removeDocument?.(dv.props.Document); + } + }); } @computed diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index b9e685b44..711ca8935 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -571,6 +571,17 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu } else { SelectionManager.DeselectAll(); this.props.removeDocument?.(this.props.Document); + const recent = Cast(Doc.UserDoc().myRecentlyClosed, Doc) as Doc; + const selected = SelectionManager.SelectedDocuments().slice(); + SelectionManager.DeselectAll(); + + selected.map(dv => { + const effectiveAcl = GetEffectiveAcl(dv.props.Document); + if (effectiveAcl === AclEdit || effectiveAcl === AclAdmin) { // deletes whatever you have the right to delete + recent && Doc.AddDocToList(recent, "data", dv.props.Document, undefined, true, true); + dv.props.removeDocument?.(dv.props.Document); + } + }); } } diff --git a/src/client/views/nodes/FontIconBox.tsx b/src/client/views/nodes/FontIconBox.tsx index 71832b0dc..c465bb3bd 100644 --- a/src/client/views/nodes/FontIconBox.tsx +++ b/src/client/views/nodes/FontIconBox.tsx @@ -59,6 +59,8 @@ export class FontIconBox extends DocComponent<FieldViewProps, FontIconDocument>( } render() { + + console.log(Doc.UserDoc()); const label = StrCast(this.rootDoc.label, StrCast(this.rootDoc.title)); const color = StrCast(this.layoutDoc.color, this._foregroundColor); const backgroundColor = StrCast(this.layoutDoc._backgroundColor, StrCast(this.rootDoc.backgroundColor, this.props.backgroundColor?.(this.rootDoc))); @@ -67,7 +69,6 @@ export class FontIconBox extends DocComponent<FieldViewProps, FontIconDocument>( style={{ boxShadow: this.layoutDoc.ischecked ? `4px 4px 12px black` : undefined, backgroundColor: this.layoutDoc.iconShape === "square" ? backgroundColor : "", - display: (this.layoutDoc.developerFeature && Doc.UserDoc().noviceMode) ? "none" : "" }}> <div className="menuButton-wrap"> {<FontAwesomeIcon className={`menuButton-icon-${shape}`} icon={StrCast(this.dataDoc.icon, "user") as any} color={color} @@ -75,7 +76,7 @@ export class FontIconBox extends DocComponent<FieldViewProps, FontIconDocument>( {!label ? (null) : <div className="fontIconBox-label" style={{ color, backgroundColor }}> {label} </div>} </div> </button>; - return !this.layoutDoc.toolTip || (this.layoutDoc.developerFeature && Doc.UserDoc().noviceMode) ? button : + return (this.layoutDoc.developerFeature && Doc.UserDoc().noviceMode) ? (null) : !this.layoutDoc.toolTip ? button : <Tooltip title={<div className="dash-tooltip">{StrCast(this.layoutDoc.toolTip)}</div>}> {button} </Tooltip>; |
