Browse Source

Merge pull request #8737 from abpframework/auto-merge/rel-4-3/342

Merge branch dev with rel-4.3
pull/8738/head
Halil İbrahim Kalkan 5 years ago
committed by GitHub
parent
commit
2821b065d2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj
  2. 34
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs
  3. 48
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs
  4. 2
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/IAppUrlProvider.cs
  5. 4
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor
  6. 4
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor
  7. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor
  8. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj
  9. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
  10. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj
  11. 4
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyCompanyName.MyProjectName.Blazor.Host.csproj

8
framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj

@ -14,10 +14,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazorise" Version="0.9.3.4" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Components" Version="0.9.3.4" />
<PackageReference Include="Blazorise" Version="0.9.3.5" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Components" Version="0.9.3.5" />
</ItemGroup>
</Project>

34
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs

@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.DependencyInjection;
@ -22,26 +23,34 @@ namespace Volo.Abp.Cli.ProjectModification
{
var file = File.ReadAllText(path);
file = UsingStatementAdder.Add(file, GetNamespace(moduleConfiguration));
var parsedModuleConfiguration = moduleConfiguration.Split(", ");
var stringToAdd = GetLineToAdd(moduleConfiguration);
if (!file.Contains(stringToAdd))
var namespaces = parsedModuleConfiguration.Select(GetNamespace);
var configurationLines = parsedModuleConfiguration.Select(GetLineToAdd);
var indexToInsert = FindIndexToInsert(file);
if (indexToInsert <= 0 || indexToInsert >= file.Length)
{
var indexToInsert = FindIndexToInsert(file);
Logger.LogWarning($"\"OnModelCreating(ModelBuilder builder)\" method couldn't be found in {path}");
return false;
}
if (indexToInsert <= 0 || indexToInsert >= file.Length)
foreach (var configurationLine in configurationLines)
{
if (file.Contains(configurationLine))
{
Logger.LogWarning($"\"OnModelCreating(ModelBuilder builder)\" method couldn't be found in {path}");
return false;
continue;
}
file = file.Insert(indexToInsert, " " + stringToAdd + Environment.NewLine + " ");
file = file.Insert(indexToInsert, " " + configurationLine + Environment.NewLine + " ");
}
else
foreach (var namespaceOfConfiguration in namespaces)
{
return false;
file = UsingStatementAdder.Add(file, namespaceOfConfiguration);
}
File.WriteAllText(path, file);
return true;
}
@ -49,7 +58,8 @@ namespace Volo.Abp.Cli.ProjectModification
protected int FindIndexToInsert(string file)
{
var indexOfMethodDeclaration = file.IndexOf("OnModelCreating(", StringComparison.Ordinal);
var indexOfOpeningBracket = indexOfMethodDeclaration + file.Substring(indexOfMethodDeclaration).IndexOf('{');
var indexOfOpeningBracket =
indexOfMethodDeclaration + file.Substring(indexOfMethodDeclaration).IndexOf('{');
var stack = 1;
var index = indexOfOpeningBracket;

48
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
@ -42,36 +43,24 @@ namespace Volo.Abp.UI.Navigation.Urls
return Options.RedirectAllowedUrls.Any(url.StartsWith);
}
protected virtual Task<string> GetConfiguredUrl(string appName, string urlName)
protected virtual async Task<string> GetConfiguredUrl(string appName, string urlName)
{
var app = Options.Applications[appName];
if (urlName.IsNullOrEmpty())
var url = await GetUrlOrNullAsync(appName, urlName);
if (!url.IsNullOrEmpty())
{
if (app.RootUrl.IsNullOrEmpty())
{
throw new AbpException(
$"RootUrl for the application '{appName}' was not configured. Use {nameof(AppUrlOptions)} to configure it!"
);
}
return Task.FromResult(app.RootUrl);
return url;
}
var url = app.Urls.GetOrDefault(urlName);
if (url.IsNullOrEmpty())
if (!urlName.IsNullOrEmpty())
{
throw new AbpException(
$"Url, named '{urlName}', for the application '{appName}' was not configured. Use {nameof(AppUrlOptions)} to configure it!"
);
}
if (app.RootUrl == null)
{
return Task.FromResult(url);
}
return Task.FromResult(app.RootUrl.EnsureEndsWith('/') + url);
throw new AbpException(
$"RootUrl for the application '{appName}' was not configured. Use {nameof(AppUrlOptions)} to configure it!"
);
}
protected virtual async Task<string> ReplacePlaceHoldersAsync(string url)
@ -118,5 +107,24 @@ namespace Volo.Abp.UI.Navigation.Urls
return CurrentTenant.Name;
}
public Task<string> GetUrlOrNullAsync([NotNull] string appName, [CanBeNull] string urlName = null)
{
var app = Options.Applications[appName];
if (urlName.IsNullOrEmpty())
{
return Task.FromResult(app.RootUrl);
}
var url = app.Urls.GetOrDefault(urlName);
if (app.RootUrl == null)
{
return Task.FromResult(url);
}
return Task.FromResult(app.RootUrl.EnsureEndsWith('/') + url);
}
}
}

2
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/IAppUrlProvider.cs

@ -7,6 +7,8 @@ namespace Volo.Abp.UI.Navigation.Urls
{
Task<string> GetUrlAsync([NotNull] string appName, [CanBeNull] string urlName = null);
Task<string> GetUrlOrNullAsync([NotNull] string appName, [CanBeNull] string urlName = null);
bool IsRedirectAllowedUrl(string url);
}
}

4
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor

@ -48,7 +48,7 @@
<Validation MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel>
<TextEdit @bind-Text="@NewEntity.Name">
<TextEdit @bind-Text="@NewEntity.Name" Autofocus="true">
<Feedback>
<ValidationError/>
</Feedback>
@ -86,7 +86,7 @@
<Validation MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel>
<TextEdit @bind-Text="EditingEntity.Name">
<TextEdit @bind-Text="EditingEntity.Name" Autofocus="true">
<Feedback>
<ValidationError/>
</Feedback>

4
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor

@ -53,7 +53,7 @@
<Validation MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel>
<TextEdit @bind-Text="NewEntity.UserName">
<TextEdit @bind-Text="NewEntity.UserName" Autofocus="true">
<Feedback>
<ValidationError/>
</Feedback>
@ -164,7 +164,7 @@
<Validation MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel>
<TextEdit @bind-Text="EditingEntity.UserName">
<TextEdit @bind-Text="EditingEntity.UserName" Autofocus="true">
<Feedback>
<ValidationError/>
</Feedback>

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor

@ -47,7 +47,7 @@
<Validation MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@L["TenantName"]</FieldLabel>
<TextEdit @bind-Text="@NewEntity.Name">
<TextEdit @bind-Text="@NewEntity.Name" Autofocus="true">
<Feedback>
<ValidationError/>
</Feedback>
@ -101,7 +101,7 @@
<Validation MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@L["TenantName"]</FieldLabel>
<TextEdit @bind-Text="@EditingEntity.Name">
<TextEdit @bind-Text="@EditingEntity.Name" Autofocus="true">
<Feedback>
<ValidationError/>
</Feedback>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.5" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="5.0.*" />

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.5" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
</ItemGroup>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.*" />
</ItemGroup>

4
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyCompanyName.MyProjectName.Blazor.Host.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.4" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.5" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.*" />
</ItemGroup>

Loading…
Cancel
Save