Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into fix/remove-root-modules

pull/1741/head
mehmet-erim 7 years ago
parent
commit
bbb08dad5a
  1. 6
      docs/en/Multi-Tenancy.md
  2. 6
      docs/zh-Hans/Multi-Tenancy.md
  3. 21
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs
  4. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/en.json
  5. 87
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml
  6. 8
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo.Abp.IdentityServer.Domain.Shared.csproj
  7. 18
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/AbpIdentityServerDomainSharedModule.cs
  8. 7
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/en.json
  9. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs
  10. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs
  11. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResources/ApiResourceRepository.cs
  12. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceRepository.cs
  13. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/MongoApiResourceRepository.cs
  14. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/MongoIdentityResourceRepository.cs
  15. 168
      npm/ng-packs/packages/identity/src/lib/components/users/users.component.html
  16. 2
      npm/ng-packs/packages/identity/src/lib/identity.module.ts
  17. 66
      npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html
  18. 3
      npm/ng-packs/packages/permission-management/src/lib/permission-management.module.ts
  19. 17
      npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.ts
  20. 7
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.html
  21. 15
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts
  22. 2
      npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.ts
  23. 105
      npm/ng-packs/packages/theme-shared/src/lib/contants/styles.ts
  24. 32
      npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts

6
docs/en/Multi-Tenancy.md

