Allow querystring parameters to set IsElementType checkbox on create document type route (#6779)

* Allow query string parameters sent to create document type route 'set' the default checkboxes for either Is an element type or Allow varying by culture

* allow isElement and AllowVaryByCulture to be set in infinite editor

not sure where this is used, but in theory this might be useful to be wired up too?

* Release the camels!

update the model properties to follow camelcase, ignoring the existing notemplate that doesn't!!
This commit is contained in:
Marc Goodson
2019-10-31 15:20:02 +00:00
committed by Sebastiaan Janssen
parent b2e5d64d6e
commit a873c9188f

View File

@@ -18,6 +18,8 @@
var documentTypeId = $routeParams.id;
var create = $routeParams.create;
var noTemplate = $routeParams.notemplate;
var isElement = $routeParams.iselement;
var allowVaryByCulture = $routeParams.culturevary;
var infiniteMode = $scope.model && $scope.model.infiniteMode;
vm.save = save;
@@ -63,6 +65,8 @@
documentTypeId = $scope.model.id;
create = $scope.model.create;
noTemplate = $scope.model.notemplate;
isElement = $scope.model.isElement;
allowVaryByCulture = $scope.model.allowVaryByCulture;
vm.submitButtonKey = "buttons_saveAndClose";
vm.generateModelsKey = "buttons_generateModelsAndClose";
}
@@ -430,7 +434,14 @@
contentType.defaultTemplate = contentTypeHelper.insertDefaultTemplatePlaceholder(contentType.defaultTemplate);
contentType.allowedTemplates = contentTypeHelper.insertTemplatePlaceholder(contentType.allowedTemplates);
}
// set isElement checkbox by default
if (isElement) {
contentType.isElement = true;
}
// set vary by culture checkbox by default
if (allowVaryByCulture) {
contentType.allowCultureVariant = true;
}
// convert icons for content type
convertLegacyIcons(contentType);