From 899a6bdeb8ab0ce749328fc6093496daada1c4ad Mon Sep 17 00:00:00 2001 From: srichman333 Date: Wed, 21 Jun 2023 10:17:31 -0400 Subject: sort groups in PropertiesView --- src/client/views/PropertiesView.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index ab3864849..825a802cd 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -412,6 +412,15 @@ export class PropertiesView extends React.Component { return u1 > u2 ? -1 : u1 === u2 ? 0 : 1; }; + /** + * Sorting algorithm to sort groups. + */ + sortGroups = (group1: Doc, group2: Doc) => { + const g1 = StrCast(group1.title); + const g2 = StrCast(group2.title); + return g1 > g2 ? -1 : g1 === g2 ? 0 : 1; + }; + /** * @returns the sharing and permissions panel. */ @@ -459,6 +468,7 @@ export class PropertiesView extends React.Component { // adds groups const groupTableEntries: JSX.Element[] = []; const groupList = GroupManager.Instance?.allGroups || []; + groupList.sort(this.sortGroups) groupList.map(group => { if (group.title != 'Public' && this.selectedDoc) { const groupKey = 'acl-' + normalizeEmail(StrCast(group.title)); -- cgit v1.2.3-70-g09d2