ui: Sort lists with health by unhealthy/healthy by default (#9234)

* ui: Update lists with Health to sort by unhealthy/healthy by default

* Fix up tests for new sorting

* Make specific services page-navigation test
This commit is contained in:
John Cowen 2020-11-19 16:05:46 +00:00 committed by GitHub
parent f8e80fc688
commit 35f1274a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 96 additions and 11 deletions

View File

@ -4,7 +4,7 @@
{{#let (hash
statuses=(if status (split status ',') undefined)
) as |filters|}}
{{#let (or sortBy "Node:asc") as |sort|}}
{{#let (or sortBy "Status:asc") as |sort|}}
<AppView>
<BlockSlot @name="header">
<h1>

View File

@ -5,7 +5,7 @@
kinds=(if kind (split kind ',') undefined)
sources=(if source (split source ',') undefined)
) as |filters|}}
{{#let (or sortBy "Name:asc") as |sort|}}
{{#let (or sortBy "Status:asc") as |sort|}}
<AppView>
<BlockSlot @name="notification" as |status type|>
<Consul::Service::Notifications

View File

@ -4,7 +4,7 @@
statuses=(if status (split status ',') undefined)
sources=(if source (split source ',') undefined)
) as |filters|}}
{{#let (or sortBy "Name:asc") as |sort|}}
{{#let (or sortBy "Status:asc") as |sort|}}
{{#if (gt items.length 0) }}
<input type="checkbox" id="toolbar-toggle" />
<Consul::ServiceInstance::SearchBar

View File

@ -4,7 +4,7 @@
{{#let (hash
instances=(if instance (split instance ',') undefined)
) as |filters|}}
{{#let (or sortBy "Name:asc") as |sort|}}
{{#let (or sortBy "Status:asc") as |sort|}}
{{#if (gt gatewayServices.length 0)}}
<input type="checkbox" id="toolbar-toggle" />
<Consul::Upstream::SearchBar

View File

@ -6,14 +6,24 @@ Feature: dc / nodes / empty-ids: Hedge for if nodes come in over the API with no
---
- ID: id-1
Node: name-1
Checks:
- Status: passing
- ID: ""
Node: name-2
Checks:
- Status: passing
- ID: ""
Node: name-3
Checks:
- Status: passing
- ID: ""
Node: name-4
Checks:
- Status: passing
- ID: ""
Node: name-5
Checks:
- Status: passing
---
When I visit the nodes page for yaml
---

View File

@ -21,10 +21,14 @@ Feature: dc / nodes / index
---
- Address: 211.245.86.75
Checks:
- Status: warning
- Status: critical
Name: Warning check
- Address: 10.0.0.1
Checks:
- Status: passing
- Address: 10.0.0.3
Checks:
- Status: passing
---
When I visit the nodes page for yaml
---

View File

@ -7,33 +7,51 @@ Feature: dc / services / index: List Services
- Name: Service-0
ExternalSources:
- consul
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 10
Kind: ~
- Name: Service-0-proxy
Kind: 'connect-proxy'
- Name: Service-1
ExternalSources:
- nomad
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 9
Kind: ~
- Name: Service-1-proxy
Kind: 'connect-proxy'
- Name: Service-2
ExternalSources:
- terraform
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 8
Kind: ~
- Name: Service-2-proxy
Kind: 'connect-proxy'
- Name: Service-3
ExternalSources:
- kubernetes
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 7
Kind: ~
- Name: Service-3-proxy
Kind: 'connect-proxy'
- Name: Service-4
ExternalSources:
- aws
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 6
Kind: ~
- Name: Service-4-proxy
Kind: 'connect-proxy'
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 5
---
When I visit the services page for yaml
@ -57,10 +75,19 @@ Feature: dc / services / index: List Services
---
- Name: Service-0-proxy
Kind: 'connect-proxy'
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 3
- Name: Service-1-ingress-gateway
Kind: 'ingress-gateway'
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 2
- Name: Service-2-terminating-gateway
Kind: 'terminating-gateway'
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 1
---
When I visit the services page for yaml
@ -83,12 +110,18 @@ Feature: dc / services / index: List Services
Kind: ~
ConnectedWithProxy: true
ConnectedWithGateway: true
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 2
- Name: Service-0-proxy
Kind: connect-proxy
- Name: Service-1
Kind: ~
ConnectedWithProxy: false
ConnectedWithGateway: false
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 1
---
When I visit the services page for yaml
@ -106,10 +139,19 @@ Feature: dc / services / index: List Services
---
- Name: Service-0
Kind: ~
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 2
- Name: Service-0-proxy
Kind: connect-proxy
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 1
- Name: Service-1
Kind: 'ingress-gateway'
ChecksPassing: 0
ChecksWarning: 0
ChecksCritical: 1
GatewayConfig:
- AssociatedServiceCount: 345
---

View File

@ -0,0 +1,16 @@
@setupApplicationTest
Feature: dc / services / navigation
Scenario: Clicking a service in the listing and back again
Given 1 datacenter model with the value "dc-1"
And 1 service model
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 1 service models
When I click service on the services
And I click "[data-test-back]"
Then the url should be /dc-1/services

View File

@ -66,7 +66,7 @@ Feature: dc / services / show: Show Service
And 1 service model from yaml
---
- Checks:
- Status: passing
- Status: critical
Service:
Kind: ~
ID: passing-service-8080
@ -74,14 +74,18 @@ Feature: dc / services / show: Show Service
Address: 1.1.1.1
Node:
Address: 1.2.2.2
- Service:
- Checks:
- Status: warning
Service:
Kind: ~
ID: service-8000
Port: 8000
Address: 2.2.2.2
Node:
Address: 2.3.3.3
- Service:
- Checks:
- Status: passing
Service:
Kind: ~
ID: service-8888
Port: 8888

View File

@ -41,7 +41,6 @@ Feature: page-navigation
Where:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Item | Model | URL | Endpoint | Back |
| service | services | /dc-1/services/service-0/topology | /v1/discovery-chain/service-0?dc=dc-1&ns=@namespace | /dc-1/services |
| kv | kvs | /dc-1/kv/0-key-value/edit | /v1/session/info/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=dc-1&ns=@namespace | /dc-1/kv |
# | acl | acls | /dc-1/acls/anonymous | /v1/acl/info/anonymous?dc=dc-1 | /dc-1/acls |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -0,0 +1,10 @@
import steps from '../../steps';
// step definitions that are shared between features should be moved to the
// tests/acceptance/steps/steps.js file
export default function(assert) {
return steps(assert).then('I should find a file', function() {
assert.ok(true, this.step);
});
}