diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/SharingManager.tsx | 1 | ||||
-rw-r--r-- | src/client/views/DocumentDecorations.scss | 6 | ||||
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 9 | ||||
-rw-r--r-- | src/client/views/PropertiesView.scss | 35 | ||||
-rw-r--r-- | src/client/views/PropertiesView.tsx | 30 | ||||
-rw-r--r-- | src/fields/util.ts | 1 |
6 files changed, 49 insertions, 33 deletions
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index d7cc352b7..d9ab0cb5f 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -179,7 +179,6 @@ export class SharingManager extends React.Component<{}> { } else { if (!doc[acl] || doc[acl] === SharingPermissions.None) doc.numUsersShared = NumCast(doc.numUsersShared, 0) + 1; } - distributeAcls(acl, permission as SharingPermissions, doc, undefined, undefined, isDashboard); this.setDashboardBackground(doc, permission as SharingPermissions); if (permission !== SharingPermissions.None) return Doc.AddDocToList(sharingDoc, storage, doc); diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss index 32bcc872a..a5ebe9d58 100644 --- a/src/client/views/DocumentDecorations.scss +++ b/src/client/views/DocumentDecorations.scss @@ -230,14 +230,14 @@ $resizeHandler: 8px; &:hover { opacity: 1; } - .documentDecorations-shareNone, - .documentDecorations-shareAdmin{ + .documentDecorations-shareNone{ width: calc(100% + 10px); background: grey; color: rgb(71, 71, 71); border-color: rgb(71, 71, 71); } - .documentDecorations-shareEdit{ + .documentDecorations-shareEdit, + .documentDecorations-shareAdmin{ width: calc(100% + 10px); background: rgb(235, 235, 145); color: rgb(75, 75, 5); diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 9aca8c339..a6b2db8f3 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -11,7 +11,7 @@ import { InkField } from '../../fields/InkField'; import { RichTextField } from '../../fields/RichTextField'; import { ScriptField } from '../../fields/ScriptField'; import { Cast, NumCast, StrCast } from '../../fields/Types'; -import { GetEffectiveAcl } from '../../fields/util'; +import { GetEffectiveAcl, normalizeEmail } from '../../fields/util'; import { aggregateBounds, emptyFunction, numberValue, returnFalse, setupMoveUpEvents, Utils } from '../../Utils'; import { Docs } from '../documents/Documents'; import { DocumentType } from '../documents/DocumentTypes'; @@ -650,7 +650,6 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P } else { const rotCtr = [docwidth / 2, docheight / 2]; const tlRotated = Utils.rotPt(-rotCtr[0], -rotCtr[1], (NumCast(doc._rotation) / 180) * Math.PI); - const maxHeight = doc.nativeHeightUnfrozen || !nheight ? 0 : Math.max(nheight, NumCast(doc.scrollHeight, NumCast(doc[docView.LayoutFieldKey + '-scrollHeight']))) * docView.NativeDimScaling(); dH && (doc._height = actualdH > maxHeight && maxHeight ? maxHeight : actualdH); dW && (doc._width = actualdW); @@ -756,9 +755,13 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P // sharing const docShareMode = Doc.GetProto(seldocview.rootDoc)['acl-Public']; + // const docShareMode = Doc.GetProto(seldocview.rootDoc)['acl-'+normalizeEmail(Doc.CurrentUserEmail)]; const shareMode = StrCast(docShareMode); var shareSymbolIcon = null; switch (shareMode) { + case 'Admin': + shareSymbolIcon = '⬢ '; + break; case 'Edit': shareSymbolIcon = '⬢ '; break; @@ -799,7 +802,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P // const collectionAcl = docView.props.docViewPath()?.lastElement() ? GetEffectiveAcl(docView.props.docViewPath().lastElement().rootDoc[DataSym]) : AclEdit; // return docView.rootDoc.stayInCollection || (collectionAcl !== AclAdmin && collectionAcl !== AclEdit && GetEffectiveAcl(docView.rootDoc) !== AclAdmin); const effectiveAcl = GetEffectiveAcl(Doc.GetProto(seldocview.rootDoc)); - return docView.rootDoc.stayInCollection || (effectiveAcl !== AclAdmin && GetEffectiveAcl(docView.rootDoc) !== AclAdmin); + return docView.rootDoc.stayInCollection || (effectiveAcl !== AclAdmin && GetEffectiveAcl(docView.rootDoc) !== AclAdmin && effectiveAcl !== AclEdit && GetEffectiveAcl(docView.rootDoc) !== AclEdit); }); const topBtn = (key: string, icon: string, pointerDown: undefined | ((e: React.PointerEvent) => void), click: undefined | ((e: any) => void), title: string) => ( <Tooltip key={key} title={<div className="dash-tooltip">{title}</div>} placement="top"> diff --git a/src/client/views/PropertiesView.scss b/src/client/views/PropertiesView.scss index 71107a5f9..3cf7f2546 100644 --- a/src/client/views/PropertiesView.scss +++ b/src/client/views/PropertiesView.scss @@ -164,23 +164,29 @@ margin-right: 10px; width: 92%; - & .propertiesView-shareDropDownNone, - .propertiesView-shareDropDownAdmin{ - padding: 5px; + & .propertiesView-shareDropDownNone{ + height: 16px; + padding: 0px; + padding-left: 3px; background: grey; color: rgb(71, 71, 71); border-radius: 6px; border: 1px solid rgb(71, 71, 71); } - & .propertiesView-shareDropDownEdit{ - padding: 5px; + & .propertiesView-shareDropDownEdit, + .propertiesView-shareDropDownAdmin{ + height: 16px; + padding: 0px; + padding-left: 3px; background: rgb(235, 235, 145); color: rgb(75, 75, 5); border-radius: 6px; border: 1px solid rgb(75, 75, 5); } & .propertiesView-shareDropDownAugment{ - padding: 5px; + height: 16px; + padding: 0px; + padding-left: 3px; background: rgb(160, 230, 160); color:rgb(19, 80, 19); border-radius: 6px; @@ -188,14 +194,18 @@ } & .propertiesView-shareDropDownView{ - padding: 5px; + height: 16px; + padding: 0px; + padding-left: 3px; background: rgb(161, 161, 238); color: rgb(25, 25, 101); border-radius: 6px; border: 1px solid rgb(25, 25, 101); } & .propertiesView-shareDropDownNot-Shared{ - padding: 5px; + height: 16px; + padding: 0px; + padding-left: 3px; background: rgb(210, 143, 143); color: rgb(138, 47, 47); border-radius: 6px; @@ -360,13 +370,13 @@ } .expansion-button { - margin-left: -20; + margin-left: 0; .expansion-button-icon { width: 11px; height: 11px; color: black; - margin-left: 27px; + margin-left: -15px; &:hover { color: rgb(131, 131, 131); @@ -410,6 +420,8 @@ .propertiesView-sharingTable-item-permission { display: flex; + position: fixed; + right: 30px; align-items: flex-end; margin-left: auto; } @@ -427,9 +439,6 @@ background: inherit; text-align: justify; // for Edge text-align-last: end; - &:hover { - cursor: pointer; - } } .propertiesView-fields { diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index a5ac58f75..fb21c2db2 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -319,8 +319,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { .filter(permission => !Doc.noviceMode || ![SharingPermissions.View].includes(permission as any)) .map(permission => ( <option className="propertiesView-permisssions-select" key={permission} value={permission}> - {' '} - {permission}{' '} + {permission} </option> ))} </select> @@ -379,16 +378,19 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { </div> {/* {name !== "Me" ? this.notifyIcon : null} */} <div className="propertiesView-sharingTable-item-permission"> - {admin && permission !== 'Owner' ? this.getPermissionsSelect(name, permission) : permission} + {this.colorACLDropDown(name, admin, permission, showExpansionIcon)} {(permission === 'Owner' && name == 'Me') || showExpansionIcon ? this.expansionIcon : null} </div> </div> ); } - publicACLDropDown(admin: boolean, permission: string, showExpansionIcon?: boolean) { + colorACLDropDown(name: string, admin: boolean, permission: string, showExpansionIcon?: boolean) { var dropDownText = ''; switch (StrCast(permission)) { + case 'Admin': + dropDownText = '⬢ '; + break; case 'Edit': dropDownText = '⬢ '; break; @@ -402,15 +404,15 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { dropDownText = '▲ '; break; } - return ( <div> <div className={'propertiesView-shareDropDown'}> <div className={`propertiesView-shareDropDown${permission}`}> <div className="propertiesView-shareDropDown"> {' '} - {dropDownText} {admin && permission !== 'Owner' ? this.getPermissionsSelect('Public', permission) : permission} - {permission === 'Owner' || showExpansionIcon ? this.expansionIcon : null} + {dropDownText} + {admin && permission !== 'Owner' ? this.getPermissionsSelect(name, permission) : permission} + {/* {(permission === 'Owner' && name == 'Me') || showExpansionIcon ? this.expansionIcon : null} */} </div> </div> </div> @@ -437,9 +439,11 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { const docs = SelectionManager.Views().length < 2 ? [this.layoutDocAcls ? docToUse : docToUse?.[DataSym]] : SelectionManager.Views().map(docView => (this.layoutDocAcls ? docView.props.Document : docView.props.Document[DataSym])); const target = docs[0]; - const effectiveAcls = GetEffectiveAcl(target); - const showAdmin = effectiveAcls == AclAdmin || docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)] == 'Owner'; - + // const effectiveAcls = GetEffectiveAcl(target); + // const showAdmin = effectiveAcls == AclAdmin || docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)] == 'Owner'; + const curUserAcl = docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)] + const showAdmin = curUserAcl == 'Admin' || curUserAcl == 'Owner' + // users in common between all docs // const commonKeys: string[] = intersection(...docs.map(doc => doc?.[AclSym] && Object.keys(doc[AclSym]).filter(key => key !== 'acl-Me'))); // const ownerSame = Doc.CurrentUserEmail !== target.author && docs.filter(doc => doc).every(doc => doc.author === docs[0].author); @@ -480,11 +484,11 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { return ( <div> {' '} - Sharing Mode - <div>{this.publicACLDropDown(showAdmin, StrCast(target['acl-Public']), false)}</div> + Sharing Mode for Public / Guest Users + <div>{this.colorACLDropDown('Public', showAdmin, StrCast(target['acl-Public']), false)}</div> <div> {' '} - <br></br> Who has access to the Dashboard?{' '} + <br></br> Sharing Modes for Individual Users and Groups with Access to the Dashboard{' '} </div> <div className="propertiesView-sharingTable">{<div> {tableEntries}</div>}</div> </div> diff --git a/src/fields/util.ts b/src/fields/util.ts index 3860decc9..5e925cd7e 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -37,6 +37,7 @@ import { RefField } from './RefField'; import { SchemaHeaderField } from './SchemaHeaderField'; import { ComputedField } from './ScriptField'; import { ScriptCast, StrCast } from './Types'; +import { convertCompilerOptionsFromJson } from 'typescript'; function _readOnlySetter(): never { throw new Error("Documents can't be modified in read-only mode"); |