From aaad7692ce2e9ddb88381d497b29999363770051 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 4 Jul 2022 18:49:21 +0100 Subject: [PATCH] ui: Fixup peering imported/exported service counts (#13662) * ui: Fix up peer states and counts in the listing --- .../peerings/service-count/index.hbs | 5 ---- .../peerings/service-count/index.js | 29 ------------------- .../app/templates/dc/peers/index.hbs | 27 +++++++++++++++-- 3 files changed, 25 insertions(+), 36 deletions(-) delete mode 100644 ui/packages/consul-ui/app/components/peerings/service-count/index.hbs delete mode 100644 ui/packages/consul-ui/app/components/peerings/service-count/index.js diff --git a/ui/packages/consul-ui/app/components/peerings/service-count/index.hbs b/ui/packages/consul-ui/app/components/peerings/service-count/index.hbs deleted file mode 100644 index 1c81bfe215..0000000000 --- a/ui/packages/consul-ui/app/components/peerings/service-count/index.hbs +++ /dev/null @@ -1,5 +0,0 @@ -{{#if this.count}} -
- {{this.text}} -
-{{/if}} diff --git a/ui/packages/consul-ui/app/components/peerings/service-count/index.js b/ui/packages/consul-ui/app/components/peerings/service-count/index.js deleted file mode 100644 index 4b455cb869..0000000000 --- a/ui/packages/consul-ui/app/components/peerings/service-count/index.js +++ /dev/null @@ -1,29 +0,0 @@ -import Component from '@glimmer/component'; -import { inject as service } from '@ember/service'; - -export default class PeeringsServiceCount extends Component { - @service intl; - - get count() { - const { peering, kind } = this.args; - - return peering[`${kind.capitalize()}ServiceCount`]; - } - - get text() { - const { kind } = this.args; - const { intl, count } = this; - - return intl.t(`routes.dc.peers.index.detail.${kind}.count`, { count }); - } - - get tooltipText() { - const { - kind, - peering: { name }, - } = this.args; - const { intl } = this; - - return intl.t(`routes.dc.peers.index.detail.${kind}.tooltip`, { name }); - } -} diff --git a/ui/packages/consul-ui/app/templates/dc/peers/index.hbs b/ui/packages/consul-ui/app/templates/dc/peers/index.hbs index c648d8fbef..9b040c12fe 100644 --- a/ui/packages/consul-ui/app/templates/dc/peers/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/peers/index.hbs @@ -77,8 +77,31 @@ as |sort filters items|}}
- - + +
+ {{t 'routes.dc.peers.index.detail.imported.count' + count=(format-number item.ImportedServiceCount) + }} +
+ +
+ {{t 'routes.dc.peers.index.detail.exported.count' + count=(format-number item.ExportedServiceCount) + }} +
+