Refactorings

pull/8074/head
Mladen Macanovic 5 years ago
parent 84e65b73a8
commit d3257d731d

@ -365,11 +365,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Compone
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components.UI.Theming", "src\Volo.Abp.AspNetCore.Components.UI.Theming\Volo.Abp.AspNetCore.Components.UI.Theming.csproj", "{B9133C38-AC24-4E2F-B581-D124CF410CDF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly", "src\Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly\Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly.csproj", "{FFA80CA2-3DEE-4EFE-8120-80342A0BEA52}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly", "src\Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly\Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly.csproj", "{FFA80CA2-3DEE-4EFE-8120-80342A0BEA52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly", "src\Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly\Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly.csproj", "{616282F9-6901-4098-B515-EBDF41C57C4F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly", "src\Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly\Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly.csproj", "{616282F9-6901-4098-B515-EBDF41C57C4F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.EventBus.Abstractions", "src\Volo.Abp.EventBus.Abstractions\Volo.Abp.EventBus.Abstractions.csproj", "{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EventBus.Abstractions", "src\Volo.Abp.EventBus.Abstractions\Volo.Abp.EventBus.Abstractions.csproj", "{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.Server", "src\Volo.Abp.AspNetCore.Components.Server\Volo.Abp.AspNetCore.Components.Server.csproj", "{41743609-6CDC-46F7-8C83-BCFBA5555AC0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -1105,6 +1107,10 @@ Global
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Release|Any CPU.Build.0 = Release|Any CPU
{41743609-6CDC-46F7-8C83-BCFBA5555AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41743609-6CDC-46F7-8C83-BCFBA5555AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41743609-6CDC-46F7-8C83-BCFBA5555AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41743609-6CDC-46F7-8C83-BCFBA5555AC0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1292,6 +1298,7 @@ Global
{FFA80CA2-3DEE-4EFE-8120-80342A0BEA52} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{616282F9-6901-4098-B515-EBDF41C57C4F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{41743609-6CDC-46F7-8C83-BCFBA5555AC0} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

@ -0,0 +1,13 @@
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting
{
public static class AbpServerHostBuilderExtensions
{
}
}

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Volo.Abp.AspNetCore.Components.Server</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.Components.Server</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.Client.Common\Volo.Abp.AspNetCore.Mvc.Client.Common.csproj" />
<ProjectReference Include="..\Volo.Abp.UI\Volo.Abp.UI.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components\Volo.Abp.AspNetCore.Components.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(MicrosoftPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="$(MicrosoftPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
</ItemGroup>
</Project>

@ -0,0 +1,185 @@
var abp = abp || {};
(function () {
abp.utils = abp.utils || {};
// DOM READY /////////////////////////////////////////////////////
abp.domReady = function (fn) {
if (document.readyState === "complete" || document.readyState === "interactive") {
setTimeout(fn, 1);
} else {
document.addEventListener("DOMContentLoaded", fn);
}
};
// COOKIES ///////////////////////////////////////////////////////
/**
* Sets a cookie value for given key.
* This is a simple implementation created to be used by ABP.
* Please use a complete cookie library if you need.
* @param {string} key
* @param {string} value
* @param {string} expireDate (optional). If not specified the cookie will expire at the end of session.
* @param {string} path (optional)
* @param {bool} secure (optional)
*/
abp.utils.setCookieValue = function (key, value, expireDate, path, secure) {
var cookieValue = encodeURIComponent(key) + '=';
if (value) {
cookieValue = cookieValue + encodeURIComponent(value);
}
if (expireDate) {
cookieValue = cookieValue + "; expires=" + expireDate;
}
if (path) {
cookieValue = cookieValue + "; path=" + path;
}
if (secure) {
cookieValue = cookieValue + "; secure";
}
document.cookie = cookieValue;
};
/**
* Gets a cookie with given key.
* This is a simple implementation created to be used by ABP.
* Please use a complete cookie library if you need.
* @param {string} key
* @returns {string} Cookie value or null
*/
abp.utils.getCookieValue = function (key) {
var equalities = document.cookie.split('; ');
for (var i = 0; i < equalities.length; i++) {
if (!equalities[i]) {
continue;
}
var splitted = equalities[i].split('=');
if (splitted.length != 2) {
continue;
}
if (decodeURIComponent(splitted[0]) === key) {
return decodeURIComponent(splitted[1] || '');
}
}
return null;
};
/**
* Deletes cookie for given key.
* This is a simple implementation created to be used by ABP.
* Please use a complete cookie library if you need.
* @param {string} key
* @param {string} path (optional)
*/
abp.utils.deleteCookie = function (key, path) {
var cookieValue = encodeURIComponent(key) + '=';
cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString();
if (path) {
cookieValue = cookieValue + "; path=" + path;
}
document.cookie = cookieValue;
}
// DOM MANIPULATION
abp.utils.addClassToTag = function (tagName, className) {
var tags = document.getElementsByTagName(tagName);
for (var i = 0; i < tags.length; i++) {
tags[i].classList.add(className);
}
};
abp.utils.removeClassFromTag = function (tagName, className) {
var tags = document.getElementsByTagName(tagName);
for (var i = 0; i < tags.length; i++) {
tags[i].classList.remove(className);
}
};
abp.utils.hasClassOnTag = function (tagName, className) {
var tags = document.getElementsByTagName(tagName);
if (tags.length) {
return tags[0].classList.contains(className);
}
return false;
};
abp.utils.replaceLinkHrefById = function (linkId, hrefValue) {
var link = document.getElementById(linkId);
if (link && link.href !== hrefValue) {
link.href = hrefValue;
}
};
// FULL SCREEN /////////////////
abp.utils.toggleFullscreen = function() {
var elem = document.documentElement;
if (!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}
abp.utils.requestFullscreen = function() {
var elem = document.documentElement;
if (!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
}
}
abp.utils.exitFullscreen = function() {
if (!(!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement)) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}
})();

@ -0,0 +1,7 @@
@page "/authentication/{action}"
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
<RemoteAuthenticatorView Action="@Action" />
@code{
[Parameter] public string Action { get; set; }
}

@ -1,6 +1,6 @@
using Volo.Abp.Bundling;
namespace Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly
namespace Volo.Abp.AspNetCore.Components.UI.BasicTheme
{
public class BasicThemeBundleContributor : IBundleContributor
{
@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly
public void AddStyles(BundleContext context)
{
context.Add("_content/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/libs/abp/css/theme.css");
context.Add("_content/Volo.Abp.AspNetCore.Components.UI.BasicTheme/libs/abp/css/theme.css");
}
}
}

@ -0,0 +1,90 @@
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.AspNetCore.Components.UI;
using Volo.Abp.AspNetCore.Components.UI.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Modularity;
namespace Microsoft.AspNetCore.Components.UI.Hosting
{
public static class AbpComponentsBuilderExtensions
{
//public static IAbpApplicationWithExternalServiceProvider AddApplication<TStartupModule>(
// [NotNull] this IServiceCollection services
// /*Action<AbpWebAssemblyApplicationCreationOptions> options*/)
// where TStartupModule : IAbpModule
//{
// Check.NotNull(services, nameof(services));
// // Related this commit(https://github.com/dotnet/aspnetcore/commit/b99d805bc037fcac56afb79abeb7d5a43141c85e)
// // Microsoft.AspNetCore.Blazor.BuildTools has been removed in net 5.0.
// // This call may be removed when we find a suitable solution.
// // System.Runtime.CompilerServices.AsyncStateMachineAttribute
// Castle.DynamicProxy.Generators.AttributesToAvoidReplicating.Add<AsyncStateMachineAttribute>();
// services.AddSingleton<IConfiguration>(builder.Configuration);
// services.AddSingleton(builder);
// var application = services.AddApplication<TStartupModule>(opts =>
// {
// options?.Invoke(new AbpAspNetCoreApplicationCreationOptions(builder, opts));
// });
// return application;
//}
public static async Task InitializeAsync(
[NotNull] this IAbpApplicationWithExternalServiceProvider application,
[NotNull] IServiceProvider serviceProvider)
{
Check.NotNull(application, nameof(application));
Check.NotNull(serviceProvider, nameof(serviceProvider));
var serviceProviderAccessor = (ComponentsClientScopeServiceProviderAccessor)
serviceProvider.GetRequiredService<IClientScopeServiceProviderAccessor>();
serviceProviderAccessor.ServiceProvider = serviceProvider;
application.Initialize(serviceProvider);
using (var scope = serviceProvider.CreateScope())
{
await InitializeModulesAsync(scope.ServiceProvider);
await SetCurrentLanguageAsync(scope);
}
}
private static async Task InitializeModulesAsync(IServiceProvider serviceProvider)
{
foreach (var service in serviceProvider.GetServices<IAsyncInitialize>())
{
await service.InitializeAsync();
}
}
private static async Task SetCurrentLanguageAsync(IServiceScope scope)
{
var configurationClient = scope.ServiceProvider.GetRequiredService<ICachedApplicationConfigurationClient>();
var utilsService = scope.ServiceProvider.GetRequiredService<IAbpUtilsService>();
var configuration = configurationClient.Get();
var cultureName = configuration.Localization?.CurrentCulture?.CultureName;
if (!cultureName.IsNullOrEmpty())
{
var culture = new CultureInfo(cultureName);
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
{
await utilsService.AddClassToTagAsync("body", "rtl");
}
}
}
}

@ -27,4 +27,8 @@
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Microsoft\Extensions\DependencyInjection\" />
</ItemGroup>
</Project>

@ -0,0 +1,13 @@
namespace Volo.Abp.AspNetCore.Components.UI
{
public class AbpAspNetCoreApplicationCreationOptions
{
public AbpApplicationCreationOptions ApplicationCreationOptions { get; }
public AbpAspNetCoreApplicationCreationOptions(
AbpApplicationCreationOptions applicationCreationOptions)
{
ApplicationCreationOptions = applicationCreationOptions;
}
}
}

@ -1,41 +1,41 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Components.DependencyInjection;
using Volo.Abp.AspNetCore.Components.UI.ExceptionHandling;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
using Volo.Abp.UI;
//using Microsoft.AspNetCore.Components;
//using Microsoft.Extensions.DependencyInjection;
//using Microsoft.Extensions.DependencyInjection.Extensions;
//using Microsoft.Extensions.Logging;
//using Volo.Abp.AspNetCore.Components.DependencyInjection;
//using Volo.Abp.AspNetCore.Components.UI.ExceptionHandling;
//using Volo.Abp.AspNetCore.Mvc.Client;
//using Volo.Abp.Http.Client;
//using Volo.Abp.Modularity;
//using Volo.Abp.UI;
namespace Volo.Abp.AspNetCore.Components.UI
{
[DependsOn(
typeof(AbpAspNetCoreMvcClientCommonModule),
typeof(AbpUiModule),
typeof(AbpAspNetCoreComponentsModule)
)]
public class AbpAspNetCoreComponentsUIModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
options.ProxyClientBuildActions.Add((_, builder) =>
{
builder.AddHttpMessageHandler<AbpBlazorClientHttpMessageHandler>();
});
});
}
//namespace Volo.Abp.AspNetCore.Components.UI
//{
// [DependsOn(
// typeof(AbpAspNetCoreMvcClientCommonModule),
// typeof(AbpUiModule),
// typeof(AbpAspNetCoreComponentsModule)
// )]
// public class AbpAspNetCoreComponentsUIModule : AbpModule
// {
// public override void PreConfigureServices(ServiceConfigurationContext context)
// {
// PreConfigure<AbpHttpClientBuilderOptions>(options =>
// {
// options.ProxyClientBuildActions.Add((_, builder) =>
// {
// builder.AddHttpMessageHandler<AbpBlazorClientHttpMessageHandler>();
// });
// });
// }
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>());
// public override void ConfigureServices(ServiceConfigurationContext context)
// {
// context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>());
//context.Services
// .GetHostBuilder().Logging
// .AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services));
}
}
}
// //context.Services
// // .GetHostBuilder().Logging
// // .AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services));
// }
// }
//}

@ -12,7 +12,7 @@ namespace Volo.Abp.AspNetCore.Components.UI
return Configuration;
}
internal void Set(ApplicationConfigurationDto configuration)
public void Set(ApplicationConfigurationDto configuration)
{
Configuration = configuration;
}

@ -6,8 +6,9 @@ using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.AspNetCore.Components.UI;
using Volo.Abp.AspNetCore.Components.UI.DependencyInjection;
using Volo.Abp.AspNetCore.Components.WebAssembly;
using Volo.Abp.AspNetCore.Components.WebAssembly.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Modularity;
@ -47,7 +48,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting
Check.NotNull(application, nameof(application));
Check.NotNull(serviceProvider, nameof(serviceProvider));
var serviceProviderAccessor = (WebAssemblyClientScopeServiceProviderAccessor)
var serviceProviderAccessor = (ComponentsClientScopeServiceProviderAccessor)
serviceProvider.GetRequiredService<IClientScopeServiceProviderAccessor>();
serviceProviderAccessor.ServiceProvider = serviceProvider;

@ -15,6 +15,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.UI\Volo.Abp.AspNetCore.Components.UI.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.Client.Common\Volo.Abp.AspNetCore.Mvc.Client.Common.csproj" />
<ProjectReference Include="..\Volo.Abp.UI\Volo.Abp.UI.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components\Volo.Abp.AspNetCore.Components.csproj" />

@ -3,7 +3,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Components.DependencyInjection;
using Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling;
using Volo.Abp.AspNetCore.Components.UI;
using Volo.Abp.AspNetCore.Components.UI.ExceptionHandling;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;

@ -1,98 +0,0 @@
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.JSInterop;
using Volo.Abp.AspNetCore.Components.Progression;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class AbpBlazorClientHttpMessageHandler : DelegatingHandler, ITransientDependency
{
private readonly IJSRuntime _jsRuntime;
private readonly ICookieService _cookieService;
private readonly NavigationManager _navigationManager;
private readonly IUiPageProgressService _uiPageProgressService;
private const string AntiForgeryCookieName = "XSRF-TOKEN";
private const string AntiForgeryHeaderName = "RequestVerificationToken";
public AbpBlazorClientHttpMessageHandler(
IJSRuntime jsRuntime,
ICookieService cookieService,
NavigationManager navigationManager,
IClientScopeServiceProviderAccessor clientScopeServiceProviderAccessor)
{
_jsRuntime = jsRuntime;
_cookieService = cookieService;
_navigationManager = navigationManager;
_uiPageProgressService = clientScopeServiceProviderAccessor.ServiceProvider.GetRequiredService<IUiPageProgressService>();
}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
try
{
await _uiPageProgressService.Go(null, options =>
{
options.Type = UiPageProgressType.Info;
});
await SetLanguageAsync(request, cancellationToken);
await SetAntiForgeryTokenAsync(request);
return await base.SendAsync(request, cancellationToken);
}
finally
{
await _uiPageProgressService.Go(-1);
}
}
private async Task SetLanguageAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var selectedLanguage = await _jsRuntime.InvokeAsync<string>(
"localStorage.getItem",
cancellationToken,
"Abp.SelectedLanguage"
);
if (!selectedLanguage.IsNullOrWhiteSpace())
{
request.Headers.AcceptLanguage.Clear();
request.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(selectedLanguage));
}
}
private async Task SetAntiForgeryTokenAsync(HttpRequestMessage request)
{
if (request.Method == HttpMethod.Get || request.Method == HttpMethod.Head ||
request.Method == HttpMethod.Trace || request.Method == HttpMethod.Options)
{
return;
}
var selfUri = new Uri(_navigationManager.Uri);
if (request.RequestUri.Host != selfUri.Host || request.RequestUri.Port != selfUri.Port)
{
return;
}
var token = await _cookieService.GetAsync(AntiForgeryCookieName);
if (!token.IsNullOrWhiteSpace())
{
request.Headers.Add(AntiForgeryHeaderName, token);
}
}
}
}

@ -1,48 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Microsoft.Extensions.Localization;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class AbpBlazorMessageLocalizerHelper<T>
{
private readonly IStringLocalizer<T> stringLocalizer;
public AbpBlazorMessageLocalizerHelper(IStringLocalizer<T> stringLocalizer)
{
this.stringLocalizer = stringLocalizer;
}
public string Localize(string message, [CanBeNull] IEnumerable<string> arguments)
{
try
{
return arguments?.Count() > 0
? stringLocalizer[message, LocalizeMessageArguments(arguments)?.ToArray()]
: stringLocalizer[message];
}
catch
{
return stringLocalizer[message];
}
}
private IEnumerable<string> LocalizeMessageArguments(IEnumerable<string> arguments)
{
foreach (var argument in arguments)
{
// first try to localize with "DisplayName:{Name}"
var localization = stringLocalizer[$"DisplayName:{argument}"];
if (localization.ResourceNotFound)
{
// then try to localize with just "{Name}"
localization = stringLocalizer[argument];
}
yield return localization;
}
}
}
}

