From 2c36a37933c7824974c966d696048a6930047ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 2 Nov 2020 15:21:27 +0300 Subject: [PATCH] Move notification/message API to Volo.Abp.AspNetCore.Components --- .../WebAssembly/{ => Messages}/SimpleUiMessageService.cs | 2 +- .../Volo/Abp/AspNetCore/Components/AbpComponentBase.cs | 7 +++++++ .../AspNetCore/Components/Messages}/IUiMessageService.cs | 0 .../AspNetCore/Components/Messages}/UiMessageEventArgs.cs | 0 .../AspNetCore/Components/Messages}/UiMessageOptions.cs | 0 .../Abp/AspNetCore/Components/Messages}/UiMessageType.cs | 0 .../Components/Notifications}/IUiNotificationService.cs | 0 .../Components/Notifications}/NullUiNotificationService.cs | 0 .../Components/Notifications}/UiNotificationEventArgs.cs | 0 .../Components/Notifications}/UiNotificationOptions.cs | 0 .../Components/Notifications}/UiNotificationType.cs | 0 framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs | 1 - .../Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs | 1 - 13 files changed, 8 insertions(+), 3 deletions(-) rename framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/{ => Messages}/SimpleUiMessageService.cs (95%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages}/IUiMessageService.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages}/UiMessageEventArgs.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages}/UiMessageOptions.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages}/UiMessageType.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications}/IUiNotificationService.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications}/NullUiNotificationService.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications}/UiNotificationEventArgs.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications}/UiNotificationOptions.cs (100%) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications}/UiNotificationType.cs (100%) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/SimpleUiMessageService.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs similarity index 95% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/SimpleUiMessageService.cs rename to framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs index 8f43b3fdcd..4cf7aa5f09 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/SimpleUiMessageService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using Microsoft.JSInterop; using Volo.Abp.DependencyInjection; -namespace Volo.Abp.AspNetCore.Components.WebAssembly +namespace Volo.Abp.AspNetCore.Components.WebAssembly.Messages { public class SimpleUiMessageService : IUiMessageService, ITransientDependency { diff --git a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/AbpComponentBase.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/AbpComponentBase.cs index a4b4c7740e..b2ed4e5603 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/AbpComponentBase.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/AbpComponentBase.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.AspNetCore.Components.WebAssembly; using Volo.Abp.Localization; using Volo.Abp.ObjectMapping; using Volo.Abp.Users; @@ -53,6 +54,12 @@ namespace Volo.Abp.AspNetCore.Components protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; + protected IUiMessageService Message => LazyGetRequiredService(ref _message); + private IUiMessageService _message; + + protected IUiNotificationService Notify => LazyGetRequiredService(ref _notify); + private IUiNotificationService _notify; + protected IObjectMapper ObjectMapper { get diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/IUiMessageService.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/IUiMessageService.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageEventArgs.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageEventArgs.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageEventArgs.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageEventArgs.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageOptions.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageType.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageType.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageType.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageType.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/IUiNotificationService.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/IUiNotificationService.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/NullUiNotificationService.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/NullUiNotificationService.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/NullUiNotificationService.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/NullUiNotificationService.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiNotificationEventArgs.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationEventArgs.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiNotificationEventArgs.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationEventArgs.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiNotificationOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationOptions.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiNotificationOptions.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationOptions.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiNotificationType.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationType.cs similarity index 100% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiNotificationType.cs rename to framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationType.cs diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs index c9e8f23b1f..2caccb3f98 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs @@ -172,7 +172,6 @@ namespace Volo.Abp.BlazoriseUI { [Inject] protected TAppService AppService { get; set; } [Inject] protected IStringLocalizer UiLocalizer { get; set; } - [Inject] protected IAuthorizationService AuthorizationService { get; set; } protected virtual int PageSize { get; } = LimitedResultRequestDto.DefaultMaxResultCount; diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs index 0d058904c4..1785079cf0 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using Blazorise; using Localization.Resources.AbpUi; using Microsoft.AspNetCore.Components;