@ -114,7 +114,7 @@ namespace MyCompany.MyProject
{ {
Configure<TenantResolveOptions>(options => Configure<TenantResolveOptions>(options =>
{ {
options.TenantResolvers.Add(new MyCustomTenantResolver()); options.TenantResolvers.Add(new MyCustomTenantResolveContributor());
}); });
//... //...
@ -123,14 +123,14 @@ namespace MyCompany.MyProject
} }
```` ````
MyCustomTenantResolver must implement **ITenantResolver** as shown below: `MyCustomTenantResolveContributor` must implement **ITenantResolveContributor** as shown below:
````C# ````C#
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
namespace MyCompany.MyProject namespace MyCompany.MyProject
{ {
public class MyCustomTenantResolver : ITenantResolver public class MyCustomTenantResolveContributor : ITenantResolveContributor
{ {
public void Resolve(ITenantResolveContext context) public void Resolve(ITenantResolveContext context)
{ {

6
docs/zh-Hans/Multi-Tenancy.md

@ -115,7 +115,7 @@ namespace MyCompany.MyProject
{ {
Configure<TenantResolveOptions>(options => Configure<TenantResolveOptions>(options =>
{ {
options.TenantResolvers.Add(new MyCustomTenantResolver()); options.TenantResolvers.Add(new MyCustomTenantResolveContributor());
}); });
//... //...
@ -124,14 +124,14 @@ namespace MyCompany.MyProject
} }
```` ````
MyCustomTenantResolver必须像下面这样实现**ITenantResolver**接口: `MyCustomTenantResolveContributor`必须像下面这样实现**ITenantResolveContributor**接口:
````C# ````C#
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
namespace MyCompany.MyProject namespace MyCompany.MyProject
{ {
public class MyCustomTenantResolver : ITenantResolver public class MyCustomTenantResolveContributor : ITenantResolveContributor
{ {
public void Resolve(ITenantResolveContext context) public void Resolve(ITenantResolveContext context)
{ {

21
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -171,31 +171,32 @@ namespace Volo.Abp.Cli
private void LogNewVersionInfo(UpdateChannel updateChannel, SemanticVersion latestVersion, string toolPath) private void LogNewVersionInfo(UpdateChannel updateChannel, SemanticVersion latestVersion, string toolPath)
{ {
Logger.LogWarning( Logger.LogWarning($"ABP CLI has a newer {updateChannel.ToString().ToLowerInvariant()} version {latestVersion}, please update to get the latest features and fixes.");
$"ABP CLI has a newer {updateChannel.ToString().ToLowerInvariant()} version {latestVersion}, please update to get the latest features and fixes."); Logger.LogWarning(string.Empty);
Logger.LogWarning("");
Logger.LogWarning("Update Command: "); Logger.LogWarning("Update Command: ");
// Update command doesn't support prerelease versions https://github.com/dotnet/sdk/issues/2551 workaround is to uninstall & install // Update command doesn't support prerelease versions https://github.com/dotnet/sdk/issues/2551 workaround is to uninstall & install
switch (updateChannel) switch (updateChannel)
{ {
case UpdateChannel.Stable: case UpdateChannel.Stable:
Logger.LogWarning($" dotnet tool update --tool-path {toolPath} Volo.Abp.Cli"); Logger.LogWarning("dotnet tool update -g Volo.Abp.Cli");
break; break;
case UpdateChannel.Prerelease: case UpdateChannel.Prerelease:
Logger.LogWarning($" dotnet tool uninstall --tool-path {toolPath} Volo.Abp.Cli"); Logger.LogWarning("dotnet tool uninstall -g Volo.Abp.Cli");
Logger.LogWarning($" dotnet tool install --tool-path {toolPath} --version {latestVersion} Volo.Abp.Cli"); Logger.LogWarning($"dotnet tool install -g Volo.Abp.Cli --version {latestVersion}");
break; break;
case UpdateChannel.Nightly: case UpdateChannel.Nightly:
Logger.LogWarning($" dotnet tool uninstall --tool-path {toolPath} Volo.Abp.Cli"); case UpdateChannel.Development:
Logger.LogWarning( Logger.LogWarning("dotnet tool uninstall -g Volo.Abp.Cli");
$" dotnet tool install --tool-path {toolPath} --add-source https://www.myget.org/F/abp-nightly/api/v3/index.json --version {latestVersion} Volo.Abp.Cli"); Logger.LogWarning($"dotnet tool install -g Volo.Abp.Cli --add-source https://www.myget.org/F/abp-nightly/api/v3/index.json --version {latestVersion}");
break; break;
default:
throw new ArgumentOutOfRangeException(nameof(updateChannel), updateChannel, null);
} }
Logger.LogWarning(""); Logger.LogWarning(string.Empty);
} }
protected enum UpdateChannel protected enum UpdateChannel

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/en.json

@ -1,6 +1,7 @@
{ {
"culture": "en", "culture": "en",
"texts": { "texts": {
"Features": "Features" "Features": "Features",
"NoFeatureFoundMessage": "There is't any available feature."
} }
} }

87
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml

@ -12,49 +12,58 @@
<form method="post" asp-page="/FeatureManagement/FeatureManagementModal" data-script-class="abp.modals.FeatureManagement"> <form method="post" asp-page="/FeatureManagement/FeatureManagementModal" data-script-class="abp.modals.FeatureManagement">
<abp-modal size="Large"> <abp-modal size="Large">
<abp-modal-header title="@(L["Features"].Value)"></abp-modal-header> <abp-modal-header title="@(L["Features"].Value)"></abp-modal-header>
<abp-modal-body class="ml-4"> @if (Model.FeatureListDto?.Features != null && Model.FeatureListDto.Features.Any())
<input asp-for="@Model.ProviderKey" /> {
<input asp-for="@Model.ProviderName" /> <abp-modal-body class="ml-4">
@for (var i = 0; i < Model.FeatureListDto.Features.Count; i++) <input asp-for="@Model.ProviderKey" />
{ <input asp-for="@Model.ProviderName" />
var feature = Model.FeatureListDto.Features[i]; @for (var i = 0; i < Model.FeatureListDto.Features.Count; i++)
<div class="mt-2" style="padding-left: @(feature.Depth * 20)px"> {
var feature = Model.FeatureListDto.Features[i];
<div class="mt-2" style="padding-left: @(feature.Depth * 20)px">
<spam class="mr-2">@feature.Name</spam> <spam class="mr-2">@feature.Name</spam>
<input type="text" name="Features[@i].Type" value="@feature.ValueType.Name" hidden /> <input type="text" name="Features[@i].Type" value="@feature.ValueType.Name" hidden />
@if (feature.ValueType is FreeTextStringValueType) @if (feature.ValueType is FreeTextStringValueType)
{ {
<input type="text" name="Features[@i].Name" value="@feature.Name" hidden /> <input type="text" name="Features[@i].Name" value="@feature.Name" hidden />
<input type="text" name="Features[@i].Value" value="@feature.Value" /> <input type="text" name="Features[@i].Value" value="@feature.Value" />
} }
@if (feature.ValueType is SelectionStringValueType) @if (feature.ValueType is SelectionStringValueType)
{ {
<input type="text" name="Features[@i].Name" value="@feature.Name" hidden /> <input type="text" name="Features[@i].Name" value="@feature.Name" hidden />
<select name="Features[@i].Value"> <select name="Features[@i].Value">
@foreach (var item in (feature.ValueType as SelectionStringValueType).ItemSource.Items) @foreach (var item in (feature.ValueType as SelectionStringValueType).ItemSource.Items)
{
if (item.Value == feature.Value)
{ {
<option value="@item.Value" selected="selected"> @L.GetString(item.DisplayText.Name) </option> if (item.Value == feature.Value)
{
<option value="@item.Value" selected="selected"> @L.GetString(item.DisplayText.Name) </option>
}
else
{
<option value="@item.Value"> @L.GetString(item.DisplayText.Name) </option>
}
} }
else </select>
{ }
<option value="@item.Value"> @L.GetString(item.DisplayText.Name) </option> @if (feature.ValueType is ToggleStringValueType)
} {
} <input type="text" name="Features[@i].Name" value="@feature.Name" hidden />
</select> <input type="checkbox" class="FeatureValueCheckbox" name="Features[@i].BoolValue" value="@feature.Value"
} @Html.Raw(feature.Value == "True" ? "checked" : "") />
@if (feature.ValueType is ToggleStringValueType) }
{ </div>
<input type="text" name="Features[@i].Name" value="@feature.Name" hidden /> }
<input type="checkbox" class="FeatureValueCheckbox" name="Features[@i].BoolValue" value="@feature.Value" </abp-modal-body>
@Html.Raw(feature.Value == "True" ? "checked" : "") /> <abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
} }
</div> else
} {
</abp-modal-body> <abp-modal-body class="ml-4">
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> @L["NoFeatureFoundMessage"]
</abp-modal-body>
}
</abp-modal> </abp-modal>
</form> </form>

8
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo.Abp.IdentityServer.Domain.Shared.csproj

@ -13,6 +13,14 @@
<RootNamespace /> <RootNamespace />
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Volo\Abp\IdentityServer\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<None Remove="Volo\Abp\IdentityServer\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
</ItemGroup> </ItemGroup>

18
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/AbpIdentityServerDomainSharedModule.cs

@ -1,6 +1,9 @@
using Volo.Abp.IdentityServer.Localization; using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.IdentityServer namespace Volo.Abp.IdentityServer
{ {
@ -11,9 +14,22 @@ namespace Volo.Abp.IdentityServer
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpIdentityServerDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options => Configure<AbpLocalizationOptions>(options =>
{ {
options.Resources.Add<AbpIdentityServerResource>("en"); options.Resources.Add<AbpIdentityServerResource>("en")
.AddBaseTypes(
typeof(AbpValidationResource)
).AddVirtualJson("/Volo/Abp/IdentityServer/Localization/Resources");
});
Configure<ExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Volo.IdentityServer", typeof(AbpIdentityServerResource));
}); });
} }
} }

7
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Volo.IdentityServer:DuplicateIdentityResourceName": "Identity Resource name already exist: {Name}",
"Volo.IdentityServer:DuplicateApiResourceName": "Api Resource name already exist: {Name}"
}
}

5
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs

@ -32,5 +32,10 @@ namespace Volo.Abp.IdentityServer.ApiResources
bool includeDetails = false, bool includeDetails = false,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
); );
Task<bool> CheckNameExistAsync(
string name,
Guid? expectedId = null
);
} }
} }