@ -1,51 +0,0 @@
using System.Threading.Tasks;
using Microsoft.JSInterop;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class AbpUtilsService : IAbpUtilsService, ITransientDependency
{
protected IJSRuntime JsRuntime { get; }
public AbpUtilsService(IJSRuntime jsRuntime)
{
JsRuntime = jsRuntime;
}
public ValueTask AddClassToTagAsync(string tagName, string className)
{
return JsRuntime.InvokeVoidAsync("abp.utils.addClassToTag", tagName, className);
}
public ValueTask RemoveClassFromTagAsync(string tagName, string className)
{
return JsRuntime.InvokeVoidAsync("abp.utils.removeClassFromTag", tagName, className);
}
public ValueTask<bool> HasClassOnTagAsync(string tagName, string className)
{
return JsRuntime.InvokeAsync<bool>("abp.utils.hasClassOnTag", tagName, className);
}
public ValueTask ReplaceLinkHrefByIdAsync(string linkId, string hrefValue)
{
return JsRuntime.InvokeVoidAsync("abp.utils.replaceLinkHrefById", linkId, hrefValue);
}
public ValueTask ToggleFullscreenAsync()
{
return JsRuntime.InvokeVoidAsync("abp.utils.toggleFullscreen");
}
public ValueTask RequestFullscreenAsync()
{
return JsRuntime.InvokeVoidAsync("abp.utils.requestFullscreen");
}
public ValueTask ExitFullscreenAsync()
{
return JsRuntime.InvokeVoidAsync("abp.utils.exitFullscreen");
}
}
}

