From 2bcf619e267829245f7e78cb78da627b9e11129b Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Wed, 7 Sep 2022 18:22:04 +0300 Subject: [PATCH 01/16] Add feature `When the user change personal info, the confirmation modal appear` --- .../Account/Localization/Resources/en.json | 2 + .../Account/Localization/Resources/tr.json | 2 + .../account/src/lib/account.module.ts | 5 ++ .../personal-settings.component.ts | 61 ++++++++++++++++--- .../account/src/lib/models/config-options.ts | 1 + .../packages/account/src/lib/tokens/index.ts | 1 + .../lib/tokens/re-login-confirmation.token.ts | 5 ++ 7 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 npm/ng-packs/packages/account/src/lib/tokens/re-login-confirmation.token.ts diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json index 17f05fe29b..9dafae13f3 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json @@ -34,6 +34,8 @@ "DisplayName:PhoneNumber": "Phone number", "PersonalSettings": "Personal settings", "PersonalSettingsSaved": "Personal settings saved", + "PersonalSettingsChangedConfirmationModalTitle": "Personal info changed", + "PersonalSettingsChangedConfirmationModalDescription": "If you want to apply these changes, you have to login. Do you want to log out?", "PasswordChanged": "Password changed", "NewPasswordConfirmFailed": "Please confirm the new password.", "Manage": "Manage", diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json index 6edaf2c1c4..d7d2454b6f 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json @@ -34,6 +34,8 @@ "DisplayName:PhoneNumber": "Telefon numarası", "PersonalSettings": "Kişisel ayarlar", "PersonalSettingsSaved": "Kişisel ayarlar kaydedildi", + "PersonalSettingsChangedConfirmationModalTitle": "Personal info changed", + "PersonalSettingsChangedConfirmationModalDescription": "If you want to apply these changes, you have to login. Do you want to log out?", "PasswordChanged": "Şifre değiştirildi", "NewPasswordConfirmFailed": "Lütfen yeni şifreyi onaylayın.", "Manage": "Manage", diff --git a/npm/ng-packs/packages/account/src/lib/account.module.ts b/npm/ng-packs/packages/account/src/lib/account.module.ts index bfa37d4bfa..d04f931a0f 100644 --- a/npm/ng-packs/packages/account/src/lib/account.module.ts +++ b/npm/ng-packs/packages/account/src/lib/account.module.ts @@ -15,6 +15,7 @@ import { accountConfigOptionsFactory } from './utils/factory-utils'; import { AuthenticationFlowGuard } from './guards/authentication-flow.guard'; import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component'; import { ResetPasswordComponent } from './components/reset-password/reset-password.component'; +import { RE_LOGIN_CONFIRMATION_TOKEN } from './tokens'; const declarations = [ LoginComponent, @@ -49,6 +50,10 @@ export class AccountModule { useFactory: accountConfigOptionsFactory, deps: [ACCOUNT_CONFIG_OPTIONS], }, + { + provide: RE_LOGIN_CONFIRMATION_TOKEN, + useValue: options.isPersonalSettingsChangedConfirmationActive ?? true, + }, ], }; } diff --git a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts index d15df99878..ec75ab96ef 100644 --- a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts @@ -1,10 +1,12 @@ -import { ProfileService } from '@abp/ng.account.core/proxy'; -import { ToasterService } from '@abp/ng.theme.shared'; -import { Component, OnInit } from '@angular/core'; +import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy'; +import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared'; +import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { finalize } from 'rxjs/operators'; +import { finalize, filter } from 'rxjs/operators'; import { Account } from '../../models/account'; import { ManageProfileStateService } from '../../services/manage-profile.state.service'; +import { AuthService } from '@abp/ng.core'; +import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens'; const { maxLength, required, email } = Validators; @@ -22,12 +24,17 @@ export class PersonalSettingsComponent form: FormGroup; inProgress: boolean; + private profile: ProfileDto; constructor( private fb: FormBuilder, private toasterService: ToasterService, private profileService: ProfileService, private manageProfileState: ManageProfileStateService, + private readonly authService: AuthService, + private confirmationService: ConfirmationService, + @Inject(RE_LOGIN_CONFIRMATION_TOKEN) + private isPersonalSettingsChangedConfirmationActive: boolean, ) {} ngOnInit() { @@ -35,18 +42,19 @@ export class PersonalSettingsComponent } buildForm() { - const profile = this.manageProfileState.getProfile(); + this.profile = this.manageProfileState.getProfile(); this.form = this.fb.group({ - userName: [profile.userName, [required, maxLength(256)]], - email: [profile.email, [required, email, maxLength(256)]], - name: [profile.name || '', [maxLength(64)]], - surname: [profile.surname || '', [maxLength(64)]], - phoneNumber: [profile.phoneNumber || '', [maxLength(16)]], + userName: [this.profile.userName, [required, maxLength(256)]], + email: [this.profile.email, [required, email, maxLength(256)]], + name: [this.profile.name || '', [maxLength(64)]], + surname: [this.profile.surname || '', [maxLength(64)]], + phoneNumber: [this.profile.phoneNumber || '', [maxLength(16)]], }); } submit() { if (this.form.invalid) return; + const isLogOutConfirmMessageVisible = this.isLogoutConfirmMessageActive(); this.inProgress = true; this.profileService .update(this.form.value) @@ -54,6 +62,39 @@ export class PersonalSettingsComponent .subscribe(profile => { this.manageProfileState.setProfile(profile); this.toasterService.success('AbpAccount::PersonalSettingsSaved', 'Success', { life: 5000 }); + if (isLogOutConfirmMessageVisible) { + this.showLogoutConfirmMessage(); + } }); } + + isDataSame(oldValue, newValue) { + return Object.entries(oldValue).some(([key, value]) => { + if (key in newValue) { + return value !== newValue[key]; + } + return false; + }); + } + + logoutConfirmation = () => { + this.authService.logout().subscribe(); + }; + + private isLogoutConfirmMessageActive() { + if (!this.isPersonalSettingsChangedConfirmationActive) { + return false; + } + return this.isDataSame(this.profile, this.form.value); + } + + private showLogoutConfirmMessage() { + this.confirmationService + .info( + 'AbpAccount::PersonalSettingsChangedConfirmationModalDescription', + 'AbpAccount::PersonalSettingsChangedConfirmationModalTitle', + ) + .pipe(filter(status => status === Confirmation.Status.confirm)) + .subscribe(this.logoutConfirmation); + } } diff --git a/npm/ng-packs/packages/account/src/lib/models/config-options.ts b/npm/ng-packs/packages/account/src/lib/models/config-options.ts index 898021b04e..1f6a15641d 100644 --- a/npm/ng-packs/packages/account/src/lib/models/config-options.ts +++ b/npm/ng-packs/packages/account/src/lib/models/config-options.ts @@ -1,3 +1,4 @@ export interface AccountConfigOptions { redirectUrl?: string; + isPersonalSettingsChangedConfirmationActive?: boolean; } diff --git a/npm/ng-packs/packages/account/src/lib/tokens/index.ts b/npm/ng-packs/packages/account/src/lib/tokens/index.ts index 0a88318130..9e126a7a1f 100644 --- a/npm/ng-packs/packages/account/src/lib/tokens/index.ts +++ b/npm/ng-packs/packages/account/src/lib/tokens/index.ts @@ -1 +1,2 @@ export * from './config-options.token'; +export * from './re-login-confirmation.token'; diff --git a/npm/ng-packs/packages/account/src/lib/tokens/re-login-confirmation.token.ts b/npm/ng-packs/packages/account/src/lib/tokens/re-login-confirmation.token.ts new file mode 100644 index 0000000000..8ca5375bab --- /dev/null +++ b/npm/ng-packs/packages/account/src/lib/tokens/re-login-confirmation.token.ts @@ -0,0 +1,5 @@ +import { InjectionToken } from '@angular/core'; + +export const RE_LOGIN_CONFIRMATION_TOKEN = new InjectionToken( + 'RE_LOGIN_CONFIRMATION_TOKEN', +); From f9991bdf503daaeef72739004b23a0d0799d9324 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Wed, 7 Sep 2022 18:22:19 +0300 Subject: [PATCH 02/16] Update Docs of Account-Module --- docs/en/UI/Angular/Account-Module.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/en/UI/Angular/Account-Module.md b/docs/en/UI/Angular/Account-Module.md index 3670a14f73..1b6be08f16 100644 --- a/docs/en/UI/Angular/Account-Module.md +++ b/docs/en/UI/Angular/Account-Module.md @@ -95,6 +95,24 @@ export class AppRoutingModule {} Before v4.3, the "My account" link in the current user dropdown on the top bar redirected the user to MVC's profile management page. As of v4.3, if you added the account module to your project, the same link will land on a page in the Angular UI account module instead. +### Personal Info Page Confirm Message + +When the user changes their own data on the personal settings tab in My Account, The data can not update the CurrentUser key of Application-Configuration. The information of the user is stored in claims. The only way to apply this information to the CurrentUser of Application-Configuration is user should log out and log in. When the Refresh-Token feature is implemented, it will be fixed. So We've added a confirmation alert. + +If you want to disable these warning, You should set `isPersonalSettingsChangedConfirmationActive` false + +```js +// app-routing.module.ts +const routes: Routes = [ + //... + { + path: 'account', + loadChildren: () => import('@volo/abp.ng.account/public').then(m => m.AccountPublicModule.forLazy({ isPersonalSettingsChangedConfirmationActive:false })), + }, + //... +export class AppRoutingModule {} +``` + ### Security Logs Page [COMMERCIAL] Before v4.3, the "Security Logs" link in the current user dropdown on the top bar redirected the user to MVC's security logs page. As of v4.3, if you added the account module to your project, the same link will land on a page in the Angular UI account public module instead. From 5dfd379dfbee94f4c3bf40b6df852222c9475509 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Wed, 1 Jun 2022 16:21:48 +0300 Subject: [PATCH 03/16] Fix angular 12 testing issue --- templates/app-nolayers/angular/src/test.ts | 3 +-- templates/app/angular/src/test.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/app-nolayers/angular/src/test.ts b/templates/app-nolayers/angular/src/test.ts index 61925f9803..85c74fe531 100644 --- a/templates/app-nolayers/angular/src/test.ts +++ b/templates/app-nolayers/angular/src/test.ts @@ -1,11 +1,10 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files - +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; -import 'zone.js/testing'; declare const require: { context( diff --git a/templates/app/angular/src/test.ts b/templates/app/angular/src/test.ts index 61925f9803..5b643ec44d 100644 --- a/templates/app/angular/src/test.ts +++ b/templates/app/angular/src/test.ts @@ -1,11 +1,11 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files - +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; -import 'zone.js/testing'; + declare const require: { context( From dd53c7b9960ce86a1e59c7226e5ec7819fa93a3b Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Wed, 1 Jun 2022 18:11:33 +0300 Subject: [PATCH 04/16] Add example tests to Home.component.spec.ts --- .../src/app/home/home.component.spec.ts | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 templates/app/angular/src/app/home/home.component.spec.ts diff --git a/templates/app/angular/src/app/home/home.component.spec.ts b/templates/app/angular/src/app/home/home.component.spec.ts new file mode 100644 index 0000000000..3ceff9410b --- /dev/null +++ b/templates/app/angular/src/app/home/home.component.spec.ts @@ -0,0 +1,100 @@ +import { CoreTestingModule } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { HomeComponent } from "./home.component"; +import { OAuthService } from 'angular-oauth2-oidc'; +import { AuthService } from '@abp/ng.core'; + + +describe("HomeComponent", () => { + let fixture: ComponentFixture; + const mockOAuthService = jasmine.createSpyObj('OAuthService', ['hasValidAccessToken']) + const mockAuthService = jasmine.createSpyObj('AuthService', ['navigateToLogin']) + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [HomeComponent], + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + ], + providers: [ + /* mock providers here */ + { + provide: OAuthService, + useValue: mockOAuthService + }, + { + provide: AuthService, + useValue: mockAuthService + } + ], + }).compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + fixture.detectChanges(); + }); + + it("should be initiated", () => { + expect(fixture.componentInstance).toBeTruthy(); + }); + + + + describe('when login state is true', () => { + beforeAll(() => { + mockOAuthService.hasValidAccessToken.and.returnValue(true) + }); + + it("hasLoggedIn should be true", () => { + + expect(fixture.componentInstance.hasLoggedIn).toBeTrue(); + expect(mockOAuthService.hasValidAccessToken).toHaveBeenCalled() + }) + + it("button should not be exists", () => { + const element = fixture.nativeElement + const button = element.querySelector('[role="button"]') + expect(button).toBeNull() + }) + + }) + + describe('when login state is false', () => { + beforeAll(() => { + mockOAuthService.hasValidAccessToken.and.returnValue(false) + }); + + it("hasLoggedIn should be false", () => { + + expect(fixture.componentInstance.hasLoggedIn).toBeFalse(); + expect(mockOAuthService.hasValidAccessToken).toHaveBeenCalled() + }) + + it("button should be exists", () => { + const element = fixture.nativeElement + const button = element.querySelector('[role="button"]') + expect(button).toBeDefined() + }) + describe('when button clicked', () => { + + beforeEach(() => { + const element = fixture.nativeElement + const button = element.querySelector('[role="button"]') + button.click() + }); + + it("navigateToLogin have been called", () => { + expect(mockAuthService.navigateToLogin).toHaveBeenCalled() + }) + }) + }) + +}); \ No newline at end of file From adfd61c6e85465d3a4ab7d4a106edbfed5be0138 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Tue, 11 Oct 2022 15:10:30 +0300 Subject: [PATCH 05/16] Fix exists test issues on Module Template --- .../src/lib/my-project-name.component.spec.ts | 20 +++++++++++++------ .../src/lib/my-project-name.service.spec.ts | 15 ++++++++++---- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/templates/module/angular/projects/my-project-name/src/lib/my-project-name.component.spec.ts b/templates/module/angular/projects/my-project-name/src/lib/my-project-name.component.spec.ts index 88f67b1e65..4d6aae3ac8 100644 --- a/templates/module/angular/projects/my-project-name/src/lib/my-project-name.component.spec.ts +++ b/templates/module/angular/projects/my-project-name/src/lib/my-project-name.component.spec.ts @@ -1,16 +1,24 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { MyProjectNameComponent } from './my-project-name.component'; +import { MyProjectNameComponent } from './components/my-project-name.component'; +import { MyProjectNameService } from '@my-company-name/my-project-name'; +import { of } from 'rxjs'; describe('MyProjectNameComponent', () => { let component: MyProjectNameComponent; let fixture: ComponentFixture; - + const mockMyProjectNameService = jasmine.createSpyObj('MyProjectNameService', { + sample: of([]), + }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ MyProjectNameComponent ] - }) - .compileComponents(); + declarations: [MyProjectNameComponent], + providers: [ + { + provide: MyProjectNameService, + useValue: mockMyProjectNameService, + }, + ], + }).compileComponents(); })); beforeEach(() => { diff --git a/templates/module/angular/projects/my-project-name/src/lib/my-project-name.service.spec.ts b/templates/module/angular/projects/my-project-name/src/lib/my-project-name.service.spec.ts index 7955ce073c..ec7aeb6c68 100644 --- a/templates/module/angular/projects/my-project-name/src/lib/my-project-name.service.spec.ts +++ b/templates/module/angular/projects/my-project-name/src/lib/my-project-name.service.spec.ts @@ -1,12 +1,19 @@ import { TestBed } from '@angular/core/testing'; - -import { MyProjectNameService } from './my-project-name.service'; +import { MyProjectNameService } from './services/my-project-name.service'; +import { RestService } from '@abp/ng.core'; describe('MyProjectNameService', () => { let service: MyProjectNameService; - + const mockRestService = jasmine.createSpyObj('RestService', ['request']); beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + providers: [ + { + provide: RestService, + useValue: mockRestService, + }, + ], + }); service = TestBed.inject(MyProjectNameService); }); From b7c14ae597f929ff2f2460e48f0c01a68eb6650d Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 11 Oct 2022 15:14:27 +0300 Subject: [PATCH 06/16] Cli: Fix project creation problems in 5.3.4 resolves https://github.com/volosoft/volo/issues/12220 --- .../Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs | 2 +- .../Templates/RemoveUnnecessaryPortsStep.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs index a5085f83a9..98ddb005a9 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs @@ -120,7 +120,7 @@ public static class FileEntryExtensions } } - if (lines[i+1].Contains(" Date: Tue, 11 Oct 2022 15:48:16 +0300 Subject: [PATCH 07/16] Fix exists test issues on app-nolayers Template --- .../src/app/home/home.component.spec.ts | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 templates/app-nolayers/angular/src/app/home/home.component.spec.ts diff --git a/templates/app-nolayers/angular/src/app/home/home.component.spec.ts b/templates/app-nolayers/angular/src/app/home/home.component.spec.ts new file mode 100644 index 0000000000..9622abc9f6 --- /dev/null +++ b/templates/app-nolayers/angular/src/app/home/home.component.spec.ts @@ -0,0 +1,62 @@ +import { CoreTestingModule } from '@abp/ng.core/testing'; +import { ThemeBasicTestingModule } from '@abp/ng.theme.basic/testing'; +import { ThemeSharedTestingModule } from '@abp/ng.theme.shared/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { NgxValidateCoreModule } from '@ngx-validate/core'; +import { HomeComponent } from './home.component'; +import { OAuthService } from 'angular-oauth2-oidc'; +import { AuthService } from '@abp/ng.core'; + +describe('HomeComponent', () => { + let fixture: ComponentFixture; + const mockOAuthService = jasmine.createSpyObj('OAuthService', ['hasValidAccessToken']); + const mockAuthService = jasmine.createSpyObj('AuthService', ['navigateToLogin']); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [HomeComponent], + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + ], + providers: [ + /* mock providers here */ + { + provide: OAuthService, + useValue: mockOAuthService, + }, + { + provide: AuthService, + useValue: mockAuthService, + }, + ], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + fixture.detectChanges(); + }); + + it('should be initiated', () => { + expect(fixture.componentInstance).toBeTruthy(); + }); + + describe('when login state is true', () => { + beforeAll(() => { + mockOAuthService.hasValidAccessToken.and.returnValue(true); + }); + + it('hasLoggedIn should be true', () => { + expect(fixture.componentInstance.hasLoggedIn).toBeTrue(); + expect(mockOAuthService.hasValidAccessToken).toHaveBeenCalled(); + }); + + it('button should not be exists', () => { + const element = fixture.nativeElement; + const cardTitle = element.querySelector('.card-title'); + expect(cardTitle).toBeTruthy(); + }); + }); +}); From 691a02c46a0dd61f8647008e4c988765cd47a7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20KILI=C3=87?= Date: Tue, 11 Oct 2022 16:35:45 +0300 Subject: [PATCH 08/16] Added Input Values can control checkbox with node click. --- .../tree/src/lib/components/tree.component.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts b/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts index 3f6179a5b2..24e2c8128a 100644 --- a/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts +++ b/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts @@ -3,6 +3,7 @@ import { ContentChild, EventEmitter, Input, + OnChanges, Output, TemplateRef, ViewEncapsulation, @@ -24,7 +25,7 @@ export type DropEvent = NzFormatEmitEvent & { pos: number }; ], encapsulation: ViewEncapsulation.None, }) -export class TreeComponent { +export class TreeComponent implements OnChanges { dropPosition: number; dropdowns = {} as { [key: string]: NgbDropdown }; @@ -44,19 +45,31 @@ export class TreeComponent { @Input() nodes = []; @Input() expandedKeys: string[] = []; @Input() selectedNode: any; + @Input() changeCheckboxWithNode: boolean; + @Input() changedNodeValues = []; @Input() isNodeSelected = node => this.selectedNode?.id === node.key; @Input() beforeDrop = (event: NzFormatBeforeDropEvent) => { this.dropPosition = event.pos; return of(false); }; + ngOnChanges() { + this.checkedKeys = [...this.changedNodeValues]; + } + onSelectedNodeChange(node) { this.selectedNode = node.origin.entity; - this.selectedNodeChange.emit(node.origin.entity); + if (this.changeCheckboxWithNode) { + this.selectedNodeChange.emit(node); + this.checkedKeys = [...this.changedNodeValues]; + this.checkedKeysChange.emit(this.changedNodeValues); + } else { + this.selectedNodeChange.emit(node.origin.entity); + } } onCheckboxChange(event) { - this.checkedKeys = [...event.keys]; + this.checkedKeys = this.changedNodeValues = [...event.keys]; this.checkedKeysChange.emit(event.keys); } From 55d541d194e075906110e6610e7f855f24340863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20KILI=C3=87?= Date: Tue, 11 Oct 2022 16:37:40 +0300 Subject: [PATCH 09/16] Deleted #treeTemplate class because of text and checkbox is not same line. --- .../components/tree/src/lib/components/tree.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.html b/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.html index 9cf973c103..34bb64ec1f 100644 --- a/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.html +++ b/npm/ng-packs/packages/components/tree/src/lib/components/tree.component.html @@ -16,7 +16,6 @@ >
Date: Tue, 18 Oct 2022 17:37:58 +0300 Subject: [PATCH 10/16] add IsTrialLicense field --- .../Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs index a9fb23da7f..6a4e750880 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs @@ -13,6 +13,7 @@ public class DeveloperApiKeyResult public string ErrorMessage { get; set; } public LicenseErrorType? ErrorType { get; set; } public LicenseType LicenseType { get; set; } + public bool IsTrialLicense { get; set; } public enum LicenseErrorType { From 224352b54cc2c7a590bb83980a800bf7708df1bd Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 19 Oct 2022 08:17:18 +0300 Subject: [PATCH 11/16] Change adding order of `blazor.webassembly.js` --- .../Volo/Abp/Cli/Bundling/BundlingService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs index 65212fe69f..5f6f4a392d 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs @@ -108,15 +108,15 @@ public class BundlingService : IBundlingService, ITransientDependency Parameters = parameters }; + scriptContext.BundleDefinitions.AddIfNotContains( + x => x.Source == "_framework/blazor.webassembly.js", + () => new BundleDefinition { Source = "_framework/blazor.webassembly.js" }); + foreach (var bundleDefinition in bundleDefinitions) { var contributor = CreateContributorInstance(bundleDefinition.BundleContributorType); contributor.AddScripts(scriptContext); } - - scriptContext.BundleDefinitions.AddIfNotContains( - x => x.Source == "_framework/blazor.webassembly.js", - () => new BundleDefinition { Source = "_framework/blazor.webassembly.js" }); return scriptContext; } From 2d07b9bd00152bef4658c48ff9b2cbee5788d308 Mon Sep 17 00:00:00 2001 From: malik masis Date: Wed, 19 Oct 2022 09:42:51 +0300 Subject: [PATCH 12/16] Updated dockerfile to .net7 --- .../test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Dockerfile b/modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Dockerfile index 86f13e6ce9..a755a4b690 100644 --- a/modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Dockerfile +++ b/modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0.0-bullseye-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim AS base WORKDIR /app EXPOSE 80 COPY bin/Release/publish . From 608bd47e3a5261635935c291ad450e317481d51a Mon Sep 17 00:00:00 2001 From: Salih Date: Wed, 19 Oct 2022 15:11:14 +0300 Subject: [PATCH 13/16] Update DatabaseManagementSystemChangeStep.cs --- .../Steps/DatabaseManagementSystemChangeStep.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs index f014942486..f06468cf19 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs @@ -91,12 +91,17 @@ public class DatabaseManagementSystemChangeStep : ProjectBuildPipelineStep private void ChangeUseSqlServer(ProjectBuildContext context, string newUseMethodForEfModule, string newUseMethodForDbContext = null) { - if (newUseMethodForDbContext == null) + var oldUseMethod = "UseSqlServer"; + + if (newUseMethodForEfModule.IsNullOrWhiteSpace()) { - newUseMethodForDbContext = newUseMethodForEfModule; + newUseMethodForEfModule = oldUseMethod; } - var oldUseMethod = "UseSqlServer"; + if (newUseMethodForDbContext.IsNullOrWhiteSpace()) + { + newUseMethodForDbContext = newUseMethodForEfModule; + } var efCoreModuleClass = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase)); efCoreModuleClass.ReplaceText(oldUseMethod, newUseMethodForEfModule); From 48a5aea25bbf3c5ba597ab9fbe0ec87af88f3209 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Wed, 19 Oct 2022 16:17:19 +0300 Subject: [PATCH 14/16] Fix merge issues --- .../personal-settings/personal-settings.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts index ad702cab41..6ec15b1667 100644 --- a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts @@ -1,6 +1,6 @@ import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy'; import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared'; -import { Component, Injector, OnInit, ViewEncapsulation } from '@angular/core'; +import { Component, Inject, Injector, OnInit } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { finalize, filter } from 'rxjs/operators'; import { Account } from '../../models/account'; @@ -14,8 +14,6 @@ import { } from '@abp/ng.theme.shared/extensions'; import { eAccountComponents } from '../../enums'; -const { maxLength, required, email } = Validators; - @Component({ selector: 'abp-personal-settings-form', templateUrl: './personal-settings.component.html', From f5eeb42e83bc8c72c4a7313d6153acdf513b374b Mon Sep 17 00:00:00 2001 From: Salih Date: Wed, 19 Oct 2022 16:44:49 +0300 Subject: [PATCH 15/16] Revert "Update DatabaseManagementSystemChangeStep.cs" This reverts commit 608bd47e3a5261635935c291ad450e317481d51a. --- .../Steps/DatabaseManagementSystemChangeStep.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs index f06468cf19..f014942486 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs @@ -91,18 +91,13 @@ public class DatabaseManagementSystemChangeStep : ProjectBuildPipelineStep private void ChangeUseSqlServer(ProjectBuildContext context, string newUseMethodForEfModule, string newUseMethodForDbContext = null) { - var oldUseMethod = "UseSqlServer"; - - if (newUseMethodForEfModule.IsNullOrWhiteSpace()) - { - newUseMethodForEfModule = oldUseMethod; - } - - if (newUseMethodForDbContext.IsNullOrWhiteSpace()) + if (newUseMethodForDbContext == null) { newUseMethodForDbContext = newUseMethodForEfModule; } + var oldUseMethod = "UseSqlServer"; + var efCoreModuleClass = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase)); efCoreModuleClass.ReplaceText(oldUseMethod, newUseMethodForEfModule); From e495fb5fb2a8d69600732ad9d75cca1f90f63b4c Mon Sep 17 00:00:00 2001 From: Salih Date: Wed, 19 Oct 2022 16:46:15 +0300 Subject: [PATCH 16/16] Update DatabaseManagementSystemChangeStep.cs --- .../Building/Steps/DatabaseManagementSystemChangeStep.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs index f014942486..56a77c4929 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs @@ -98,7 +98,13 @@ public class DatabaseManagementSystemChangeStep : ProjectBuildPipelineStep var oldUseMethod = "UseSqlServer"; - var efCoreModuleClass = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase)); + var efCoreModuleClass = context.Files.FirstOrDefault(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase)); + + if(efCoreModuleClass == null) + { + return; + } + efCoreModuleClass.ReplaceText(oldUseMethod, newUseMethodForEfModule); var dbContextFactoryFile = context.Files.FirstOrDefault(f => f.Name.EndsWith($"{(_hasDbMigrations ? "Migrations" : string.Empty)}DbContextFactoryBase.cs", StringComparison.OrdinalIgnoreCase))