diff --git a/build-all.ps1 b/build-all.ps1 index f4ff6ae116..023cbdeb4a 100644 --- a/build-all.ps1 +++ b/build-all.ps1 @@ -19,7 +19,7 @@ $solutionPaths = ( "modules/audit-logging", "modules/background-jobs", "modules/client-simulation", - "templates/mvc-module", + "templates/module/aspnet-core", "templates/app/aspnet-core", "samples/MicroserviceDemo", "abp_io/AbpIoLocalization" diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs index ceb79b2a53..53f8c566cd 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs @@ -19,6 +19,8 @@ namespace Volo.Abp.Cli.ProjectBuilding { case AppTemplate.TemplateName: return new AppTemplate(); + case AppProTemplate.TemplateName: + return new AppProTemplate(); case ModuleTemplate.TemplateName: return new ModuleTemplate(); default: diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppProTemplate.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppProTemplate.cs new file mode 100644 index 0000000000..1b05b887c5 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppProTemplate.cs @@ -0,0 +1,16 @@ +namespace Volo.Abp.Cli.ProjectBuilding.Templates.App +{ + public class AppProTemplate : AppTemplateBase + { + /// + /// "app-pro". + /// + public const string TemplateName = "app-pro"; + + public AppProTemplate() + : base(TemplateName) + { + + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplate.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplate.cs index 8dbedb61f4..030a0a8752 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplate.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplate.cs @@ -1,123 +1,16 @@ -using System.Collections.Generic; -using Volo.Abp.Cli.ProjectBuilding.Building; -using Volo.Abp.Cli.ProjectBuilding.Building.Steps; - -namespace Volo.Abp.Cli.ProjectBuilding.Templates.App +namespace Volo.Abp.Cli.ProjectBuilding.Templates.App { - public class AppTemplate : TemplateInfo + public class AppTemplate : AppTemplateBase { /// /// "app". /// public const string TemplateName = "app"; - public AppTemplate() - : base(TemplateName, DatabaseProvider.EntityFrameworkCore, UiFramework.Mvc) - { - DocumentUrl = "https://docs.abp.io/en/abp/latest/Startup-Templates/Application"; - } - - public override IEnumerable GetCustomSteps(ProjectBuildContext context) - { - var steps = new List(); - - SwitchDatabaseProvider(context, steps); - DeleteUnrelatedProjects(context, steps); - RandomizeSslPorts(context, steps); - CleanupFolderHierarchy(context, steps); - - return steps; - } - - private static void SwitchDatabaseProvider(ProjectBuildContext context, List steps) + public AppTemplate() + : base(TemplateName) { - if (context.BuildArgs.DatabaseProvider == DatabaseProvider.MongoDb) - { - steps.Add(new AppTemplateSwitchEntityFrameworkCoreToMongoDbStep()); - } - - if (context.BuildArgs.DatabaseProvider != DatabaseProvider.EntityFrameworkCore) - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests")); - } - - if (context.BuildArgs.DatabaseProvider != DatabaseProvider.MongoDb) - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.MongoDB")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.MongoDB.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests")); - } - } - private void DeleteUnrelatedProjects(ProjectBuildContext context, List steps) - { - if (context.BuildArgs.UiFramework == UiFramework.Mvc) - { - if (context.BuildArgs.ExtraProperties.ContainsKey("tiered")) - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests")); - steps.Add(new AppTemplateProjectRenameStep("MyCompanyName.MyProjectName.Web.Host", "MyCompanyName.MyProjectName.Web")); - } - else - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer")); - steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44303")); - } - - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds")); - } - - if (context.BuildArgs.UiFramework != UiFramework.Mvc) - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests")); - - if (context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server")) - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds")); - steps.Add(new AngularEnvironmentFilePortChangeForSeparatedIdentityServersStep()); - } - else - { - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); - steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer")); - steps.Add(new AppTemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host")); - steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305")); - } - } - - if (context.BuildArgs.UiFramework != UiFramework.Angular) - { - steps.Add(new RemoveFolderStep("/angular")); - } - } - - private static void RandomizeSslPorts(ProjectBuildContext context, List steps) - { - steps.Add(new TemplateRandomSslPortStep( - new List - { - "https://localhost:44300", - "https://localhost:44301", - "https://localhost:44302", - "https://localhost:44303", - "https://localhost:44305" - } - ) - ); - } - - private void CleanupFolderHierarchy(ProjectBuildContext context, List steps) - { - if (context.BuildArgs.UiFramework == UiFramework.Mvc) - { - steps.Add(new MoveFolderStep("/aspnet-core/", "/")); - } } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs new file mode 100644 index 0000000000..559ddbf2b6 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -0,0 +1,124 @@ +using System.Collections.Generic; +using Volo.Abp.Cli.ProjectBuilding.Building; +using Volo.Abp.Cli.ProjectBuilding.Building.Steps; + +namespace Volo.Abp.Cli.ProjectBuilding.Templates.App +{ + public abstract class AppTemplateBase : TemplateInfo + { + protected AppTemplateBase(string templateName) + : base(templateName, DatabaseProvider.EntityFrameworkCore, UiFramework.Mvc) + { + DocumentUrl = "https://docs.abp.io/en/abp/latest/Startup-Templates/Application"; + } + + public static bool IsAppTemplate(string templateName) + { + return templateName == AppTemplate.TemplateName || + templateName == AppProTemplate.TemplateName; + } + + public override IEnumerable GetCustomSteps(ProjectBuildContext context) + { + var steps = new List(); + + SwitchDatabaseProvider(context, steps); + DeleteUnrelatedProjects(context, steps); + RandomizeSslPorts(context, steps); + CleanupFolderHierarchy(context, steps); + + return steps; + } + + private static void SwitchDatabaseProvider(ProjectBuildContext context, List steps) + { + if (context.BuildArgs.DatabaseProvider == DatabaseProvider.MongoDb) + { + steps.Add(new AppTemplateSwitchEntityFrameworkCoreToMongoDbStep()); + } + + if (context.BuildArgs.DatabaseProvider != DatabaseProvider.EntityFrameworkCore) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests")); + } + + if (context.BuildArgs.DatabaseProvider != DatabaseProvider.MongoDb) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.MongoDB")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.MongoDB.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests")); + } + } + + private void DeleteUnrelatedProjects(ProjectBuildContext context, List steps) + { + if (context.BuildArgs.UiFramework == UiFramework.Mvc) + { + if (context.BuildArgs.ExtraProperties.ContainsKey("tiered")) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests")); + steps.Add(new AppTemplateProjectRenameStep("MyCompanyName.MyProjectName.Web.Host", "MyCompanyName.MyProjectName.Web")); + } + else + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer")); + steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44303")); + } + + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds")); + } + + if (context.BuildArgs.UiFramework != UiFramework.Mvc) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests")); + + if (context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server")) + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds")); + steps.Add(new AngularEnvironmentFilePortChangeForSeparatedIdentityServersStep()); + } + else + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer")); + steps.Add(new AppTemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host")); + steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305")); + } + } + + if (context.BuildArgs.UiFramework != UiFramework.Angular) + { + steps.Add(new RemoveFolderStep("/angular")); + } + } + + private static void RandomizeSslPorts(ProjectBuildContext context, List steps) + { + steps.Add(new TemplateRandomSslPortStep( + new List + { + "https://localhost:44300", + "https://localhost:44301", + "https://localhost:44302", + "https://localhost:44303", + "https://localhost:44305" + } + ) + ); + } + + private void CleanupFolderHierarchy(ProjectBuildContext context, List steps) + { + if (context.BuildArgs.UiFramework == UiFramework.Mvc) + { + steps.Add(new MoveFolderStep("/aspnet-core/", "/")); + } + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs index facbeef476..8b30ca2519 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs @@ -44,7 +44,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates ) .ToList(); - if (context.Template.Name == AppTemplate.TemplateName) + if (AppTemplateBase.IsAppTemplate(context.Template.Name)) { // no tiered if (launchSettings.Count == 1 && diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts index 6a4e53bf0c..2e14e3edae 100644 --- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts @@ -113,6 +113,8 @@ export class ConfigState { const selector = createSelector( [ConfigState], function(state: Config.State) { + if (!state.localization) return key; + const { defaultResourceName } = state.environment.localization; if (keys[0] === '') { if (!defaultResourceName) { diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html index da17738c1d..af162133da 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html @@ -100,9 +100,13 @@ - + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html index e7f4646039..9d5aa0a9f0 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html @@ -84,7 +84,7 @@ -
+ @@ -183,9 +183,13 @@ - + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/identity/src/lib/services/identity.service.ts b/npm/ng-packs/packages/identity/src/lib/services/identity.service.ts index 93436f3878..78292fd02a 100644 --- a/npm/ng-packs/packages/identity/src/lib/services/identity.service.ts +++ b/npm/ng-packs/packages/identity/src/lib/services/identity.service.ts @@ -108,7 +108,7 @@ export class IdentityService { } updateUser(body: Identity.UserItem): Observable { - const url = `/identity/users/${body.id}`; + const url = `/api/identity/users/${body.id}`; delete body.id; const request: Rest.Request = { diff --git a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html index 22488241f3..6ad9bfb201 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html +++ b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html @@ -82,9 +82,13 @@ - + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html index e7632b7e9c..ec059131e0 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html +++ b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.html @@ -73,13 +73,6 @@ > {{ 'AbpTenantManagement::ConnectionStrings' | abpLocalization }} - - + {{ 'AbpIdentity::Save' | abpLocalization }} @@ -158,7 +155,3 @@
- - - Manage Features - diff --git a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts index b6fad6851c..450ee81540 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts @@ -68,9 +68,6 @@ export class TenantsComponent implements OnInit { @ViewChild('connectionStringModalTemplate', { static: false }) connectionStringModalTemplate: TemplateRef; - @ViewChild('featuresModalTemplate', { static: false }) - featuresModalTemplate: TemplateRef; - constructor( private confirmationService: ConfirmationService, private tenantService: TenantManagementService, @@ -126,10 +123,6 @@ export class TenantsComponent implements OnInit { }); } - onManageFeatures(id: string) { - this.openModal('AbpTenantManagement::Features', this.featuresModalTemplate, 'saveFeatures'); - } - onAddTenant() { this.selected = {} as ABP.BasicItem; this.createTenantForm(); diff --git a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management.service.ts b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management.service.ts index 8639fba755..f038931390 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management.service.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/services/tenant-management.service.ts @@ -61,7 +61,7 @@ export class TenantManagementService { } getDefaultConnectionString(id: string): Observable { - const url = `/api/multi-tenancy/tenants/${id}/defaultConnectionString`; + const url = `/api/multi-tenancy/tenants/${id}/default-connection-string`; const request: Rest.Request = { method: 'GET', @@ -72,7 +72,7 @@ export class TenantManagementService { } updateDefaultConnectionString(payload: TenantManagement.DefaultConnectionStringRequest): Observable { - const url = `/api/multi-tenancy/tenants/${payload.id}/defaultConnectionString`; + const url = `/api/multi-tenancy/tenants/${payload.id}/default-connection-string`; const request: Rest.Request = { method: 'PUT', @@ -83,7 +83,7 @@ export class TenantManagementService { } deleteDefaultConnectionString(id: string): Observable { - const url = `/api/multi-tenancy/tenant/${id}/defaultConnectionString`; + const url = `/api/multi-tenancy/tenant/${id}/default-connection-string`; const request: Rest.Request = { method: 'DELETE', diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.html index 9993242caa..d1dc99b109 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.html @@ -27,8 +27,12 @@ - + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html index 8b2cd5b373..921d800649 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html @@ -6,7 +6,7 @@
* + > *
@@ -36,8 +36,12 @@ - + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/samples/BookStore-Angular-MongoDb/angular/package.json b/samples/BookStore-Angular-MongoDb/angular/package.json index 6ca4f5328d..30e57a1741 100644 --- a/samples/BookStore-Angular-MongoDb/angular/package.json +++ b/samples/BookStore-Angular-MongoDb/angular/package.json @@ -1,5 +1,5 @@ { - "name": "my-project-name", + "name": "BookStore", "version": "0.0.0", "scripts": { "ng": "ng", @@ -17,14 +17,14 @@ "@abp/ng.identity": "^0.8.0", "@abp/ng.tenant-management": "^0.8.0", "@abp/ng.theme.basic": "^0.8.0", - "@angular/animations": "~8.1.2", - "@angular/common": "~8.1.2", - "@angular/compiler": "~8.1.2", - "@angular/core": "~8.1.2", - "@angular/forms": "~8.1.2", - "@angular/platform-browser": "~8.1.2", - "@angular/platform-browser-dynamic": "~8.1.2", - "@angular/router": "~8.1.2", + "@angular/animations": "~8.2.0", + "@angular/common": "~8.2.0", + "@angular/compiler": "~8.2.0", + "@angular/core": "~8.2.0", + "@angular/forms": "~8.2.0", + "@angular/platform-browser": "~8.2.0", + "@angular/platform-browser-dynamic": "~8.2.0", + "@angular/router": "~8.2.0", "@angularclass/hmr": "^2.1.3", "@ngxs/devtools-plugin": "^3.5.0", "@ngxs/hmr-plugin": "^3.5.0", @@ -33,10 +33,10 @@ "zone.js": "~0.9.1" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.801.2", - "@angular/cli": "~8.1.2", - "@angular/compiler-cli": "~8.1.2", - "@angular/language-service": "~8.1.2", + "@angular-devkit/build-angular": "~0.802.0", + "@angular/cli": "~8.2.0", + "@angular/compiler-cli": "~8.2.0", + "@angular/language-service": "~8.2.0", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", @@ -48,7 +48,7 @@ "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", - "ngxs-schematic": "^1.1.5", + "ngxs-schematic": "^1.1.6", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/app-routing.module.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/app-routing.module.ts index ac367f979f..d18817b0f5 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/app-routing.module.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/app-routing.module.ts @@ -6,21 +6,15 @@ import { ABP } from '@abp/ng.core'; import { TENANT_MANAGEMENT_ROUTES } from '@abp/ng.tenant-management'; const routes: Routes = [ - { path: '', redirectTo: '/home', pathMatch: 'full' }, { - path: 'home', + path: '', loadChildren: () => import('./home/home.module').then(m => m.HomeModule), data: { routes: { - name: 'Home', + name: '::Menu:Home', } as ABP.Route, }, }, - { path: 'books', loadChildren: () => import('./books/books.module').then(m => m.BooksModule), data: { - routes: { - name: 'Books', - } as ABP.Route, - }, }, { path: 'account', loadChildren: () => import('./lazy-libs/account-wrapper.module').then(m => m.AccountWrapperModule), @@ -37,8 +31,15 @@ const routes: Routes = [ import('./lazy-libs/tenant-management-wrapper.module').then(m => m.TenantManagementWrapperModule), data: { routes: TENANT_MANAGEMENT_ROUTES }, }, - { path: '**', redirectTo: '/' }, - + { + path: 'books', + loadChildren: () => import('./books/books.module').then(m => m.BooksModule), + data: { + routes: { + name: 'Books', + } as ABP.Route, + }, + }, ]; @NgModule({ diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/app.component.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/app.component.ts index 6e89cd41a5..bf2a27962a 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/app.component.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/app.component.ts @@ -7,6 +7,4 @@ import { Component } from '@angular/core'; `, }) -export class AppComponent { - title = 'myProjectName'; -} +export class AppComponent {} diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/app.module.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/app.module.ts index fe0603df3c..d222477028 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/app.module.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/app.module.ts @@ -12,14 +12,12 @@ import { AppComponent } from './app.component'; import { SharedModule } from './shared/shared.module'; import { ThemeSharedModule } from '@abp/ng.theme.shared'; import { BooksState } from './store/states/books.state'; -import { HttpClientModule } from '@angular/common/http'; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, BrowserAnimationsModule, - HttpClientModule, AppRoutingModule, SharedModule, ThemeSharedModule.forRoot(), diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books-routing.module.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books-routing.module.ts index 429ac255aa..4d54fc0a71 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books-routing.module.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books-routing.module.ts @@ -1,19 +1,14 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; - -import { BooksComponent } from './books.component'; import { LayoutApplicationComponent } from '@abp/ng.theme.basic'; +import { BooksComponent } from './books.component'; const routes: Routes = [ - { - path: '', - component: LayoutApplicationComponent, - children: [{ path: '', component: BooksComponent }], - }, + { path: '', component: LayoutApplicationComponent, children: [{ path: '', component: BooksComponent }] }, ]; @NgModule({ imports: [RouterModule.forChild(routes)], - exports: [RouterModule] + exports: [RouterModule], }) -export class BooksRoutingModule { } +export class BooksRoutingModule {} diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.html b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.html index c83bc50050..5be870bad6 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.html +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.html @@ -1 +1,31 @@ -

books works!

+
+
+
+
+
+ Books +
+
+
+
+
+ + + + Book name + Book type + Publish date + Price + + + + + {{ data.name }} + {{ bookType[data.type] }} + {{ data.publishDate | date }} + {{ data.price }} + + + +
+
diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.ts index 5514fc6ad6..880e8dbd75 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.component.ts @@ -1,13 +1,27 @@ -import { Component, OnInit } from "@angular/core"; -import { Store } from "@ngxs/store"; +import { Component, OnInit } from '@angular/core'; +import { Store, Select } from '@ngxs/store'; +import { BooksState } from '../store/states'; +import { Observable } from 'rxjs'; +import { Books } from '../store/models'; +import { BooksGet } from '../store/actions'; @Component({ - selector: "app-books", - templateUrl: "./books.component.html", - styleUrls: ["./books.component.scss"] + selector: 'app-books', + templateUrl: './books.component.html', + styleUrls: ['./books.component.scss'], }) export class BooksComponent implements OnInit { + @Select(BooksState.getBooks) + books$: Observable; + + bookType = Books.Type; + + loading = false; + constructor(private store: Store) {} - ngOnInit() {} + ngOnInit() { + this.loading = true; + this.store.dispatch(new BooksGet()).subscribe(() => (this.loading = false)); + } } diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.module.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.module.ts index 07fd3b1b5c..f7beabbab2 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.module.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/books/books.module.ts @@ -5,13 +5,8 @@ import { BooksRoutingModule } from './books-routing.module'; import { BooksComponent } from './books.component'; import { SharedModule } from '../shared/shared.module'; - @NgModule({ declarations: [BooksComponent], - imports: [ - CommonModule, - BooksRoutingModule, - SharedModule - ] + imports: [CommonModule, BooksRoutingModule, SharedModule], }) -export class BooksModule { } +export class BooksModule {} diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/shared/services/books.service.spec.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/books/services/books.service.spec.ts similarity index 100% rename from samples/BookStore-Angular-MongoDb/angular/src/app/shared/services/books.service.spec.ts rename to samples/BookStore-Angular-MongoDb/angular/src/app/books/services/books.service.spec.ts diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/books/services/books.service.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/books/services/books.service.ts new file mode 100644 index 0000000000..f7c379a359 --- /dev/null +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/books/services/books.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { RestService, Rest } from '@abp/ng.core'; +import { Books } from '../../store/models'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class BooksService { + constructor(private rest: RestService) {} + + get(): Observable { + const request: Rest.Request = { + method: 'GET', + url: '/api/app/book', + }; + + return this.rest.request(request); + } +} diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/home/home.component.html b/samples/BookStore-Angular-MongoDb/angular/src/app/home/home.component.html index ca2ebda8c5..5f16712b31 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/home/home.component.html +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/home/home.component.html @@ -1,9 +1,8 @@
-
Welcome
+
{{ '::Welcome' | abpLocalization }}

- Welcome to the application. This is a startup project based on the ABP framework. For more information, visit - abp.io. + {{ '::LongWelcomeMessage' | abpLocalization }}

; + + export interface Item { + name: string; + type: Type; + publishDate: string; + price: number; + lastModificationTime: string; + lastModifierId: string; + creationTime: string; + creatorId: string; + id: string; + } + + export enum Type { + Undefined, + Adventure, + Biography, + Dystopia, + Fantastic, + Horror, + Science, + ScienceFiction, + Poetry, } } diff --git a/samples/BookStore-Angular-MongoDb/angular/src/app/store/states/books.state.ts b/samples/BookStore-Angular-MongoDb/angular/src/app/store/states/books.state.ts index 066bfa2faf..96443006a3 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/app/store/states/books.state.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/app/store/states/books.state.ts @@ -1,27 +1,29 @@ -import { State, Action, StateContext } from "@ngxs/store"; -import { BooksGet } from "../actions/books.actions"; -import { Books } from "../models/books"; -import { BooksService } from "src/app/shared/services/books.service"; -import { tap } from "rxjs/operators"; +import { State, Action, StateContext, Selector } from '@ngxs/store'; +import { BooksGet } from '../actions/books.actions'; +import { Books } from '../models/books'; +import { BooksService } from '../../books/services/books.service'; +import { tap } from 'rxjs/operators'; @State({ - name: "BooksState", - defaults: {} as Books.State + name: 'BooksState', + defaults: { data: {} } as Books.State, }) export class BooksState { + @Selector() + static getBooks({ data }: Books.State) { + return data.items || []; + } + constructor(private booksService: BooksService) {} @Action(BooksGet) - booksAction( - { getState, patchState }: StateContext, - { payload }: BooksGet - ) { + getBooks({ patchState }: StateContext) { return this.booksService.get().pipe( tap(data => { patchState({ - data + data, }); - }) + }), ); } } diff --git a/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.hmr.ts b/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.hmr.ts index 65b05ebac2..730ae1f969 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.hmr.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.hmr.ts @@ -3,7 +3,7 @@ export const environment = { hmr: true, oAuthConfig: { issuer: 'https://localhost:44359', - clientId: 'BookStore_ConsoleTestApp', + clientId: 'BookStore_App', dummyClientSecret: '1q2w3e*', scope: 'BookStore', showDebugInformation: true, diff --git a/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.prod.ts b/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.prod.ts index 4848d1bd44..501a1a049c 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.prod.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.prod.ts @@ -3,7 +3,7 @@ export const environment = { hmr: false, oAuthConfig: { issuer: 'https://localhost:44359', - clientId: 'BookStore_ConsoleTestApp', + clientId: 'BookStore_App', dummyClientSecret: '1q2w3e*', scope: 'BookStore', showDebugInformation: true, diff --git a/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.ts b/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.ts index e4bd2964f9..957ba8f2b7 100644 --- a/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.ts +++ b/samples/BookStore-Angular-MongoDb/angular/src/environments/environment.ts @@ -3,7 +3,7 @@ export const environment = { hmr: false, oAuthConfig: { issuer: 'https://localhost:44359', - clientId: 'BookStore_ConsoleTestApp', + clientId: 'BookStore_App', dummyClientSecret: '1q2w3e*', scope: 'BookStore', showDebugInformation: true, diff --git a/templates/app/angular/package.json b/templates/app/angular/package.json index d9445dbf96..3696fec874 100644 --- a/templates/app/angular/package.json +++ b/templates/app/angular/package.json @@ -1,5 +1,5 @@ { - "name": "my-project-name", + "name": "MyProjectName", "version": "0.0.0", "scripts": { "ng": "ng", @@ -48,7 +48,7 @@ "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", - "ngxs-schematic": "^1.1.5", + "ngxs-schematic": "^1.1.6", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", diff --git a/templates/app/angular/src/app/app-routing.module.ts b/templates/app/angular/src/app/app-routing.module.ts index 55a082d813..eac8712bad 100644 --- a/templates/app/angular/src/app/app-routing.module.ts +++ b/templates/app/angular/src/app/app-routing.module.ts @@ -31,7 +31,6 @@ const routes: Routes = [ import('./lazy-libs/tenant-management-wrapper.module').then(m => m.TenantManagementWrapperModule), data: { routes: TENANT_MANAGEMENT_ROUTES }, }, - { path: '**', redirectTo: '/' }, ]; @NgModule({ diff --git a/templates/app/angular/src/app/home/home.component.html b/templates/app/angular/src/app/home/home.component.html index 5f16712b31..4fafc67398 100644 --- a/templates/app/angular/src/app/home/home.component.html +++ b/templates/app/angular/src/app/home/home.component.html @@ -5,7 +5,7 @@ {{ '::LongWelcomeMessage' | abpLocalization }}

- {{ 'AbpIdentity::Login' | abpLocalization }}

diff --git a/templates/app/angular/src/app/shared/shared.module.ts b/templates/app/angular/src/app/shared/shared.module.ts index 90dc61005a..6bae4ea332 100644 --- a/templates/app/angular/src/app/shared/shared.module.ts +++ b/templates/app/angular/src/app/shared/shared.module.ts @@ -1,12 +1,14 @@ -import { NgModule } from '@angular/core'; -import { ThemeSharedModule } from '@abp/ng.theme.shared'; import { CoreModule } from '@abp/ng.core'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgModule } from '@angular/core'; import { ThemeBasicModule } from '@abp/ng.theme.basic'; +import { ThemeSharedModule } from '@abp/ng.theme.shared'; +import { TableModule } from 'primeng/table'; @NgModule({ declarations: [], - imports: [CoreModule, ThemeSharedModule, ThemeBasicModule], - exports: [CoreModule, ThemeSharedModule, ThemeBasicModule], + imports: [CoreModule, ThemeSharedModule, ThemeBasicModule, TableModule, NgbDropdownModule], + exports: [CoreModule, ThemeSharedModule, ThemeBasicModule, TableModule, NgbDropdownModule], providers: [], }) export class SharedModule {} diff --git a/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings b/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings index b89df7b544..cb0b2c919f 100644 --- a/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings +++ b/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings @@ -1,7 +1,23 @@  - True - D:\github\abp\common.DotSettings - ..\..\..\common.DotSettings - True - 1 + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL \ No newline at end of file diff --git a/templates/module/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings b/templates/module/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings index 836e6ed4da..cb0b2c919f 100644 --- a/templates/module/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings +++ b/templates/module/aspnet-core/MyCompanyName.MyProjectName.sln.DotSettings @@ -1,7 +1,23 @@  - True - D:\github\abp\common.DotSettings - ..\..\..\common.DotSettings - True - 1 + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL \ No newline at end of file