mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
Sort organization filters alphabetically (#5117)
This commit is contained in:
parent
019aaf214b
commit
19626a7837
@ -138,12 +138,16 @@ export class VaultFilterService implements VaultFilterServiceAbstraction {
|
|||||||
orgs = orgs.slice(0, 1);
|
orgs = orgs.slice(0, 1);
|
||||||
}
|
}
|
||||||
if (orgs) {
|
if (orgs) {
|
||||||
|
const orgNodes: TreeNode<OrganizationFilter>[] = [];
|
||||||
orgs.filter(isNotProviderUser).forEach((org) => {
|
orgs.filter(isNotProviderUser).forEach((org) => {
|
||||||
const orgCopy = org as OrganizationFilter;
|
const orgCopy = org as OrganizationFilter;
|
||||||
orgCopy.icon = "bwi-business";
|
orgCopy.icon = "bwi-business";
|
||||||
const node = new TreeNode<OrganizationFilter>(orgCopy, headNode, orgCopy.name);
|
const node = new TreeNode<OrganizationFilter>(orgCopy, headNode, orgCopy.name);
|
||||||
headNode.children.push(node);
|
orgNodes.push(node);
|
||||||
});
|
});
|
||||||
|
// Sort organization nodes, then add them to the list after 'My Vault' and 'All Vaults' if present
|
||||||
|
orgNodes.sort((a, b) => a.node.name.localeCompare(b.node.name));
|
||||||
|
headNode.children.push(...orgNodes);
|
||||||
}
|
}
|
||||||
return headNode;
|
return headNode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user