sort list idps by alphabest (#5599)

This commit is contained in:
Hoang Nguyen 2021-10-22 00:24:23 +07:00 committed by GitHub
parent e63234e8fc
commit 298774e020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,6 +202,11 @@ export default {
api('listIdps').then(response => {
if (response) {
this.idps = response.listidpsresponse.idp || []
this.idps.sort(function (a, b) {
if (a.orgName < b.orgName) { return -1 }
if (a.orgName > b.orgName) { return 1 }
return 0
})
this.selectedIdp = this.idps[0].id || ''
}
})