Updating code style, removes obsolete files, now we can move the tree to the Translation section

This commit is contained in:
Sebastiaan Janssen
2018-06-13 15:17:31 +02:00
parent 9c33f1b1c9
commit d66e951b68
25 changed files with 315 additions and 611 deletions

View File

@@ -1,17 +1,16 @@
namespace Umbraco.Web.Models.Mapping
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Mapping;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models.Mapping
{
using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Mapping;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
/// <inheritdoc />
/// <summary>
/// The dictionary model mapper.
/// </summary>
@@ -42,9 +41,8 @@
// TODO check if there is a better way
if (src.ParentId.HasValue)
{
var ids = new List<int>();
var ids = new List<int> { -1 };
ids.Add(-1);
var parentIds = new List<int>();
@@ -95,7 +93,7 @@
var translation = src.Translations.FirstOrDefault(x => x.LanguageId == langId);
dest.Translations.Add(
new DictionaryOverviewTranslationDisplay()
new DictionaryOverviewTranslationDisplay
{
DisplayName = lang.CultureInfo.DisplayName,
HasTranslation = translation != null && string.IsNullOrEmpty(translation.Value) == false
@@ -104,8 +102,6 @@
});
}
/// <summary>
/// Goes up the dictoinary tree to get all parent ids
/// </summary>
@@ -122,15 +118,13 @@
{
var dictionary = localizationService.GetDictionaryItemById(parentId);
if (dictionary != null)
{
ids.Add(dictionary.Id);
if (dictionary == null)
return;
if (dictionary.ParentId.HasValue)
{
this.GetParentId(dictionary.ParentId.Value, localizationService, ids);
}
}
ids.Add(dictionary.Id);
if (dictionary.ParentId.HasValue)
GetParentId(dictionary.ParentId.Value, localizationService, ids);
}
}
}