Merge branch 'dev-v7' into dev-v7-contenttypeeditor
Conflicts: src/Umbraco.Web.UI.Client/bower.json src/Umbraco.Web.UI.Client/gruntFile.js src/Umbraco.Web.UI.Client/src/common/directives/editors/umbAutoResize.directive.js src/Umbraco.Web.UI.Client/src/common/directives/imaging/umbimagefolder.directive.js src/Umbraco.Web.UI.Client/src/common/directives/util/delayedMouseLeave.directive.js src/Umbraco.Web.UI.Client/src/less/application/grid.less src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js src/Umbraco.Web/Umbraco.Web.csproj
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService;
|
||||
var descendants = contentTypeService.GetContentTypeChildren(contentType.Id)
|
||||
.FlattenList(type => contentTypeService.GetContentTypeChildren(type.Id));
|
||||
.SelectRecursive(type => contentTypeService.GetContentTypeChildren(type.Id));
|
||||
return descendants;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace Umbraco.Core.Models.EntityBase
|
||||
/// the new api, which also needs to take effect in the legacy api.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
[Obsolete("Anytime there's a cancellable method it needs to return an Attempt so we know the outcome instead of this hack, not all services have been updated to use this though yet.")]
|
||||
internal bool WasCancelled
|
||||
{
|
||||
get { return _wasCancelled; }
|
||||
|
||||
@@ -4,9 +4,14 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IDomain : IAggregateRoot, IRememberBeingDirty, ICanBeDirty
|
||||
{
|
||||
ILanguage Language { get; set; }
|
||||
int? LanguageId { get; set; }
|
||||
string DomainName { get; set; }
|
||||
IContent RootContent { get; set; }
|
||||
int? RootContentId { get; set; }
|
||||
bool IsWildcard { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Readonly value of the language ISO code for the domain
|
||||
/// </summary>
|
||||
string LanguageIsoCode { get; }
|
||||
}
|
||||
}
|
||||
@@ -23,5 +23,11 @@ namespace Umbraco.Core.Models.Rdbms
|
||||
|
||||
[Column("domainName")]
|
||||
public string DomainName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used for a result on the query to get the associated language for a domain if there is one
|
||||
/// </summary>
|
||||
[ResultColumn("languageISOCode")]
|
||||
public string IsoCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -33,11 +33,11 @@ namespace Umbraco.Core.Models
|
||||
//re-parse it so we can check what properties are different and adjust the event handlers
|
||||
var parsed = StylesheetHelper.ParseRules(Content).ToArray();
|
||||
var names = parsed.Select(x => x.Name).ToArray();
|
||||
var existing = _properties.Value.Where(x => names.Contains(x.Name)).ToArray();
|
||||
var existing = _properties.Value.Where(x => names.InvariantContains(x.Name)).ToArray();
|
||||
//update existing
|
||||
foreach (var stylesheetProperty in existing)
|
||||
{
|
||||
var updateFrom = parsed.Single(x => x.Name == stylesheetProperty.Name);
|
||||
var updateFrom = parsed.Single(x => x.Name.InvariantEquals(stylesheetProperty.Name));
|
||||
//remove current event handler while we update, we'll reset it after
|
||||
stylesheetProperty.PropertyChanged -= Property_PropertyChanged;
|
||||
stylesheetProperty.Alias = updateFrom.Selector;
|
||||
@@ -46,14 +46,14 @@ namespace Umbraco.Core.Models
|
||||
stylesheetProperty.PropertyChanged += Property_PropertyChanged;
|
||||
}
|
||||
//remove no longer existing
|
||||
var nonExisting = _properties.Value.Where(x => names.Contains(x.Name) == false).ToArray();
|
||||
var nonExisting = _properties.Value.Where(x => names.InvariantContains(x.Name) == false).ToArray();
|
||||
foreach (var stylesheetProperty in nonExisting)
|
||||
{
|
||||
stylesheetProperty.PropertyChanged -= Property_PropertyChanged;
|
||||
_properties.Value.Remove(stylesheetProperty);
|
||||
}
|
||||
//add new ones
|
||||
var newItems = parsed.Where(x => _properties.Value.Select(p => p.Name).Contains(x.Name) == false);
|
||||
var newItems = parsed.Where(x => _properties.Value.Select(p => p.Name).InvariantContains(x.Name) == false);
|
||||
foreach (var stylesheetRule in newItems)
|
||||
{
|
||||
var prop = new StylesheetProperty(stylesheetRule.Name, stylesheetRule.Selector, stylesheetRule.Styles);
|
||||
@@ -128,7 +128,7 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="property"></param>
|
||||
public void AddProperty(StylesheetProperty property)
|
||||
{
|
||||
if (Properties.Any(x => x.Name == property.Name))
|
||||
if (Properties.Any(x => x.Name.InvariantEquals(property.Name)))
|
||||
{
|
||||
throw new DuplicateNameException("The property with the name " + property.Name + " already exists in the collection");
|
||||
}
|
||||
@@ -151,7 +151,7 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="name"></param>
|
||||
public void RemoveProperty(string name)
|
||||
{
|
||||
if (Properties.Any(x => x.Name == name))
|
||||
if (Properties.Any(x => x.Name.InvariantEquals(name)))
|
||||
{
|
||||
Content = StylesheetHelper.ReplaceRule(Content, name, null);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
//TODO: Need to custom serialize this
|
||||
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class UmbracoDomain : Entity, IDomain
|
||||
@@ -16,25 +14,32 @@ namespace Umbraco.Core.Models
|
||||
_domainName = domainName;
|
||||
}
|
||||
|
||||
private IContent _content;
|
||||
private ILanguage _language;
|
||||
public UmbracoDomain(string domainName, string languageIsoCode)
|
||||
: this(domainName)
|
||||
{
|
||||
LanguageIsoCode = languageIsoCode;
|
||||
}
|
||||
|
||||
private int? _contentId;
|
||||
private int? _languageId;
|
||||
private string _domainName;
|
||||
|
||||
private static readonly PropertyInfo DefaultLanguageSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, ILanguage>(x => x.Language);
|
||||
private static readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.RootContentId);
|
||||
private static readonly PropertyInfo DefaultLanguageSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.LanguageId);
|
||||
private static readonly PropertyInfo DomainNameSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, string>(x => x.DomainName);
|
||||
private static readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, IContent>(x => x.RootContent);
|
||||
|
||||
|
||||
[DataMember]
|
||||
public ILanguage Language
|
||||
public int? LanguageId
|
||||
{
|
||||
get { return _language; }
|
||||
get { return _languageId; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_language = value;
|
||||
return _language;
|
||||
}, _language, DefaultLanguageSelector);
|
||||
_languageId = value;
|
||||
return _languageId;
|
||||
}, _languageId, DefaultLanguageSelector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,16 +58,16 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
[DataMember]
|
||||
public IContent RootContent
|
||||
public int? RootContentId
|
||||
{
|
||||
get { return _content; }
|
||||
get { return _contentId; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_content = value;
|
||||
return _content;
|
||||
}, _content, ContentSelector);
|
||||
_contentId = value;
|
||||
return _contentId;
|
||||
}, _contentId, ContentSelector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,5 +75,10 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
get { return string.IsNullOrWhiteSpace(DomainName) || DomainName.StartsWith("*"); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Readonly value of the language ISO code for the domain
|
||||
/// </summary>
|
||||
public string LanguageIsoCode { get; internal set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user