mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-10-24 21:41:16 +00:00
Sort access keys by name (#294)
This commit is contained in:
parent
d1c896627c
commit
ccb05fbcfb
1 changed files with 15 additions and 1 deletions
|
|
@ -320,7 +320,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<!-- rows for each access key -->
|
||||
<template is="dom-repeat" items="{{accessKeyRows}}" filter="isRegularConnection">
|
||||
<template is="dom-repeat" items="{{accessKeyRows}}" filter="isRegularConnection" sort='sort'>
|
||||
<div class="access-key-row">
|
||||
<span class="access-key-container">
|
||||
<img class="access-key-icon" src="images/key-avatar.svg">
|
||||
|
|
@ -592,6 +592,20 @@
|
|||
isRegularConnection: function(item) {
|
||||
return item.id !== MY_CONNECTION_USER_ID;
|
||||
},
|
||||
// https://stackoverflow.com/a/46119203/1298144
|
||||
sort: function(a, b) {
|
||||
var nameA = a.name.toUpperCase();
|
||||
var nameB = b.name.toUpperCase();
|
||||
if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// names must be equal
|
||||
return 0;
|
||||
},
|
||||
deleteServer: function() {
|
||||
this.fire('DeleteServerRequested');
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue