ui: If a service has no external-source, don't show the icon (#4996)

This commit is contained in:
John Cowen 2018-11-26 17:34:00 +00:00 committed by GitHub
parent a641727208
commit 77ad621c04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -7,7 +7,13 @@
{{#block-slot 'header'}}
<h1>
{{ item.Service.Service }}
<span data-test-external-source="{{service/external-source item.Service}}" style={{{ concat 'background-image: ' (css-var (concat '--' (service/external-source item.Service) '-color-svg') 'none')}}} data-tooltip="Registered via {{service/external-source item.Service}}">Registered via {{service/external-source item.Service}}</span>
{{#with (service/external-source item.Service) as |externalSource| }}
{{#with (css-var (concat '--' externalSource '-color-svg') 'none') as |bg| }}
{{#if (not-eq bg 'none') }}
<span data-test-external-source="{{externalSource}}" style={{{ concat 'background-image:' bg }}} data-tooltip="Registered via {{externalSource}}">Registered via {{externalSource}}</span>
{{/if}}
{{/with}}
{{/with}}
</h1>
{{/block-slot}}
{{#block-slot 'toolbar'}}

View File

@ -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