Merge pull request #4510 from abpframework/feat/upgrade-angular-version

Upgraded Angular versions to v10
pull/4513/head
Levent Arman Özak 5 years ago committed by GitHub
commit 398945be0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,10 +33,10 @@ describe('Routes Service', () => {
const visible = await service.visible$.pipe(take(1)).toPromise();
expect(flat.length).toBe(4);
expect(flat[0].name).toBe('foo');
expect(flat[1].name).toBe('baz');
expect(flat[2].name).toBe('x');
expect(flat[3].name).toBe('bar');
expect(flat[3].name).toBe('foo');
expect(flat[0].name).toBe('baz');
expect(flat[1].name).toBe('x');
expect(flat[2].name).toBe('bar');
expect(tree.length).toBe(1);
expect(tree[0].name).toBe('foo');
@ -88,8 +88,8 @@ describe('Routes Service', () => {
const visible = service.visible;
expect(flat.length).toBe(2);
expect(flat[0].name).toBe('foo');
expect(flat[1].name).toBe('x');
expect(flat[1].name).toBe('foo');
expect(flat[0].name).toBe('x');
expect(tree.length).toBe(1);
expect(tree[0].name).toBe('foo');
@ -114,10 +114,10 @@ describe('Routes Service', () => {
const visible = service.visible;
expect(flat.length).toBe(4);
expect(flat[0].name).toBe('foo');
expect(flat[1].name).toBe('baz');
expect(flat[2].name).toBe('x');
expect(flat[3].name).toBe('bar');
expect(flat[3].name).toBe('foo');
expect(flat[0].name).toBe('baz');
expect(flat[1].name).toBe('x');
expect(flat[2].name).toBe('bar');
expect(tree.length).toBe(1);
expect(tree[0].name).toBe('foo');

@ -15,7 +15,7 @@ export class FeatureManagementService {
getFeatures(params: FeatureManagement.Provider): Observable<FeatureManagement.Features> {
const request: Rest.Request<null> = {
method: 'GET',
url: '/api/abp/features',
url: '/api/feature-management/features',
params,
};
return this.rest.request<FeatureManagement.Provider, FeatureManagement.Features>(request, {
@ -30,7 +30,7 @@ export class FeatureManagementService {
}: FeatureManagement.Provider & FeatureManagement.Features): Observable<null> {
const request: Rest.Request<FeatureManagement.Features> = {
method: 'PUT',
url: '/api/abp/features',
url: '/api/feature-management/features',
body: { features },
params: { providerKey, providerName },
};

@ -16,7 +16,7 @@ export class PermissionManagementService {
): Observable<PermissionManagement.Response> {
const request: Rest.Request<PermissionManagement.GrantedProvider> = {
method: 'GET',
url: '/api/abp/permissions',
url: '/api/permission-management/permissions',
params,
};
@ -33,7 +33,7 @@ export class PermissionManagementService {
}: PermissionManagement.GrantedProvider & PermissionManagement.UpdateRequest): Observable<null> {
const request: Rest.Request<PermissionManagement.UpdateRequest> = {
method: 'PUT',
url: '/api/abp/permissions',
url: '/api/permission-management/permissions',
body: { permissions },
params: { providerKey, providerName },
};

@ -1,9 +1,9 @@
{
"extends": "../tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"target": "es2018",
"types": [
"jasmine",
"jasminewd2",

@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve --open",
"build": "ng build",
"build:prod": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
@ -16,41 +17,39 @@
"@abp/ng.setting-management": "~2.9.0",
"@abp/ng.tenant-management": "~2.9.0",
"@abp/ng.theme.basic": "~2.9.0",
"@angular/animations": "~9.1.0",
"@angular/common": "~9.1.0",
"@angular/compiler": "~9.1.0",
"@angular/core": "~9.1.0",
"@angular/forms": "~9.1.0",
"@angular/platform-browser": "~9.1.0",
"@angular/platform-browser-dynamic": "~9.1.0",
"@angular/router": "~9.1.0",
"@swimlane/ngx-datatable": "^17.0.0",
"@angular/animations": "~10.0.1",
"@angular/common": "~10.0.1",
"@angular/compiler": "~10.0.1",
"@angular/core": "~10.0.1",
"@angular/forms": "~10.0.1",
"@angular/platform-browser": "~10.0.1",
"@angular/platform-browser-dynamic": "~10.0.1",
"@angular/router": "~10.0.1",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.0",
"@angular-devkit/build-ng-packagr": "~0.901.0",
"@angular/cli": "~9.1.0",
"@angular/compiler-cli": "~9.1.0",
"@angular/language-service": "~9.1.0",
"@ngxs/logger-plugin": "^3.6.2",
"@angular-devkit/build-angular": "~0.1000.0",
"@angular-devkit/build-ng-packagr": "~0.1000.0",
"@angular/cli": "~10.0.0",
"@angular/compiler-cli": "~10.0.1",
"@angular/language-service": "~10.0.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"ng-packagr": "^9.0.0",
"protractor": "~5.4.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^10.0.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
"typescript": "~3.9.5"
}
}

@ -1,35 +1,37 @@
import { ABP } from '@abp/ng.core';
import { ABP, DynamicLayoutComponent } from '@abp/ng.core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: '',
loadChildren: () => import('./home/home.module').then((m) => m.HomeModule),
data: {
routes: {
name: '::Menu:Home',
} as ABP.Route,
},
},
{
path: 'account',
loadChildren: () =>
import('@abp/ng.account').then((m) => m.AccountModule.forLazy({ redirectUrl: '/' })),
},
{
path: 'identity',
loadChildren: () => import('@abp/ng.identity').then((m) => m.IdentityModule.forLazy()),
},
{
path: 'tenant-management',
loadChildren: () =>
import('@abp/ng.tenant-management').then((m) => m.TenantManagementModule.forLazy()),
},
{
path: 'setting-management',
loadChildren: () =>
import('@abp/ng.setting-management').then((m) => m.SettingManagementModule.forLazy()),
component: DynamicLayoutComponent,
children: [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then((m) => m.HomeModule),
},
{
path: 'account',
loadChildren: () =>
import('@abp/ng.account').then((m) => m.AccountModule.forLazy({ redirectUrl: '/' })),
},
{
path: 'identity',
loadChildren: () => import('@abp/ng.identity').then((m) => m.IdentityModule.forLazy()),
},
{
path: 'tenant-management',
loadChildren: () =>
import('@abp/ng.tenant-management').then((m) => m.TenantManagementModule.forLazy()),
},
{
path: 'setting-management',
loadChildren: () =>
import('@abp/ng.setting-management').then((m) => m.SettingManagementModule.forLazy()),
},
],
},
];

@ -8,13 +8,11 @@ import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgxsLoggerPluginModule } from '@ngxs/logger-plugin';
import { NgxsModule } from '@ngxs/store';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];
import { APP_ROUTE_PROVIDER } from './route.provider';
@NgModule({
imports: [
@ -31,9 +29,9 @@ const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];
SettingManagementConfigModule.forRoot(),
NgxsModule.forRoot(),
ThemeBasicModule.forRoot(),
...(environment.production ? [] : LOGGERS),
],
declarations: [AppComponent],
providers: [APP_ROUTE_PROVIDER],
bootstrap: [AppComponent],
})
export class AppModule {}

@ -3,13 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
import { ApplicationLayoutComponent } from '@abp/ng.theme.basic';
const routes: Routes = [
{
path: '',
component: ApplicationLayoutComponent,
children: [{ path: '', component: HomeComponent }],
},
];
const routes: Routes = [{ path: '', component: HomeComponent }];
@NgModule({
imports: [RouterModule.forChild(routes)],

@ -0,0 +1,20 @@
import { RoutesService, eLayoutType } from '@abp/ng.core';
import { APP_INITIALIZER } from '@angular/core';
export const APP_ROUTE_PROVIDER = [
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
];
function configureRoutes(routes: RoutesService) {
return () => {
routes.add([
{
path: '/',
name: '::Menu:Home',
iconClass: 'fas fa-home',
order: 1,
layout: eLayoutType.application,
},
]);
};
}

@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []

@ -0,0 +1,22 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2018", "dom"]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableIvy": true
}
}

@ -1,22 +1,17 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScripts language server to improve development experience.
It is not intended to be used to perform a compilation.
To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2018", "dom"]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableIvy": true
}
}
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [

@ -1,8 +1,16 @@
{
"extends": "tslint:recommended",
"rules": {
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-parens": false,
"arrow-return-shorthand": true,
"curly": true,
"deprecation": {
"severity": "warning"
},
@ -21,10 +29,17 @@
"app",
"kebab-case"
],
"eofline": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"interface-name": false,
"max-classes-per-file": false,
"max-line-length": [
@ -71,6 +86,20 @@
true,
"single"
],
"semicolon": {
"options": [
"always"
]
},
"space-before-function-paren": {
"options": {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
@ -82,9 +111,44 @@
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
},
, "variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
}
},
"rulesDirectory": [
"codelyzer"
]

@ -1,6 +1,6 @@
# MyProjectName
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.9.
This is a startup project based on the ABP framework. For more information, visit <a href="https://abp.io/" target="_blank">abp.io</a>
## Development server

@ -1,6 +1,6 @@
# MyProjectName
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.11.
This is a startup project based on the ABP framework. For more information, visit <a href="https://abp.io/" target="_blank">abp.io</a
## Code scaffolding

Loading…
Cancel
Save