From 0733af1a5f0f9ff5eabd71d6ac9b6e6e04cdf1cb Mon Sep 17 00:00:00 2001
From: Kenia <19161242+kaxcode@users.noreply.github.com>
Date: Fri, 23 Oct 2020 09:44:38 -0400
Subject: [PATCH] ui: Update Topology metrics dashboard and configuration links
(#9002)
* Update Topology metrics dashboard and configuration links
* Fixup tests
* Remove Dashboard Link from settings page
* Removing use of settings Dashboard links
---
.../app/components/topology-metrics/index.hbs | 4 ++--
.../app/components/topology-metrics/skin.scss | 2 +-
ui/packages/consul-ui/app/routes/dc/services/show.js | 4 ++--
.../app/templates/dc/services/show/topology.hbs | 4 ++--
ui/packages/consul-ui/app/templates/settings.hbs | 11 -----------
.../consul-ui/lib/startup/templates/head.html.js | 10 +++++++++-
.../tests/acceptance/dc/services/show.feature | 7 +------
7 files changed, 17 insertions(+), 25 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 f615c381b..da71d3332 100644
--- a/ui/packages/consul-ui/app/components/topology-metrics/index.hbs
+++ b/ui/packages/consul-ui/app/components/topology-metrics/index.hbs
@@ -29,9 +29,9 @@
{{/if}}
diff --git a/ui/packages/consul-ui/app/components/topology-metrics/skin.scss b/ui/packages/consul-ui/app/components/topology-metrics/skin.scss
index 2fb25f5fc..7fd958974 100644
--- a/ui/packages/consul-ui/app/components/topology-metrics/skin.scss
+++ b/ui/packages/consul-ui/app/components/topology-metrics/skin.scss
@@ -82,7 +82,7 @@
.metrics-link::before {
@extend %with-exit-mask, %as-pseudo;
}
- .settings-link::before {
+ .config-link::before {
@extend %with-docs-mask, %as-pseudo;
}
}
diff --git a/ui/packages/consul-ui/app/routes/dc/services/show.js b/ui/packages/consul-ui/app/routes/dc/services/show.js
index 63e621b35..8b9a72ca3 100644
--- a/ui/packages/consul-ui/app/routes/dc/services/show.js
+++ b/ui/packages/consul-ui/app/routes/dc/services/show.js
@@ -5,7 +5,7 @@ import { get } from '@ember/object';
export default Route.extend({
data: service('data-source/service'),
- settings: service('settings'),
+ config: service('ui-config'),
model: function(params, transition) {
const dc = this.modelFor('dc').dc.Name;
const nspace = this.modelFor('nspace').nspace.substr(1);
@@ -16,7 +16,7 @@ export default Route.extend({
items: this.data.source(
uri => uri`/${nspace}/${dc}/service-instances/for-service/${params.name}`
),
- urls: this.settings.findBySlug('urls'),
+ urls: this.config.get().dashboard_url_template,
chain: null,
proxies: [],
topology: null,
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 2e5edbb2e..fda0cfbb0 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
@@ -7,9 +7,9 @@
@upstreams={{topology.Upstreams}}
@downstreams={{filter-by 'Datacenter' topology.Datacenter topology.Downstreams}}
@dc={{topology.Datacenter}}
- @metricsHref={{render-template urls.service (hash
+ @metricsHref={{render-template urls.services (hash
Datacenter=dc
- Service=(hash Name=item.Service.Service)
+ Service=items.firstObject
)}}
/>
{{else}}
diff --git a/ui/packages/consul-ui/app/templates/settings.hbs b/ui/packages/consul-ui/app/templates/settings.hbs
index 94e719bed..0bd92ac6c 100644
--- a/ui/packages/consul-ui/app/templates/settings.hbs
+++ b/ui/packages/consul-ui/app/templates/settings.hbs
@@ -13,17 +13,6 @@