From 77ad621c0458f11c67527d60da09057f0759ab26 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 26 Nov 2018 17:34:00 +0000 Subject: [PATCH] ui: If a service has no external-source, don't show the icon (#4996) --- ui-v2/app/templates/dc/services/show.hbs | 8 +++++++- ui-v2/tests/acceptance/dc/services/show.feature | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ui-v2/app/templates/dc/services/show.hbs b/ui-v2/app/templates/dc/services/show.hbs index 2b8614389..130c18ce8 100644 --- a/ui-v2/app/templates/dc/services/show.hbs +++ b/ui-v2/app/templates/dc/services/show.hbs @@ -7,7 +7,13 @@ {{#block-slot 'header'}}

{{ item.Service.Service }} - Registered via {{service/external-source item.Service}} +{{#with (service/external-source item.Service) as |externalSource| }} + {{#with (css-var (concat '--' externalSource '-color-svg') 'none') as |bg| }} + {{#if (not-eq bg 'none') }} + Registered via {{externalSource}} + {{/if}} + {{/with}} +{{/with}}

{{/block-slot}} {{#block-slot 'toolbar'}} diff --git a/ui-v2/tests/acceptance/dc/services/show.feature b/ui-v2/tests/acceptance/dc/services/show.feature index 8be64db06..5fa48f0de 100644 --- a/ui-v2/tests/acceptance/dc/services/show.feature +++ b/ui-v2/tests/acceptance/dc/services/show.feature @@ -16,6 +16,22 @@ Feature: dc / services / show: Show Service service: service-0 --- Then I see externalSource like "consul" + Scenario: Given a service with an 'unsupported' external source, there is no logo + Given 1 datacenter model with the value "dc1" + And 1 node models + And 1 service model from yaml + --- + - Service: + Tags: ['Tag1', 'Tag2'] + Meta: + external-source: 'not-supported' + --- + When I visit the service page for yaml + --- + dc: dc1 + service: service-0 + --- + Then I don't see externalSource Scenario: Given various services with various tags, all tags are displayed Given 1 datacenter model with the value "dc1" And 3 node models