diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-06-16 13:40:12 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-06-16 13:40:12 -0400 |
commit | 3be20e0d7555e68662b7b63359082c9f1c3421da (patch) | |
tree | 879de8fbba20e0d6fba615cdaa09af25f2e18380 /src | |
parent | f101fd2a3ba25c9fc417d8097f1f10ca622f3dd0 (diff) |
fixed groups displaying in PropertiesView (sorted by the selected doc rather than the open dashboard)
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/PropertiesView.tsx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 8648d84c2..f5a39898e 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -462,13 +462,13 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { // adds each user to usersAdded SharingManager.Instance.users.forEach(eachUser => { - var userOnDashboard = true; - if (Doc.ActiveDashboard) { - if (Doc.ActiveDashboard['acl-' + normalizeEmail(eachUser.user.email)] == '' || Doc.ActiveDashboard['acl-' + normalizeEmail(eachUser.user.email)] == undefined) { - userOnDashboard = false; + var userOnDoc = true; + if (this.selectedDoc) { + if (this.selectedDoc['acl-' + normalizeEmail(eachUser.user.email)] == '' || this.selectedDoc['acl-' + normalizeEmail(eachUser.user.email)] == undefined) { + userOnDoc = false; } } - if (userOnDashboard && !usersAdded.includes(eachUser.user.email) && eachUser.user.email != 'Public' && eachUser.user.email != target.author) { + if (userOnDoc && !usersAdded.includes(eachUser.user.email) && eachUser.user.email != 'Public' && eachUser.user.email != target.author) { // tableEntries.unshift(this.sharingItem(eachUser.user.email, showAdmin, permission, false)); // adds each user usersAdded.push(eachUser.user.email); } @@ -491,13 +491,10 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { // adds groups const groupList = GroupManager.Instance?.allGroups || []; - const groups = groupList.slice().sort(this.sortGroups); - const commonKeys = intersection(...docs.map(doc => (this.layoutDocAcls ? doc : doc[DocData])).map(doc => doc?.[DocAcl] && Object.keys(doc[DocAcl]))); - const groupListMap: (Doc | { title: string })[] = groups.filter(({ title }) => (docs.length > 1 ? commonKeys.includes(`acl-${normalizeEmail(StrCast(title))}`) : true)); - groupListMap.map(group => { - if (group.title != 'Public' && Doc.ActiveDashboard) { + groupList.map(group => { + if (group.title != 'Public' && this.selectedDoc) { const groupKey = 'acl-' + normalizeEmail(StrCast(group.title)); - if (Doc.ActiveDashboard[groupKey] != '' && Doc.ActiveDashboard[groupKey] != undefined) { + if (this.selectedDoc[groupKey] != '' && this.selectedDoc[groupKey] != undefined) { const permission = StrCast(target[groupKey]); tableEntries.unshift(this.sharingItem(StrCast(group.title), showAdmin, permission, false)); } |