fix sort
This commit is contained in:
parent
54e8986be9
commit
4cd6a0028b
@ -29,7 +29,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
this.permissions = data.sort((a, b) => {
|
this.permissions = data.sort((a, b) => {
|
||||||
const isAsc = sort.direction === 'asc';
|
const isAsc = sort.direction === 'asc';
|
||||||
switch(sort.active) {
|
switch(sort.active) {
|
||||||
case 'name': return this.compare(this.i18n.get('permissions.' + a.name, []), this.i18n.get('permissions.' + b.name, []), isAsc);
|
case 'name': return this.compare(this.i18n.get('apps.' + a.name + '.title', []), this.i18n.get('apps.' + b.name + '.title', []), isAsc);
|
||||||
case 'starts': return this.compare(a.starts, b.starts, isAsc);
|
case 'starts': return this.compare(a.starts, b.starts, isAsc);
|
||||||
case 'expires': return this.compare(a.expires, b.expires, isAsc);
|
case 'expires': return this.compare(a.expires, b.expires, isAsc);
|
||||||
default: return 0;
|
default: return 0;
|
||||||
|
@ -28,7 +28,7 @@ export class QuotasComponent implements OnInit {
|
|||||||
this.quotas = data.sort((a, b) => {
|
this.quotas = data.sort((a, b) => {
|
||||||
const isAsc = sort.direction === 'asc';
|
const isAsc = sort.direction === 'asc';
|
||||||
switch(sort.active) {
|
switch(sort.active) {
|
||||||
case 'name': return this.compare(this.i18n.get('quotas.' + a.name, []), this.i18n.get('quotas.' + b.name,[]), isAsc);
|
case 'name': return this.compare(this.i18n.get('apps.' + a.name + '.title', []), this.i18n.get('apps.' + b.name + '.title', []), isAsc);
|
||||||
case 'value': return this.compare(a.value, b.value, isAsc);
|
case 'value': return this.compare(a.value, b.value, isAsc);
|
||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user