5
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs

@ -27,5 +27,10 @@ namespace Volo.Abp.IdentityServer.IdentityResources
bool includeDetails = true, bool includeDetails = true,
CancellationToken cancellationToken = default CancellationToken cancellationToken = default
); );
Task<bool> CheckNameExistAsync(
string name,
Guid? expectedId = null
);
} }
} }

5
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResources/ApiResourceRepository.cs

@ -61,6 +61,11 @@ namespace Volo.Abp.IdentityServer.ApiResources
.ToListAsync(GetCancellationToken(cancellationToken)); .ToListAsync(GetCancellationToken(cancellationToken));
} }
public async Task<bool> CheckNameExistAsync(string name, Guid? expectedId = null)
{
return await DbSet.AnyAsync(ar => ar.Id != expectedId && ar.Name == name);
}
public override async Task DeleteAsync(Guid id, bool autoSave = false, CancellationToken cancellationToken = default) public override async Task DeleteAsync(Guid id, bool autoSave = false, CancellationToken cancellationToken = default)
{ {
var scopeClaims = DbContext.Set<ApiScopeClaim>().Where(sc => sc.ApiResourceId == id); var scopeClaims = DbContext.Set<ApiScopeClaim>().Where(sc => sc.ApiResourceId == id);

5
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceRepository.cs

@ -56,5 +56,10 @@ namespace Volo.Abp.IdentityServer.IdentityResources
.Where(x => x.Name == name) .Where(x => x.Name == name)
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); .FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
} }
public async Task<bool> CheckNameExistAsync(string name, Guid? expectedId = null)
{
return await DbSet.AnyAsync(ir => ir.Id != expectedId && ir.Name == name);
}
} }
} }

