Merge remote-tracking branch 'origin/v8/dev' into v9/feature/merge-v8-05072021

# Conflicts:
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Compose/RelateOnTrashComponent.cs
#	src/Umbraco.Core/Composing/Current.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/Constants-SqlTemplates.cs
#	src/Umbraco.Core/Dashboards/ContentDashboardSettings.cs
#	src/Umbraco.Core/Dashboards/IContentDashboardSettings.cs
#	src/Umbraco.Core/Extensions/PublishedPropertyExtension.cs
#	src/Umbraco.Core/HealthChecks/Checks/Services/SmtpCheck.cs
#	src/Umbraco.Core/Models/IReadOnlyContentBase.cs
#	src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
#	src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs
#	src/Umbraco.Core/Models/ReadOnlyContentBaseAdapter.cs
#	src/Umbraco.Core/Persistence/NPocoDatabaseExtensions-Bulk.cs
#	src/Umbraco.Core/PropertyEditors/IPropertyCacheCompression.cs
#	src/Umbraco.Core/PropertyEditors/IPropertyCacheCompressionOptions.cs
#	src/Umbraco.Core/PropertyEditors/MediaPicker3Configuration.cs
#	src/Umbraco.Core/PropertyEditors/NoopPropertyCacheCompressionOptions.cs
#	src/Umbraco.Core/PropertyEditors/PropertyCacheCompression.cs
#	src/Umbraco.Core/Routing/UrlProviderExtensions.cs
#	src/Umbraco.Core/Runtime/CoreRuntime.cs
#	src/Umbraco.Core/Services/ILocalizedTextService.cs
#	src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs
#	src/Umbraco.Examine.Lucene/BackOfficeExamineSearcher.cs
#	src/Umbraco.Examine/UmbracoContentIndex.cs
#	src/Umbraco.Infrastructure/Examine/GenericIndexDiagnostics.cs
#	src/Umbraco.Infrastructure/IPublishedContentQuery.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Models/MediaWithCrops.cs
#	src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions.cs
#	src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ImageCropperConfiguration.cs
#	src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/UploadFileTypeValidator.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValue.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MediaPickerWithCropsValueConverter.cs
#	src/Umbraco.Infrastructure/PublishedContentQuery.cs
#	src/Umbraco.Infrastructure/Search/UmbracoTreeSearcherFields.cs
#	src/Umbraco.Infrastructure/Services/Implement/LocalizedTextService.cs
#	src/Umbraco.Persistence.SqlCe/SqlCeSyntaxProvider.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/BTree.DictionaryOfPropertyDataSerializer.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/BTree.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentSourceDto.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/PropertyData.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ImageCropperTest.cs
#	src/Umbraco.Tests/App.config
#	src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs
#	src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
#	src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
#	src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentTypeControllerBase.cs
#	src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs
#	src/Umbraco.Web.BackOffice/Controllers/DataTypeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs
#	src/Umbraco.Web.BackOffice/Controllers/TemplateQueryController.cs
#	src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web.BackOffice/Trees/DataTypeTreeController.cs
#	src/Umbraco.Web.BackOffice/Trees/MediaTypeTreeController.cs
#	src/Umbraco.Web.Common/Extensions/FriendlyImageCropperTemplateExtensions.cs
#	src/Umbraco.Web.Common/Extensions/ImageCropperTemplateCoreExtensions.cs
#	src/Umbraco.Web.Common/Macros/MacroRenderer.cs
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/it.xml
#	src/Umbraco.Web.UI/web.Template.Debug.config
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Compose/NotificationsComponent.cs
#	src/Umbraco.Web/Composing/ModuleInjector.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/Editors/CurrentUserController.cs
#	src/Umbraco.Web/Editors/DictionaryController.cs
#	src/Umbraco.Web/Editors/MediaTypeController.cs
#	src/Umbraco.Web/Editors/MemberController.cs
#	src/Umbraco.Web/Editors/MemberGroupController.cs
#	src/Umbraco.Web/Editors/MemberTypeController.cs
#	src/Umbraco.Web/Editors/NuCacheStatusController.cs
#	src/Umbraco.Web/Editors/UserGroupsController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/AbstractConfigCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/CompilationDebugCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationService.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/CustomErrorsCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/MacroErrorsCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/NotificationEmailCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/TraceCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Config/TrySkipIisCustomErrorsCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Permissions/FolderAndFilePermissionsCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/BaseHttpHeaderCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs
#	src/Umbraco.Web/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
#	src/Umbraco.Web/Models/Trees/MenuItemList.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentCacheDataModel.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/SerializerBase.cs
#	src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs
#	src/Umbraco.Web/Runtime/WebRuntime.cs
#	src/Umbraco.Web/Search/ExamineComponent.cs
#	src/Umbraco.Web/Trees/ApplicationTreeController.cs
#	src/Umbraco.Web/Trees/MemberTreeController.cs
#	src/Umbraco.Web/UrlHelperRenderExtensions.cs
This commit is contained in:
Bjarke Berg
2021-07-05 20:58:04 +02:00
122 changed files with 4101 additions and 1694 deletions

