From f19ef98f5f5616bca6fd2b67b12d285552289b85 Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Wed, 4 Oct 2017 16:04:31 -0300 Subject: [PATCH] Ignoring action components when using arrays on group mixin --- .../ohif-core/client/components/base/mixins/group.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Packages/ohif-core/client/components/base/mixins/group.js b/Packages/ohif-core/client/components/base/mixins/group.js index 0b7d4c5aa..e9b725c96 100644 --- a/Packages/ohif-core/client/components/base/mixins/group.js +++ b/Packages/ohif-core/client/components/base/mixins/group.js @@ -44,6 +44,12 @@ OHIF.mixins.group = new OHIF.Mixin({ component.registeredItems.forEach(child => { // Check if it is an array or an object group if (isArray) { + // Get the mixins array + const mixins = child.templateInstance.data.mixins.split(' '); + + // Prevent reading action components + if (mixins.indexOf('action') > -1) return; + // Push the item value to the result array result.push(child.value()); } else { @@ -73,6 +79,11 @@ OHIF.mixins.group = new OHIF.Mixin({ // Iterate over each registered item and set its value let i = 0; component.registeredItems.forEach(child => { + const mixins = child.templateInstance.data.mixins.split(' '); + + // Prevent reading action components + if (isArray && mixins.indexOf('action') > -1) return; + const key = isArray ? i : child.templateInstance.data.key; const childValue = _.isUndefined(groupValue[key]) ? null : groupValue[key]; child.value(childValue);