5
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/MongoApiResourceRepository.cs

@ -47,5 +47,10 @@ namespace Volo.Abp.IdentityServer.MongoDB
{ {
return await GetCountAsync(); return await GetCountAsync();
} }
public async Task<bool> CheckNameExistAsync(string name, Guid? expectedId = null)
{
return await GetMongoQueryable().AnyAsync(ar => ar.Id != expectedId && ar.Name == name);
}
} }
} }

5
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/MongoIdentityResourceRepository.cs

@ -50,5 +50,10 @@ namespace Volo.Abp.IdentityServer.MongoDB
{ {
return await GetCountAsync(); return await GetCountAsync();
} }
public async Task<bool> CheckNameExistAsync(string name, Guid? expectedId = null)
{
return await GetMongoQueryable().AnyAsync(ir => ir.Id != expectedId && ir.Name == name);
}
} }
} }

168
npm/ng-packs/packages/identity/src/lib/components/users/users.component.html

@ -83,100 +83,98 @@
</ng-template> </ng-template>
<ng-template #abpBody> <ng-template #abpBody>
<perfect-scrollbar class="ps-show-always" style="max-height: 70vh;"> <form [formGroup]="form" (ngSubmit)="save()">
<form [formGroup]="form" (ngSubmit)="save()"> <ngb-tabset>
<ngb-tabset> <ngb-tab [title]="'AbpIdentity::UserInformations' | abpLocalization">
<ngb-tab [title]="'AbpIdentity::UserInformations' | abpLocalization"> <ng-template ngbTabContent>
<ng-template ngbTabContent> <div class="mt-2 fade-in-top">
<div class="mt-2 fade-in-top"> <div class="form-group">
<div class="form-group"> <label for="user-name">{{ 'AbpIdentity::UserName' | abpLocalization }}</label
<label for="user-name">{{ 'AbpIdentity::UserName' | abpLocalization }}</label ><span> * </span>
><span> * </span> <input type="text" id="user-name" class="form-control" formControlName="userName" autofocus />
<input type="text" id="user-name" class="form-control" formControlName="userName" autofocus /> </div>
</div>
<div class="form-group"> <div class="form-group">
<label for="name">{{ 'AbpIdentity::DisplayName:Name' | abpLocalization }}</label> <label for="name">{{ 'AbpIdentity::DisplayName:Name' | abpLocalization }}</label>
<input type="text" id="name" class="form-control" formControlName="name" /> <input type="text" id="name" class="form-control" formControlName="name" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="surname">{{ 'AbpIdentity::DisplayName:Surname' | abpLocalization }}</label> <label for="surname">{{ 'AbpIdentity::DisplayName:Surname' | abpLocalization }}</label>
<input type="text" id="surname" class="form-control" formControlName="surname" /> <input type="text" id="surname" class="form-control" formControlName="surname" />
</div> </div>
<div *ngIf="!selected.userName" class="form-group"> <div *ngIf="!selected.userName" class="form-group">
<label for="password">{{ 'AbpIdentity::Password' | abpLocalization }}</label <label for="password">{{ 'AbpIdentity::Password' | abpLocalization }}</label
><span> * </span> ><span> * </span>
<input <input
type="password" type="password"
id="password" id="password"
autocomplete="new-password" autocomplete="new-password"
class="form-control" class="form-control"
formControlName="password" formControlName="password"
/> />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">{{ 'AbpIdentity::EmailAddress' | abpLocalization }}</label <label for="email">{{ 'AbpIdentity::EmailAddress' | abpLocalization }}</label
><span> * </span> ><span> * </span>
<input type="text" id="email" class="form-control" formControlName="email" /> <input type="text" id="email" class="form-control" formControlName="email" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="phone-number">{{ 'AbpIdentity::PhoneNumber' | abpLocalization }}</label> <label for="phone-number">{{ 'AbpIdentity::PhoneNumber' | abpLocalization }}</label>
<input type="text" id="phone-number" class="form-control" formControlName="phoneNumber" /> <input type="text" id="phone-number" class="form-control" formControlName="phoneNumber" />
</div> </div>
<div class="custom-checkbox custom-control mb-2"> <div class="custom-checkbox custom-control mb-2">
<input <input
type="checkbox" type="checkbox"
id="lockout-checkbox" id="lockout-checkbox"
class="custom-control-input" class="custom-control-input"
formControlName="lockoutEnabled" formControlName="lockoutEnabled"
/> />
<label class="custom-control-label" for="lockout-checkbox">{{ <label class="custom-control-label" for="lockout-checkbox">{{
'AbpIdentity::DisplayName:LockoutEnabled' | abpLocalization 'AbpIdentity::DisplayName:LockoutEnabled' | abpLocalization
}}</label> }}</label>
</div> </div>
<div class="custom-checkbox custom-control mb-2"> <div class="custom-checkbox custom-control mb-2">
<input <input
type="checkbox" type="checkbox"
id="two-factor-checkbox" id="two-factor-checkbox"
class="custom-control-input" class="custom-control-input"
formControlName="twoFactorEnabled" formControlName="twoFactorEnabled"
/> />
<label class="custom-control-label" for="two-factor-checkbox">{{ <label class="custom-control-label" for="two-factor-checkbox">{{
'AbpIdentity::DisplayName:TwoFactorEnabled' | abpLocalization 'AbpIdentity::DisplayName:TwoFactorEnabled' | abpLocalization
}}</label> }}</label>
</div>
</div> </div>
</ng-template> </div>
</ngb-tab> </ng-template>
<ngb-tab [title]="'AbpIdentity::Roles' | abpLocalization"> </ngb-tab>
<ng-template ngbTabContent> <ngb-tab [title]="'AbpIdentity::Roles' | abpLocalization">
<div class="mt-2 fade-in-top"> <ng-template ngbTabContent>
<div <div class="mt-2 fade-in-top">
*ngFor="let roleGroup of roleGroups; let i = index; trackBy: trackByFn" <div
class="custom-checkbox custom-control mb-2" *ngFor="let roleGroup of roleGroups; let i = index; trackBy: trackByFn"
> class="custom-checkbox custom-control mb-2"
<input >
type="checkbox" <input
name="Roles[0].IsAssigned" type="checkbox"
value="true" name="Roles[0].IsAssigned"
class="custom-control-input" value="true"
[attr.id]="'roles-' + i" class="custom-control-input"
[formControl]="roleGroup.controls[roles[i].name]" [attr.id]="'roles-' + i"
/> [formControl]="roleGroup.controls[roles[i].name]"
<label class="custom-control-label" [attr.for]="'roles-' + i">{{ roles[i].name }}</label> />
</div> <label class="custom-control-label" [attr.for]="'roles-' + i">{{ roles[i].name }}</label>
</div> </div>
</ng-template> </div>
</ngb-tab> </ng-template>
</ngb-tabset> </ngb-tab>
</form> </ngb-tabset>
</perfect-scrollbar> </form>
</ng-template> </ng-template>
<ng-template #abpFooter> <ng-template #abpFooter>

