diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/SharingManager.scss | 2 | ||||
-rw-r--r-- | src/client/util/SharingManager.tsx | 24 | ||||
-rw-r--r-- | src/client/views/PropertiesView.tsx | 9 |
3 files changed, 17 insertions, 18 deletions
diff --git a/src/client/util/SharingManager.scss b/src/client/util/SharingManager.scss index 3cab77816..aa1e11ef5 100644 --- a/src/client/util/SharingManager.scss +++ b/src/client/util/SharingManager.scss @@ -85,11 +85,11 @@ .layoutDoc-acls, .myDocs-acls { flex-direction: column; - margin-right: 12; label { font-weight: normal; font-style: italic; + padding-right: 12; } input { diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index 40a282db0..aa9fc4433 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -82,6 +82,7 @@ export class SharingManager extends React.Component<{}> { @observable private showGroupOptions: boolean = false; // // whether to show groups as options when sharing (in the react-select component) private populating: boolean = false; // whether the list of users is populating or not @observable private layoutDocAcls: boolean = false; // whether the layout doc or data doc's acls are to be used + @observable private overridePrivate: boolean = false; // whether child docs in a collection/dashboard should be changed to be less private @observable private myDocAcls: boolean = false; // whether the My Docs checkbox is selected or not // private get linkVisible() { @@ -161,10 +162,12 @@ export class SharingManager extends React.Component<{}> { const isDashboard = DocListCast(Doc.MyDashboards.data).indexOf(target) !== -1; // setting the same acl for a docs within the doc being shared - var childDocs = DocListCast(target.data) - childDocs.map(doc => { - this.setInternalSharing(recipient, permission, doc) - }) + if (this.overridePrivate){ + var childDocs = DocListCast(target.data) + childDocs.map(doc => { + this.setInternalSharing(recipient, permission, doc) + }) + } const docs = SelectionManager.Views().length < 2 ? [target] : SelectionManager.Views().map(docView => docView.props.Document); @@ -200,10 +203,12 @@ export class SharingManager extends React.Component<{}> { const isDashboard = DocListCast(Doc.MyDashboards.data).indexOf(target) !== -1; // setting the same acl for a docs within the doc being shared - var childDocs = DocListCast(target.data) - childDocs.map(doc => { - this.setInternalGroupSharing(group, permission, doc) - }) + if (this.overridePrivate){ + var childDocs = DocListCast(target.data) + childDocs.map(doc => { + this.setInternalGroupSharing(group, permission, doc) + }) + } const docs = SelectionManager.Views().length < 2 ? [target] : SelectionManager.Views().map(docView => docView.props.Document); @@ -275,7 +280,7 @@ export class SharingManager extends React.Component<{}> { const dashboards = DocListCast(Doc.MyDashboards.data); docs.forEach(doc => { const isDashboard = dashboards.indexOf(doc) !== -1; - this.shareFromPropertiesSidebar(shareWith, permission, DocListCast(doc.data)) + if (this.overridePrivate) this.shareFromPropertiesSidebar(shareWith, permission, DocListCast(doc.data)) if (GetEffectiveAcl(doc) === AclAdmin) distributeAcls(`acl-${shareWith}`, permission, doc, undefined, undefined, isDashboard); this.setDashboardBackground(doc, permission as SharingPermissions); }); @@ -648,6 +653,7 @@ export class SharingManager extends React.Component<{}> { <div className="acl-container"> {Doc.noviceMode ? null : ( <div className="layoutDoc-acls"> + <input type="checkbox" onChange={action(() => (this.overridePrivate = !this.overridePrivate))} checked={this.overridePrivate} /> <label>Override Private </label> <input type="checkbox" onChange={action(() => (this.layoutDocAcls = !this.layoutDocAcls))} checked={this.layoutDocAcls} /> <label>Layout</label> </div> )} diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 984c2dc04..94a6d5639 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -368,14 +368,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { @undoBatch changePermissions = (e: any, user: string) => { const docs = (SelectionManager.Views().length < 2 ? [this.selectedDoc] : SelectionManager.Views().map(dv => dv.props.Document)).filter(doc => doc).map(doc => (this.layoutDocAcls ? doc : DocCast(doc)[DataSym])); - if (user=="Public"){ - // docs[0]['acl-' +user] = e.currentTarget.value as SharingPermissions; - SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, docs); - } - else{ - - SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, docs); - } + SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, docs); }; /** |