diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js index 90f81bd827..f003e1afa6 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js @@ -15,7 +15,8 @@ $scope.activeTabAlias = null; $scope.tabs = []; - $scope.allowUpdate = $scope.content.allowedActions.includes('A'); + //$scope.allowUpdate = $scope.content.allowedActions.includes('A'); + setAllowUpdate() $scope.allowEditInvariantFromNonDefault = Umbraco.Sys.ServerVariables.umbracoSettings.allowEditInvariantFromNonDefault; $scope.$watchCollection('content.tabs', (newValue) => { @@ -44,6 +45,10 @@ } }); + function setAllowUpdate() { + $scope.allowUpdate = $scope.content.allowedActions.includes('A'); + } + function onScroll(event) { var viewFocusY = scrollableNode.scrollTop + scrollableNode.clientHeight * .5; @@ -151,6 +156,17 @@ } }); + $scope.$on("formSubmitting", function() { + $scope.allowUpdate = false; + }); + + $scope.$on("formSubmitted", function() { + setAllowUpdate(); + }); + $scope.$on("formSubmittedValidationFailed", function() { + setAllowUpdate(); + }); + //ensure to unregister from all dom-events $scope.$on('$destroy', function () { cancelScrollTween(); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js index 85ca297e69..4a8dff7146 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js @@ -637,21 +637,26 @@ } blockObject.retrieveValuesFrom = function (content, settings) { - if (this.content !== null) { + if (this.content) { mapElementValues(content, this.content); + if (this.config.settingsElementTypeKey !== null) { + mapElementValues(settings, this.settings); + } + } else { + console.error("This data cannot be edited at the given movement. Maybe due to publishing while editing."); } - if (this.config.settingsElementTypeKey !== null) { - mapElementValues(settings, this.settings); - } + }; blockObject.sync = function () { - if (this.content !== null) { + if (this.content) { mapToPropertyModel(this.content, this.data); - } - if (this.config.settingsElementTypeKey !== null) { - mapToPropertyModel(this.settings, this.settingsData); + if (this.config.settingsElementTypeKey !== null) { + mapToPropertyModel(this.settings, this.settingsData); + } + } else { + console.error("This data cannot be edited at the given movement. Maybe due to publishing while editing."); } }; // first time instant update of label. diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js index f260bd4d31..b5353c74e4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js @@ -369,7 +369,7 @@ let i = layoutEntry.areas.length; while(i--) { const layoutEntryArea = layoutEntry.areas[i]; - const areaConfigIndex = block.config.areas.findIndex(x => x.key === layoutEntryArea.key); + const areaConfigIndex = block.config.unsupported ? -1 : block.config.areas.findIndex(x => x.key === layoutEntryArea.key); if(areaConfigIndex === -1) { layoutEntry.areas.splice(i, 1); }