There are no services. diff --git a/ui-v2/app/templates/dc/services/show.hbs b/ui-v2/app/templates/dc/services/show.hbs index 469bb3e63e..48c02e095c 100644 --- a/ui-v2/app/templates/dc/services/show.hbs +++ b/ui-v2/app/templates/dc/services/show.hbs @@ -10,29 +10,21 @@
diff --git a/ui-v2/app/utils/dom/click-first-anchor.js b/ui-v2/app/utils/dom/click-first-anchor.js
index da3699fbc7..04cde2e9e9 100644
--- a/ui-v2/app/utils/dom/click-first-anchor.js
+++ b/ui-v2/app/utils/dom/click-first-anchor.js
@@ -14,7 +14,11 @@ const clickEvent = function($el) {
export default function(closest, click = clickEvent) {
// TODO: Decide whether we should use `e` for ease
// or `target`/`el`
- return function(e) {
+ // TODO: currently, using a string stopElement to tell the func
+ // where to stop looking and currenlty default is 'tr' because
+ // it's backwards compatible.
+ // Long-term this func shouldn't default to 'tr'
+ return function(e, stopElement = 'tr') {
// click on row functionality
// so if you click the actual row but not a link
// find the first link and fire that instead
@@ -26,9 +30,7 @@ export default function(closest, click = clickEvent) {
case 'button':
return;
}
- // TODO: why should this be restricted to a tr
- // closest should probably be relaced with a finder function
- const $a = closest('tr', e.target).querySelector('a');
+ const $a = closest(stopElement, e.target).querySelector('a');
if ($a) {
click($a);
}
diff --git a/ui-v2/tests/acceptance/components/catalog-filter.feature b/ui-v2/tests/acceptance/components/catalog-filter.feature
index ad8fd42df8..a3536fa3aa 100644
--- a/ui-v2/tests/acceptance/components/catalog-filter.feature
+++ b/ui-v2/tests/acceptance/components/catalog-filter.feature
@@ -127,26 +127,30 @@ Feature: components / catalog-filter
-------------------------------------------------
Scenario: Freetext filtering the service listing
Given 1 datacenter model with the value "dc-1"
- And 3 service models from yaml
+ And 6 service models from yaml
---
- Name: Service-0
- Kind: consul
Tags: ['one', 'two', 'three']
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 1
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
- Name: Service-1
- Kind: consul
Tags: ['two', 'three']
ChecksPassing: 0
ChecksWarning: 1
ChecksCritical: 0
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
- Name: Service-2
- Kind: consul
Tags: ['three']
ChecksPassing: 1
ChecksWarning: 0
ChecksCritical: 0
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
+
---
When I visit the services page for yaml
---
diff --git a/ui-v2/tests/acceptance/dc/error.feature b/ui-v2/tests/acceptance/dc/error.feature
index 2682471d3f..7e432259c5 100644
--- a/ui-v2/tests/acceptance/dc/error.feature
+++ b/ui-v2/tests/acceptance/dc/error.feature
@@ -6,14 +6,17 @@ Feature: dc / error: Recovering from a dc 500 error
- dc-1
- dc-500
---
- And 3 service models from yaml
+ And 6 service models from yaml
---
- Name: Service-0
- Kind: consul
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
- Name: Service-1
- Kind: consul
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
- Name: Service-2
- Kind: consul
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
---
And the url "/v1/internal/ui/services" responds with a 500 status
When I visit the services page for yaml
diff --git a/ui-v2/tests/acceptance/dc/list-blocking.feature b/ui-v2/tests/acceptance/dc/list-blocking.feature
index 7e6d924386..b0d039883c 100644
--- a/ui-v2/tests/acceptance/dc/list-blocking.feature
+++ b/ui-v2/tests/acceptance/dc/list-blocking.feature
@@ -32,7 +32,7 @@ Feature: dc / list-blocking
When I visit the [Page] page for yaml
---
dc: dc-1
- service: service-0-proxy
+ service: service
---
Then the url should be /dc-1/[Url]
And pause until I see 3 [Model] models
@@ -45,5 +45,5 @@ Feature: dc / list-blocking
Where:
-----------------------------------------------------------------
| Page | Model | Url |
- | service | instance | services/service-0-proxy/instances |
+ | service | instance | services/service/instances |
-----------------------------------------------------------------
diff --git a/ui-v2/tests/acceptance/dc/nspaces/manage.feature b/ui-v2/tests/acceptance/dc/nspaces/manage.feature
index 24083b10f7..431777ac2e 100644
--- a/ui-v2/tests/acceptance/dc/nspaces/manage.feature
+++ b/ui-v2/tests/acceptance/dc/nspaces/manage.feature
@@ -13,20 +13,26 @@ Feature: dc / nspaces / manage : Managing Namespaces
---
- dc-1
---
- And 6 service models from yaml
+ And 12 service models from yaml
---
- Name: Service-0
- Kind: consul
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
- Name: Service-1
- Kind: consul
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
- Name: Service-2
- Kind: consul
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
- Name: Service-3
- Kind: consul
+ - Name: Service-3-proxy
+ Kind: 'connect-proxy'
- Name: Service-4
- Kind: consul
+ - Name: Service-4-proxy
+ Kind: 'connect-proxy'
- Name: Service-5
- Kind: consul
+ - Name: Service-5-proxy
+ Kind: 'connect-proxy'
---
When I visit the services page for yaml
diff --git a/ui-v2/tests/acceptance/dc/services/dc-switch.feature b/ui-v2/tests/acceptance/dc/services/dc-switch.feature
index 5b2d7d2933..ae294a69c1 100644
--- a/ui-v2/tests/acceptance/dc/services/dc-switch.feature
+++ b/ui-v2/tests/acceptance/dc/services/dc-switch.feature
@@ -6,21 +6,28 @@ Feature: dc / services / dc-switch : Switching Datacenters
- dc-1
- dc-2
---
- And 6 service models from yaml
+ And 12 service models from yaml
---
- Name: Service-0
- Kind: consul
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
- Name: Service-1
- Kind: consul
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
- Name: Service-2
- Kind: consul
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
- Name: Service-3
- Kind: consul
+ - Name: Service-3-proxy
+ Kind: 'connect-proxy'
- Name: Service-4
- Kind: consul
+ - Name: Service-4-proxy
+ Kind: 'connect-proxy'
- Name: Service-5
- Kind: consul
+ - Name: Service-5-proxy
+ Kind: 'connect-proxy'
---
+
When I visit the services page for yaml
---
dc: dc-1
diff --git a/ui-v2/tests/acceptance/dc/services/index.feature b/ui-v2/tests/acceptance/dc/services/index.feature
index 9fde582588..b3ecf44ba4 100644
--- a/ui-v2/tests/acceptance/dc/services/index.feature
+++ b/ui-v2/tests/acceptance/dc/services/index.feature
@@ -2,36 +2,42 @@
Feature: dc / services / index: List Services
Scenario:
Given 1 datacenter model with the value "dc-1"
- And 4 service models from yaml
+ And 10 service models from yaml
---
- - Name: Service 1
- Kind: consul
- ExternalSources:
- - consul
- - Name: Service 2
- Kind: consul
- ExternalSources:
- - nomad
- - Name: Service 3
- Kind: consul
- ExternalSources:
- - terraform
- - Name: Service 4
- Kind: consul
- ExternalSources:
- - kubernetes
- - Name: Service 5
- Kind: consul
- ExternalSources:
- - aws
+ - Name: Service-0
+ ExternalSources:
+ - consul
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
+ - Name: Service-1
+ ExternalSources:
+ - nomad
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
+ - Name: Service-2
+ ExternalSources:
+ - terraform
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
+ - Name: Service-3
+ ExternalSources:
+ - kubernetes
+ - Name: Service-3-proxy
+ Kind: 'connect-proxy'
+ - Name: Service-4
+ ExternalSources:
+ - aws
+ - Name: Service-4-proxy
+ Kind: 'connect-proxy'
---
+
When I visit the services page for yaml
---
dc: dc-1
---
Then the url should be /dc-1/services
And the title should be "Services - Consul"
- Then I see 4 service models
+ Then I see 5 service models
And I see externalSource on the services like yaml
---
- consul
diff --git a/ui-v2/tests/acceptance/dc/services/list-blocking.feature b/ui-v2/tests/acceptance/dc/services/list-blocking.feature
index c445782129..74ee620216 100644
--- a/ui-v2/tests/acceptance/dc/services/list-blocking.feature
+++ b/ui-v2/tests/acceptance/dc/services/list-blocking.feature
@@ -2,14 +2,17 @@
Feature: dc / services / list blocking
Scenario: Viewing the listing pages for service
Given 1 datacenter model with the value "dc-1"
- Given 3 service models from yaml
+ And 6 service models from yaml
---
- Name: Service-0
- Kind: consul
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
- Name: Service-1
- Kind: consul
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
- Name: Service-2
- Kind: consul
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
---
And a network latency of 100
When I visit the services page for yaml
diff --git a/ui-v2/tests/acceptance/dc/services/list.feature b/ui-v2/tests/acceptance/dc/services/list.feature
index db7317083f..2638253f0f 100644
--- a/ui-v2/tests/acceptance/dc/services/list.feature
+++ b/ui-v2/tests/acceptance/dc/services/list.feature
@@ -2,14 +2,17 @@
Feature: dc / services / list
Scenario: Listing service
Given 1 datacenter model with the value "dc-1"
- And 3 service models from yaml
+ And 6 service models from yaml
---
- Name: Service-0
- Kind: consul
+ - Name: Service-0-proxy
+ Kind: 'connect-proxy'
- Name: Service-1
- Kind: consul
+ - Name: Service-1-proxy
+ Kind: 'connect-proxy'
- Name: Service-2
- Kind: consul
+ - Name: Service-2-proxy
+ Kind: 'connect-proxy'
---
When I visit the services page for yaml
---
diff --git a/ui-v2/tests/acceptance/dc/services/show-routing.feature b/ui-v2/tests/acceptance/dc/services/show-routing.feature
index ff1b7cdf7e..70c64c57c3 100644
--- a/ui-v2/tests/acceptance/dc/services/show-routing.feature
+++ b/ui-v2/tests/acceptance/dc/services/show-routing.feature
@@ -6,7 +6,6 @@ Feature: dc / services / Show Routing for Service
And 1 service model from yaml
---
- Service:
- Kind: consul
Name: service-0
ID: service-0-with-id
---
@@ -17,31 +16,12 @@ Feature: dc / services / Show Routing for Service
---
And the title should be "service-0 - Consul"
And I see routing on the tabs
- Scenario: Given a service proxy, the Routing tab should not display
- Given 1 datacenter model with the value "dc1"
- And 1 node models
- And 1 service model from yaml
- ---
- - Service:
- Kind: connect-proxy
- Name: service-0-proxy
- ID: service-0-proxy-with-id
- ---
- When I visit the service page for yaml
- ---
- dc: dc1
- service: service-0-proxy
- ---
- And the title should be "service-0-proxy - Consul"
- And I don't see routing on the tabs
-
Scenario: Given connect is disabled, the Routing tab should not display or error
Given 1 datacenter model with the value "dc1"
And 1 node models
And 1 service model from yaml
---
- Service:
- Kind: consul
Name: service-0
ID: service-0-with-id
---
diff --git a/ui-v2/tests/integration/components/consul-service-instance-list-test.js b/ui-v2/tests/integration/components/consul-service-instance-list-test.js
new file mode 100644
index 0000000000..19f7666f62
--- /dev/null
+++ b/ui-v2/tests/integration/components/consul-service-instance-list-test.js
@@ -0,0 +1,26 @@
+import { module, skip } from 'qunit';
+import { setupRenderingTest } from 'ember-qunit';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | consul-service-instance-list', function(hooks) {
+ setupRenderingTest(hooks);
+
+ skip('it renders', async function(assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`