Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice

# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Core/Extensions/PublishedContentExtensions.cs
#	src/Umbraco.Core/Telemetry/Models/TelemetryReportData.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiUrlPickerValueConverter.cs
#	src/Umbraco.PublishedCache.NuCache/ContentStore.cs
#	src/Umbraco.Web.BackOffice/Trees/MemberTypeTreeController.cs
#	src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs
#	src/Umbraco.Web.Common/Security/MemberManager.cs
#	src/Umbraco.Web.Website/Routing/ControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/IControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformer.cs
This commit is contained in:
Nikolaj Geisle
2022-04-21 10:26:51 +02:00
172 changed files with 4578 additions and 1710 deletions

View File

@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Net.Mime;
using System.Text;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
@@ -191,6 +193,39 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return _umbracoMapper.Map<IDictionaryItem, DictionaryDisplay>(dictionary);
}
/// <summary>
/// Changes the structure for dictionary items
/// </summary>
/// <param name="move"></param>
/// <returns></returns>
public IActionResult PostMove(MoveOrCopy move)
{
var dictionaryItem = _localizationService.GetDictionaryItemById(move.Id);
if (dictionaryItem == null)
return ValidationProblem(_localizedTextService.Localize("dictionary", "itemDoesNotExists"));
var parent = _localizationService.GetDictionaryItemById(move.ParentId);
if (parent == null)
{
if (move.ParentId == Constants.System.Root)
dictionaryItem.ParentId = null;
else
return ValidationProblem(_localizedTextService.Localize("dictionary", "parentDoesNotExists"));
}
else
{
dictionaryItem.ParentId = parent.Key;
if (dictionaryItem.Key == parent.ParentId)
return ValidationProblem(_localizedTextService.Localize("moveOrCopy", "notAllowedByPath"));
}
_localizationService.Save(dictionaryItem);
var model = _umbracoMapper.Map<IDictionaryItem, DictionaryDisplay>(dictionaryItem);
return Content(model.Path, MediaTypeNames.Text.Plain, Encoding.UTF8);
}
/// <summary>
/// Saves a dictionary item
/// </summary>