From 166f40837a85a4ff2ea1406918aa708b5ee422a5 Mon Sep 17 00:00:00 2001 From: Kenia <19161242+kaxcode@users.noreply.github.com> Date: Tue, 27 Oct 2020 10:25:23 -0400 Subject: [PATCH] ui: Remove downstream dc filter (#9040) * Remove datacenter filter and update props passed down * Merging changes fixed * Fixup tests for metrics link --- .../app/components/topology-metrics/index.hbs | 38 +++++++++---------- .../templates/dc/services/show/topology.hbs | 7 +--- .../lib/startup/templates/head.html.js | 2 +- .../tests/acceptance/dc/services/show.feature | 2 +- .../consul-ui/tests/pages/dc/services/show.js | 3 ++ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ui/packages/consul-ui/app/components/topology-metrics/index.hbs b/ui/packages/consul-ui/app/components/topology-metrics/index.hbs index 27f6390ed..87ebfe945 100644 --- a/ui/packages/consul-ui/app/components/topology-metrics/index.hbs +++ b/ui/packages/consul-ui/app/components/topology-metrics/index.hbs @@ -1,10 +1,10 @@ {{on-window 'resize' (action this.calculate)}} -
-{{#if (gt @downstreams.length 0)}} +
+{{#if (gt @topology.Downstreams.length 0)}}
-

{{@dc}}

+

{{@topology.Datacenter}}

Only showing downstreams within the current datacenter for {{@service.Service.Service}}. @@ -12,11 +12,11 @@
{{/if}} @@ -27,21 +27,21 @@ {{#if this.hasMetricsProvider }} {{/if}} -{{#if (gt @upstreams.length 0)}} +{{#if (gt @topology.Upstreams.length 0)}}
- {{#each-in (group-by "Datacenter" @upstreams) as |dc upstreams|}} + {{#each-in (group-by "Datacenter" @topology.Upstreams) as |dc upstreams|}}

{{dc}}

{{/each-in}} @@ -79,7 +79,7 @@ @view={{this.upView}} @center={{this.centerDimensions}} @lines={{this.upLines}} - @items={{@upstreams}} + @items={{@topology.Upstreams}} />
\ No newline at end of file diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs index 45ce9b9fa..9f691dc40 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs @@ -6,11 +6,8 @@ {{#if topology}} ` metrics_provider: 'prometheus', metrics_proxy_enabled: true, dashboard_url_template: { - services: 'https://example.com?{{Service.Name}}&{{Datacenter}}', + service: 'https://example.com?{{Service.Name}}&{{Datacenter}}', }, }) ) diff --git a/ui/packages/consul-ui/tests/acceptance/dc/services/show.feature b/ui/packages/consul-ui/tests/acceptance/dc/services/show.feature index 39b298723..f490f976f 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/services/show.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/services/show.feature @@ -108,4 +108,4 @@ Feature: dc / services / show: Show Service dc: dc1 service: service-0 --- - And I see href on the dashboardAnchor like "https://example.com?service-0-with-id&dc1" + And I see href on the metricsAnchor like "https://example.com?service-0-with-id&dc1" 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 84fc79677..0d31559d3 100644 --- a/ui/packages/consul-ui/tests/pages/dc/services/show.js +++ b/ui/packages/consul-ui/tests/pages/dc/services/show.js @@ -7,6 +7,9 @@ export default function(visitable, attribute, collection, text, intentions, filt dashboardAnchor: { href: attribute('href', '[data-test-dashboard-anchor]'), }, + metricsAnchor: { + href: attribute('href', '[data-test-metrics-anchor]'), + }, tabs: tabs('tab', [ 'topology', 'instances',