Skip to content

Commit

Permalink
ui: Add live updates/blocking queries to the Intention listing page (#…
Browse files Browse the repository at this point in the history
…7161)

* ui: Enable blocking queries/live updates for intentions

* ui: Add acceptance tests for intention blocking queries

* ui: Add copy to explain that intentions are also now 'real time'
  • Loading branch information
johncowen authored Jan 29, 2020
1 parent e568cde commit ac60338
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion ui-v2/app/instance-initializers/event-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function initialize(container) {
if (env('CONSUL_UI_DISABLE_REALTIME')) {
return;
}
['node', 'coordinate', 'session', 'service', 'proxy', 'discovery-chain']
['node', 'coordinate', 'session', 'service', 'proxy', 'discovery-chain', 'intention']
.concat(env('CONSUL_NSPACES_ENABLED') ? ['nspace/enabled'] : [])
.map(function(item) {
// create repositories that return a promise resolving to an EventSource
Expand Down Expand Up @@ -70,6 +70,12 @@ export function initialize(container) {
proxyRepo: 'repository/proxy/event-source',
},
},
{
route: 'dc/intentions/index',
services: {
repo: 'repository/intention/event-source',
},
},
{
service: 'form',
services: {
Expand Down
2 changes: 1 addition & 1 deletion ui-v2/app/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{#if (not (env 'CONSUL_UI_DISABLE_REALTIME'))}}
<fieldset>
<h2>Blocking Queries</h2>
<p>Keep catalog info up-to-date without refreshing the page. Any changes made to services and nodes would be reflected in real time.</p>
<p>Keep catalog info up-to-date without refreshing the page. Any changes made to services, nodes and intentions would be reflected in real time.</p>
<div class="type-toggle">
<label>
<input type="checkbox" name="client[blocking]" checked={{if item.client.blocking 'checked'}} onchange={{action 'change'}} />
Expand Down
5 changes: 3 additions & 2 deletions ui-v2/tests/acceptance/dc/list-blocking.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: dc / list-blocking
I want to see changes if I change consul externally
Background:
Given 1 datacenter model with the value "dc-1"
Scenario: Viewing the listing pages
Scenario: Viewing the listing pages for [Page]
Given 3 [Model] models
And a network latency of 100
When I visit the [Page] page for yaml
Expand All @@ -25,8 +25,9 @@ Feature: dc / list-blocking
| Page | Model | Url |
| services | service | services |
| nodes | node | nodes |
| intentions | intention | intentions |
------------------------------------------------
Scenario: Viewing detail pages with a listing
Scenario: Viewing detail pages with a listing for [Page]
Given 3 [Model] models
And a network latency of 100
When I visit the [Page] page for yaml
Expand Down

0 comments on commit ac60338

Please sign in to comment.