diff --git a/ui/packages/consul-ui/app/components/consul/service/search-bar/index.hbs b/ui/packages/consul-ui/app/components/consul/service/search-bar/index.hbs index df7abdc695..c88651b5eb 100644 --- a/ui/packages/consul-ui/app/components/consul/service/search-bar/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/service/search-bar/index.hbs @@ -134,7 +134,14 @@ {{#let components.Option as |Option|}} {{#if (gt @sources.length 0)}} - {{#each @sources as |source|}} + + {{#each this.sortedSources as |source|}} {{/if}} {{/let}} diff --git a/ui/packages/consul-ui/app/components/consul/service/search-bar/index.js b/ui/packages/consul-ui/app/components/consul/service/search-bar/index.js index 0db51f3404..700434c900 100644 --- a/ui/packages/consul-ui/app/components/consul/service/search-bar/index.js +++ b/ui/packages/consul-ui/app/components/consul/service/search-bar/index.js @@ -8,4 +8,14 @@ export default class ConsulServiceSearchBar extends Component { return ['passing', 'warning', 'critical', 'empty']; } } + + get sortedSources() { + const sources = this.args.sources || []; + + if (sources.includes('consul-api-gateway')) { + return [...sources.filter((s) => s !== 'consul-api-gateway'), 'consul-api-gateway']; + } else { + return sources; + } + } }