mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 23:07:22 +00:00
feat: sort the event types in alphabetical order (#6400)
Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
parent
fd00ac533a
commit
5dddbe7a8b
@ -173,7 +173,43 @@ export class FilterEventsComponent implements OnInit {
|
|||||||
return this.adminService
|
return this.adminService
|
||||||
.listEventTypes(req)
|
.listEventTypes(req)
|
||||||
.then((list) => {
|
.then((list) => {
|
||||||
this.eventTypes = list.eventTypesList ?? [];
|
this.eventTypes =
|
||||||
|
list.eventTypesList.sort((a, b) => {
|
||||||
|
if (b.localized && b.localized.localizedMessage) {
|
||||||
|
if (a.localized && a.localized.localizedMessage) {
|
||||||
|
if (a.localized.localizedMessage < b.localized.localizedMessage) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.localized.localizedMessage > b.localized.localizedMessage) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (a.type < b.localized.localizedMessage) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.type > b.localized.localizedMessage) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (a.localized && a.localized.localizedMessage) {
|
||||||
|
if (a.localized.localizedMessage < b.type) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.localized.localizedMessage > b.type) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (a.type < b.type) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.type > b.type) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}) ?? [];
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.toast.showError(error);
|
this.toast.showError(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user