@ -1,15 +0,0 @@
using Volo.Abp.AspNetCore.Components.Alerts;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts
{
public class AlertManager : IAlertManager, IScopedDependency
{
public AlertList Alerts { get; }
public AlertManager()
{
Alerts = new AlertList();
}
}
}

@ -1,20 +0,0 @@
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class ApplicationConfigurationCache : ISingletonDependency
{
protected ApplicationConfigurationDto Configuration { get; set; }
public virtual ApplicationConfigurationDto Get()
{
return Configuration;
}
internal void Set(ApplicationConfigurationDto configuration)
{
Configuration = configuration;
}
}
}

@ -1,17 +0,0 @@
using Volo.Abp.Bundling;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class ComponentsWebAssemblyBundleContributor : IBundleContributor
{
public void AddScripts(BundleContext context)
{
context.Add("_content/Volo.Abp.AspNetCore.Components.WebAssembly/libs/abp/js/abp.js");
}
public void AddStyles(BundleContext context)
{
}
}
}

@ -1,11 +0,0 @@
using System;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class CookieOptions
{
public DateTimeOffset? ExpireDate { get; set; }
public string Path { get; set; }
public bool Secure { get; set; }
}
}

@ -1,32 +0,0 @@
using System.Threading.Tasks;
using Microsoft.JSInterop;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
[Dependency(ReplaceServices = true)]
public class CookieService : ICookieService, ITransientDependency
{
public IJSRuntime JsRuntime { get; }
public CookieService(IJSRuntime jsRuntime)
{
JsRuntime = jsRuntime;
}
public async ValueTask SetAsync(string key, string value, CookieOptions options)
{
await JsRuntime.InvokeVoidAsync("abp.utils.setCookieValue", key, value, options?.ExpireDate?.ToString("r"), options?.Path, options?.Secure);
}
public async ValueTask<string> GetAsync(string key)
{
return await JsRuntime.InvokeAsync<string>("abp.utils.getCookieValue", key);
}
public async ValueTask DeleteAsync(string key, string path = null)
{
await JsRuntime.InvokeVoidAsync("abp.utils.deleteCookie", key);
}
}
}

