move page alert infrastructure to the volo.abp.aspnetcore.components project.

pull/6270/head
Ilkay Ilknur 5 years ago
parent 273fb7bfa1
commit 68ce2a23ce

@ -1,4 +1,5 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.AspNetCore.Components.Alerts;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
{

@ -1,7 +0,0 @@
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
{
public interface IAlertManager
{
AlertList Alerts { get; }
}
}

@ -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.Alerts;
using Volo.Abp.AspNetCore.Components.Messages;
using Volo.Abp.AspNetCore.Components.Notifications;
using Volo.Abp.Localization;
@ -61,6 +62,11 @@ namespace Volo.Abp.AspNetCore.Components
protected IUiNotificationService Notify => LazyGetNonScopedRequiredService(ref _notify);
private IUiNotificationService _notify;
protected IAlertManager AlertManager => LazyGetNonScopedRequiredService(ref _alertManager);
private IAlertManager _alertManager;
protected AlertList Alerts => AlertManager.Alerts;
protected IObjectMapper ObjectMapper
{
get

@ -1,6 +1,11 @@
using System.Collections.ObjectModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
namespace Volo.Abp.AspNetCore.Components.Alerts
{
public class AlertList : ObservableCollection<AlertMessage>
{
@ -29,4 +34,4 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
Add(new AlertMessage(AlertType.Success, text, title, dismissible));
}
}
}
}

@ -1,6 +1,6 @@
using JetBrains.Annotations;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
namespace Volo.Abp.AspNetCore.Components.Alerts
{
public class AlertMessage
{
@ -27,4 +27,4 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
Dismissible = dismissible;
}
}
}
}

@ -1,4 +1,10 @@
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Volo.Abp.AspNetCore.Components.Alerts
{
public enum AlertType
{
@ -12,4 +18,4 @@
Light,
Dark
}
}
}

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Volo.Abp.AspNetCore.Components.Alerts
{
public interface IAlertManager
{
AlertList Alerts { get; }
}
}

@ -1,4 +1,4 @@
using Volo.Abp.AspNetCore.Components.WebAssembly.Alerts;
using Volo.Abp.AspNetCore.Components.Alerts;
namespace Volo.Abp.BlazoriseUI.Components
{

@ -5,7 +5,7 @@ using System.Linq;
using Blazorise;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Volo.Abp.AspNetCore.Components.WebAssembly.Alerts;
using Volo.Abp.AspNetCore.Components.Alerts;
namespace Volo.Abp.BlazoriseUI.Components
{
@ -47,7 +47,7 @@ namespace Volo.Abp.BlazoriseUI.Components
{
Alerts.Add(new AlertWrapper
{
AlertMessage = (AspNetCore.Components.WebAssembly.Alerts.AlertMessage)item,
AlertMessage = (AspNetCore.Components.Alerts.AlertMessage)item,
IsVisible = true
});
}

Loading…
Cancel
Save