mirror of https://github.com/portainer/portainer
fix(registry): fix order of registries in drop down menu EE-1939 (#5960)
Co-authored-by: Prabhat Khera <prabhat.khera@portainer.io>pull/6079/head
parent
1e80061186
commit
c24dc3112b
|
@ -80,10 +80,14 @@ class porImageRegistryController {
|
||||||
let showDefaultRegistry = false;
|
let showDefaultRegistry = false;
|
||||||
this.registries = await this.EndpointService.registries(this.endpoint.Id, this.namespace);
|
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
|
// hide default(anonymous) dockerhub registry if user has an authenticated one
|
||||||
if (!this.registries.some((registry) => registry.Type === RegistryTypes.DOCKERHUB)) {
|
if (!this.registries.some((registry) => registry.Type === RegistryTypes.DOCKERHUB)) {
|
||||||
showDefaultRegistry = true;
|
showDefaultRegistry = true;
|
||||||
this.registries.push(this.defaultRegistry);
|
// Add dockerhub on top
|
||||||
|
this.registries.splice(0, 0, this.defaultRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = this.model.Registry.Id;
|
const id = this.model.Registry.Id;
|
||||||
|
|
Loading…
Reference in New Issue