2
npm/ng-packs/packages/identity/src/lib/identity.module.ts

@ -10,7 +10,6 @@ import { UsersComponent } from './components/users/users.component';
import { PermissionManagementModule } from '@abp/ng.permission-management'; import { PermissionManagementModule } from '@abp/ng.permission-management';
import { TableModule } from 'primeng/table'; import { TableModule } from 'primeng/table';
import { NgxValidateCoreModule } from '@ngx-validate/core'; import { NgxValidateCoreModule } from '@ngx-validate/core';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@NgModule({ @NgModule({
declarations: [RolesComponent, UsersComponent], declarations: [RolesComponent, UsersComponent],
@ -24,7 +23,6 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
NgbDropdownModule, NgbDropdownModule,
PermissionManagementModule, PermissionManagementModule,
NgxValidateCoreModule, NgxValidateCoreModule,
PerfectScrollbarModule,
], ],
}) })
export class IdentityModule {} export class IdentityModule {}

66
npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html

@ -22,16 +22,14 @@
<div class="row"> <div class="row">
<div class="col-4"> <div class="col-4">
<ul class="nav nav-pills flex-column"> <ul class="nav nav-pills flex-column">
<perfect-scrollbar class="ps-show-always" style="max-height: 70vh;"> <li *ngFor="let group of groups$ | async; trackBy: trackByFn" class="nav-item">
<li *ngFor="let group of groups$ | async; trackBy: trackByFn" class="nav-item"> <a
<a class="nav-link pointer"
class="nav-link pointer" [class.active]="selectedGroup?.name === group?.name"
[class.active]="selectedGroup?.name === group?.name" (click)="onChangeGroup(group)"
(click)="onChangeGroup(group)" >{{ group?.displayName }}</a
>{{ group?.displayName }}</a >
> </li>
</li>
</perfect-scrollbar>
</ul> </ul>
</div> </div>
<div class="col-8"> <div class="col-8">
@ -52,32 +50,30 @@
}}</label> }}</label>
</div> </div>
<hr class="mb-3" /> <hr class="mb-3" />
<perfect-scrollbar class="ps-show-always" style="max-height: 60vh;"> <div
<div *ngFor="let permission of selectedGroupPermissions$ | async; let i = index; trackBy: trackByFn"
*ngFor="let permission of selectedGroupPermissions$ | async; let i = index; trackBy: trackByFn" [style.margin-left]="permission.margin + 'px'"
[style.margin-left]="permission.margin + 'px'" class="custom-checkbox custom-control mb-2"
class="custom-checkbox custom-control mb-2" >
<input
#permissionCheckbox
type="checkbox"
[checked]="getChecked(permission.name)"
[value]="getChecked(permission.name)"
[attr.id]="permission.name"
class="custom-control-input"
[disabled]="isGrantedByRole(permission.grantedProviders)"
/>
<label
class="custom-control-label"
[attr.for]="permission.name"
(click)="onClickCheckbox(permission, permissionCheckbox.value)"
>{{ permission.displayName }}
<span *ngFor="let provider of permission.grantedProviders" class="badge badge-light"
>{{ provider.providerName }}: {{ provider.providerKey }}</span
></label
> >
<input </div>
#permissionCheckbox
type="checkbox"
[checked]="getChecked(permission.name)"
[value]="getChecked(permission.name)"
[attr.id]="permission.name"
class="custom-control-input"
[disabled]="isGrantedByRole(permission.grantedProviders)"
/>
<label
class="custom-control-label"
[attr.for]="permission.name"
(click)="onClickCheckbox(permission, permissionCheckbox.value)"
>{{ permission.displayName }}
<span *ngFor="let provider of permission.grantedProviders" class="badge badge-light"
>{{ provider.providerName }}: {{ provider.providerKey }}</span
></label
>
</div>
</perfect-scrollbar>
</div> </div>
</div> </div>
</div> </div>

