Merge branch 'v8/8.7' into v8/dev
# Conflicts: # src/SolutionInfo.cs # src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js
This commit is contained in:
@@ -22,18 +22,18 @@
|
||||
|
||||
// Loop through all inner properties:
|
||||
for (var k in obj) {
|
||||
propClearingMethod(obj[k]);
|
||||
propClearingMethod(obj[k], clipboardService.TYPES.RAW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clipboardService.registrerClearPropertyResolver(clearNestedContentPropertiesForStorage)
|
||||
clipboardService.registerClearPropertyResolver(clearNestedContentPropertiesForStorage, clipboardService.TYPES.ELEMENT_TYPE)
|
||||
|
||||
|
||||
function clearInnerNestedContentPropertiesForStorage(prop, propClearingMethod) {
|
||||
|
||||
// if we got an array, and it has a entry with ncContentTypeAlias this meants that we are dealing with a NestedContent property inside a NestedContent property.
|
||||
// if we got an array, and it has a entry with ncContentTypeAlias this meants that we are dealing with a NestedContent property data.
|
||||
if ((Array.isArray(prop) && prop.length > 0 && prop[0].ncContentTypeAlias !== undefined)) {
|
||||
|
||||
for (var i = 0; i < prop.length; i++) {
|
||||
@@ -44,13 +44,13 @@
|
||||
|
||||
// Loop through all inner properties:
|
||||
for (var k in obj) {
|
||||
propClearingMethod(obj[k]);
|
||||
propClearingMethod(obj[k], clipboardService.TYPES.RAW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clipboardService.registrerClearPropertyResolver(clearInnerNestedContentPropertiesForStorage)
|
||||
clipboardService.registerClearPropertyResolver(clearInnerNestedContentPropertiesForStorage, clipboardService.TYPES.RAW)
|
||||
}]);
|
||||
|
||||
angular
|
||||
@@ -130,7 +130,7 @@
|
||||
}
|
||||
|
||||
localizationService.localize("clipboard_labelForArrayOfItemsFrom", [model.label, nodeName]).then(function (data) {
|
||||
clipboardService.copyArray("elementTypeArray", aliases, vm.nodes, data, "icon-thumbnail-list", model.id, clearNodeForCopy);
|
||||
clipboardService.copyArray(clipboardService.TYPES.ELEMENT_TYPE, aliases, vm.nodes, data, "icon-thumbnail-list", model.id, clearNodeForCopy);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
size: availableItems.length > 6 ? "medium" : "small",
|
||||
availableItems: availableItems,
|
||||
clickPasteItem: function (item) {
|
||||
if (item.type === "elementTypeArray") {
|
||||
if (Array.isArray(item.data)) {
|
||||
_.each(item.data, function (entry) {
|
||||
pasteFromClipboard(entry);
|
||||
});
|
||||
@@ -238,10 +238,9 @@
|
||||
|
||||
dialog.pasteItems = [];
|
||||
|
||||
var singleEntriesForPaste = clipboardService.retriveEntriesOfType("elementType", contentTypeAliases);
|
||||
_.each(singleEntriesForPaste, function (entry) {
|
||||
var entriesForPaste = clipboardService.retriveEntriesOfType(clipboardService.TYPES.ELEMENT_TYPE, contentTypeAliases);
|
||||
_.each(entriesForPaste, function (entry) {
|
||||
dialog.pasteItems.push({
|
||||
type: "elementType",
|
||||
date: entry.date,
|
||||
name: entry.label,
|
||||
data: entry.data,
|
||||
@@ -249,18 +248,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
var arrayEntriesForPaste = clipboardService.retriveEntriesOfType("elementTypeArray", contentTypeAliases);
|
||||
_.each(arrayEntriesForPaste, function (entry) {
|
||||
dialog.pasteItems.push({
|
||||
type: "elementTypeArray",
|
||||
date: entry.date,
|
||||
name: entry.label,
|
||||
data: entry.data,
|
||||
icon: entry.icon
|
||||
});
|
||||
});
|
||||
|
||||
vm.overlayMenu.pasteItems.sort( (a, b) => {
|
||||
dialog.pasteItems.sort( (a, b) => {
|
||||
return b.date - a.date
|
||||
});
|
||||
|
||||
@@ -269,8 +257,7 @@
|
||||
dialog.clickClearPaste = function ($event) {
|
||||
$event.stopPropagation();
|
||||
$event.preventDefault();
|
||||
clipboardService.clearEntriesOfType("elementType", contentTypeAliases);
|
||||
clipboardService.clearEntriesOfType("elementTypeArray", contentTypeAliases);
|
||||
clipboardService.clearEntriesOfType(clipboardService.TYPES.ELEMENT_TYPE, contentTypeAliases);
|
||||
dialog.pasteItems = [];// This dialog is not connected via the clipboardService events, so we need to update manually.
|
||||
dialog.overlayMenu.hideHeader = false;
|
||||
};
|
||||
@@ -463,7 +450,7 @@
|
||||
|
||||
syncCurrentNode();
|
||||
|
||||
clipboardService.copy("elementType", node.contentTypeAlias, node, null, null, null, clearNodeForCopy);
|
||||
clipboardService.copy(clipboardService.TYPES.ELEMENT_TYPE, node.contentTypeAlias, node, null, null, null, clearNodeForCopy);
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
@@ -474,6 +461,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
newNode = clipboardService.parseContentForPaste(newNode, clipboardService.TYPES.ELEMENT_TYPE);
|
||||
|
||||
// generate a new key.
|
||||
newNode.key = String.CreateGuid();
|
||||
|
||||
@@ -485,7 +474,7 @@
|
||||
}
|
||||
|
||||
function checkAbilityToPasteContent() {
|
||||
vm.showPaste = clipboardService.hasEntriesOfType("elementType", contentTypeAliases) || clipboardService.hasEntriesOfType("elementTypeArray", contentTypeAliases);
|
||||
vm.showPaste = clipboardService.hasEntriesOfType(clipboardService.TYPES.ELEMENT_TYPE, contentTypeAliases);
|
||||
}
|
||||
|
||||
eventsService.on("clipboardService.storageUpdate", checkAbilityToPasteContent);
|
||||
|
||||
Reference in New Issue
Block a user