View File

@@ -14,7 +14,7 @@ function dataTypeHelper() {
for (var i = 0; i < preVals.length; i++) {
preValues.push({
hideLabel: preVals[i].hideLabel,
alias: preVals[i].key,
alias: preVals[i].key != undefined ? preVals[i].key : preVals[i].alias,
description: preVals[i].description,
label: preVals[i].label,
view: preVals[i].view,

View File

@@ -11,7 +11,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
//These are absolutely required in order for the macros to render inline
//we put these as extended elements because they get merged on top of the normal allowed elements by tiny mce
var extendedValidElements = "@[id|class|style],-div[id|dir|class|align|style],ins[datetime|cite],-ul[class|style],-li[class|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align],span[id|class|style]";
var extendedValidElements = "@[id|class|style],-div[id|dir|class|align|style],ins[datetime|cite],-ul[class|style],-li[class|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align],span[id|class|style|lang]";
var fallbackStyles = [{ title: "Page header", block: "h2" }, { title: "Section header", block: "h3" }, { title: "Paragraph header", block: "h4" }, { title: "Normal", block: "p" }, { title: "Quote", block: "blockquote" }, { title: "Code", block: "code" }];
// these languages are available for localization
var availableLanguages = [

View File

@@ -15,17 +15,6 @@
pointer-events: none;
}
.umb-nested-content--mandatory {
/*
yeah so this is a pain, but we must be super specific in targeting the mandatory property labels,
otherwise all properties within a reqired, nested, nested content property will all appear mandatory
*/
.umb-property > ng-form > .control-group > .umb-el-wrap > .control-header label:after {
content: '*';
color: @red;
}
}
.umb-nested-content-overlay {
position: absolute;
top: 0;

View File

@@ -112,7 +112,6 @@
* This will load in a new version
*/
function createDiff(currentVersion, previousVersion) {
vm.diff = {};
vm.diff.properties = [];
@@ -120,41 +119,55 @@
vm.diff.name = JsDiff.diffWords(currentVersion.name, previousVersion.name);
// extract all properties from the tabs and create new object for the diff
currentVersion.tabs.forEach((tab, tabIndex) => {
tab.properties.forEach((property, propertyIndex) => {
var oldProperty = previousVersion.tabs[tabIndex].properties[propertyIndex];
currentVersion.tabs.forEach(function (tab) {
tab.properties.forEach(function (property) {
let oldTabIndex = -1;
let oldTabPropertyIndex = -1;
const previousVersionTabs = previousVersion.tabs;
// copy existing properties, so it doesn't manipulate existing properties on page
oldProperty = Utilities.copy(oldProperty);
property = Utilities.copy(property);
// we have to make properties storing values as object into strings (Grid, nested content, etc.)
if(property.value instanceof Object) {
property.value = JSON.stringify(property.value, null, 1);
property.isObject = true;
// find the property by alias, but only search until we find it
for (var oti = 0, length = previousVersionTabs.length; oti < length; oti++) {
const opi = previousVersionTabs[oti].properties.findIndex(p => p.alias === property.alias);
if (opi !== -1) {
oldTabIndex = oti;
oldTabPropertyIndex = opi;
break;
}
}
if(oldProperty.value instanceof Object) {
oldProperty.value = JSON.stringify(oldProperty.value, null, 1);
oldProperty.isObject = true;
if (oldTabIndex !== -1 && oldTabPropertyIndex !== -1) {
let oldProperty = previousVersion.tabs[oldTabIndex].properties[oldTabPropertyIndex];
// copy existing properties, so it doesn't manipulate existing properties on page
oldProperty = Utilities.copy(oldProperty);
property = Utilities.copy(property);
// we have to make properties storing values as object into strings (Grid, nested content, etc.)
if (property.value instanceof Object) {
property.value = JSON.stringify(property.value, null, 1);
property.isObject = true;
}
if (oldProperty.value instanceof Object) {
oldProperty.value = JSON.stringify(oldProperty.value, null, 1);
oldProperty.isObject = true;
}
// diff requires a string
property.value = property.value ? property.value + '' : '';
oldProperty.value = oldProperty.value ? oldProperty.value + '' : '';
const diffProperty = {
'alias': property.alias,
'label': property.label,
'diff': property.isObject ? JsDiff.diffJson(property.value, oldProperty.value) : JsDiff.diffWords(property.value, oldProperty.value),
'isObject': property.isObject || oldProperty.isObject
};
vm.diff.properties.push(diffProperty);
}
// diff requires a string
property.value = property.value ? property.value + "" : "";
oldProperty.value = oldProperty.value ? oldProperty.value + "" : "";
var diffProperty = {
"alias": property.alias,
"label": property.label,
"diff": (property.isObject) ? JsDiff.diffJson(property.value, oldProperty.value) : JsDiff.diffWords(property.value, oldProperty.value),
"isObject": (property.isObject || oldProperty.isObject) ? true : false
};
vm.diff.properties.push(diffProperty);
});
});
}
function rollback() {

View File

@@ -16,7 +16,7 @@
{{vm.property.label}}
<span ng-if="vm.property.validation.mandatory">
<span ng-if="vm.property.validation.mandatory || vm.property.ncMandatory">
<strong class="umb-control-required">*</strong>
</span>

View File

@@ -1 +0,0 @@
<p style="background-color: #fee4e1; padding: 8px;"><strong>Important:</strong> switching from "Media Picker (legacy)" to "Media Picker" is not supported and doing so will mean all data (references to previously selected media items) will no longer be available on existing content items.</p>

View File

@@ -190,7 +190,7 @@
};
vm.openNodeTypePicker = function ($event) {
if (vm.nodes.length >= vm.maxItems) {
return;
}
@@ -537,15 +537,20 @@
if (tab) {
scaffold.variants[0].tabs.push(tab);
tab.properties.forEach(function (property) {
tab.properties.forEach(
function (property) {
if (_.find(notSupported, function (x) { return x === property.editor; })) {
property.notSupported = true;
// TODO: Not supported message to be replaced with 'content_nestedContentEditorNotSupported' dictionary key. Currently not possible due to async/timing quirk.
property.notSupportedMessage = "Property " + property.label + " uses editor " + property.editor + " which is not supported by Nested Content.";
}
});
}
);
}
// Ensure Culture Data for Complex Validation.
ensureCultureData(scaffold);
// Store the scaffold object
vm.scaffolds.push(scaffold);
}
@@ -558,6 +563,29 @@
});
});
/**
* Ensure that the containing content variant language and current property culture is transferred along
* to the scaffolded content object representing this block.
* This is required for validation along with ensuring that the umb-property inheritance is constantly maintained.
* @param {any} content
*/
function ensureCultureData(content) {
if (!content || !vm.umbVariantContent || !vm.umbProperty) return;
if (vm.umbVariantContent.editor.content.language) {
// set the scaffolded content's language to the language of the current editor
content.language = vm.umbVariantContent.editor.content.language;
}
// currently we only ever deal with invariant content for blocks so there's only one
content.variants[0].tabs.forEach(tab => {
tab.properties.forEach(prop => {
// set the scaffolded property to the culture of the containing property
prop.culture = vm.umbProperty.property.culture;
});
});
}
var initIfAllScaffoldsHaveLoaded = function () {
// Initialize when all scaffolds have loaded
if (model.config.contentTypes.length === scaffoldsLoaded) {

View File

@@ -4,7 +4,7 @@
<umb-property property="property"
property-alias="{{property.propertyAlias}}"
element-key="{{model.key}}"
ng-class="{'umb-nested-content--not-supported': property.notSupported, 'umb-nested-content--mandatory': property.ncMandatory}"
ng-class="{'umb-nested-content--not-supported': property.notSupported }"
data-element="property-{{property.alias}}">
<umb-property-editor model="property"></umb-property-editor>