Skip to content

Commit

Permalink
Allow querystring parameters to set IsElementType checkbox on create …
Browse files Browse the repository at this point in the history
…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!!
  • Loading branch information
marcemarc authored and nul800sebastiaan committed Oct 31, 2019
1 parent b2e5d64 commit a873c91
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit a873c91

Please sign in to comment.