From 7e2c66ad12f91ffe1b589c3939072bbcba4aea5e Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 8 May 2019 10:01:26 +0100 Subject: [PATCH] ui: fix production build only empty role modal (#5806) Adds the ability for multiple components to use the same dom buffer --- ui-v2/app/services/dom-buffer.js | 9 +++++++-- ui-v2/app/templates/components/role-selector.hbs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ui-v2/app/services/dom-buffer.js b/ui-v2/app/services/dom-buffer.js index fe58d5fa36..9c06b5b4ca 100644 --- a/ui-v2/app/services/dom-buffer.js +++ b/ui-v2/app/services/dom-buffer.js @@ -11,12 +11,17 @@ export default Service.extend(Evented, { }, add: function(name, dom) { this.trigger('add', dom); - buffer[name] = dom; + if (typeof buffer[name] === 'undefined') { + buffer[name] = []; + } + buffer[name].push(dom); return dom; }, remove: function(name) { if (typeof buffer[name] !== 'undefined') { - buffer[name].remove(); + buffer[name].forEach(function(item) { + item.remove(); + }); delete buffer[name]; } }, diff --git a/ui-v2/app/templates/components/role-selector.hbs b/ui-v2/app/templates/components/role-selector.hbs index 0300e23e0f..dcdb1d1c50 100644 --- a/ui-v2/app/templates/components/role-selector.hbs +++ b/ui-v2/app/templates/components/role-selector.hbs @@ -8,7 +8,7 @@ {{/block-slot}} {{#block-slot 'body'}} - + {{#role-form form=form dc=dc}} {{#block-slot 'policy'}} @@ -23,7 +23,7 @@ {{/block-slot}} {{/role-form}} - + {{policy-form data-test-policy-form name="role[policy]" form=policyForm dc=dc}} {{/block-slot}}