@ -1,12 +0,0 @@
using System;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.DependencyInjection
{
public class WebAssemblyClientScopeServiceProviderAccessor :
IClientScopeServiceProviderAccessor,
ISingletonDependency
{
public IServiceProvider ServiceProvider { get; set; }
}
}

@ -1,65 +0,0 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling
{
public class AbpExceptionHandlingLogger : ILogger
{
private readonly IServiceCollection _serviceCollection;
private IUserExceptionInformer _userExceptionInformer;
public AbpExceptionHandlingLogger(IServiceCollection serviceCollection)
{
_serviceCollection = serviceCollection;
}
public virtual void Log<TState>(
LogLevel logLevel,
EventId eventId,
TState state,
Exception exception,
Func<TState, Exception, string> formatter)
{
if (exception == null)
{
return;
}
if (logLevel != LogLevel.Critical && logLevel != LogLevel.Error)
{
return;
}
TryInitialize();
if (_userExceptionInformer == null)
{
return;
}
_userExceptionInformer.Inform(new UserExceptionInformerContext(exception));
}
protected virtual void TryInitialize()
{
var serviceProvider = _serviceCollection.GetServiceProviderOrNull();
if (serviceProvider == null)
{
return;
}
_userExceptionInformer = serviceProvider.GetRequiredService<IUserExceptionInformer>();
}
public virtual bool IsEnabled(LogLevel logLevel)
{
return logLevel == LogLevel.Critical || logLevel == LogLevel.Error;
}
public virtual IDisposable BeginScope<TState>(TState state)
{
return NullDisposable.Instance;
}
}
}

