From 20d217d825891cf29a432a048d1f8e7bc04d062a Mon Sep 17 00:00:00 2001 From: srichman333 Date: Wed, 14 Jun 2023 15:02:39 -0400 Subject: PropertiesView changes - colors on all permissions and fixed bug with when the drop down arrow is displayed --- src/client/views/PropertiesView.tsx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/client/views/PropertiesView.tsx') 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 { .filter(permission => !Doc.noviceMode || ![SharingPermissions.View].includes(permission as any)) .map(permission => ( ))} @@ -379,16 +378,19 @@ export class PropertiesView extends React.Component { {/* {name !== "Me" ? this.notifyIcon : null} */}
- {admin && permission !== 'Owner' ? this.getPermissionsSelect(name, permission) : permission} + {this.colorACLDropDown(name, admin, permission, showExpansionIcon)} {(permission === 'Owner' && name == 'Me') || showExpansionIcon ? this.expansionIcon : null}
); } - 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 { dropDownText = '▲ '; break; } - return (
{' '} - {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} */}
@@ -437,9 +439,11 @@ export class PropertiesView extends React.Component { 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 { return (
{' '} - Sharing Mode -
{this.publicACLDropDown(showAdmin, StrCast(target['acl-Public']), false)}
+ Sharing Mode for Public / Guest Users +
{this.colorACLDropDown('Public', showAdmin, StrCast(target['acl-Public']), false)}
{' '} -

Who has access to the Dashboard?{' '} +

Sharing Modes for Individual Users and Groups with Access to the Dashboard{' '}
{
{tableEntries}
}
-- cgit v1.2.3-70-g09d2