Skip to content

Commit

Permalink
V14/Fix Merge (#630)
Browse files Browse the repository at this point in the history
* From v13: Fixes (#590) - missing null check

* From v13: Fixes #604. don't prepend path with ~ (for no random reason!)

* From v13: Fix #224 - Observe root folder value in rootfolder array if set (and root folders array is not set). (#606)

* From v13: Throw for duplicates ( Jumoo/uSync.Complete.Issues#225 )

* Add serializers and handlers for webhooks. (#613)

* Add serializers and handlers for webhooks.

* Webhook Comments

* From v13: Add serializers and handlers for webhooks. (#613)

* From v13: Fix #609 Default language importing. (#614)

* From v13: Use folders provided in options over config (#610)

* From v13: fix #605 - check delete by serializing item one last time. (#616)

* From v13: Fix - delete entries show up twice in report and actions. (#617)

* From v13: #612 - couple of extra checks so we never try to create an XCData section with a null value. (#618)

* Fix for #619. don't report property deletes as changes when they have… (#621)

* Fix for #619. don't report property deletes as changes when they have already happened

* Add fix for #620 - don't recreate items that are deleted.

* v13 - > v14 null checks.

* From v13: DataType merging Empty items alway win

* update build script

* tidy up logging.

* consistant JSON options

* Add Extra saves for content (not sure we need them! - might be a rc1 issue)

* Add Ability to change the editor alias on import

* Post RC1 - migration fixes.

* chore: project things

* fixes #629 have a custom Operations handler just for uSync swagger endpoint.
  • Loading branch information
KevinJump committed Apr 19, 2024
1 parent 4f3d299 commit 6ab50f7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions uSync.Backoffice.Management.Api/ApiComposer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection;

using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;

Expand All @@ -14,6 +15,8 @@ public class ApiComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddSingleton<IOperationIdHandler, uSyncCustomOperationHandler>();

builder.Services.ConfigureOptions<ConfigSyncApiSwaggerGenOptions>();
builder.Services.AddSingleton<ISyncManagementCache, uSyncManagementCache>();
builder.Services.AddSingleton<ISyncManagementService, uSyncManagementService>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ public void Configure(SwaggerGenOptions options)
Version = "Latest",
Description = "Api access uSync operations"
});

options.CustomOperationIds(e => $"{e.ActionDescriptor.RouteValues["action"]}");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Controllers;

using Umbraco.Cms.Api.Common.OpenApi;

namespace uSync.Backoffice.Management.Api.Configuration;

public class uSyncCustomOperationHandler : IOperationIdHandler
{
public bool CanHandle(ApiDescription apiDescription)
{
if (apiDescription.ActionDescriptor is not
ControllerActionDescriptor controllerActionDescriptor)
return false;

return CanHandle(apiDescription, controllerActionDescriptor);
}

public bool CanHandle(ApiDescription apiDescription, ControllerActionDescriptor controllerActionDescriptor)
=> controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("uSync") is true;

public string Handle(ApiDescription apiDescription)
=> $"{apiDescription.ActionDescriptor.RouteValues["action"]}";
}

0 comments on commit 6ab50f7

Please sign in to comment.