Merge branch 'temp-U4-7549' into 7.4.0
Conflicts: src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js
This commit is contained in:
@@ -187,7 +187,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
|
||||
private void CreateCmsPropertyTypeData()
|
||||
{
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = -90, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = 1043, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
|
||||
@@ -110,7 +110,6 @@
|
||||
];
|
||||
|
||||
if ($routeParams.create) {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
//we are creating so get an empty data type item
|
||||
@@ -124,7 +123,6 @@
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
contentTypeResource.getById($routeParams.id).then(function (dt) {
|
||||
@@ -141,7 +139,6 @@
|
||||
/* ---------- SAVE ---------- */
|
||||
|
||||
function save() {
|
||||
|
||||
var deferred = $q.defer();
|
||||
|
||||
vm.page.saveButtonState = "busy";
|
||||
@@ -206,18 +203,15 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
vm.page.saveButtonState = "error";
|
||||
|
||||
deferred.reject(err);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
|
||||
}
|
||||
|
||||
function init(contentType) {
|
||||
|
||||
//get available composite types
|
||||
contentTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) {
|
||||
contentType.availableCompositeContentTypes = result;
|
||||
@@ -237,8 +231,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// sort properties after sort order
|
||||
angular.forEach(contentType.groups, function (group) {
|
||||
group.properties = $filter('orderBy')(group.properties, 'sortOrder');
|
||||
@@ -250,17 +242,13 @@
|
||||
contentType.allowedTemplates = contentTypeHelper.insertTemplatePlaceholder(contentType.allowedTemplates);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//set a shared state
|
||||
editorState.set(contentType);
|
||||
|
||||
vm.contentType = contentType;
|
||||
|
||||
}
|
||||
|
||||
function convertLegacyIcons(contentType) {
|
||||
|
||||
// make array to store contentType icon
|
||||
var contentTypeArray = [];
|
||||
|
||||
@@ -272,11 +260,9 @@
|
||||
|
||||
// set icon back on contentType
|
||||
contentType.icon = contentTypeArray[0].icon;
|
||||
|
||||
}
|
||||
|
||||
function getDataTypeDetails(property) {
|
||||
|
||||
if (property.propertyState !== "init") {
|
||||
|
||||
dataTypeResource.getById(property.dataTypeId)
|
||||
@@ -287,18 +273,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Syncs the content type to it's tree node - this occurs on first load and after saving */
|
||||
function syncTreeNode(dt, path, initialLoad) {
|
||||
|
||||
navigationService.syncTree({ tree: "documenttypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
|
||||
vm.currentNode = syncArgs.node;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.DocumentTypes.EditController", DocumentTypesEditController);
|
||||
|
||||
})();
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
"use strict";
|
||||
|
||||
function MediaTypesEditController($scope, $routeParams, mediaTypeResource, dataTypeResource, editorState, contentEditingHelper, formHelper, navigationService, iconHelper, contentTypeHelper, notificationsService, $filter, $q, localizationService) {
|
||||
|
||||
var vm = this;
|
||||
|
||||
vm.save = save;
|
||||
@@ -96,22 +95,20 @@
|
||||
];
|
||||
|
||||
if ($routeParams.create) {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
//we are creating so get an empty data type item
|
||||
mediaTypeResource.getScaffold($routeParams.id)
|
||||
.then(function (dt) {
|
||||
init(dt);
|
||||
.then(function(dt) {
|
||||
init(dt);
|
||||
|
||||
vm.page.loading = false;
|
||||
});
|
||||
vm.page.loading = false;
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
mediaTypeResource.getById($routeParams.id).then(function (dt) {
|
||||
mediaTypeResource.getById($routeParams.id).then(function(dt) {
|
||||
init(dt);
|
||||
|
||||
syncTreeNode(vm.contentType, dt.path, true);
|
||||
@@ -120,11 +117,9 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ---------- SAVE ---------- */
|
||||
|
||||
function save() {
|
||||
|
||||
var deferred = $q.defer();
|
||||
|
||||
vm.page.saveButtonState = "busy";
|
||||
@@ -165,17 +160,14 @@
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
|
||||
}
|
||||
|
||||
function init(contentType) {
|
||||
|
||||
//get available composite types
|
||||
mediaTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) {
|
||||
contentType.availableCompositeContentTypes = result;
|
||||
|
||||
// convert icons for composite content types
|
||||
iconHelper.formatContentTypeIcons(contentType.availableCompositeContentTypes);
|
||||
// convert legacy icons
|
||||
convertLegacyIcons(contentType);
|
||||
});
|
||||
|
||||
// set all tab to inactive
|
||||
@@ -189,10 +181,7 @@
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// convert legacy icons
|
||||
convertLegacyIcons(contentType);
|
||||
|
||||
|
||||
// sort properties after sort order
|
||||
angular.forEach(contentType.groups, function (group) {
|
||||
group.properties = $filter('orderBy')(group.properties, 'sortOrder');
|
||||
@@ -202,11 +191,9 @@
|
||||
editorState.set(contentType);
|
||||
|
||||
vm.contentType = contentType;
|
||||
|
||||
}
|
||||
|
||||
function convertLegacyIcons(contentType) {
|
||||
|
||||
// make array to store contentType icon
|
||||
var contentTypeArray = [];
|
||||
|
||||
@@ -218,33 +205,27 @@
|
||||
|
||||
// set icon back on contentType
|
||||
contentType.icon = contentTypeArray[0].icon;
|
||||
|
||||
}
|
||||
|
||||
function getDataTypeDetails(property) {
|
||||
|
||||
if (property.propertyState !== "init") {
|
||||
|
||||
dataTypeResource.getById(property.dataTypeId)
|
||||
.then(function (dataType) {
|
||||
property.dataTypeIcon = dataType.icon;
|
||||
property.dataTypeName = dataType.name;
|
||||
});
|
||||
.then(function(dataType) {
|
||||
property.dataTypeIcon = dataType.icon;
|
||||
property.dataTypeName = dataType.name;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Syncs the content type to it's tree node - this occurs on first load and after saving */
|
||||
function syncTreeNode(dt, path, initialLoad) {
|
||||
|
||||
navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
|
||||
navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function(syncArgs) {
|
||||
vm.currentNode = syncArgs.node;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.MediaTypes.EditController", MediaTypesEditController);
|
||||
|
||||
})();
|
||||
|
||||
@@ -140,8 +140,8 @@
|
||||
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
|
||||
<providers>
|
||||
<clear />
|
||||
<add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
|
||||
<add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
|
||||
<add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
|
||||
<add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
|
||||
</providers>
|
||||
</membership>
|
||||
<!-- Role Provider -->
|
||||
|
||||
Reference in New Issue
Block a user