diff --git a/ui-v2/app/components/app-view/index.hbs b/ui-v2/app/components/app-view/index.hbs index b66f00fbca..0bbbfc76c5 100644 --- a/ui-v2/app/components/app-view/index.hbs +++ b/ui-v2/app/components/app-view/index.hbs @@ -6,11 +6,11 @@ {{#let (lowercase component.flashType) (lowercase flash.action) as |status type|}} {{! flashes automatically ucfirst the type }} -

+

{{/if}} - {{#if (gt proxy.Proxy.Upstreams.length 0)}} + {{#if (gt proxy.Proxy.Expose.Paths.length 0)}}

Exposed paths

The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation.

- - - - - - - - - - {{#each proxy.Proxy.Expose.Paths as |path|}} - - - - - - {{#let (concat item.Address ':' path.ListenerPort path.Path) as |combinedAddress| }} - - {{/let}} - - {{/each}} - -
PathProtocolListener portLocal path portCombined addressService address, listener port, and path all combined into one URL.
- {{or path.Path '-'}} - - {{or path.Protocol '-'}} - - {{or path.ListenerPort '-'}} - - {{or path.LocalPathPort '-'}} - - {{#if combinedAddress}} - {{combinedAddress}} - - {{else}} - {{'-'}} - {{/if}} -
+
{{/if}} - + \ No newline at end of file diff --git a/ui-v2/app/templates/dc/services/show/services.hbs b/ui-v2/app/templates/dc/services/show/services.hbs index 1d2a29f48b..e93ef13e9f 100644 --- a/ui-v2/app/templates/dc/services/show/services.hbs +++ b/ui-v2/app/templates/dc/services/show/services.hbs @@ -4,35 +4,9 @@

The following services may receive traffic from external services through this gateway. Learn more about configuring gateways in our - step-by-step guide. - + step-by-step guide.

- {{#let item.Service.Namespace as |nspace|}} - - - {{item.Name}} - - - - {{/let}} +
{{else}}

diff --git a/ui-v2/app/templates/dc/services/show/upstreams.hbs b/ui-v2/app/templates/dc/services/show/upstreams.hbs index 61764e1a3e..fde1adc483 100644 --- a/ui-v2/app/templates/dc/services/show/upstreams.hbs +++ b/ui-v2/app/templates/dc/services/show/upstreams.hbs @@ -3,11 +3,10 @@ {{#if (gt gateway.Services.length 0)}}

- Upstreams are services that may receive traffic from this gateway. Learn more about configuring gateways in our - documentation. + Upstreams are services that may receive traffic from this gateway. Learn more about configuring gateways in our documentation.

{{#let item.Service.Namespace as |nspace|}} - + {{item.Name}} @@ -21,11 +20,11 @@ {{/if}} {{#if (not-eq item.GatewayConfig.ListenerPort 0)}}
  • + :{{item.GatewayConfig.ListenerPort}} - :{{item.GatewayConfig.ListenerPort}}
  • {{/if}} diff --git a/ui-v2/tests/acceptance/dc/services/show/services.feature b/ui-v2/tests/acceptance/dc/services/show/services.feature index cc576c6c18..6871bae396 100644 --- a/ui-v2/tests/acceptance/dc/services/show/services.feature +++ b/ui-v2/tests/acceptance/dc/services/show/services.feature @@ -1,57 +1,57 @@ -@setupApplicationTest -Feature: dc / services / show / services - Background: - Given 1 datacenter model with the value "dc1" - And 1 node models - And 1 service model from yaml - --- - - Service: - Name: terminating-gateway-1 - Kind: terminating-gateway - --- - Scenario: Seeing the Linked Services tab - When I visit the service page for yaml - --- - dc: dc1 - service: terminating-gateway-1 - --- - And the title should be "terminating-gateway-1 - Consul" - And I see linkedServices on the tabs - When I click linkedServices on the tabs - And I see linkedServicesIsSelected on the tabs - Scenario: Seeing the list of Linked Services - Given 3 service models from yaml - When I visit the service page for yaml - --- - dc: dc1 - service: terminating-gateway-1 - --- - And the title should be "terminating-gateway-1 - Consul" - When I click linkedServices on the tabs - Then I see 3 service models - Scenario: Don't see the Linked Services tab - Given 1 datacenter model with the value "dc1" - And 1 node models - And 1 service model from yaml - --- - - Service: - Name: [Name] - Kind: [Kind] - --- - When I visit the service page for yaml - --- - dc: dc1 - service: [Name] - --- - And the title should be "[Name] - Consul" - And I don't see linkedServices on the tabs - Where: - --------------------------------------------- - | Name | Kind | - | service | ~ | - | ingress-gateway | ingress-gateway | - | mesh-gateway | mesh-gateway | - --------------------------------------------- - - - +@setupApplicationTest +Feature: dc / services / show / services + Background: + Given 1 datacenter model with the value "dc1" + And 1 node models + And 1 service model from yaml + --- + - Service: + Name: terminating-gateway-1 + Kind: terminating-gateway + --- + Scenario: Seeing the Linked Services tab + When I visit the service page for yaml + --- + dc: dc1 + service: terminating-gateway-1 + --- + And the title should be "terminating-gateway-1 - Consul" + And I see linkedServices on the tabs + When I click linkedServices on the tabs + And I see linkedServicesIsSelected on the tabs + Scenario: Seeing the list of Linked Services + Given 3 service models from yaml + When I visit the service page for yaml + --- + dc: dc1 + service: terminating-gateway-1 + --- + And the title should be "terminating-gateway-1 - Consul" + When I click linkedServices on the tabs + Then I see 3 service models on the tabs.linkedServicesTab component + Scenario: Don't see the Linked Services tab + Given 1 datacenter model with the value "dc1" + And 1 node models + And 1 service model from yaml + --- + - Service: + Name: [Name] + Kind: [Kind] + --- + When I visit the service page for yaml + --- + dc: dc1 + service: [Name] + --- + And the title should be "[Name] - Consul" + And I don't see linkedServices on the tabs + Where: + --------------------------------------------- + | Name | Kind | + | service | ~ | + | ingress-gateway | ingress-gateway | + | mesh-gateway | mesh-gateway | + --------------------------------------------- + + + diff --git a/ui-v2/tests/acceptance/dc/services/show/upstreams.feature b/ui-v2/tests/acceptance/dc/services/show/upstreams.feature index 4e0def9205..cc703e4a43 100644 --- a/ui-v2/tests/acceptance/dc/services/show/upstreams.feature +++ b/ui-v2/tests/acceptance/dc/services/show/upstreams.feature @@ -1,54 +1,54 @@ -@setupApplicationTest -Feature: dc / services / show / upstreams - Background: - Given 1 datacenter model with the value "dc1" - And 1 node models - And 1 service model from yaml - --- - - Service: - Name: ingress-gateway-1 - Kind: ingress-gateway - --- - Scenario: Seeing the Upstreams tab - When I visit the service page for yaml - --- - dc: dc1 - service: ingress-gateway-1 - --- - And the title should be "ingress-gateway-1 - Consul" - And I see upstreams on the tabs - When I click upstreams on the tabs - And I see upstreamsIsSelected on the tabs - Scenario: Seeing the list of Upstreams - Given 3 service models from yaml - When I visit the service page for yaml - --- - dc: dc1 - service: ingress-gateway-1 - --- - And the title should be "ingress-gateway-1 - Consul" - When I click upstreams on the tabs - Then I see 3 service models - Scenario: Don't see the Upstreams tab - Given 1 datacenter model with the value "dc1" - And 1 node models - And 1 service model from yaml - --- - - Service: - Name: [Name] - Kind: [Kind] - --- - When I visit the service page for yaml - --- - dc: dc1 - service: [Name] - --- - And the title should be "[Name] - Consul" - And I don't see upstreams on the tabs - Where: - --------------------------------------------- - | Name | Kind | - | service | ~ | - | terminating-gateway | terminating-gateway | - | mesh-gateway | mesh-gateway | - --------------------------------------------- +@setupApplicationTest +Feature: dc / services / show / upstreams + Background: + Given 1 datacenter model with the value "dc1" + And 1 node models + And 1 service model from yaml + --- + - Service: + Name: ingress-gateway-1 + Kind: ingress-gateway + --- + Scenario: Seeing the Upstreams tab + When I visit the service page for yaml + --- + dc: dc1 + service: ingress-gateway-1 + --- + And the title should be "ingress-gateway-1 - Consul" + And I see upstreams on the tabs + When I click upstreams on the tabs + And I see upstreamsIsSelected on the tabs + Scenario: Seeing the list of Upstreams + Given 3 service models + When I visit the service page for yaml + --- + dc: dc1 + service: ingress-gateway-1 + --- + And the title should be "ingress-gateway-1 - Consul" + When I click upstreams on the tabs + Then I see 3 service models on the tabs.upstreamsTab component + Scenario: Don't see the Upstreams tab + Given 1 datacenter model with the value "dc1" + And 1 node models + And 1 service model from yaml + --- + - Service: + Name: [Name] + Kind: [Kind] + --- + When I visit the service page for yaml + --- + dc: dc1 + service: [Name] + --- + And the title should be "[Name] - Consul" + And I don't see upstreams on the tabs + Where: + --------------------------------------------- + | Name | Kind | + | service | ~ | + | terminating-gateway | terminating-gateway | + | mesh-gateway | mesh-gateway | + --------------------------------------------- diff --git a/ui-v2/tests/pages/dc/services/show.js b/ui-v2/tests/pages/dc/services/show.js index c9fd7bc304..9483168274 100644 --- a/ui-v2/tests/pages/dc/services/show.js +++ b/ui-v2/tests/pages/dc/services/show.js @@ -1,5 +1,5 @@ export default function(visitable, attribute, collection, text, intentions, filter, tabs) { - return { + const page = { visit: visitable('/:dc/services/:service'), externalSource: attribute('data-test-external-source', '[data-test-external-source]', { scope: '.title', @@ -22,8 +22,16 @@ export default function(visitable, attribute, collection, text, intentions, filt address: text('[data-test-address]'), }), intentions: intentions(), - services: collection('.consul-gateway-services-list> ul > li:not(:first-child)', { + }; + page.tabs.upstreamsTab = { + services: collection('.consul-upstream-list > ul > li:not(:first-child)', { name: text('[data-test-service-name]'), }), }; + page.tabs.linkedServicesTab = { + services: collection('.consul-service-list > ul > li:not(:first-child)', { + name: text('[data-test-service-name]'), + }), + }; + return page; } diff --git a/ui-v2/tests/unit/utils/components/discovery-chain/get-alternate-services-test.js b/ui-v2/tests/unit/components/discovery-chain/get-alternate-services-test.js similarity index 90% rename from ui-v2/tests/unit/utils/components/discovery-chain/get-alternate-services-test.js rename to ui-v2/tests/unit/components/discovery-chain/get-alternate-services-test.js index a641d722b7..56152a97d6 100644 --- a/ui-v2/tests/unit/utils/components/discovery-chain/get-alternate-services-test.js +++ b/ui-v2/tests/unit/components/discovery-chain/get-alternate-services-test.js @@ -1,7 +1,7 @@ -import { getAlternateServices } from 'consul-ui/utils/components/discovery-chain/index'; +import { getAlternateServices } from 'consul-ui/components/discovery-chain/utils'; import { module, test } from 'qunit'; -module('Unit | Utility | components/discovery-chain/get-alternative-services', function() { +module('Unit | Component | discovery-chain/get-alternative-services', function() { test('it guesses a different namespace', function(assert) { const expected = { Type: 'Namespace', diff --git a/ui-v2/tests/unit/utils/components/discovery-chain/get-resolvers-test.js b/ui-v2/tests/unit/components/discovery-chain/get-resolvers-test.js similarity index 98% rename from ui-v2/tests/unit/utils/components/discovery-chain/get-resolvers-test.js rename to ui-v2/tests/unit/components/discovery-chain/get-resolvers-test.js index 8223d60c37..4ec4b9d101 100644 --- a/ui-v2/tests/unit/utils/components/discovery-chain/get-resolvers-test.js +++ b/ui-v2/tests/unit/components/discovery-chain/get-resolvers-test.js @@ -1,4 +1,4 @@ -import { getResolvers } from 'consul-ui/utils/components/discovery-chain/index'; +import { getResolvers } from 'consul-ui/components/discovery-chain/utils'; import { module, test } from 'qunit'; import { get } from 'consul-ui/tests/helpers/api'; @@ -7,7 +7,7 @@ const nspace = 'default'; const request = { url: `/v1/discovery-chain/service-name?dc=${dc}`, }; -module('Unit | Utility | components/discovery-chain/get-resolvers', function() { +module('Unit | Component | discovery-chain/get-resolvers', function() { test('it assigns Subsets correctly', function(assert) { return get(request.url, { headers: { diff --git a/ui-v2/tests/unit/utils/components/discovery-chain/get-splitters-test.js b/ui-v2/tests/unit/components/discovery-chain/get-splitters-test.js similarity index 87% rename from ui-v2/tests/unit/utils/components/discovery-chain/get-splitters-test.js rename to ui-v2/tests/unit/components/discovery-chain/get-splitters-test.js index ca1dc500d6..78e89af428 100644 --- a/ui-v2/tests/unit/utils/components/discovery-chain/get-splitters-test.js +++ b/ui-v2/tests/unit/components/discovery-chain/get-splitters-test.js @@ -1,7 +1,7 @@ -import { getSplitters } from 'consul-ui/utils/components/discovery-chain/index'; +import { getSplitters } from 'consul-ui/components/discovery-chain/utils'; import { module, test } from 'qunit'; -module('Unit | Utility | components/discovery-chain/get-splitters', function() { +module('Unit | Component | discovery-chain/get-splitters', function() { test('it collects and correctly parses splitter Names', function(assert) { const actual = getSplitters({ 'splitter:splitter-name.default': {