From 472485317f341a342bae8c417d6041c079120a25 Mon Sep 17 00:00:00 2001 From: Masum ULU Date: Thu, 31 Aug 2023 10:37:06 +0300 Subject: [PATCH 1/6] Fix user self disable issue --- .../src/lib/defaults/default-users-form-props.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts b/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts index ccdf06df24..b8830b0c63 100644 --- a/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts +++ b/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts @@ -1,7 +1,8 @@ -import { IdentityUserDto } from '@abp/ng.identity/proxy'; +import { Validators } from '@angular/forms'; +import { ConfigStateService, CurrentUserDto } from '@abp/ng.core'; import { getPasswordValidators } from '@abp/ng.theme.shared'; import { ePropType, FormProp } from '@abp/ng.theme.shared/extensions'; -import { Validators } from '@angular/forms'; +import { IdentityUserDto } from '@abp/ng.identity/proxy'; export const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany([ { @@ -70,5 +71,15 @@ export const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.map validators: (data: any) => [...getPasswordValidators({ get: data.getInjected })], }; } + if (prop.name === 'isActive') { + return { + ...prop, + visible: data => { + const configState = data.getInjected(ConfigStateService); + const currentUser = configState.getOne('currentUser') as CurrentUserDto; + return currentUser.id !== data.record.id; + }, + }; + } return prop; }); From 9523b2dadeb37a8a9190dd25adb28ee1461a2af3 Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masumulu28@users.noreply.github.com> Date: Fri, 1 Sep 2023 08:36:03 +0300 Subject: [PATCH 2/6] Update default-users-form-props.ts --- .../identity/src/lib/defaults/default-users-form-props.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts b/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts index b8830b0c63..3c1a3e4c82 100644 --- a/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts +++ b/npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts @@ -76,8 +76,8 @@ export const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.map ...prop, visible: data => { const configState = data.getInjected(ConfigStateService); - const currentUser = configState.getOne('currentUser') as CurrentUserDto; - return currentUser.id !== data.record.id; + const currentUserId = configState.getDeep('currentUser.id'); + return currentUserId !== data.record.id; }, }; } From a12315f0d982e7ec14093eb78b34cd5f5d241520 Mon Sep 17 00:00:00 2001 From: Masum ULU Date: Thu, 7 Sep 2023 13:58:18 +0300 Subject: [PATCH 3/6] Reset group display name during closing --- .../feature-management.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts index c04b4500e2..84f057779a 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts @@ -55,11 +55,19 @@ export class FeatureManagementComponent } set visible(value: boolean) { - if (this._visible === value) return; + if (this._visible === value) { + return; + } this._visible = value; this.visibleChange.emit(value); - if (value) this.openModal(); + + if (value) { + this.openModal(); + return; + } + + this.selectedGroupDisplayName = undefined; } @Output() readonly visibleChange = new EventEmitter(); From cb956907fe905b74d984cff411c3798bbe1e47d4 Mon Sep 17 00:00:00 2001 From: Sinan997 Date: Fri, 8 Sep 2023 16:42:16 +0300 Subject: [PATCH 4/6] add *ngIf directive to make feature-management-component destroyable --- .../feature-management-tab.component.html | 6 ++++-- .../feature-management-tab.component.ts | 4 +--- .../feature-management/feature-management.component.ts | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.html b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.html index cfd49602b6..38912f7caa 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.html +++ b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.html @@ -4,7 +4,8 @@ {{ 'AbpFeatureManagement::ManageHostFeatures' | abpLocalization }} - + + > + diff --git a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.ts b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.ts index 3ac018478e..d65b3a74a9 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.ts @@ -9,9 +9,7 @@ export class FeatureManagementTabComponent { providerKey: string; openFeaturesModal() { - setTimeout(() => { - this.visibleFeatures = true; - }, 0); + this.visibleFeatures = true; } onVisibleFeaturesChange = (value: boolean) => { diff --git a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts index 84f057779a..25d8e76764 100644 --- a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts +++ b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts @@ -66,8 +66,6 @@ export class FeatureManagementComponent this.openModal(); return; } - - this.selectedGroupDisplayName = undefined; } @Output() readonly visibleChange = new EventEmitter(); From 1f9a3be32535c7d2e052916283c98e304972344d Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 11 Sep 2023 11:11:17 +0800 Subject: [PATCH 5/6] Get safe redirect url --- .../Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs index dbc56d306c..aca5e2a02c 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs @@ -19,11 +19,17 @@ public class LoggedOutModel : AccountPageModel public virtual Task OnGetAsync() { + PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri); + SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl); + return Task.FromResult(Page()); } public virtual Task OnPostAsync() { + PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri); + SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl); + return Task.FromResult(Page()); } } From 161d538ae3fde8ed64d6e884e977a144ef781c2f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 11 Sep 2023 11:33:38 +0800 Subject: [PATCH 6/6] Add NormalizeUrl --- .../Pages/Account/LoggedOut.cshtml.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs index aca5e2a02c..efa1a7a618 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NUglify.Helpers; namespace Volo.Abp.Account.Web.Pages.Account; @@ -19,17 +20,26 @@ public class LoggedOutModel : AccountPageModel public virtual Task OnGetAsync() { - PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri); - SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl); - + NormalizeUrl(); return Task.FromResult(Page()); } public virtual Task OnPostAsync() { - PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri); - SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl); - + NormalizeUrl(); return Task.FromResult(Page()); } + + protected virtual void NormalizeUrl() + { + if (!PostLogoutRedirectUri.IsNullOrWhiteSpace()) + { + PostLogoutRedirectUri = Url.Content(GetRedirectUrl(PostLogoutRedirectUri)); + } + + if(!SignOutIframeUrl.IsNullOrWhiteSpace()) + { + SignOutIframeUrl = Url.Content(GetRedirectUrl(SignOutIframeUrl)); + } + } }