From a43b981feb4b210b5f5ab929d5a72811523aa3c6 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 28 Aug 2019 21:21:23 +0200 Subject: [PATCH 1/2] Temp-5724: Unable to add multiple property groups in membertype/doctype editor --- .../components/umbgroupsbuilder.directive.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js index c1f34e64ae..2d4b0aaca5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js @@ -381,6 +381,8 @@ // activate group scope.activateGroup(group); + // push new init tab to the scope + addInitGroup(scope.model.groups); }; scope.activateGroup = function(selectedGroup) { @@ -399,7 +401,6 @@ scope.removeGroup = function(groupIndex) { scope.model.groups.splice(groupIndex, 1); - addInitGroup(scope.model.groups); }; scope.updateGroupTitle = function(group) { @@ -528,9 +529,6 @@ // set focus on init property var numberOfProperties = group.properties.length; group.properties[numberOfProperties - 1].focus = true; - - // push new init tab to the scope - addInitGroup(scope.model.groups); notifyChanged(); }, @@ -582,10 +580,10 @@ if(tab.properties.length === 1 && tab.properties[0].propertyState === "init") { angular.forEach(scope.model.groups, function(group, index, groups){ - if(group.tabState === 'init') { + if(group === tab) { groups.splice(index, 1); } - }); + }); } From e85905ad6537555e15ef89c87f72c6afc49c4511 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 28 Aug 2019 21:31:50 +0200 Subject: [PATCH 2/2] temp-5724: Removed the placeholder code, because there should always be an inital group now --- .../components/umbgroupsbuilder.directive.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js index 2d4b0aaca5..3129e720e4 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js @@ -576,17 +576,6 @@ // remove property tab.properties.splice(propertyIndex, 1); - // if the last property in group is an placeholder - remove add new tab placeholder - if(tab.properties.length === 1 && tab.properties[0].propertyState === "init") { - - angular.forEach(scope.model.groups, function(group, index, groups){ - if(group === tab) { - groups.splice(index, 1); - } - }); - - } - notifyChanged(); };