From b1a39fc12f8f6dbe260be80439c075605e2aaeee Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Thu, 21 Jul 2022 16:35:54 +0200 Subject: [PATCH] ui: Surface peer info in nodes.show view (#13832) --- .../consul/{service/peer-info => peer/info}/index.hbs | 6 +++--- .../consul/{service/peer-info => peer/info}/index.scss | 4 ++-- ui/packages/consul-ui/app/styles/components.scss | 2 +- ui/packages/consul-ui/app/templates/dc/nodes/show.hbs | 1 + ui/packages/consul-ui/app/templates/dc/services/show.hbs | 2 +- ui/packages/consul-ui/tests/pages/dc/services/show.js | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) rename ui/packages/consul-ui/app/components/consul/{service/peer-info => peer/info}/index.hbs (86%) rename ui/packages/consul-ui/app/components/consul/{service/peer-info => peer/info}/index.scss (71%) diff --git a/ui/packages/consul-ui/app/components/consul/service/peer-info/index.hbs b/ui/packages/consul-ui/app/components/consul/peer/info/index.hbs similarity index 86% rename from ui/packages/consul-ui/app/components/consul/service/peer-info/index.hbs rename to ui/packages/consul-ui/app/components/consul/peer/info/index.hbs index 5ed3fd4e86..25fbb2180b 100644 --- a/ui/packages/consul-ui/app/components/consul/service/peer-info/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/peer/info/index.hbs @@ -1,5 +1,5 @@ -{{#if @service.PeerName}} -
+{{#if @item.PeerName}} +
- Imported from {{@service.PeerName}} + Imported from {{@item.PeerName}}
{{/if}} diff --git a/ui/packages/consul-ui/app/components/consul/service/peer-info/index.scss b/ui/packages/consul-ui/app/components/consul/peer/info/index.scss similarity index 71% rename from ui/packages/consul-ui/app/components/consul/service/peer-info/index.scss rename to ui/packages/consul-ui/app/components/consul/peer/info/index.scss index 88be476faa..a9d57b1635 100644 --- a/ui/packages/consul-ui/app/components/consul/service/peer-info/index.scss +++ b/ui/packages/consul-ui/app/components/consul/peer/info/index.scss @@ -1,4 +1,4 @@ -.consul-service-peer-info { +.consul-peer-info { background: rgb(var(--gray-100)); color: rgb(var(--gray-600)); padding: 0px 8px; @@ -7,7 +7,7 @@ display: flex; align-items: center; - .consul-service-peer-info__description { + .consul-peer-info__description { margin-left: 4px; } } diff --git a/ui/packages/consul-ui/app/styles/components.scss b/ui/packages/consul-ui/app/styles/components.scss index e6dca0229e..f94f14d448 100644 --- a/ui/packages/consul-ui/app/styles/components.scss +++ b/ui/packages/consul-ui/app/styles/components.scss @@ -107,5 +107,5 @@ @import 'consul-ui/components/consul/peer'; @import 'consul-ui/components/peerings/badge'; @import 'consul-ui/components/consul/node/peer-info'; -@import 'consul-ui/components/consul/service/peer-info'; +@import 'consul-ui/components/consul/peer/info'; @import 'consul-ui/components/consul/peer/form'; diff --git a/ui/packages/consul-ui/app/templates/dc/nodes/show.hbs b/ui/packages/consul-ui/app/templates/dc/nodes/show.hbs index 47459c3996..ec7f464939 100644 --- a/ui/packages/consul-ui/app/templates/dc/nodes/show.hbs +++ b/ui/packages/consul-ui/app/templates/dc/nodes/show.hbs @@ -103,6 +103,7 @@ as |item tomography|}} + - + {{#if (not-eq item.Service.Kind 'mesh-gateway')}} diff --git a/ui/packages/consul-ui/tests/pages/dc/services/show.js b/ui/packages/consul-ui/tests/pages/dc/services/show.js index f0426a18a3..a1bc3ae94b 100644 --- a/ui/packages/consul-ui/tests/pages/dc/services/show.js +++ b/ui/packages/consul-ui/tests/pages/dc/services/show.js @@ -19,7 +19,7 @@ export default function( metricsAnchor: { href: attribute('href', '[data-test-metrics-anchor]'), }, - peer: text('[data-test-service-peer-info] [data-test-peer-name]'), + peer: text('[data-test-peer-info] [data-test-peer-name]'), tabs: tabs('tab', [ 'topology', 'instances',