Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the non-controversial, straightforward obsoleted constructs for Umbraco 16 #18661

Open
wants to merge 81 commits into
base: v16/dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c5667e4
Removed obsoletes from IConfigManipulator.
AndyButland Mar 12, 2025
bf54ff1
Removed obsolete models builder extensions.
AndyButland Mar 12, 2025
a7188d0
Removed the obsolete ContentDashboardSettings.
AndyButland Mar 12, 2025
e1ae059
Removed the obsolete InstallMissingDatabase setting on GlobalSettings.
AndyButland Mar 12, 2025
ab3805b
Removed obsolete NuCache settings.
AndyButland Mar 12, 2025
b111590
Removed obsolete RuntimeMinificationSettings.
AndyButland Mar 12, 2025
a51720b
Removed obsolete health check constant.
AndyButland Mar 12, 2025
fe9fc0a
Removed obsolete icon constant.
AndyButland Mar 12, 2025
66761a5
Removed obsolete telemetry constant.
AndyButland Mar 12, 2025
1ab8150
Removed obsolete property and constructor on UmbracoBuilder.
AndyButland Mar 12, 2025
9e64fd9
Removed obsolete constructor on AuditNotificationsHandler.
AndyButland Mar 12, 2025
b5a0d60
Removed obsolete constructor on HTTP header health checks.
AndyButland Mar 12, 2025
cdb124e
Removed obsolete constructor on MediaFileManager.
AndyButland Mar 12, 2025
03f4a60
Removed obsolete GetDefaultFileContent on ViewHelper.
AndyButland Mar 12, 2025
a238880
Remove obsoleted methods on embed providers.
AndyButland Mar 12, 2025
823ed88
Fix tests.
AndyButland Mar 12, 2025
1913dd4
Removed obsolete constructors on BlockEditorDataConverter.
AndyButland Mar 12, 2025
1e24bbc
Removed obsolete SeedCacheDuration property on CacheSettings.
AndyButland Mar 12, 2025
1f3e881
Removed obsolete PublishCulture on ContentRepositoryExtensions.
AndyButland Mar 12, 2025
12b3cd5
Removed obsolete MonitorLock.
AndyButland Mar 12, 2025
3c43db2
Removed obsolete synchronous HasSavedValues from IDataTypeUsageServic…
AndyButland Mar 12, 2025
2ab9b3b
Removed obsolete HasSavedPropertyValues from IPropertyTypeUsageServic…
AndyButland Mar 12, 2025
db894d0
Removed obsolete methods in ITrackedReferencesService and ITrackedRef…
AndyButland Mar 12, 2025
9e64c74
Removed obsolete DateValueEditor constructors.
AndyButland Mar 12, 2025
e48b8bc
Removed obsolete GetAutomaticRelationTypesAliases.
AndyButland Mar 12, 2025
40f67d8
Removed obsolete constructor on TextOnlyValueEditor.
AndyButland Mar 12, 2025
3526625
Removed obsolete constructors on RegexValidator and RequiredValidator.
AndyButland Mar 12, 2025
b91546a
Removed obsolete constructs on SliderValueConverter and TagsValueConv…
AndyButland Mar 12, 2025
d4a93da
Removed obsolete GetContentType methods from IPublishedCache.
AndyButland Mar 12, 2025
c3dbca5
Removed ContentFinderByIdPath.
AndyButland Mar 12, 2025
4fbb73f
Removed obsolete constructor on DefaultMediaUrlProvider.
AndyButland Mar 12, 2025
2d3a994
Removed obsolete constructor on Domain.
AndyButland Mar 12, 2025
8a4ce56
Removed obsolete constructor on PublishedRequest.
AndyButland Mar 12, 2025
9fa4822
Removed obsolete methods on CheckPermissions.
AndyButland Mar 12, 2025
928ecbb
Removed obsolete GetUserId from IBackOfficeSecurity.
AndyButland Mar 12, 2025
62c8423
Removed obsolete methods on LegacyPasswordSecurity.
AndyButland Mar 12, 2025
891cbde
Removed obsolete constructors on AuditService.
AndyButland Mar 12, 2025
9181e66
Removed obsolete methods on IContentEditingService.
AndyButland Mar 12, 2025
a4dbe62
Remove obsolete constructors and methods on ContentService/IContentSe…
AndyButland Mar 12, 2025
df69bd9
Removed obsolete constructor in ContentTypeEditingService.
AndyButland Mar 12, 2025
373f848
Removed obsolete constructor in MediaTypeEditingService.
AndyButland Mar 12, 2025
aff8ccb
Removed obsolete constructor in MemberTypeEditingService.
AndyButland Mar 12, 2025
d3e7ceb
Removed obsolete constructor in ContentTypeService.
AndyButland Mar 12, 2025
4c15d0e
Removed obsolete constructors in ContentTypeServiceBase.
AndyButland Mar 12, 2025
61df5db
Removed obsolete constructors and methods in ContentVersionService.
AndyButland Mar 12, 2025
e387702
Removed obsolete constructor in DataTypeUsageService.
AndyButland Mar 12, 2025
76cfdd4
Removed obsolete constructor in DomainService.
AndyButland Mar 12, 2025
5a9eb4e
Removed obsolete constructor in FileService.
AndyButland Mar 12, 2025
99b04a9
Removes obsolete AttemptMove from IContentService.
AndyButland Mar 12, 2025
2b2a802
Removes obsolete SetPreventCleanup from IContentVersionService.
AndyButland Mar 12, 2025
566f4bb
Removes obsolete GetReferences from IDataTypeService.
AndyButland Mar 12, 2025
bfc79c5
Removed obsolete SetConsentLevel from IMetricsConsentService.
AndyButland Mar 12, 2025
7e363e0
Removed obsolete methods from IPackageDataInstallation.
AndyButland Mar 12, 2025
cd54c2e
Removed obsolete methods from IPackagingService.
AndyButland Mar 12, 2025
5320f52
Removed obsolete methods on ITwoFactorLoginService.
AndyButland Mar 12, 2025
df1aed7
Removed obsolete constructor from MediaService, MemberTypeService and…
AndyButland Mar 12, 2025
cb0585b
More obsolete constructors.
AndyButland Mar 12, 2025
6207043
Removed obsoleted overloads on IPropertyValidationService.
AndyButland Mar 12, 2025
2d64d9d
Fixed build for tests.
AndyButland Mar 12, 2025
d266228
Removed obsolete constructor for PublicAccessService, UserService and…
AndyButland Mar 12, 2025
a92398f
Removed GetDefaultMemberType.
AndyButland Mar 12, 2025
d871be1
Removed obsolete user group functionality from IUserService.
AndyButland Mar 12, 2025
a992836
Removed obsolete extension methods on IUserService.
AndyButland Mar 12, 2025
c581c52
Removed obsolete method from ITelemetryService.
AndyButland Mar 12, 2025
d67bf38
Removed obsolete UdiParserServiceConnectors.
AndyButland Mar 12, 2025
e403ebe
Removed obsolete method on ICookieManager.
AndyButland Mar 12, 2025
cb16045
Removed obsolete DynamicContext.
AndyButland Mar 12, 2025
4e89fa2
Removed obsolete XmlHelper.
AndyButland Mar 12, 2025
4511aa6
Fixed failing integration tests.
AndyButland Mar 12, 2025
2f24f78
Removed obsoletes in Umbraco.Cms.Api.Common
AndyButland Mar 13, 2025
8ffeadb
Removed obsoletes in Umbraco.Cms.Api.Delivery
AndyButland Mar 13, 2025
3a6261a
Removed obsoletes in Umbraco.Cms.Api.Management
AndyButland Mar 13, 2025
affa923
Removed obsoletes in Umbraco.Examine.Lucene
AndyButland Mar 13, 2025
b816e31
Removed obsoletes in Umbraco.Infrastructure
AndyButland Mar 13, 2025
0651ff2
Fix failing delivery API contract integration test.
AndyButland Mar 13, 2025
b8f5692
Made integration tests internal.
AndyButland Mar 13, 2025
2ec0221
Removed obsoletes from web projects.
AndyButland Mar 13, 2025
f10d3d0
Fix build.
AndyButland Mar 13, 2025
dd79da0
Removed Twitter OEmbed provider
AndyButland Mar 14, 2025
35504ce
Removed obsolete constructor on PublishedDataType.
AndyButland Mar 14, 2025
59a56e8
Removed obsolete constructors on PublishedCacheBase.
AndyButland Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;

