Merge remote-tracking branch 'origin/temp8' into temp8-IAction-cleanup

# Conflicts:
#	src/Umbraco.Tests/Composing/ActionCollectionTests.cs
#	src/Umbraco.Web/Models/Trees/MenuItem.cs
#	src/Umbraco.Web/_Legacy/Actions/Action.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionChangeDocType.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionCreateBlueprintFromContent.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionExport.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionImport.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionMove.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionNew.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionNull.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionRights.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionSort.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs
#	src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs
#	src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs
#	src/Umbraco.Web/_Legacy/Actions/IAction.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs
This commit is contained in:
Shannon
2018-10-29 23:35:24 +11:00
41 changed files with 552 additions and 85 deletions

View File

@@ -52,6 +52,18 @@ namespace Umbraco.Web.Models.Mapping
variant.Name = source.GetCultureName(x.IsoCode);
}
//Put the default language first in the list & then sort rest by a-z
var defaultLang = variants.SingleOrDefault(x => x.Language.IsDefault);
//Remove the default lang from the list for now
variants.Remove(defaultLang);
//Sort the remaining languages a-z
variants = variants.OrderBy(x => x.Name).ToList();
//Insert the default lang as the first item
variants.Insert(0, defaultLang);
return variants;
}
return result;

View File

@@ -28,7 +28,21 @@ namespace Umbraco.Web.Models.Mapping
{
public IEnumerable<Language> Convert(IEnumerable<ILanguage> source, IEnumerable<Language> destination, ResolutionContext context)
{
return source.Select(x => context.Mapper.Map<ILanguage, Language>(x, null, context)).OrderBy(x => x.Name);
var langs = source.Select(x => context.Mapper.Map<ILanguage, Language>(x, null, context)).ToList();
//Put the default language first in the list & then sort rest by a-z
var defaultLang = langs.SingleOrDefault(x => x.IsDefault);
//Remove the default lang from the list for now
langs.Remove(defaultLang);
//Sort the remaining languages a-z
langs = langs.OrderBy(x => x.Name).ToList();
//Insert the default lang as the first item
langs.Insert(0, defaultLang);
return langs;
}
}
}

View File

@@ -52,6 +52,7 @@ namespace Umbraco.Web.Models.Trees
SeperatorBefore = false;
Icon = action.Icon;
Action = action;
OpensDialog = legacyMenu.OpensDialog;
}
#endregion
@@ -85,6 +86,10 @@ namespace Umbraco.Web.Models.Trees
[DataMember(Name = "cssclass")]
public string Icon { get; set; }
[DataMember(Name = "opensDialog")]
public bool OpensDialog { get; set; }
#endregion
#region Constants