@ -1,38 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling
{
public class AbpExceptionHandlingLoggerProvider : ILoggerProvider
{
private AbpExceptionHandlingLogger _logger;
private static readonly object SyncObj = new object();
private readonly IServiceCollection _serviceCollection;
public AbpExceptionHandlingLoggerProvider(IServiceCollection serviceCollection)
{
_serviceCollection = serviceCollection;
}
public ILogger CreateLogger(string categoryName)
{
if (_logger == null)
{
lock (SyncObj)
{
if (_logger == null)
{
_logger = new AbpExceptionHandlingLogger(_serviceCollection);
}
}
}
return _logger;
}
public void Dispose()
{
}
}
}

@ -1,7 +0,0 @@
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling
{
public interface IUserExceptionInformer
{
void Inform(UserExceptionInformerContext context);
}
}

@ -1,52 +0,0 @@
using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.AspNetCore.Components.Messages;
using Volo.Abp.AspNetCore.ExceptionHandling;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http;
using Volo.Abp.Http.Client;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling
{
public class UserExceptionInformer : IUserExceptionInformer, ITransientDependency
{
public ILogger<UserExceptionInformer> Logger { get; set; }
protected IUiMessageService MessageService { get; }
protected IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; }
public UserExceptionInformer(
IUiMessageService messageService,
IExceptionToErrorInfoConverter exceptionToErrorInfoConverter)
{
MessageService = messageService;
ExceptionToErrorInfoConverter = exceptionToErrorInfoConverter;
Logger = NullLogger<UserExceptionInformer>.Instance;
}
public void Inform(UserExceptionInformerContext context)
{
var errorInfo = GetErrorInfo(context);
if (errorInfo.Details.IsNullOrEmpty())
{
//TODO: Should we introduce MessageService.Error (sync) method instead of such a usage (without await)..?
MessageService.Error(errorInfo.Message);
}
else
{
MessageService.Error(errorInfo.Details, errorInfo.Message);
}
}
protected virtual RemoteServiceErrorInfo GetErrorInfo(UserExceptionInformerContext context)
{
if (context.Exception is AbpRemoteCallException remoteCallException)
{
return remoteCallException.Error;
}
return ExceptionToErrorInfoConverter.Convert(context.Exception, false);
}
}
}

