diff --git a/ui-v2/app/controllers/settings.js b/ui-v2/app/controllers/settings.js index 8bb96673c..7f0df20d3 100644 --- a/ui-v2/app/controllers/settings.js +++ b/ui-v2/app/controllers/settings.js @@ -34,9 +34,6 @@ export default Controller.extend({ const blocking = get(this, 'item.client.blocking'); switch (target.name) { case 'client[blocking]': - if (typeof blocking === 'undefined') { - set(this, 'item.client', {}); - } set(this, 'item.client.blocking', !blocking); this.send('update', get(this, 'item')); break; diff --git a/ui-v2/app/routes/settings.js b/ui-v2/app/routes/settings.js index d62cb6b9c..567f5040c 100644 --- a/ui-v2/app/routes/settings.js +++ b/ui-v2/app/routes/settings.js @@ -1,7 +1,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { hash } from 'rsvp'; -import { get } from '@ember/object'; +import { get, set } from '@ember/object'; export default Route.extend({ client: service('client/http'), @@ -12,6 +12,9 @@ export default Route.extend({ item: get(this, 'repo').findAll(), dcs: get(this, 'dcRepo').findAll(), }).then(model => { + if (typeof get(model.item, 'client.blocking') === 'undefined') { + set(model, 'item.client', { blocking: true }); + } return hash({ ...model, ...{ diff --git a/ui-v2/app/services/repository/type/event-source.js b/ui-v2/app/services/repository/type/event-source.js index 31c1b41ea..7f45c0686 100644 --- a/ui-v2/app/services/repository/type/event-source.js +++ b/ui-v2/app/services/repository/type/event-source.js @@ -65,7 +65,7 @@ const createProxy = function(repo, find, settings, cache, serialize = JSON.strin key: key, type: BlockingEventSource, settings: { - enabled: settings.blocking, + enabled: typeof settings.blocking === 'undefined' || settings.blocking, }, createEvent: createEvent, } diff --git a/ui-v2/tests/acceptance/dc/list-blocking.feature b/ui-v2/tests/acceptance/dc/list-blocking.feature index 7413ae8a7..74e8f34bb 100644 --- a/ui-v2/tests/acceptance/dc/list-blocking.feature +++ b/ui-v2/tests/acceptance/dc/list-blocking.feature @@ -5,11 +5,6 @@ Feature: dc / list-blocking I want to see changes if I change consul externally Background: Given 1 datacenter model with the value "dc-1" - And settings from yaml - --- - consul:client: - blocking: 1 - --- Scenario: Viewing the listing pages Given 3 [Model] models And a network latency of 100 @@ -51,4 +46,4 @@ Feature: dc / list-blocking ------------------------------------------------- | Page | Model | Url | | service | instance | services/service-0 | - ------------------------------------------------- \ No newline at end of file + ------------------------------------------------- diff --git a/ui-v2/tests/acceptance/dc/nodes/sessions/invalidate.feature b/ui-v2/tests/acceptance/dc/nodes/sessions/invalidate.feature index ba2288a38..6ac9a7a2f 100644 --- a/ui-v2/tests/acceptance/dc/nodes/sessions/invalidate.feature +++ b/ui-v2/tests/acceptance/dc/nodes/sessions/invalidate.feature @@ -25,7 +25,7 @@ Feature: dc / nodes / sessions / invalidate: Invalidate Lock Sessions Scenario: Invalidating the lock session And I click delete on the sessions And I click confirmDelete on the sessions - Then a PUT request is made to "/v1/session/destroy/7bbbd8bb-fff3-4292-b6e3-cfedd788546a?dc=dc1" + Then the last PUT request was made to "/v1/session/destroy/7bbbd8bb-fff3-4292-b6e3-cfedd788546a?dc=dc1" Then the url should be /dc1/nodes/node-0 And "[data-notification]" has the "notification-delete" class And "[data-notification]" has the "success" class