Skip to content

Commit

Permalink
Filter out complex properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Öhman committed Mar 8, 2021
1 parent 15058c4 commit 38358ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
vm.properties.push({
alias: property.alias,
name: property.label,
isDisabled: property.editor === "Umbraco.NestedContent" || property.editor === "Umbraco.BlockList",
copy: false,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h5>Copy..</h5>
<div class="umb-checkboxlist">
<ul class="unstyled">
<li ng-repeat="item in vm.properties track by item.alias">
<umb-checkbox name="paroperty" value="{{::item.alias}}" model="item.copy" text="{{::item.name}}"></umb-checkbox>
<umb-checkbox disabled="item.isDisabled" name="paroperty" value="{{::item.alias}}" model="item.copy" text="{{::item.name}}"></umb-checkbox>
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ public bool CopyCulture(CopyCulture model)
Services.ContentService.Save(content);
}

var complexProperty = new string[] {
global::Umbraco.Core.Constants.PropertyEditors.Aliases.NestedContent,
global::Umbraco.Core.Constants.PropertyEditors.Aliases.BlockList
};

foreach (var property in content.Properties.Where(x =>
x.PropertyType.VariesByCulture() &&
!complexProperty.Contains(x.PropertyType.Alias) &&
(model.Properties.Any() && model.Properties.Contains(x.Alias))
))
{
Expand Down

0 comments on commit 38358ab

Please sign in to comment.