@ -1,16 +0,0 @@
using System;
using JetBrains.Annotations;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling
{
public class UserExceptionInformerContext
{
[NotNull]
public Exception Exception { get; }
public UserExceptionInformerContext(Exception exception)
{
Exception = exception;
}
}
}

@ -1,21 +0,0 @@
using System.Threading.Tasks;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public interface IAbpUtilsService
{
ValueTask AddClassToTagAsync(string tagName, string className);
ValueTask RemoveClassFromTagAsync(string tagName, string className);
ValueTask<bool> HasClassOnTagAsync(string tagName, string className);
ValueTask ReplaceLinkHrefByIdAsync(string linkId, string hrefValue);
ValueTask ToggleFullscreenAsync();
ValueTask RequestFullscreenAsync();
ValueTask ExitFullscreenAsync();
}
}

@ -1,12 +0,0 @@
using System;
using System.Threading.Tasks;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public interface ICookieService
{
public ValueTask SetAsync(string key, string value, CookieOptions options = null);
public ValueTask<string> GetAsync(string key);
public ValueTask DeleteAsync(string key, string path = null);
}
}

@ -1,43 +0,0 @@
using System;
using System.Threading.Tasks;
using Microsoft.JSInterop;
using Volo.Abp.AspNetCore.Components.Messages;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Messages
{
public class SimpleUiMessageService : IUiMessageService, ITransientDependency
{
protected IJSRuntime JsRuntime { get; }
public SimpleUiMessageService(IJSRuntime jsRuntime)
{
JsRuntime = jsRuntime;
}
public async Task Info(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task Success(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task Warn(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task Error(string message, string title = null, Action<UiMessageOptions> options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task<bool> Confirm(string message, string title = null, Action<UiMessageOptions> options = null)
{
return await JsRuntime.InvokeAsync<bool>("confirm", message);
}
}
}

@ -1,11 +0,0 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.MultiTenancy
{
[Dependency(ReplaceServices = true)]
public class WebAssemblyCurrentTenantAccessor : ICurrentTenantAccessor, ISingletonDependency
{
public BasicTenantInfo Current { get; set; }
}
}

@ -1,70 +0,0 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc.MultiTenancy;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.DynamicProxying;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.MultiTenancy
{
public class WebAssemblyRemoteTenantStore : ITenantStore, ITransientDependency
{
protected IHttpClientProxy<IAbpTenantAppService> Proxy { get; }
protected WebAssemblyRemoteTenantStoreCache Cache { get; }
public WebAssemblyRemoteTenantStore(
IHttpClientProxy<IAbpTenantAppService> proxy,
WebAssemblyRemoteTenantStoreCache cache)
{
Proxy = proxy;
Cache = cache;
}
public async Task<TenantConfiguration> FindAsync(string name)
{
var cached = Cache.Find(name);
if (cached != null)
{
return cached;
}
var tenant = CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name));
Cache.Set(tenant);
return tenant;
}
public async Task<TenantConfiguration> FindAsync(Guid id)
{
var cached = Cache.Find(id);
if (cached != null)
{
return cached;
}
var tenant = CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id));
Cache.Set(tenant);
return tenant;
}
public TenantConfiguration Find(string name)
{
return AsyncHelper.RunSync(() => FindAsync(name));
}
public TenantConfiguration Find(Guid id)
{
return AsyncHelper.RunSync(() => FindAsync(id));
}
protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto)
{
if (!tenantResultDto.Success || tenantResultDto.TenantId == null)
{
return null;
}
return new TenantConfiguration(tenantResultDto.TenantId.Value, tenantResultDto.Name);
}
}
}