3
npm/ng-packs/packages/permission-management/src/lib/permission-management.module.ts

@ -4,11 +4,10 @@ import { NgModule } from '@angular/core';
import { NgxsModule } from '@ngxs/store'; import { NgxsModule } from '@ngxs/store';
import { PermissionManagementComponent } from './components/permission-management.component'; import { PermissionManagementComponent } from './components/permission-management.component';
import { PermissionManagementState } from './states/permission-management.state'; import { PermissionManagementState } from './states/permission-management.state';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@NgModule({ @NgModule({
declarations: [PermissionManagementComponent], declarations: [PermissionManagementComponent],
imports: [CoreModule, ThemeSharedModule, NgxsModule.forFeature([PermissionManagementState]), PerfectScrollbarModule], imports: [CoreModule, ThemeSharedModule, NgxsModule.forFeature([PermissionManagementState])],
exports: [PermissionManagementComponent], exports: [PermissionManagementComponent],
}) })
export class PermissionManagementModule {} export class PermissionManagementModule {}

17
npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.ts

@ -11,26 +11,25 @@ import { Toaster } from '../../models/toaster';
(onClose)="close(dismiss)" (onClose)="close(dismiss)"
[modal]="true" [modal]="true"
[baseZIndex]="1000" [baseZIndex]="1000"
styleClass="" styleClass="abp-confirm"
> >
<ng-template let-message pTemplate="message"> <ng-template let-message pTemplate="message">
<div *ngIf="message.summary" class="modal-header"> <i class="fa fa-exclamation-circle abp-confirm-icon"></i>
<h4 class="modal-title"> <div *ngIf="message.summary" class="abp-confirm-summary">
{{ message.summary | abpLocalization: message.titleLocalizationParams }} {{ message.summary | abpLocalization: message.titleLocalizationParams }}
</h4>
</div> </div>
<div class="modal-body"> <div class="abp-confirm-body">
{{ message.detail | abpLocalization: message.messageLocalizationParams }} {{ message.detail | abpLocalization: message.messageLocalizationParams }}
</div> </div>
<div class="modal-footer justify-content-center"> <div class="abp-confirm-footer justify-content-center">
<button *ngIf="!message.hideCancelBtn" type="button" class="btn btn-secondary" (click)="close(reject)"> <button *ngIf="!message.hideCancelBtn" type="button" class="btn btn-sm btn-primary" (click)="close(reject)">
{{ message.cancelCopy || 'AbpIdentity::Cancel' | abpLocalization }} {{ message.cancelCopy || 'AbpIdentity::Cancel' | abpLocalization }}
</button> </button>
<button <button
*ngIf="!message.hideYesBtn" *ngIf="!message.hideYesBtn"
type="button" type="button"
class="btn btn-secondary" class="btn btn-sm btn-primary"
(click)="close(confirm)" (click)="close(confirm)"
autofocus autofocus
> >

