From 9bfe3d530e2238910f44df9260636aff11a24797 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 8 Dec 2020 12:27:41 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20confirmations=20shou?= =?UTF-8?q?ld=20be=20enabled=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/addon/services/confirm.js | 4 +++- addons/core/tests/dummy/config/environment.js | 4 +++- ui/admin/config/environment.js | 1 - ui/desktop/config/environment.js | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/core/addon/services/confirm.js b/addons/core/addon/services/confirm.js index df271f219..e63a76fdf 100644 --- a/addons/core/addon/services/confirm.js +++ b/addons/core/addon/services/confirm.js @@ -19,9 +19,11 @@ export default class ConfirmationsService extends Service { /** * When the confirm service is disabled, it always returns resolving promises. + * By default the service is enabled but it is useful to disable it for test + * purposes. * @type {boolean} */ - enabled = config.enableConfirmService; + enabled = config.enableConfirmService ?? true; /** * @type {Array} diff --git a/addons/core/tests/dummy/config/environment.js b/addons/core/tests/dummy/config/environment.js index 84720c90a..2a5061f98 100644 --- a/addons/core/tests/dummy/config/environment.js +++ b/addons/core/tests/dummy/config/environment.js @@ -39,7 +39,9 @@ module.exports = function (environment) { 'ember-cli-mirage': { directory: '../api/mirage' - } + }, + + enableConfirmService: false }; if (environment === "development") { diff --git a/ui/admin/config/environment.js b/ui/admin/config/environment.js index c071cd17c..7cd8efa3e 100644 --- a/ui/admin/config/environment.js +++ b/ui/admin/config/environment.js @@ -36,7 +36,6 @@ module.exports = function (environment) { notifyTimeout: 4000, sessionPollingTimeoutSeconds: 2.5, - enableConfirmService: true, documentation: { baseURL: 'https://boundaryproject.io/help/admin-ui', diff --git a/ui/desktop/config/environment.js b/ui/desktop/config/environment.js index 05aaad491..ed64f6253 100644 --- a/ui/desktop/config/environment.js +++ b/ui/desktop/config/environment.js @@ -70,6 +70,8 @@ module.exports = function (environment) { // Notification timeout should be 0 for fast tests ENV.notifyTimeout = 0; + + ENV.enableConfirmService = false; } if (environment === 'production') {