Merge remote-tracking branch 'origin/v8/8.7' into v8/feature/block-editor-list-validation

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/blocklistentryeditors/labelblock/labelblock.editor.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js
This commit is contained in:
Shannon
2020-07-02 15:29:13 +10:00
12 changed files with 2546 additions and 2504 deletions
@@ -396,7 +396,7 @@
if (blockConfiguration === null) {
console.error("The block entry of "+udi+" is not begin initialized cause its contentTypeKey is not allowed for this PropertyEditor");
} else {
var contentScaffold = this.getScaffoldFromKey(blockConfiguration.contentTypeKey);
contentScaffold = this.getScaffoldFromKey(blockConfiguration.contentTypeKey);
if(contentScaffold === null) {
console.error("The block entry of "+udi+" is not begin initialized cause its Element Type was not loaded.");
}
@@ -359,6 +359,7 @@
if (infiniteMode && $scope.model.submit) {
$scope.model.documentTypeAlias = vm.contentType.alias;
$scope.model.documentTypeKey = vm.contentType.key;
$scope.model.submit($scope.model);
}
@@ -13,9 +13,11 @@
$scope.$broadcast("formSubmitting", { scope: $scope });
// Some property editors need to performe an action after all property editors have reacted to the formSubmitting.
$scope.$broadcast("postFormSubmitting", { scope: $scope });
block.active = false;
} else {
$scope.api.activateBlock(block);
}
block.active = !block.active;
}
}
@@ -1,5 +1,5 @@
<button type="button" class="btn-reset umb-outline blockelement-labelblock-editor blockelement__draggable-element"
ng-click="api.editBlock(block, false, index)"
ng-click="api.editBlock(block, block.hideContentInOverlay, index)"
ng-focus="block.focus"
ng-class="{'--active':block.active}">
<i class="icon {{block.content.icon}}"></i>
@@ -132,11 +132,11 @@
vm.elementTypes[i] = args.documentType;
}
}
if (vm.contentPreview.key === key) {
if (vm.contentPreview && vm.contentPreview.key === key) {
vm.contentPreview = args.documentType;
$scope.$evalAsync();
}
if (vm.settingsPreview.key === key) {
if (vm.settingsPreview && vm.settingsPreview.key === key) {
vm.settingsPreview = args.documentType;
$scope.$evalAsync();
}
@@ -196,6 +196,28 @@
</div>
<div class="umb-group-panel">
<div class="umb-group-panel__header">
<localize key="blockEditor_headlineAdvanced">Advanced</localize>
</div>
<div class="umb-group-panel__content">
<!-- forceHideContentEditorInOverlay -->
<div class="control-group umb-control-group -no-border">
<div class="umb-el-wrap">
<label class="control-label" for="forceHideContentEditorInOverlay"><localize key="blockEditor_forceHideContentEditor">Force hide content editor</localize></label>
<div class="controls">
<umb-toggle checked="vm.block.forceHideContentEditorInOverlay" on-click="vm.block.forceHideContentEditorInOverlay = vm.block.forceHideContentEditorInOverlay != true"></umb-toggle>
</div>
</div>
</div>
</div>
</div>
</div>
</umb-editor-container>
@@ -172,6 +172,7 @@
block.view = (block.config.view ? "/" + block.config.view : getDefaultViewForBlock(block));
block.hideContentInOverlay = block.config.forceHideContentEditorInOverlay === true || inlineEditing === true;
block.showSettings = block.config.settingsElementTypeKey != null;
block.showCopy = vm.supportCopy && block.config.contentTypeKey != null;// if we have content, otherwise it dosnt make sense to copy.
@@ -226,6 +227,10 @@
deleteBlock(entry.$block);
});
}
function activateBlock(blockObject) {
blockObject.active = true;
}
function editBlock(blockObject, openSettings, blockIndex) {
@@ -235,12 +240,19 @@
}
var wasNotActiveBefore = blockObject.active !== true;
blockObject.active = true;
if (inlineEditing === true && openSettings !== true) {
// dont open the editor overlay if block has hidden its content editor in overlays and we are requesting to open content, not settings.
if (openSettings !== true && blockObject.hideContentInOverlay === true) {
return;
}
// if requesting to open settings but we dont have settings then return.
if (openSettings === true && !blockObject.config.settingsElementTypeKey) {
return;
}
activateBlock(blockObject);
// make a clone to avoid editing model directly.
var blockContentClone = Utilities.copy(blockObject.content);
var blockSettingsClone = null;
@@ -248,12 +260,10 @@
if (blockObject.config.settingsElementTypeKey) {
blockSettingsClone = Utilities.copy(blockObject.settings);
}
var hideContent = (openSettings === true && inlineEditing === true);
var blockEditorModel = {
$parentScope: $scope, // pass in a $parentScope, this maintains the scope inheritance in infinite editing
hideContent: hideContent,
hideContent: blockObject.hideContentInOverlay,
openSettings: openSettings === true,
liveEditing: liveEditing,
title: blockObject.label,
@@ -339,7 +349,11 @@
if(!(mouseEvent.ctrlKey || mouseEvent.metaKey)) {
editorService.close();
if (added && vm.layout.length > createIndex) {
editBlock(vm.layout[createIndex].$block, false, createIndex);
if (inlineEditing === true) {
activateBlock(vm.layout[createIndex].$block);
} else if (inlineEditing === false && vm.layout[createIndex].$block.hideContentInOverlay !== true) {
editBlock(vm.layout[createIndex].$block, false, createIndex);
}
}
}
},
@@ -486,6 +500,7 @@
}
vm.blockEditorApi = {
activateBlock: activateBlock,
editBlock: editBlock,
copyBlock: copyBlock,
requestDeleteBlock: requestDeleteBlock,
@@ -1849,6 +1849,8 @@ Mange hilsner fra Umbraco robotten
<key alias="tabCreateEmpty">Opret ny</key>
<key alias="tabClipboard">Udklipsholder</key>
<key alias="tabBlockSettings">Indstillinger</key>
<key alias="headlineAdvanced">Avanceret</key>
<key alias="forceHideContentEditor">Skjuld indholds editoren</key>
</area>
</language>
File diff suppressed because it is too large Load Diff
@@ -2485,6 +2485,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="tabCreateEmpty">Create empty</key>
<key alias="tabClipboard">Clipboard</key>
<key alias="tabBlockSettings">Settings</key>
<key alias="headlineAdvanced">Advanced</key>
<key alias="forceHideContentEditor">Force hide content editor</key>
</area>
<area alias="contentTemplatesDashboard">
<key alias="whatHeadline">What are Content Templates?</key>
@@ -8,13 +8,6 @@
{
if (layout?.Udi == null) { continue; }
var data = layout.Data;
try
{
@Html.Partial("BlockList/Components/" + data.ContentType.Alias, layout)
}
catch (Exception ex)
{
global::Umbraco.Core.Composing.Current.Logger.Error(typeof(BlockListModel), ex, "Could not display block list component for content type {0}", data?.ContentType?.Alias);
}
@Html.Partial("BlockList/Components/" + data.ContentType.Alias, layout)
}
</div>
@@ -44,6 +44,9 @@ namespace Umbraco.Web.PropertyEditors
[JsonProperty("editorSize")]
public string EditorSize { get; set; }
[JsonProperty("forceHideContentEditorInOverlay")]
public bool ForceHideContentEditorInOverlay { get; set; }
}
[ConfigurationField("validationLimit", "Amount", "numberrange", Description = "Set a required range of blocks")]