1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

fix(registry): fix order of registries in drop down menu EE-1939 (#5960)

Co-authored-by: Prabhat Khera <prabhat.khera@portainer.io>
This commit is contained in:
Richard Wei 2021-11-30 11:03:08 +13:00 committed by GitHub
parent 1e80061186
commit c24dc3112b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,10 +80,14 @@ class porImageRegistryController {
let showDefaultRegistry = false;
this.registries = await this.EndpointService.registries(this.endpoint.Id, this.namespace);
// Sort the registries by Name
this.registries.sort((a, b) => a.Name.localeCompare(b.Name));
// hide default(anonymous) dockerhub registry if user has an authenticated one
if (!this.registries.some((registry) => registry.Type === RegistryTypes.DOCKERHUB)) {
showDefaultRegistry = true;
this.registries.push(this.defaultRegistry);
// Add dockerhub on top
this.registries.splice(0, 0, this.defaultRegistry);
}
const id = this.model.Registry.Id;