7
npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.html

@ -27,10 +27,9 @@
[style.minHeight]="minHeight || undefined" [style.minHeight]="minHeight || undefined"
> >
<ng-container *ngTemplateOutlet="abpBody"></ng-container> <ng-container *ngTemplateOutlet="abpBody"></ng-container>
</div>
<div id="abp-modal-footer" class="modal-footer"> <div id="abp-modal-footer" class="modal-footer">
<ng-container *ngTemplateOutlet="abpFooter"></ng-container> <ng-container *ngTemplateOutlet="abpFooter"></ng-container>
</div>
</div> </div>
</div> </div>
</div> </div>

15
npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

@ -119,11 +119,16 @@ export class ModalComponent implements OnDestroy {
this.visibleChange.emit(value); this.visibleChange.emit(value);
this.showModal = value; this.showModal = value;
value if (value) {
? timer(ANIMATION_TIMEOUT + 100) timer(ANIMATION_TIMEOUT + 100)
.pipe(take(1)) .pipe(take(1))
.subscribe(_ => (this.closable = true)) .subscribe(_ => (this.closable = true));
: (this.closable = false);
this.renderer.addClass(document.body, 'modal-open');
} else {
this.closable = false;
this.renderer.removeClass(document.body, 'modal-open');
}
} }
listen() { listen() {

2
npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.ts

@ -3,7 +3,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
selector: 'abp-toast', selector: 'abp-toast',
template: ` template: `
<p-toast position="bottom-right" key="abpToast" [baseZIndex]="1000"> <p-toast position="bottom-right" key="abpToast" styleClass="abp-toast" [baseZIndex]="1000">
<ng-template let-message pTemplate="message"> <ng-template let-message pTemplate="message">
<span <span
class="ui-toast-icon pi" class="ui-toast-icon pi"

105
npm/ng-packs/packages/theme-shared/src/lib/contants/styles.ts

@ -45,6 +45,111 @@ export default `
white-space: nowrap; white-space: nowrap;
} }
.abp-toast .ui-toast-message {
box-sizing: border-box !important;
border: 2px solid transparent !important;
border-radius: 4px !important;
background-color: #f4f4f7 !important;
color: #1b1d29 !important;
}
.abp-toast .ui-toast-message-content {
padding: 10px !important;
}
.abp-toast .ui-toast-message-content .ui-toast-icon {
top: 0 !important;
left: 0 !important;
padding: 10px !important;
}
.abp-toast .ui-toast-summary {
margin: 0 !important;
font-weight: 700 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-error {
border-color: #ba1659 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-error .ui-toast-message-content .ui-toast-icon {
color: #ba1659 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-warning {
border-color: #ed5d98 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-warning .ui-toast-message-content .ui-toast-icon {
color: #ed5d98 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-success {
border-color: #1c9174 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-success .ui-toast-message-content .ui-toast-icon {
color: #1c9174 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-info {
border-color: #fccb31 !important;
}
.abp-toast .ui-toast-message.ui-toast-message-info .ui-toast-message-content .ui-toast-icon {
color: #fccb31 !important;
}
.abp-confirm .ui-toast-message {
box-sizing: border-box !important;
padding: 0px !important;
border:0 none !important;
border-radius: 4px !important;
background-color: #fff !important;
color: rgba(0, 0, 0, .65) !important;
font-family: "Poppins", sans-serif;
text-align: center !important;
}
.abp-confirm .ui-toast-message-content {
padding: 0px !important;
}
.abp-confirm .abp-confirm-icon {
margin: 32px 50px 5px !important;
color: #f8bb86 !important;
font-size: 52px !important;
}
.abp-confirm .ui-toast-close-icon {
display: none !important;
}
.abp-confirm .abp-confirm-summary {
display: block !important;
margin-bottom: 13px !important;
padding: 13px 16px 0px !important;
font-weight: 600 !important;
font-size: 18px !important;
}
.abp-confirm .abp-confirm-body {
display: inline-block !important;
padding: 0px 10px !important;
}
.abp-confirm .abp-confirm-footer {
display: block !important;
margin-top: 30px !important;
padding: 16px !important;
background-color: #f4f4f7 !important;
text-align: right !important;
}
.abp-confirm .abp-confirm-footer .btn {
margin-left: 10px !important;
}
/* <animations */ /* <animations */
.fade-in-top { .fade-in-top {

32
npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts

@ -18,22 +18,26 @@ import { ChangePasswordComponent } from './components/change-password/change-pas
import { ProfileComponent } from './components/profile/profile.component'; import { ProfileComponent } from './components/profile/profile.component';
import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component'; import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component';
export function appendScript(injector: Injector) { export function appendScript(styles) {
const fn = function() { const higher = (injector: Injector) => {
const lazyLoadService: LazyLoadService = injector.get(LazyLoadService); const fn = function() {
const lazyLoadService: LazyLoadService = injector.get(LazyLoadService);
return forkJoin( return forkJoin(
lazyLoadService.load( lazyLoadService.load(
null, null,
'style', 'style',
styles, styles,
'head', 'head',
'afterbegin', 'afterbegin',
) /* lazyLoadService.load(null, 'script', scripts) */, ) /* lazyLoadService.load(null, 'script', scripts) */,
).pipe(take(1)); ).pipe(take(1));
};
return fn;
}; };
return fn; return higher;
} }
@NgModule({ @NgModule({
@ -87,7 +91,7 @@ export class ThemeSharedModule {
provide: APP_INITIALIZER, provide: APP_INITIALIZER,
multi: true, multi: true,
deps: [Injector, ErrorHandler], deps: [Injector, ErrorHandler],
useFactory: appendScript, useFactory: appendScript(styles),
}, },
{ provide: MessageService, useClass: MessageService }, { provide: MessageService, useClass: MessageService },
], ],

Loading…
Cancel
Save