aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-06-21 10:17:31 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-06-21 10:17:31 -0400
commit899a6bdeb8ab0ce749328fc6093496daada1c4ad (patch)
treee041acf35883185bfe9f0245c5717981f6487ca4 /src
parented3bb0dc180e9fd70311936fa1a60fc10b69f5ad (diff)
sort groups in PropertiesView
Diffstat (limited to 'src')
-rw-r--r--src/client/views/PropertiesView.tsx10
1 files changed, 10 insertions, 0 deletions
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
@@ -413,6 +413,15 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
};
/**
+ * 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.
*/
@computed get sharingTable() {
@@ -459,6 +468,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
// 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));