From ccea7ae26afb541c3fcd350cc88c7d7c5cec0223 Mon Sep 17 00:00:00 2001 From: ozermzn Date: Sat, 31 Dec 2022 03:22:16 +0300 Subject: [PATCH 01/10] When the login button is clicked, the button will be disabled and the loading icon will appear in front of it and then redirect to the login page. --- .../apps/dev-app/src/app/app.module.ts | 4 +-- .../dev-app/src/app/home/home.component.html | 18 ++++++++-- .../dev-app/src/app/home/home.component.ts | 8 ++++- .../appsettings.json | 2 +- .../appsettings.json | 34 +++++++++---------- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/app.module.ts b/npm/ng-packs/apps/dev-app/src/app/app.module.ts index c3a0cd68c5..52ebd38362 100644 --- a/npm/ng-packs/apps/dev-app/src/app/app.module.ts +++ b/npm/ng-packs/apps/dev-app/src/app/app.module.ts @@ -14,7 +14,7 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { APP_ROUTE_PROVIDER } from './route.provider'; import { FeatureManagementModule } from '@abp/ng.feature-management'; -// import { AbpOAuthModule } from '@abp/ng.oauth'; +import { AbpOAuthModule } from '@abp/ng.oauth'; @NgModule({ imports: [ @@ -27,7 +27,7 @@ import { FeatureManagementModule } from '@abp/ng.feature-management'; sendNullsAsQueryParam: false, skipGetAppConfiguration: false, }), - // AbpOAuthModule.forRoot(), + AbpOAuthModule.forRoot(), ThemeSharedModule.forRoot(), AccountConfigModule.forRoot(), IdentityConfigModule.forRoot(), diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html index 677ee2e37f..1302cfa018 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html @@ -10,9 +10,23 @@

{{ '::LongWelcomeMessage' | abpLocalization }}

- {{ 'AbpAccount::Login' | abpLocalization }} + {{ 'AbpAccount::Login' | abpLocalization }} +
+ Loading... +
+

Let's improve your application!

diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index c48187728c..c2df395a0e 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,12 +1,14 @@ import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; import { OAuthService } from 'angular-oauth2-oidc'; +import { timeInterval } from 'rxjs'; @Component({ selector: 'app-home', templateUrl: './home.component.html', }) export class HomeComponent { + isLog: boolean = false; get hasLoggedIn(): boolean { return this.authService.isAuthenticated; } @@ -14,6 +16,10 @@ export class HomeComponent { constructor(private authService: AuthService) {} login() { - this.authService.navigateToLogin(); + this.isLog = true; + setTimeout(data => { + this.authService.navigateToLogin(); + this.isLog = false; + }, 1000); } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json index 0602764acb..7087adeeb9 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" + "Default": "Server=özer\\OZER;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" }, "OpenIddict": { "Applications": { diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json index f46c93101c..6a03e588a2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json @@ -1,19 +1,19 @@ { - "App": { - "SelfUrl": "https://localhost:44305", - "ClientUrl": "http://localhost:4200", - "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,https://localhost:44307", - "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" - }, - "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" - }, - "AuthServer": { - "Authority": "https://localhost:44305", - "RequireHttpsMetadata": "false", - "SwaggerClientId": "MyProjectName_Swagger" - }, - "StringEncryption": { - "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - } + "App": { + "SelfUrl": "https://localhost:44305", + "ClientUrl": "http://localhost:4200", + "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,https://localhost:44307", + "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" + }, + "ConnectionStrings": { + "Default": "Server=özer\\OZER;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" + }, + "AuthServer": { + "Authority": "https://localhost:44305", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "MyProjectName_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "gsKnGZ041HLL4IM8" + } } From f8a3d9a4ee1faa279c1944213c2c12e647f5a6f4 Mon Sep 17 00:00:00 2001 From: ozermzn Date: Tue, 3 Jan 2023 00:14:47 +0300 Subject: [PATCH 02/10] * abp-loading-directive added to button with other styles. --- .../dev-app/src/app/home/home.component.html | 13 ++++--------- .../apps/dev-app/src/app/home/home.component.ts | 16 ++++++++++++---- .../apps/dev-app/src/app/home/home.module.ts | 3 ++- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html index 1302cfa018..70e342698c 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html @@ -12,19 +12,14 @@
diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index c2df395a0e..42956fb55c 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,24 +1,32 @@ import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; -import { OAuthService } from 'angular-oauth2-oidc'; -import { timeInterval } from 'rxjs'; +import { Router } from '@angular/router'; @Component({ selector: 'app-home', templateUrl: './home.component.html', }) export class HomeComponent { + //for disabled button and abp loading spinner isLog: boolean = false; get hasLoggedIn(): boolean { return this.authService.isAuthenticated; } - constructor(private authService: AuthService) {} + constructor(private authService: AuthService, private router: Router) { + // this.router.events.subscribe(event => { + // if (event instanceof NavigationStart) { + // console.log(event); + // } + // }); + } login() { + //when clicked button spinner and disabled will be active this.isLog = true; - setTimeout(data => { + setTimeout(a => { this.authService.navigateToLogin(); + //all functions is over here this.isLog = false; }, 1000); } diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts index 72d20ccc65..18416a991c 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts @@ -2,9 +2,10 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; import { HomeRoutingModule } from './home-routing.module'; import { HomeComponent } from './home.component'; +import { LoadingDirective, ThemeSharedModule } from '@abp/ng.theme.shared'; @NgModule({ declarations: [HomeComponent], - imports: [SharedModule, HomeRoutingModule], + imports: [SharedModule, HomeRoutingModule, ThemeSharedModule], }) export class HomeModule {} From ef22c298de99f8b3a26e00ce740f8b060aacc111 Mon Sep 17 00:00:00 2001 From: ozermzn Date: Thu, 5 Jan 2023 20:01:16 +0300 Subject: [PATCH 03/10] updated login button for loading design. --- .../dev-app/src/app/home/home.component.html | 15 +++++------ .../dev-app/src/app/home/home.component.ts | 26 +++++-------------- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html index 70e342698c..2d249da3d8 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html @@ -10,18 +10,17 @@

{{ '::LongWelcomeMessage' | abpLocalization }}

- + {{ 'AbpAccount::Login' | abpLocalization }} +

Let's improve your application!

diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index 42956fb55c..e9a12a2644 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,33 +1,21 @@ -import { AuthService } from '@abp/ng.core'; +import { AuthService, RouterEvents } from '@abp/ng.core'; import { Component } from '@angular/core'; -import { Router } from '@angular/router'; +import { Event, NavigationCancel, NavigationEnd, NavigationStart, Router } from '@angular/router'; +import { map } from 'rxjs'; @Component({ selector: 'app-home', templateUrl: './home.component.html', }) export class HomeComponent { - //for disabled button and abp loading spinner - isLog: boolean = false; + loading: boolean = false; get hasLoggedIn(): boolean { return this.authService.isAuthenticated; } - constructor(private authService: AuthService, private router: Router) { - // this.router.events.subscribe(event => { - // if (event instanceof NavigationStart) { - // console.log(event); - // } - // }); - } - + constructor(private authService: AuthService) {} login() { - //when clicked button spinner and disabled will be active - this.isLog = true; - setTimeout(a => { - this.authService.navigateToLogin(); - //all functions is over here - this.isLog = false; - }, 1000); + this.loading = true; + this.authService.navigateToLogin(); } } From 17cf722386e5f975d89125bbc856b8ab6b3b253b Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 09:58:12 +0300 Subject: [PATCH 04/10] Update appsettings.json --- .../appsettings.json | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json index 6a03e588a2..f46c93101c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json @@ -1,19 +1,19 @@ { - "App": { - "SelfUrl": "https://localhost:44305", - "ClientUrl": "http://localhost:4200", - "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,https://localhost:44307", - "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" - }, - "ConnectionStrings": { - "Default": "Server=özer\\OZER;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" - }, - "AuthServer": { - "Authority": "https://localhost:44305", - "RequireHttpsMetadata": "false", - "SwaggerClientId": "MyProjectName_Swagger" - }, - "StringEncryption": { - "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - } + "App": { + "SelfUrl": "https://localhost:44305", + "ClientUrl": "http://localhost:4200", + "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,https://localhost:44307", + "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" + }, + "ConnectionStrings": { + "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" + }, + "AuthServer": { + "Authority": "https://localhost:44305", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "MyProjectName_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "gsKnGZ041HLL4IM8" + } } From 86e0202fb2e2f051c36b83c31fb075403beab714 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 09:59:05 +0300 Subject: [PATCH 05/10] Update appsettings.json --- .../src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json index 7087adeeb9..0602764acb 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "Default": "Server=özer\\OZER;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" + "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" }, "OpenIddict": { "Applications": { From 7c6e0a04903a72ea942a567683baa1996db32410 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 16:46:51 +0300 Subject: [PATCH 06/10] Update npm/ng-packs/apps/dev-app/src/app/home/home.module.ts Co-authored-by: Qingxiao Ren --- npm/ng-packs/apps/dev-app/src/app/home/home.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts index 18416a991c..e5933f37e3 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts @@ -6,6 +6,6 @@ import { LoadingDirective, ThemeSharedModule } from '@abp/ng.theme.shared'; @NgModule({ declarations: [HomeComponent], - imports: [SharedModule, HomeRoutingModule, ThemeSharedModule], + imports: [SharedModule, HomeRoutingModule], }) export class HomeModule {} From 4889fc35c51afcbf76a6ab886512c1877c00646a Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 16:46:56 +0300 Subject: [PATCH 07/10] Update npm/ng-packs/apps/dev-app/src/app/home/home.component.ts Co-authored-by: Qingxiao Ren --- npm/ng-packs/apps/dev-app/src/app/home/home.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index e9a12a2644..3794fbf0ed 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,6 +1,5 @@ import { AuthService, RouterEvents } from '@abp/ng.core'; import { Component } from '@angular/core'; -import { Event, NavigationCancel, NavigationEnd, NavigationStart, Router } from '@angular/router'; import { map } from 'rxjs'; @Component({ From ca1a19177257b26efa55365c5269e1df8a4d8ffe Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 16:47:03 +0300 Subject: [PATCH 08/10] Update npm/ng-packs/apps/dev-app/src/app/home/home.component.ts Co-authored-by: Qingxiao Ren --- npm/ng-packs/apps/dev-app/src/app/home/home.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index 3794fbf0ed..970c470573 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,4 +1,4 @@ -import { AuthService, RouterEvents } from '@abp/ng.core'; +import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; import { map } from 'rxjs'; From fce790941eed13514d5445e2de40d0a3693eda81 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 16:47:09 +0300 Subject: [PATCH 09/10] Update npm/ng-packs/apps/dev-app/src/app/home/home.component.ts Co-authored-by: Qingxiao Ren --- npm/ng-packs/apps/dev-app/src/app/home/home.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index 970c470573..70bd6da830 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,6 +1,5 @@ import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; -import { map } from 'rxjs'; @Component({ selector: 'app-home', From 49f1833d7c423dd31d98bc8c003fd06e7dcd8044 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 6 Jan 2023 16:47:15 +0300 Subject: [PATCH 10/10] Update npm/ng-packs/apps/dev-app/src/app/home/home.module.ts Co-authored-by: Qingxiao Ren --- npm/ng-packs/apps/dev-app/src/app/home/home.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts index e5933f37e3..72d20ccc65 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.module.ts @@ -2,7 +2,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; import { HomeRoutingModule } from './home-routing.module'; import { HomeComponent } from './home.component'; -import { LoadingDirective, ThemeSharedModule } from '@abp/ng.theme.shared'; @NgModule({ declarations: [HomeComponent],