namespace Umbraco.Cms.Api.Common.Configuration;
Expand All @@ -18,13 +17,6 @@ public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOpt
private readonly ISchemaIdSelector _schemaIdSelector;
private readonly ISubTypesSelector _subTypesSelector;

[Obsolete("Use non-obsolete constructor. This will be removed in Umbraco 16.")]
public ConfigureUmbracoSwaggerGenOptions(
IOperationIdSelector operationIdSelector,
ISchemaIdSelector schemaIdSelector)
: this(operationIdSelector, schemaIdSelector, StaticServiceProvider.Instance.GetRequiredService<ISubTypesSelector>())
{ }

public ConfigureUmbracoSwaggerGenOptions(
IOperationIdSelector operationIdSelector,
ISchemaIdSelector schemaIdSelector,
Expand Down
3 changes: 0 additions & 3 deletions src/Umbraco.Cms.Api.Common/OpenApi/IOperationIdSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ namespace Umbraco.Cms.Api.Common.OpenApi;

public interface IOperationIdSelector
{
[Obsolete("Use overload that only takes ApiDescription instead. This will be removed in Umbraco 15.")]
string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions);

string? OperationId(ApiDescription apiDescription);
}
3 changes: 0 additions & 3 deletions src/Umbraco.Cms.Api.Common/OpenApi/OperationIdSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public OperationIdSelector()
public OperationIdSelector(IEnumerable<IOperationIdHandler> operationIdHandlers)
=> _operationIdHandlers = operationIdHandlers;

