ui: Redesign - Gateway Instances List page (#7796)

* Hide Nav in Instances page for Gateway services

* Fix up tests to have mocked Services with no Kind attribute

* Upgrade consul-api-double to 2.14.4
This commit is contained in:
Kenia 2020-05-06 14:13:36 -04:00 committed by John Cowen
parent 5832e84822
commit abc43b6a0f
5 changed files with 17 additions and 5 deletions

View File

@ -14,13 +14,14 @@ export default Route.extend({
const nspace = this.modelFor('nspace').nspace.substr(1); const nspace = this.modelFor('nspace').nspace.substr(1);
return hash({ return hash({
item: this.repo.findBySlug(params.name, dc, nspace), item: this.repo.findBySlug(params.name, dc, nspace),
intentions: this.intentionRepo.findByService(params.name, dc, nspace),
urls: this.settings.findBySlug('urls'), urls: this.settings.findBySlug('urls'),
dc: dc, dc: dc,
proxies: [],
}).then(model => { }).then(model => {
return ['connect-proxy', 'mesh-gateway'].includes(get(model, 'item.Service.Kind')) return ['connect-proxy', 'mesh-gateway'].includes(get(model, 'item.Service.Kind'))
? model ? model
: hash({ : hash({
intentions: this.intentionRepo.findByService(params.name, dc, nspace),
chain: this.chainRepo.findBySlug(params.name, dc, nspace).catch(function(e) { chain: this.chainRepo.findBySlug(params.name, dc, nspace).catch(function(e) {
const code = get(e, 'errors.firstObject.status'); const code = get(e, 'errors.firstObject.status');
// Currently we are specifically catching a 500, but we return null // Currently we are specifically catching a 500, but we return null

View File

@ -16,6 +16,7 @@
</h1> </h1>
<ConsulExternalSource @item={{item.Service}} /> <ConsulExternalSource @item={{item.Service}} />
</div> </div>
{{#if (not item.Service.Kind)}}
<TabNav @items={{ <TabNav @items={{
compact compact
(array (array
@ -25,6 +26,7 @@
(hash label="Tags" href=(href-to "dc.services.show.tags") selected=(is-href "dc.services.show.tags")) (hash label="Tags" href=(href-to "dc.services.show.tags") selected=(is-href "dc.services.show.tags"))
) )
}}/> }}/>
{{/if}}
</BlockSlot> </BlockSlot>
<BlockSlot @name="actions"> <BlockSlot @name="actions">
{{#if urls.service}} {{#if urls.service}}

View File

@ -6,6 +6,7 @@ Feature: dc / services / show: Show Service
And 1 service model from yaml And 1 service model from yaml
--- ---
- Service: - Service:
Kind: ~
Tags: ['Tag1', 'Tag2'] Tags: ['Tag1', 'Tag2']
Meta: Meta:
external-source: consul external-source: consul
@ -24,6 +25,7 @@ Feature: dc / services / show: Show Service
And 1 service model from yaml And 1 service model from yaml
--- ---
- Service: - Service:
Kind: ~
Tags: ['Tag1', 'Tag2'] Tags: ['Tag1', 'Tag2']
Meta: Meta:
external-source: 'not-supported' external-source: 'not-supported'
@ -40,10 +42,13 @@ Feature: dc / services / show: Show Service
And 1 service model from yaml And 1 service model from yaml
--- ---
- Service: - Service:
Kind: ~
Tags: ['Tag1', 'Tag2'] Tags: ['Tag1', 'Tag2']
- Service: - Service:
Kind: ~
Tags: ['Tag3', 'Tag1'] Tags: ['Tag3', 'Tag1']
- Service: - Service:
Kind: ~
Tags: ['Tag2', 'Tag3'] Tags: ['Tag2', 'Tag3']
--- ---
When I visit the service page for yaml When I visit the service page for yaml
@ -51,6 +56,7 @@ Feature: dc / services / show: Show Service
dc: dc1 dc: dc1
service: service-0 service: service-0
--- ---
And pause for 3000
And I click tags on the tabs And I click tags on the tabs
Then I see the text "Tag1" in "[data-test-tags] span:nth-child(1)" Then I see the text "Tag1" in "[data-test-tags] span:nth-child(1)"
Then I see the text "Tag2" in "[data-test-tags] span:nth-child(2)" Then I see the text "Tag2" in "[data-test-tags] span:nth-child(2)"
@ -63,18 +69,21 @@ Feature: dc / services / show: Show Service
- Checks: - Checks:
- Status: passing - Status: passing
Service: Service:
Kind: ~
ID: passing-service-8080 ID: passing-service-8080
Port: 8080 Port: 8080
Address: 1.1.1.1 Address: 1.1.1.1
Node: Node:
Address: 1.2.2.2 Address: 1.2.2.2
- Service: - Service:
Kind: ~
ID: service-8000 ID: service-8000
Port: 8000 Port: 8000
Address: 2.2.2.2 Address: 2.2.2.2
Node: Node:
Address: 2.3.3.3 Address: 2.3.3.3
- Service: - Service:
Kind: ~
ID: service-8888 ID: service-8888
Port: 8888 Port: 8888
Address: 3.3.3.3 Address: 3.3.3.3

View File

@ -6,7 +6,7 @@ Feature: dc / services / intentions: Intentions per service
And 1 service model from yaml And 1 service model from yaml
--- ---
- Service: - Service:
Kind: consul Kind: ~
Name: service-0 Name: service-0
ID: service-0-with-id ID: service-0-with-id
--- ---

View File

@ -1211,9 +1211,9 @@
js-yaml "^3.13.1" js-yaml "^3.13.1"
"@hashicorp/consul-api-double@^2.6.2": "@hashicorp/consul-api-double@^2.6.2":
version "2.14.3" version "2.14.4"
resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-2.14.3.tgz#57974cd877cd457d660f1168abdfd0b3fc79ea1b" resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-2.14.4.tgz#cc68c500f934d9ac76292797f845e78b9e3c4fcb"
integrity sha512-3E7aBFbeWWdCk3f07x5z3puGfV3DEyxrpElWD/J4NWxZIgJ92iYV2LKkLZ5u19UGAI5lVdhT3wYaBOqmC725pA== integrity sha512-6GXHlSKr822CPuAz7jWBDZE4KAxKNSFt/2RA0Z7q6HAHu0O3NTd14vZweO30hS1yusyVEI9RLd9OvgMbv5WXhA==
"@hashicorp/ember-cli-api-double@^3.0.2": "@hashicorp/ember-cli-api-double@^3.0.2":
version "3.0.2" version "3.0.2"