get and set AllowSegmentVariant

This commit is contained in:
Niels Lyngsø
2020-02-10 14:39:05 +01:00
parent 87b9642d1a
commit 0b730968ed
3 changed files with 4 additions and 2 deletions

View File

@@ -83,7 +83,7 @@
});
var saveProperties = _.map(realProperties, function (p) {
var saveProperty = _.pick(p, 'id', 'alias', 'description', 'validation', 'label', 'sortOrder', 'dataTypeId', 'groupId', 'memberCanEdit', 'showOnMemberProfile', 'isSensitiveData', 'allowCultureVariant');
var saveProperty = _.pick(p, 'id', 'alias', 'description', 'validation', 'label', 'sortOrder', 'dataTypeId', 'groupId', 'memberCanEdit', 'showOnMemberProfile', 'isSensitiveData', 'allowCultureVariant', 'allowSegmentVariant');
return saveProperty;
});

View File

@@ -228,6 +228,7 @@ namespace Umbraco.Web.Models.Mapping
target.ValidationRegExp = source.Validation.Pattern;
target.ValidationRegExpMessage = source.Validation.PatternMessage;
target.SetVariesBy(ContentVariation.Culture, source.AllowCultureVariant);
target.SetVariesBy(ContentVariation.Segment, source.AllowSegmentVariant);
if (source.Id > 0)
target.Id = source.Id;

View File

@@ -241,7 +241,8 @@ namespace Umbraco.Web.Models.Mapping
SortOrder = p.SortOrder,
ContentTypeId = contentType.Id,
ContentTypeName = contentType.Name,
AllowCultureVariant = p.VariesByCulture()
AllowCultureVariant = p.VariesByCulture(),
AllowSegmentVariant = p.VariesBySegment()
});
}