@ -1,35 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.MultiTenancy
{
public class WebAssemblyRemoteTenantStoreCache : IScopedDependency
{
protected readonly List<TenantConfiguration> CachedTenants = new List<TenantConfiguration>();
public virtual TenantConfiguration Find(string name)
{
return CachedTenants.FirstOrDefault(t => t.Name == name);
}
public virtual TenantConfiguration Find(Guid id)
{
return CachedTenants.FirstOrDefault(t => t.Id == id);
}
public virtual void Set(TenantConfiguration tenant)
{
var existingTenant = Find(tenant.Id);
if (existingTenant != null)
{
existingTenant.Name = tenant.Name;
return;
}
CachedTenants.Add(tenant);
}
}
}

@ -1,29 +0,0 @@
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Authorization;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Security
{
[ExposeServices(
typeof(AbpWebAssemblyClaimsCache),
typeof(IAsyncInitialize)
)]
public class AbpWebAssemblyClaimsCache : ISingletonDependency, IAsyncInitialize
{
public ClaimsPrincipal Principal { get; private set; }
private readonly AuthenticationStateProvider _authenticationStateProvider;
public AbpWebAssemblyClaimsCache(AuthenticationStateProvider authenticationStateProvider)
{
_authenticationStateProvider = authenticationStateProvider;
}
public virtual async Task InitializeAsync()
{
var authenticationState = await _authenticationStateProvider.GetAuthenticationStateAsync();
Principal = authenticationState.User;
}
}
}

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.UI;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.DependencyInjection;

@ -1,5 +1,5 @@
using System.Security.Claims;
using Volo.Abp.AspNetCore.Components.WebAssembly.Security;
using Volo.Abp.AspNetCore.Components.UI.Security;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Security.Claims;
@ -7,10 +7,10 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public class WebAssemblyCurrentPrincipalAccessor : CurrentPrincipalAccessorBase, ITransientDependency
{
protected AbpWebAssemblyClaimsCache ClaimsCache { get; }
protected AbpComponentsClaimsCache ClaimsCache { get; }
public WebAssemblyCurrentPrincipalAccessor(
AbpWebAssemblyClaimsCache claimsCache)
AbpComponentsClaimsCache claimsCache)
{
ClaimsCache = claimsCache;
}

