Merge branch 'v8/8.17' into v9/feature/merge_v8.17-rc
This commit is contained in:
@@ -22,7 +22,6 @@ using Umbraco.Cms.Core.Models.Membership;
|
||||
using Umbraco.Cms.Core.Net;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Web.BackOffice.Extensions;
|
||||
using Umbraco.Cms.Web.BackOffice.Filters;
|
||||
using Umbraco.Cms.Web.BackOffice.Security;
|
||||
using Umbraco.Cms.Web.Common.ActionsResults;
|
||||
@@ -48,6 +47,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
//[ValidationFilter] // TODO: I don't actually think this is required with our custom Application Model conventions applied
|
||||
[AngularJsonOnlyConfiguration] // TODO: This could be applied with our Application Model conventions
|
||||
[IsBackOffice]
|
||||
[DisableBrowserCache]
|
||||
public class AuthenticationController : UmbracoApiControllerBase
|
||||
{
|
||||
// NOTE: Each action must either be explicitly authorized or explicitly [AllowAnonymous], the latter is optional because
|
||||
|
||||
@@ -386,6 +386,23 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
return GetEmptyInner(contentType, parentId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a dictionary containing empty content items for every alias specified in the contentTypeAliases array in the body of the request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is a post request in order to support a large amount of aliases without hitting the URL length limit.
|
||||
/// </remarks>
|
||||
/// <param name="contentTypesByAliases"></param>
|
||||
/// <returns></returns>
|
||||
[OutgoingEditorModelEvent]
|
||||
[HttpPost]
|
||||
public ActionResult<IDictionary<string, ContentItemDisplay>> GetEmptyByAliases(ContentTypesByAliases contentTypesByAliases)
|
||||
{
|
||||
// It's important to do this operation within a scope to reduce the amount of readlock queries.
|
||||
using var scope = _scopeProvider.CreateScope(autoComplete: true);
|
||||
var contentTypes = contentTypesByAliases.ContentTypeAliases.Select(alias => _contentTypeService.Get(alias));
|
||||
return GetEmpties(contentTypes, contentTypesByAliases.ParentId).ToDictionary(x => x.ContentTypeAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an empty content item for the document type.
|
||||
|
||||
@@ -513,11 +513,13 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
{
|
||||
foreach (var propertyAlias in invalidPropertyAliases)
|
||||
{
|
||||
//find the property relating to these
|
||||
var prop = contentTypeSave.Groups.SelectMany(x => x.Properties).Single(x => x.Alias == propertyAlias);
|
||||
var group = contentTypeSave.Groups.Single(x => x.Properties.Contains(prop));
|
||||
// Find the property relating to these
|
||||
var property = contentTypeSave.Groups.SelectMany(x => x.Properties).Single(x => x.Alias == propertyAlias);
|
||||
var group = contentTypeSave.Groups.Single(x => x.Properties.Contains(property));
|
||||
var propertyIndex = group.Properties.IndexOf(property);
|
||||
var groupIndex = contentTypeSave.Groups.IndexOf(group);
|
||||
|
||||
var key = string.Format("Groups[{0}].Properties[{1}].Alias", group.SortOrder, prop.SortOrder);
|
||||
var key = $"Groups[{groupIndex}].Properties[{propertyIndex}].Alias";
|
||||
ModelState.AddModelError(key, "Duplicate property aliases not allowed between compositions");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
@@ -227,8 +227,10 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
return _dashboardService.GetDashboards(section, currentUser).Select(x => new Tab<IDashboardSlim>
|
||||
{
|
||||
Id = x.Id,
|
||||
Alias = x.Alias,
|
||||
Key = x.Key,
|
||||
Label = x.Label,
|
||||
Alias = x.Alias,
|
||||
Type = x.Type,
|
||||
Expanded = x.Expanded,
|
||||
IsActive = x.IsActive,
|
||||
Properties = x.Properties.Select(y => new DashboardSlim
|
||||
|
||||
Reference in New Issue
Block a user