From cdf40a6ae6414a4a012efd9a5e2b05f45929de99 Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Mon, 18 Jul 2022 14:22:17 +0200 Subject: [PATCH] ui: wan federation message dc-dropdown (#13753) * Only display dc dropdown when more than one dc is available * Add wan federation message to dc dropdown * Add test for conditionally displaying dc dropdown * Move single datacenter indicator into datacenter selector * Add `DATACENTERS` seperator dc dropdown * "fix" unnecessary margin-top in dc dropdown --- .../consul/datacenter/selector/index.hbs | 97 +++++++++++-------- .../app/components/hashicorp-consul/index.hbs | 12 +-- .../components/hashicorp-consul/index.scss | 11 +++ .../components/main-nav-vertical/layout.scss | 2 +- .../consul/datacenter/selector-test.js | 49 ++++++++++ .../components/hashicorp-consul-test.js | 3 +- 6 files changed, 123 insertions(+), 51 deletions(-) create mode 100644 ui/packages/consul-ui/tests/integration/components/consul/datacenter/selector-test.js diff --git a/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs b/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs index 97194bf298..f54b4606bf 100644 --- a/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs @@ -2,49 +2,60 @@ class="dcs" data-test-datacenter-menu > - - - {{@dc.Name}} - - - - - {{#each menu.items as |item|}} - - + + {{@dc.Name}} + + + +

+ Datacenters shown in this dropdown are available through WAN Federation. +

+ + + DATACENTERS + + {{#each menu.items as |item|}} + - {{item.Name}} - {{#if item.Primary}} - Primary - {{/if}} - {{#if item.Local}} - Local - {{/if}} -
-
- {{/each}} -
-
-
+ + {{item.Name}} + {{#if item.Primary}} + Primary + {{/if}} + {{#if item.Local}} + Local + {{/if}} + + + {{/each}} + + + + {{else}} +
  • {{@dcs.firstObject.Name}}
  • + {{/if}} diff --git a/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs b/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs index 07296d4fe1..4d7a040ff9 100644 --- a/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs +++ b/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs @@ -87,12 +87,12 @@ <:main-nav>