Merge branch 'v15/dev' into v16/dev
# Conflicts: # src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/RebuildPublishedCacheController.cs # src/Umbraco.Core/Configuration/Models/ContentSettings.cs
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Asp.Versioning;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Asp.Versioning;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
|
||||
@@ -9,7 +8,6 @@ using Umbraco.Cms.Core.Mapping;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
using Umbraco.Cms.Web.Common.Authorization;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
|
||||
|
||||
@@ -25,6 +23,15 @@ public class AllowedChildrenDocumentTypeController : DocumentTypeControllerBase
|
||||
_umbracoMapper = umbracoMapper;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[Obsolete("Use the non obsoleted method instead. Scheduled to be removed in v16")]
|
||||
public async Task<IActionResult> AllowedChildrenByKey(
|
||||
CancellationToken cancellationToken,
|
||||
Guid id,
|
||||
int skip = 0,
|
||||
int take = 100)
|
||||
=> await AllowedChildrenByKey(cancellationToken, id, null, skip, take);
|
||||
|
||||
[HttpGet("{id:guid}/allowed-children")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<AllowedDocumentType>), StatusCodes.Status200OK)]
|
||||
@@ -32,10 +39,11 @@ public class AllowedChildrenDocumentTypeController : DocumentTypeControllerBase
|
||||
public async Task<IActionResult> AllowedChildrenByKey(
|
||||
CancellationToken cancellationToken,
|
||||
Guid id,
|
||||
Guid? parentContentKey = null,
|
||||
int skip = 0,
|
||||
int take = 100)
|
||||
{
|
||||
Attempt<PagedModel<IContentType>?, ContentTypeOperationStatus> attempt = await _contentTypeService.GetAllowedChildrenAsync(id, skip, take);
|
||||
Attempt<PagedModel<IContentType>?, ContentTypeOperationStatus> attempt = await _contentTypeService.GetAllowedChildrenAsync(id, parentContentKey, skip, take);
|
||||
if (attempt.Success is false)
|
||||
{
|
||||
return OperationStatusResult(attempt.Status);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Asp.Versioning;
|
||||
using Asp.Versioning;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
|
||||
@@ -23,6 +23,15 @@ public class AllowedChildrenMediaTypeController : MediaTypeControllerBase
|
||||
_umbracoMapper = umbracoMapper;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[Obsolete("Use the non obsoleted method instead. Scheduled for removal in Umbraco 16.")]
|
||||
public async Task<IActionResult> AllowedChildrenByKey(
|
||||
CancellationToken cancellationToken,
|
||||
Guid id,
|
||||
int skip = 0,
|
||||
int take = 100)
|
||||
=> await AllowedChildrenByKey(cancellationToken, id, null, skip, take);
|
||||
|
||||
[HttpGet("{id:guid}/allowed-children")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<AllowedMediaType>), StatusCodes.Status200OK)]
|
||||
@@ -30,10 +39,11 @@ public class AllowedChildrenMediaTypeController : MediaTypeControllerBase
|
||||
public async Task<IActionResult> AllowedChildrenByKey(
|
||||
CancellationToken cancellationToken,
|
||||
Guid id,
|
||||
Guid? parentContentKey = null,
|
||||
int skip = 0,
|
||||
int take = 100)
|
||||
{
|
||||
Attempt<PagedModel<IMediaType>?, ContentTypeOperationStatus> attempt = await _mediaTypeService.GetAllowedChildrenAsync(id, skip, take);
|
||||
Attempt<PagedModel<IMediaType>?, ContentTypeOperationStatus> attempt = await _mediaTypeService.GetAllowedChildrenAsync(id, parentContentKey, skip, take);
|
||||
if (attempt.Success is false)
|
||||
{
|
||||
return OperationStatusResult(attempt.Status);
|
||||
|
||||
@@ -17,7 +17,20 @@ public class RebuildPublishedCacheController : PublishedCacheControllerBase
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public Task<IActionResult> Rebuild(CancellationToken cancellationToken)
|
||||
{
|
||||
_databaseCacheRebuilder.Rebuild();
|
||||
return Task.FromResult<IActionResult>(Ok());
|
||||
if (_databaseCacheRebuilder.IsRebuilding())
|
||||
{
|
||||
var problemDetails = new ProblemDetails
|
||||
{
|
||||
Title = "Database cache can not be rebuilt",
|
||||
Detail = $"The database cache is in the process of rebuilding.",
|
||||
Status = StatusCodes.Status400BadRequest,
|
||||
Type = "Error",
|
||||
};
|
||||
|
||||
return await Task.FromResult(Conflict(problemDetails));
|
||||
}
|
||||
|
||||
_databaseCacheRebuilder.Rebuild(true);
|
||||
return await Task.FromResult(Ok());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using Asp.Versioning;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Api.Management.ViewModels.PublishedCache;
|
||||
using Umbraco.Cms.Core.PublishedCache;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache;
|
||||
|
||||
[ApiVersion("1.0")]
|
||||
public class RebuildPublishedCacheStatusController : PublishedCacheControllerBase
|
||||
{
|
||||
private readonly IDatabaseCacheRebuilder _databaseCacheRebuilder;
|
||||
|
||||
public RebuildPublishedCacheStatusController(IDatabaseCacheRebuilder databaseCacheRebuilder) => _databaseCacheRebuilder = databaseCacheRebuilder;
|
||||
|
||||
[HttpGet("rebuild/status")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(RebuildStatusModel), StatusCodes.Status200OK)]
|
||||
public Task<IActionResult> Status(CancellationToken cancellationToken)
|
||||
{
|
||||
var isRebuilding = _databaseCacheRebuilder.IsRebuilding();
|
||||
return Task.FromResult((IActionResult)Ok(new RebuildStatusModel
|
||||
{
|
||||
IsRebuilding = isRebuilding
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Security;
|
||||
public class BackOfficeGraphicsController : Controller
|
||||
{
|
||||
public const string LogoRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(Logo);
|
||||
public const string LogoAlternativeRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LogoAlternative);
|
||||
public const string LoginBackGroundRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginBackground);
|
||||
public const string LoginLogoRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginLogo);
|
||||
public const string LoginLogoAlternativeRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginLogoAlternative);
|
||||
@@ -44,6 +45,11 @@ public class BackOfficeGraphicsController : Controller
|
||||
[MapToApiVersion("1.0")]
|
||||
public IActionResult Logo() => HandleFileRequest(_contentSettings.Value.BackOfficeLogo);
|
||||
|
||||
[HttpGet("logo-alternative", Name = LogoAlternativeRouteName)]
|
||||
[AllowAnonymous]
|
||||
[MapToApiVersion("1.0")]
|
||||
public IActionResult LogoAlternative() => HandleFileRequest(_contentSettings.Value.BackOfficeLogoAlternative);
|
||||
|
||||
[HttpGet("login-logo", Name = LoginLogoRouteName)]
|
||||
[AllowAnonymous]
|
||||
[MapToApiVersion("1.0")]
|
||||
|
||||
@@ -28,6 +28,7 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
|
||||
|
||||
private static readonly string _indent = $"{Environment.NewLine} ";
|
||||
|
||||
[ActivatorUtilitiesConstructor]
|
||||
public ExecuteTemplateQueryController(
|
||||
IPublishedContentQuery publishedContentQuery,
|
||||
IPublishedValueFallback publishedValueFallback,
|
||||
|
||||
Reference in New Issue
Block a user