diff --git a/.changelog/12248.txt b/.changelog/12248.txt new file mode 100644 index 000000000..cfa3077be --- /dev/null +++ b/.changelog/12248.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +ui: Exclude Service Instance Health from Health Check reporting on the Node listing page. The health icons on each individual row now only reflect Node health. +``` diff --git a/ui/packages/consul-ui/app/components/consul/node/list/index.hbs b/ui/packages/consul-ui/app/components/consul/node/list/index.hbs index b4ff07425..2fd449b12 100644 --- a/ui/packages/consul-ui/app/components/consul/node/list/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/node/list/index.hbs @@ -3,7 +3,7 @@ @items={{@items}} as |item index|> -
+
Health
diff --git a/ui/packages/consul-ui/app/models/node.js b/ui/packages/consul-ui/app/models/node.js index a403291cf..1d5787ea7 100644 --- a/ui/packages/consul-ui/app/models/node.js +++ b/ui/packages/consul-ui/app/models/node.js @@ -31,7 +31,9 @@ export default class Node extends Model { // ProxyServiceInstances are all instances that are connect-proxies @filter('Services', item => item.Service.Kind === 'connect-proxy') ProxyServiceInstances; - @computed('Checks.[]', 'ChecksCritical', 'ChecksPassing', 'ChecksWarning') + @filter('Checks', item => item.ServiceID === '') NodeChecks; + + @computed('ChecksCritical', 'ChecksPassing', 'ChecksWarning') get Status() { switch (true) { case this.ChecksCritical !== 0: @@ -45,18 +47,18 @@ export default class Node extends Model { } } - @computed('Checks.[]') + @computed('NodeChecks.[]') get ChecksCritical() { - return this.Checks.filter(item => item.Status === 'critical').length; + return this.NodeChecks.filter(item => item.Status === 'critical').length; } - @computed('Checks.[]') + @computed('NodeChecks.[]') get ChecksPassing() { - return this.Checks.filter(item => item.Status === 'passing').length; + return this.NodeChecks.filter(item => item.Status === 'passing').length; } - @computed('Checks.[]') + @computed('NodeChecks.[]') get ChecksWarning() { - return this.Checks.filter(item => item.Status === 'warning').length; + return this.NodeChecks.filter(item => item.Status === 'warning').length; } } diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature index 59158038b..8bcd61f2e 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature @@ -7,6 +7,36 @@ Feature: dc / nodes / index body: | "211.245.86.75:8500" --- + Scenario: Viewing a node with an unhealthy NodeCheck + Given 1 node model from yaml + --- + - Checks: + - Status: critical + ServiceID: "" + --- + When I visit the nodes page for yaml + --- + dc: dc-1 + --- + Then the url should be /dc-1/nodes + Then I see 1 node models + And I see status on the nodes.0 like "critical" + Scenario: Viewing a node with an unhealthy ServiceCheck + Given 1 node model from yaml + --- + - Checks: + - Status: passing + ServiceID: "" + - Status: critical + ServiceID: web + --- + When I visit the nodes page for yaml + --- + dc: dc-1 + --- + Then the url should be /dc-1/nodes + Then I see 1 node models + And I see status on the nodes.0 like "passing" Scenario: Viewing nodes in the listing Given 3 node models When I visit the nodes page for yaml diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature index dc09fec40..452a2eeea 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature @@ -7,21 +7,27 @@ Feature: dc / nodes / sorting - Node: Node-A Checks: - Status: critical + ServiceID: "" - Node: Node-B Checks: - Status: passing + ServiceID: "" - Node: Node-C Checks: - Status: warning + ServiceID: "" - Node: Node-D Checks: - Status: critical + ServiceID: "" - Node: Node-E Checks: - Status: critical + ServiceID: "" - Node: Node-F Checks: - Status: warning + ServiceID: "" --- When I visit the nodes page for yaml --- diff --git a/ui/packages/consul-ui/tests/pages/dc/nodes/index.js b/ui/packages/consul-ui/tests/pages/dc/nodes/index.js index 81aabe3ff..b4a4308cf 100644 --- a/ui/packages/consul-ui/tests/pages/dc/nodes/index.js +++ b/ui/packages/consul-ui/tests/pages/dc/nodes/index.js @@ -3,6 +3,7 @@ export default function(visitable, text, clickable, attribute, collection, popov name: text('[data-test-node]'), leader: attribute('data-test-leader', '[data-test-leader]'), node: clickable('a'), + status: attribute('data-test-status', '[data-test-status]'), }; return { visit: visitable('/:dc/nodes'),