[Obsolete("Use overload that only takes ApiDescription instead. This will be removed in Umbraco 15.")]
public virtual string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions) => OperationId(apiDescription);

public virtual string? OperationId(ApiDescription apiDescription)
{
IOperationIdHandler? handler = _operationIdHandlers.FirstOrDefault(h => h.CanHandle(apiDescription));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Diagnostics;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand All @@ -8,7 +7,6 @@

namespace Umbraco.Cms.Api.Delivery.Controllers.Content;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdContentApiController : ContentApiItemControllerBase
{
Expand All @@ -21,16 +19,6 @@ public ByIdContentApiController(
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _requestMemberAccessService = requestMemberAccessService;

[HttpGet("item/{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> ById(Guid id)
=> await HandleRequest(id);

/// <summary>
/// Gets a content item by id.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ public ByIdsContentApiController(
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _requestMemberAccessService = requestMemberAccessService;

[HttpGet("item")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> Item([FromQuery(Name = "id")] HashSet<Guid> ids)
=> await HandleRequest(ids);

/// <summary>
/// Gets content items by ids.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using Asp.Versioning;

Check notice on line 1 in src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

✅ No longer an issue: Code Duplication

The module no longer contains too many functions with similar structure

Check notice on line 1 in src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

✅ No longer an issue: Constructor Over-Injection

ByRouteContentApiController is no longer above the threshold for number of arguments. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.

Check warning on line 1 in src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

❌ New issue: String Heavy Function Arguments

In this module, 41.7% of all arguments to its 7 functions are strings. The threshold for string arguments is 39.0%. The functions in this file have a high ratio of strings as arguments. Avoid adding more.
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;

namespace Umbraco.Cms.Api.Delivery.Controllers.Content;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByRouteContentApiController : ContentApiItemControllerBase
{
Expand All @@ -20,46 +16,7 @@
private readonly IRequestPreviewService _requestPreviewService;
private readonly IRequestMemberAccessService _requestMemberAccessService;
private const string PreviewContentRequestPathPrefix = $"/{Constants.DeliveryApi.Routing.PreviewContentPathPrefix}";

Check notice on line 19 in src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

✅ No longer an issue: Constructor Over-Injection

ByRouteContentApiController is no longer above the threshold for number of arguments. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
[Obsolete($"Please use the constructor that accepts {nameof(IApiContentPathResolver)}. Will be removed in V15.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRedirectService,
requestPreviewService,
requestMemberAccessService,
StaticServiceProvider.Instance.GetRequiredService<IApiContentPathResolver>())
{
}

[Obsolete($"Please use the non-obsolete constructor. Will be removed in V15.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService,
IApiContentPathResolver apiContentPathResolver)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRedirectService,
requestPreviewService,
requestMemberAccessService,
apiContentPathResolver)
{
}

[ActivatorUtilitiesConstructor]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
Expand All @@ -75,16 +32,6 @@
_apiContentPathResolver = apiContentPathResolver;
}

[HttpGet("item/{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> ByRoute(string path = "")
=> await HandleRequest(path);

/// <summary>
/// Gets a content item by route.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace Umbraco.Cms.Api.Delivery.Controllers.Content;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class QueryContentApiController : ContentApiControllerBase
{
Expand All @@ -29,21 +28,7 @@
_apiContentQueryService = apiContentQueryService;
_requestMemberAccessService = requestMemberAccessService;
}

Check notice on line 31 in src/Umbraco.Cms.Api.Delivery/Controllers/Content/QueryContentApiController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

✅ No longer an issue: Excess Number of Function Arguments

Query is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> Query(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
=> await HandleRequest(fetch, filter, sort, skip, take);

/// <summary>
/// Gets a paginated list of content item(s) from query.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Umbraco.Cms.Api.Delivery.Controllers.Media;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdMediaApiController : MediaApiControllerBase
{
Expand All @@ -19,14 +18,6 @@ public ByIdMediaApiController(
{
}

[HttpGet("item/{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public Task<IActionResult> ById(Guid id)
=> Task.FromResult(HandleRequest(id));

/// <summary>
/// Gets a media item by id.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Umbraco.Cms.Api.Delivery.Controllers.Media;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdsMediaApiController : MediaApiControllerBase
{
Expand All @@ -18,13 +17,6 @@ public ByIdsMediaApiController(IPublishedMediaCache publishedMediaCache, IApiMed
{
}

[HttpGet("item")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<IApiMediaWithCropsResponse>), StatusCodes.Status200OK)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public Task<IActionResult> Item([FromQuery(Name = "id")] HashSet<Guid> ids)
=> Task.FromResult(HandleRequest(ids));

/// <summary>
/// Gets media items by ids.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Umbraco.Cms.Api.Delivery.Controllers.Media;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByPathMediaApiController : MediaApiControllerBase
{
Expand All @@ -22,14 +21,6 @@ public ByPathMediaApiController(
: base(publishedMediaCache, apiMediaWithCropsResponseBuilder)
=> _apiMediaQueryService = apiMediaQueryService;

[HttpGet("item/{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public Task<IActionResult> ByPath(string path)
=> Task.FromResult(HandleRequest(path));

/// <summary>
/// Gets a media item by its path.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Umbraco.Cms.Api.Delivery.Controllers.Media;

[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class QueryMediaApiController : MediaApiControllerBase
{
Expand All @@ -27,19 +26,6 @@ public QueryMediaApiController(
: base(publishedMediaCache, apiMediaWithCropsResponseBuilder)
=> _apiMediaQueryService = apiMediaQueryService;

[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiMediaWithCropsResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public Task<IActionResult> Query(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
=> Task.FromResult(HandleRequest(fetch, filter, sort, skip, take));

/// <summary>
/// Gets a paginated list of media item(s) from query.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OpenIddict.Abstractions;
using OpenIddict.Server.AspNetCore;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Web.Common.Security;
using Umbraco.Extensions;
Expand All @@ -32,32 +30,7 @@
private readonly IMemberClientCredentialsManager _memberClientCredentialsManager;
private readonly DeliveryApiSettings _deliveryApiSettings;
private readonly ILogger<MemberController> _logger;

Check notice on line 33 in src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

✅ No longer an issue: Constructor Over-Injection

MemberController is no longer above the threshold for number of arguments

[Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")]
public MemberController(
IHttpContextAccessor httpContextAccessor,
IMemberSignInManager memberSignInManager,
IMemberManager memberManager,
IOptions<DeliveryApiSettings> deliveryApiSettings,
ILogger<MemberController> logger)
: this(memberSignInManager, memberManager, StaticServiceProvider.Instance.GetRequiredService<IMemberClientCredentialsManager>(), deliveryApiSettings, logger)
{
}

[Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")]
public MemberController(
IHttpContextAccessor httpContextAccessor,
IMemberSignInManager memberSignInManager,
IMemberManager memberManager,
IMemberClientCredentialsManager memberClientCredentialsManager,
IOptions<DeliveryApiSettings> deliveryApiSettings,
ILogger<MemberController> logger)
: this(memberSignInManager, memberManager, memberClientCredentialsManager, deliveryApiSettings, logger)
{
}

[ActivatorUtilitiesConstructor]
public MemberController(
IMemberSignInManager memberSignInManager,
IMemberManager memberManager,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.Document.Collection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
Expand All @@ -22,20 +20,6 @@ public class ByKeyDocumentCollectionController : DocumentCollectionControllerBas
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IDocumentCollectionPresentationFactory _documentCollectionPresentationFactory;

[Obsolete("Please use the constructor taking all parameters.")]
public ByKeyDocumentCollectionController(
IContentListViewService contentListViewService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IUmbracoMapper mapper)
: this(
contentListViewService,
backOfficeSecurityAccessor,
mapper,
StaticServiceProvider.Instance.GetRequiredService<IDocumentCollectionPresentationFactory>())
{
}

[ActivatorUtilitiesConstructor]
public ByKeyDocumentCollectionController(
IContentListViewService contentListViewService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand All @@ -21,17 +20,7 @@
_indexedEntitySearchService = indexedEntitySearchService;
_documentPresentationFactory = documentPresentationFactory;
}

Check notice on line 23 in src/Umbraco.Cms.Api.Management/Controllers/Document/Item/SearchDocumentItemController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v16/dev)

✅ No longer an issue: Excess Number of Function Arguments

SearchFromParent is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> SearchFromParent(cancellationToken, query, skip, take);

[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
=> await SearchFromParentWithAllowedTypes(cancellationToken, query, skip, take, parentId);

[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<DocumentItemResponseModel>), StatusCodes.Status200OK)]
Expand Down
Loading
Loading