diff --git a/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs b/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs index 3a0ef18d49..cd5f98b6d6 100644 --- a/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs +++ b/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs @@ -21,6 +21,7 @@ namespace Volo.Abp.Http.Client.Web.Conventions; public class AbpHttpClientProxyServiceConvention : AbpServiceConvention { protected readonly IClientProxyApiDescriptionFinder ClientProxyApiDescriptionFinder; + protected readonly List ControllerWithAttributeRoute; protected readonly List ActionWithAttributeRoute; public AbpHttpClientProxyServiceConvention( @@ -30,6 +31,7 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention : base(options, conventionalRouteBuilder) { ClientProxyApiDescriptionFinder = clientProxyApiDescriptionFinder; + ControllerWithAttributeRoute = new List(); ActionWithAttributeRoute = new List(); } @@ -51,15 +53,6 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention { controller.ControllerName = controller.ControllerName.RemovePostFix("ClientProxy"); - var moduleApiDescription = FindModuleApiDescriptionModel(controller); - - if (moduleApiDescription != null && !moduleApiDescription.RootPath.IsNullOrWhiteSpace()) - { - var selector = controller.Selectors.FirstOrDefault(); - selector?.EndpointMetadata.Add(new AreaAttribute(moduleApiDescription.RootPath)); - controller.RouteValues.Add(new KeyValuePair("area", moduleApiDescription.RootPath)); - } - var controllerApiDescription = FindControllerApiDescriptionModel(controller); if (controllerApiDescription != null && !controllerApiDescription.ControllerGroupName.IsNullOrWhiteSpace()) @@ -77,6 +70,14 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention { RemoveEmptySelectors(controller.Selectors); + var moduleApiDescription = FindModuleApiDescriptionModel(controller); + if (moduleApiDescription != null && !moduleApiDescription.RootPath.IsNullOrWhiteSpace()) + { + var selector = controller.Selectors.FirstOrDefault(); + selector?.EndpointMetadata.Add(new AreaAttribute(moduleApiDescription.RootPath)); + controller.RouteValues.Add(new KeyValuePair("area", moduleApiDescription.RootPath)); + } + var controllerType = controller.ControllerType.AsType(); var remoteServiceAtt = ReflectionHelper.GetSingleAttributeOrDefault(controllerType.GetTypeInfo()); if (remoteServiceAtt != null && !remoteServiceAtt.IsEnabledFor(controllerType)) @@ -111,15 +112,14 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention return;; } + ControllerWithAttributeRoute.Add(controller); ActionWithAttributeRoute.Add(action); if (!action.Selectors.Any()) { var abpServiceSelectorModel = new SelectorModel { - AttributeRouteModel = new AttributeRouteModel( - new RouteAttribute(template: actionApiDescriptionModel.Url) - ), + AttributeRouteModel = new AttributeRouteModel(new RouteAttribute(template: actionApiDescriptionModel.Url)), ActionConstraints = { new HttpMethodActionConstraint(new[] { actionApiDescriptionModel.HttpMethod }) } }; @@ -142,9 +142,7 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention if (selector.AttributeRouteModel == null) { - selector.AttributeRouteModel = new AttributeRouteModel( - new RouteAttribute(template: actionApiDescriptionModel.Url) - ); + selector.AttributeRouteModel = new AttributeRouteModel(new RouteAttribute(template: actionApiDescriptionModel.Url)); } if (!selector.ActionConstraints.OfType().Any()) @@ -157,14 +155,17 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention protected virtual void ConfigureClientProxyApiExplorer(ControllerModel controller) { - if (controller.ApiExplorer.GroupName.IsNullOrEmpty()) + if (ControllerWithAttributeRoute.Contains(controller)) { - controller.ApiExplorer.GroupName = controller.ControllerName; - } + if (controller.ApiExplorer.GroupName.IsNullOrEmpty()) + { + controller.ApiExplorer.GroupName = controller.ControllerName; + } - if (controller.ApiExplorer.IsVisible == null) - { - controller.ApiExplorer.IsVisible = IsVisibleRemoteService(controller.ControllerType); + if (controller.ApiExplorer.IsVisible == null) + { + controller.ApiExplorer.IsVisible = IsVisibleRemoteService(controller.ControllerType); + } } foreach (var action in controller.Actions) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index eca26a6b0f..e49dbd2ce1 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -56,6 +56,17 @@ "@angular/platform-browser": "12.2.13", "@angular/platform-browser-dynamic": "12.2.13", "@angular/router": "12.2.13", + "@abp/ng.account": "~5.0.1", + "@abp/ng.account.core": "~5.0.1", + "@abp/ng.core": "~5.0.1", + "@abp/ng.feature-management": "~5.0.1", + "@abp/ng.identity": "~5.0.1", + "@abp/ng.permission-management": "~5.0.1", + "@abp/ng.schematics": "~5.0.1", + "@abp/ng.setting-management": "~5.0.1", + "@abp/ng.tenant-management": "~5.0.1", + "@abp/ng.theme.basic": "~5.0.1", + "@abp/ng.theme.shared": "~5.0.1", "@fortawesome/fontawesome-free": "^5.15.4", "@ng-bootstrap/ng-bootstrap": "11.0.0-beta.2", "@ngneat/spectator": "^8.0.3", diff --git a/npm/ng-packs/packages/core/src/lib/tests/dynamic-layout.component.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/dynamic-layout.component.spec.ts index ba4fd361c2..2076be84b4 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/dynamic-layout.component.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/dynamic-layout.component.spec.ts @@ -198,6 +198,5 @@ describe('DynamicLayoutComponent', () => { spectator.detectComponentChanges(); expect(spectator.query('abp-layout-empty')).toBeFalsy(); - expect(spectator.query('abp-dynamic-layout').children[0].tagName).toEqual('ROUTER-OUTLET'); }); });