Merge branch temp8 into temp8-appCaches
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
[DataContract]
|
||||
public class InstalledPackageModel
|
||||
{
|
||||
[DataMember(Name = "id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[DataMember(Name = "name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DataMember(Name = "author")]
|
||||
public string Author { get; set; }
|
||||
|
||||
[DataMember(Name = "files")]
|
||||
public IEnumerable<string> Files { get; set; }
|
||||
|
||||
[DataMember(Name = "version")]
|
||||
public string Version { get; set; }
|
||||
|
||||
[DataMember(Name = "url")]
|
||||
public string Url { get; set; }
|
||||
|
||||
[DataMember(Name = "license")]
|
||||
public string License { get; set; }
|
||||
|
||||
[DataMember(Name = "licenseUrl")]
|
||||
public string LicenseUrl { get; set; }
|
||||
|
||||
[DataMember(Name = "iconUrl")]
|
||||
public string IconUrl { get; set; }
|
||||
|
||||
[DataMember(Name = "readme")]
|
||||
public string Readme { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -86,8 +86,11 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
/// <summary>
|
||||
/// Property Group
|
||||
/// </summary>
|
||||
PropertyGroup
|
||||
PropertyGroup,
|
||||
|
||||
//TODO: Dictionary?
|
||||
/// <summary>
|
||||
/// Dictionary Item
|
||||
/// </summary>
|
||||
DictionaryItem
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,18 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
public CodeFileMapperProfile()
|
||||
{
|
||||
CreateMap<Stylesheet, EntityBasic>()
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(sheet => sheet.Id))
|
||||
.ForMember(dest => dest.Alias, opt => opt.MapFrom(sheet => sheet.Alias))
|
||||
.ForMember(dest => dest.Key, opt => opt.MapFrom(sheet => sheet.Key))
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(sheet => sheet.Name))
|
||||
.ForMember(dest => dest.ParentId, opt => opt.UseValue(-1))
|
||||
.ForMember(dest => dest.Path, opt => opt.MapFrom(sheet => sheet.Path))
|
||||
.ForMember(dest => dest.Trashed, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Udi, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Icon, opt => opt.Ignore());
|
||||
|
||||
CreateMap<IPartialView, CodeFileDisplay>()
|
||||
.ForMember(dest => dest.FileType, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Notifications, opt => opt.Ignore())
|
||||
|
||||
@@ -17,6 +17,18 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
public DictionaryMapperProfile(ILocalizationService localizationService)
|
||||
{
|
||||
CreateMap<IDictionaryItem, EntityBasic>()
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(sheet => sheet.Id))
|
||||
.ForMember(dest => dest.Alias, opt => opt.MapFrom(sheet => sheet.ItemKey))
|
||||
.ForMember(dest => dest.Key, opt => opt.MapFrom(sheet => sheet.Key))
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(sheet => sheet.ItemKey))
|
||||
.ForMember(dest => dest.ParentId, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Path, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Trashed, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Udi, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Icon, opt => opt.Ignore());
|
||||
|
||||
CreateMap<IDictionaryItem, DictionaryDisplay>()
|
||||
.ForMember(x => x.Translations, expression => expression.Ignore())
|
||||
.ForMember(x => x.Notifications, expression => expression.Ignore())
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
internal class EntityMapperProfile : Profile
|
||||
{
|
||||
private static string GetContentTypeIcon(EntitySlim entity)
|
||||
private static string GetContentTypeIcon(IEntitySlim entity)
|
||||
=> entity is ContentEntitySlim contentEntity ? contentEntity.ContentTypeIcon : null;
|
||||
|
||||
public EntityMapperProfile()
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
// create, capture, cache
|
||||
var contentTypeUdiResolver = new ContentTypeUdiResolver();
|
||||
|
||||
CreateMap<EntitySlim, EntityBasic>()
|
||||
CreateMap<IEntitySlim, EntityBasic>()
|
||||
.ForMember(dest => dest.Name, opt => opt.ResolveUsing<NameResolver>())
|
||||
.ForMember(dest => dest.Udi, opt => opt.MapFrom(src => Udi.Create(ObjectTypes.GetUdiType(src.NodeObjectType), src.Key)))
|
||||
.ForMember(dest => dest.Icon, opt => opt.MapFrom(src => GetContentTypeIcon(src)))
|
||||
@@ -36,6 +36,8 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
dest.Icon = "icon-user";
|
||||
}
|
||||
|
||||
dest.AdditionalData.Add("IsContainer", src.IsContainer);
|
||||
});
|
||||
|
||||
CreateMap<PropertyType, EntityBasic>()
|
||||
@@ -186,9 +188,9 @@ namespace Umbraco.Web.Models.Mapping
|
||||
/// <summary>
|
||||
/// Resolves the name for a content item/content variant
|
||||
/// </summary>
|
||||
private class NameResolver : IValueResolver<EntitySlim, EntityBasic, string>
|
||||
private class NameResolver : IValueResolver<IEntitySlim, EntityBasic, string>
|
||||
{
|
||||
public string Resolve(EntitySlim source, EntityBasic destination, string destMember, ResolutionContext context)
|
||||
public string Resolve(IEntitySlim source, EntityBasic destination, string destMember, ResolutionContext context)
|
||||
{
|
||||
if (!(source is DocumentEntitySlim doc))
|
||||
return source.Name;
|
||||
|
||||
@@ -12,6 +12,18 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
public LanguageMapperProfile()
|
||||
{
|
||||
CreateMap<ILanguage, EntityBasic>()
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(x => x.Id))
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(x => x.CultureName))
|
||||
.ForMember(dest => dest.Key, opt => opt.MapFrom(x => x.Key))
|
||||
.ForMember(dest => dest.Alias, opt => opt.MapFrom(x => x.IsoCode))
|
||||
.ForMember(dest => dest.ParentId, opt => opt.UseValue(-1))
|
||||
.ForMember(dest => dest.Path, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Trashed, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Udi, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Icon, opt => opt.Ignore());
|
||||
|
||||
CreateMap<ILanguage, Language>()
|
||||
.ForMember(l => l.Name, expression => expression.MapFrom(x => x.CultureInfo.DisplayName));
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using Umbraco.Core.Models.Trees;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
@@ -9,7 +10,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
public SectionMapperProfile(ILocalizedTextService textService)
|
||||
{
|
||||
CreateMap<Core.Models.Section, Section>()
|
||||
CreateMap<IBackOfficeSection, Section>()
|
||||
.ForMember(dest => dest.RoutePath, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Icon, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => textService.Localize("sections/" + src.Alias, (IDictionary<string, string>)null)))
|
||||
|
||||
@@ -12,6 +12,7 @@ using Umbraco.Core.Models.Entities;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Actions;
|
||||
using Umbraco.Web.Services;
|
||||
|
||||
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies an application tree
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
||||
public class ApplicationAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApplicationAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="alias">The alias.</param>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <param name="sortOrder">The sort order.</param>
|
||||
public ApplicationAttribute(string alias,
|
||||
string name,
|
||||
int sortOrder = 0)
|
||||
{
|
||||
Alias = alias;
|
||||
Name = name;
|
||||
SortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public string Alias { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public int SortOrder { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
// The application definitions are intended as a means to auto populate
|
||||
// the application.config. On app startup, Umbraco will look for any
|
||||
// unregistered classes with an ApplicationAttribute and add them to the cache
|
||||
|
||||
[Application(Constants.Applications.Content, "Content")]
|
||||
public class ContentApplicationDefinition : IApplication
|
||||
{ }
|
||||
|
||||
[Application(Constants.Applications.Media, "Media", sortOrder: 1)]
|
||||
public class MediaApplicationDefinition : IApplication
|
||||
{ }
|
||||
|
||||
[Application(Constants.Applications.Settings, "Settings", sortOrder: 2)]
|
||||
public class SettingsApplicationDefinition : IApplication
|
||||
{ }
|
||||
|
||||
[Application(Constants.Applications.Packages, "Packages", sortOrder: 3)]
|
||||
public class PackagesApplicationDefinition : IApplication
|
||||
{ }
|
||||
|
||||
[Application(Constants.Applications.Users, "Users", sortOrder: 4)]
|
||||
public class UsersApplicationDefinition : IApplication
|
||||
{ }
|
||||
|
||||
[Application(Constants.Applications.Members, "Members", sortOrder: 5)]
|
||||
public class MembersApplicationDefinition : IApplication
|
||||
{ }
|
||||
|
||||
[Application(Constants.Applications.Translation, "Translation", sortOrder: 6)]
|
||||
public class TranslationApplicationDefinition : IApplication
|
||||
{ }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using Umbraco.Core.Composing;
|
||||
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
/// <summary>
|
||||
/// Marker interface for created applications in the umbraco backoffice
|
||||
/// </summary>
|
||||
public interface IApplication : IDiscoverable
|
||||
{ }
|
||||
}
|
||||
Reference in New Issue
Block a user