Browse Source

Merge branch 'dev' into ShouldChangePasswordOnNextLogin

pull/15708/head
maliming 4 years ago
parent
commit
9f5ed90526
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 21
      docs/en/Tutorials/Todo/Single-Layer/Index.md
  2. 2
      framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs
  3. 51
      npm/ng-packs/angular.json
  4. 6
      npm/ng-packs/apps/dev-app/src/app/app.module.ts
  5. 29
      npm/ng-packs/package.json
  6. 30
      npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts

21
docs/en/Tutorials/Todo/Single-Layer/Index.md

@ -255,7 +255,7 @@ Before starting to implement these use cases, first we need to create a DTO clas
[Application services](../../../Application-Services.md) typically get and return DTOs ([Data Transfer Objects](../../../Data-Transfer-Objects.md)) instead of entities. So, create a new `TodoItemDto` class under the `Services/Dtos` folder{{if UI=="Blazor"}} of your `TodoApp.Contracts` project{{end}}:
```csharp
namespace TodoApp{{if UI=="Blazor"}}.Contracts{{end}}.Services.Dtos;
namespace TodoApp.Services.Dtos;
public class TodoItemDto
{
@ -273,10 +273,10 @@ This is a very simple DTO class that has the same properties as the `TodoItem` e
Create a `ITodoAppService` interface under the `Services` folder of the `TodoApp.Contracts` project, as shown below:
```csharp
using TodoApp.Contracts.Services.Dtos;
using TodoApp.Services.Dtos;
using Volo.Abp.Application.Services;
namespace TodoApp.Contracts.Services;
namespace TodoApp.Services;
public interface ITodoAppService : IApplicationService
{
@ -296,17 +296,18 @@ Create a `TodoAppService` class under the `Services` folder of {{if UI=="Blazor"
```csharp
{{if UI=="Blazor"}}
using TodoApp.Contracts.Services;
using TodoApp.Contracts.Services.Dtos;
using TodoApp.Host.Entities;
using TodoApp.Services;
using TodoApp.Services.Dtos;
using TodoApp.Entities;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
{{else}}
using TodoApp.Entities;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
{{end}}
namespace TodoApp{{if UI=="Blazor"}}.Host{{end}}.Services;
namespace TodoApp.Services;
public class TodoAppService : ApplicationService{{if UI=="Blazor"}}, ITodoAppService{{end}}
{
@ -562,8 +563,8 @@ Open the `Index.razor.cs` file in the `Pages` folder{{if UI=="Blazor"}} in your
```csharp
{{if UI=="Blazor"}}
using Microsoft.AspNetCore.Components;
using TodoApp.Contracts.Services;
using TodoApp.Contracts.Services.Dtos;
using TodoApp.Services;
using TodoApp.Services.Dtos;
{{else}}
using Microsoft.AspNetCore.Components;
using TodoApp.Services;

2
framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs

@ -124,7 +124,7 @@ public class FeatureDefinition : ICanCreateChildFeature
}
/// <summary>
/// Sets a property in the <see cref="Properties"/> dictionary.
/// Adds one or more providers to the <see cref="AllowedProviders"/> list.
/// This is a shortcut for nested calls on this object.
/// </summary>
public virtual FeatureDefinition WithProviders(params string[] providers)

51
npm/ng-packs/angular.json

@ -195,15 +195,55 @@
"assets": ["apps/dev-app/src/favicon.ico", "apps/dev-app/src/assets"],
"styles": [
{
"input": "node_modules/bootstrap/dist/css/bootstrap.rtl.min.css",
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.css",
"inject": false,
"bundleName": "bootstrap-rtl.min"
"bundleName": "bootstrap-dim"
},
{
"input": "node_modules/bootstrap/dist/css/bootstrap.min.css",
"inject": true,
"bundleName": "bootstrap-ltr.min"
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/ng-bundle.css",
"inject": false,
"bundleName": "ng-bundle"
},
{
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/side-menu/layout-bundle.css",
"inject": false,
"bundleName": "layout-bundle"
},
{
"input": "node_modules/@abp/ng.theme.lepton-x/assets/css/abp-bundle.css",
"inject": false,
"bundleName": "abp-bundle"
},
{
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.rtl.css",
"inject": false,
"bundleName": "bootstrap-dim.rtl"
},
{
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/ng-bundle.rtl.css",
"inject": false,
"bundleName": "ng-bundle.rtl"
},
{
"input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/side-menu/layout-bundle.rtl.css",
"inject": false,
"bundleName": "layout-bundle.rtl"
},
{
"input": "node_modules/@abp/ng.theme.lepton-x/assets/css/abp-bundle.rtl.css",
"inject": false,
"bundleName": "abp-bundle.rtl"
},
{
"input":"node_modules/@volo/ngx-lepton-x.lite/assets/css/font-bundle.rtl.css",
"inject":false,
"bundleName":"font-bundle.rtl"
},
{
"input":"node_modules/@volo/ngx-lepton-x.lite/assets/css/font-bundle.css",
"inject":false,
"bundleName":"font-bundle"
},
{
"input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css",
"inject": true,
@ -234,6 +274,7 @@
"inject": false,
"bundleName": "ng-zorro-antd-tree"
},
"node_modules/bootstrap-icons/font/bootstrap-icons.css",
"apps/dev-app/src/styles.scss"
],
"scripts": []

6
npm/ng-packs/apps/dev-app/src/app/app.module.ts

@ -4,7 +4,8 @@ import { registerLocale } from '@abp/ng.core/locale';
import { IdentityConfigModule } from '@abp/ng.identity/config';
import { SettingManagementConfigModule } from '@abp/ng.setting-management/config';
import { TenantManagementConfigModule } from '@abp/ng.tenant-management/config';
import { ThemeBasicModule } from '@abp/ng.theme.basic';
import { ThemeLeptonXModule } from "@abp/ng.theme.lepton-x";
import { SideMenuLayoutModule } from "@abp/ng.theme.lepton-x/layouts";
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
@ -34,7 +35,8 @@ import { AbpOAuthModule } from '@abp/ng.oauth';
TenantManagementConfigModule.forRoot(),
FeatureManagementModule.forRoot(),
SettingManagementConfigModule.forRoot(),
ThemeBasicModule.forRoot(),
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot()
],
providers: [APP_ROUTE_PROVIDER],
declarations: [AppComponent],

29
npm/ng-packs/package.json

@ -42,6 +42,18 @@
},
"private": true,
"devDependencies": {
"@abp/ng.account": "~7.1.0-rc.1",
"@abp/ng.account.core": "~7.1.0-rc.1",
"@abp/ng.core": "~7.1.0-rc.1",
"@abp/ng.feature-management": "~7.1.0-rc.1",
"@abp/ng.identity": "~7.1.0-rc.1",
"@abp/ng.oauth": "~7.1.0-rc.1",
"@abp/ng.permission-management": "~7.1.0-rc.1",
"@abp/ng.schematics": "~7.1.0-rc.1",
"@abp/ng.setting-management": "~7.1.0-rc.1",
"@abp/ng.tenant-management": "~7.1.0-rc.1",
"@abp/ng.theme.basic": "~7.1.0-rc.1",
"@abp/ng.theme.shared": "~7.1.0-rc.1",
"@abp/utils": "~7.1.0-rc.1",
"@angular-devkit/build-angular": "~15.0.1",
"@angular-devkit/build-ng-packagr": "^0.1002.0",
@ -61,18 +73,6 @@
"@angular/platform-browser": "~15.0.1",
"@angular/platform-browser-dynamic": "~15.0.1",
"@angular/router": "~15.0.1",
"@abp/ng.account": "~7.1.0-rc.1",
"@abp/ng.account.core": "~7.1.0-rc.1",
"@abp/ng.core": "~7.1.0-rc.1",
"@abp/ng.oauth": "~7.1.0-rc.1",
"@abp/ng.feature-management": "~7.1.0-rc.1",
"@abp/ng.identity": "~7.1.0-rc.1",
"@abp/ng.permission-management": "~7.1.0-rc.1",
"@abp/ng.schematics": "~7.1.0-rc.1",
"@abp/ng.setting-management": "~7.1.0-rc.1",
"@abp/ng.tenant-management": "~7.1.0-rc.1",
"@abp/ng.theme.basic": "~7.1.0-rc.1",
"@abp/ng.theme.shared": "~7.1.0-rc.1",
"@fortawesome/fontawesome-free": "^5.15.4",
"@ng-bootstrap/ng-bootstrap": "^14.0.0",
"@ngneat/spectator": "^10.0.0",
@ -129,7 +129,10 @@
"typescript": "4.8.4",
"zone.js": "0.11.4"
},
"dependencies": {},
"dependencies": {
"@abp/ng.theme.lepton-x": "^2.1.0-rc.1",
"bootstrap-icons": "^1.10.3"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": [
"npx prettier --write --config .prettierrc "

30
npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts

@ -81,7 +81,7 @@ export class PermissionManagementComponent
});
});
} else {
this.selectedGroup = null;
this.setSelectedGroup(null);
this._visible = false;
this.visibleChange.emit(false);
}
@ -110,10 +110,22 @@ export class PermissionManagementComponent
modalBusy = false;
selectedGroupPermissions: PermissionWithStyle[] = [];
trackByFn: TrackByFunction<PermissionGroupDto> = (_, item) => item.name;
get selectedGroupPermissions(): PermissionWithStyle[] {
if (!this.selectedGroup) return [];
constructor(protected service: PermissionsService, protected configState: ConfigStateService) {}
getChecked(name: string) {
return (this.permissions.find(per => per.name === name) || { isGranted: false }).isGranted;
}
setSelectedGroup(group: PermissionGroupDto) {
this.selectedGroup = group;
if (!this.selectedGroup) {
this.selectedGroupPermissions = [];
return;
}
const margin = `margin-${
(document.body.dir as LocaleDirection) === 'rtl' ? 'right' : 'left'
@ -123,7 +135,7 @@ export class PermissionManagementComponent
group => group.name === this.selectedGroup.name,
).permissions;
return permissions.map(
this.selectedGroupPermissions = permissions.map(
permission =>
({
...permission,
@ -133,12 +145,6 @@ export class PermissionManagementComponent
);
}
constructor(protected service: PermissionsService, protected configState: ConfigStateService) {}
getChecked(name: string) {
return (this.permissions.find(per => per.name === name) || { isGranted: false }).isGranted;
}
setDisabled(permissions: PermissionGrantInfoDto[]) {
if (permissions.length) {
this.disableSelectAllTab = permissions.every(
@ -248,7 +254,7 @@ export class PermissionManagementComponent
onChangeGroup(group: PermissionGroupDto) {
this.setDisabled(group.permissions);
this.selectedGroup = group;
this.setSelectedGroup(group);
this.setTabCheckboxState();
}
@ -291,8 +297,8 @@ export class PermissionManagementComponent
return this.service.get(this.providerName, this.providerKey).pipe(
tap((permissionRes: GetPermissionListResultDto) => {
this.data = permissionRes;
this.selectedGroup = permissionRes.groups[0];
this.permissions = getPermissions(permissionRes.groups);
this.setSelectedGroup(permissionRes.groups[0]);
this.disabledSelectAllInAllTabs = this.permissions.every(
per =>
per.isGranted &&

Loading…
Cancel
Save