@ -1,12 +1,13 @@
using Blazorise;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Components;
using Volo.Abp.AspNetCore.Components.UI;
using Volo.Abp.Modularity;
namespace Volo.Abp.BlazoriseUI
{
[DependsOn(
typeof(AbpAspNetCoreComponentsUIModule)
typeof(AbpAspNetCoreComponentsModule)
)]
public class AbpBlazoriseUIModule : AbpModule
{

@ -1,5 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing;
using Volo.Abp.AspNetCore.Components.UI.Theming.Routing;
using Volo.Abp.AutoMapper;
using Volo.Abp.BlazoriseUI;
using Volo.Abp.Modularity;

@ -2,10 +2,9 @@
@attribute [Authorize( IdentityPermissions.Roles.Default )]
@using Volo.Abp.Identity
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.PermissionManagement.Blazor.Components
@using Microsoft.Extensions.Localization
@using Volo.Abp.Identity.Localization
@using Volo.Abp.AspNetCore.Components.UI
@inject AbpBlazorMessageLocalizerHelper<IdentityResource> LH
@inherits AbpCrudPageBase<IIdentityRoleAppService, IdentityRoleDto, Guid, GetIdentityRolesInput, IdentityRoleCreateDto, IdentityRoleUpdateDto>

@ -1,10 +1,9 @@
@page "/identity/users"
@attribute [Authorize( IdentityPermissions.Users.Default )]
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.PermissionManagement.Blazor.Components
@using Microsoft.Extensions.Localization
@using Volo.Abp.Identity.Localization
@using Volo.Abp.AspNetCore.Components.UI
@inject AbpBlazorMessageLocalizerHelper<IdentityResource> LH
@inherits AbpCrudPageBase<IIdentityUserAppService, IdentityUserDto, Guid, GetIdentityUsersInput, IdentityUserCreateDto, IdentityUserUpdateDto>
@ -17,7 +16,7 @@
<h1>@L["Users"]</h1>
</Column>
<Column ColumnSize="ColumnSize.IsAuto">
@if (HasCreatePermission)
@if ( HasCreatePermission )
{
<Button Color="Color.Primary" Clicked="OpenCreateModalAsync">
<Icon Margin="Margin.Is1.FromRight" Name="IconName.Add"></Icon>@L["NewUser"]
@ -75,7 +74,7 @@
</Card>
@* ************************* CREATE MODAL ************************* *@
@if (HasCreatePermission)
@if ( HasCreatePermission )
{
<Modal @ref="CreateModal">
<ModalBackdrop />
@ -159,9 +158,9 @@
</Field>
</TabPanel>
<TabPanel Name="Roles">
@if (NewUserRoles != null)
@if ( NewUserRoles != null )
{
@foreach (var role in NewUserRoles)
@foreach ( var role in NewUserRoles )
{
<Field>
<input type="hidden" @bind-value="@role.Name" />
@ -184,7 +183,7 @@
}
@* ************************* EDIT MODAL ************************* *@
@if (HasUpdatePermission)
@if ( HasUpdatePermission )
{
<Modal @ref="EditModal">
<ModalBackdrop />
@ -270,9 +269,9 @@
</Field>
</TabPanel>
<TabPanel Name="Roles">
@if (EditUserRoles != null)
@if ( EditUserRoles != null )
{
@foreach (var role in EditUserRoles)
@foreach ( var role in EditUserRoles )
{
<Field>
<input type="hidden" @bind-value="@role.Name" />
@ -294,7 +293,7 @@
</Modal>
}
@if (HasManagePermissionsPermission)
@if ( HasManagePermissionsPermission )
{
<PermissionManagementModal @ref="PermissionManagementModal" />
}

@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Components.Web
@using Volo.Abp.AspNetCore.Components.WebAssembly
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.BlazoriseUI
@using Volo.Abp.BlazoriseUI.Components

@ -1,4 +1,4 @@
using Volo.Abp.AspNetCore.Components.UI.Theming;
using Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
@ -10,6 +10,8 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.UI\Volo.Abp.AspNetCore.Components.UI.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.UI.Theming\Volo.Abp.AspNetCore.Components.UI.Theming.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly\Volo.Abp.AspNetCore.Components.UI.BasicTheme.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly\Volo.Abp.AspNetCore.Components.UI.Theming.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
</ItemGroup>

@ -4,6 +4,7 @@
@using Volo.Abp.FeatureManagement.Blazor.Components
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.AspNetCore.Components.UI
@inject AbpBlazorMessageLocalizerHelper<AbpTenantManagementResource> LH
@inherits AbpCrudPageBase<ITenantAppService, TenantDto, Guid, GetTenantsInput, TenantCreateDto, TenantUpdateDto>
@ -15,7 +16,7 @@
<Heading Size="HeadingSize.Is1">@L["Tenants"]</Heading>
</Column>
<Column ColumnSize="ColumnSize.IsAuto">
@if (HasCreatePermission)
@if ( HasCreatePermission )
{
<Button Color="Color.Primary" Clicked="OpenCreateModalAsync">
<Icon Margin="Margin.Is1.FromRight" Name="IconName.Add"></Icon>@L["NewTenant"]
@ -67,7 +68,7 @@
</Card>
@* ************************* CREATE MODAL ************************* *@
@if (HasCreatePermission)
@if ( HasCreatePermission )
{
<Modal @ref="CreateModal">
<ModalBackdrop />
@ -121,7 +122,7 @@
}
@* ************************* EDIT MODAL ************************* *@
@if (HasUpdatePermission)
@if ( HasUpdatePermission )
{
<Modal @ref="EditModal">
<ModalBackdrop />
@ -155,7 +156,7 @@
}
@* ************************* EDIT CONNECTION STRING MODAL ************************* *@
@if (HasManageConnectionStringsPermission)
@if ( HasManageConnectionStringsPermission )
{
<Modal @ref="@ManageConnectionStringModal">
<ModalBackdrop />
@ -173,7 +174,7 @@
<Check TValue="bool" @bind-Checked="@TenantInfo.UseSharedDatabase" Cursor="@Cursor.Pointer" />
</Field>
</Validation>
@if (!TenantInfo.UseSharedDatabase)
@if ( !TenantInfo.UseSharedDatabase )
{
<Validation MessageLocalizer="@LH.Localize">
<Field>
@ -193,7 +194,7 @@
</Modal>
}
@if (HasManageFeaturesPermission)
@if ( HasManageFeaturesPermission )
{
<FeatureManagementModal @ref="FeatureManagementModal" />
}

Loading…
Cancel
Save