From dab8bd04440ecfe7aa737a587c5cc11b049ce6ad Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 7 Oct 2021 13:01:42 +0800 Subject: [PATCH 1/5] Improve UX of user status (active/inactive) --- .../Pages/Identity/Users/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index e82aa94f3b..3e9c6f6cc7 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -60,7 +60,7 @@ _dataTable.ajax.reload(); }); }, - } + } ] ); } @@ -79,6 +79,14 @@ { title: l('UserName'), data: 'userName', + render: function (data, type, row) { + row.userName = $.fn.dataTable.render.text().display(row.userName); + if (!row.isActive) { + return ' ' + row.userName + ''; + } + + return row.userName ; + } }, { title: l('EmailAddress'), @@ -93,7 +101,7 @@ }, 0 //adds as the first contributor ); - + $(function () { var _$wrapper = $('#IdentityUsersWrapper'); var _$table = _$wrapper.find('table'); From 915f0cc4a016c013286fc37f2eb68d88aeb657ab Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 7 Oct 2021 13:04:08 +0800 Subject: [PATCH 2/5] Update index.js --- .../src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 3e9c6f6cc7..4c768bef64 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -82,7 +82,7 @@ render: function (data, type, row) { row.userName = $.fn.dataTable.render.text().display(row.userName); if (!row.isActive) { - return ' ' + row.userName + ''; + return ' ' + row.userName + ''; } return row.userName ; From ddd5a4f3e1aa180d558b0cc07fcce3e01014e274 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 7 Oct 2021 13:31:59 +0800 Subject: [PATCH 3/5] Add localization. --- .../Volo/Abp/Identity/Localization/en.json | 1 + .../Volo/Abp/Identity/Localization/tr.json | 1 + .../Volo/Abp/Identity/Localization/zh-Hans.json | 1 + .../Volo/Abp/Identity/Localization/zh-Hant.json | 1 + .../Volo.Abp.Identity.Web/Pages/Identity/Users/index.js | 8 ++++++-- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json index 642bede8d6..f01681e69f 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json @@ -71,6 +71,7 @@ "Volo.Abp.Identity:010007": "You can't change your two factor setting.", "Volo.Abp.Identity:010008": "It's not allowed to change two factor setting.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximum allowed organization unit membership count for a user", + "ThisUserIsNotActiveMessage": "This user is not active.", "Permission:IdentityManagement": "Identity management", "Permission:RoleManagement": "Role management", "Permission:Create": "Create", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json index aa69206ddb..57ad76d5ef 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json @@ -69,6 +69,7 @@ "Volo.Abp.Identity:010003": "Kimliği dışarıdan alınan kullanıcıların şifresi değiştirilemez!", "Volo.Abp.Identity:010004": "{0} isminde bir birim zaten var. Aynı seviyede aynı isimli iki birim olamaz.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Bir kullanıcı için izin verilen en fazla organizasyon birimi sayısı", + "ThisUserIsNotActiveMessage": "Bu kullanıcı aktif değil.", "Permission:IdentityManagement": "Kimlik yönetimi", "Permission:RoleManagement": "Rol yönetimi", "Permission:Create": "Oluşturma", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json index 35fae96839..4e70855f26 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json @@ -71,6 +71,7 @@ "Volo.Abp.Identity:010007": "你不能修改你的双因素身份验证设置", "Volo.Abp.Identity:010008": "不允许修改双因素身份验证设置.", "Identity.OrganizationUnit.MaxUserMembershipCount": "组织单位最大允许的成员资格计数", + "ThisUserIsNotActiveMessage": "该用户不可用.", "Permission:IdentityManagement": "身份标识管理", "Permission:RoleManagement": "角色管理", "Permission:Create": "创建", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json index 06f72cd5d0..7ee45887ca 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json @@ -71,6 +71,7 @@ "Volo.Abp.Identity:010007": "你不能修改你的雙因素身份驗證設置", "Volo.Abp.Identity:010008": "不允許修改雙因素身份驗證設置.", "Identity.OrganizationUnit.MaxUserMembershipCount": "允許一個使用者至多可隸屬在幾個組織單位", + "ThisUserIsNotActiveMessage": "該用戶不可用.", "Permission:IdentityManagement": "身份識別管理", "Permission:RoleManagement": "角色管理", "Permission:Create": "建立", diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 4c768bef64..83ba8c825f 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -81,11 +81,15 @@ data: 'userName', render: function (data, type, row) { row.userName = $.fn.dataTable.render.text().display(row.userName); + var roleHtml = row.userName; if (!row.isActive) { - return ' ' + row.userName + ''; + return ' ' + + '' + row.userName + ''; } - return row.userName ; + return roleHtml; } }, { From 0419db7a38f706fc8836ee91cc803bf8ba33da49 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 7 Oct 2021 13:42:41 +0800 Subject: [PATCH 4/5] Update index.js --- .../src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 83ba8c825f..28e7581cb1 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -81,7 +81,6 @@ data: 'userName', render: function (data, type, row) { row.userName = $.fn.dataTable.render.text().display(row.userName); - var roleHtml = row.userName; if (!row.isActive) { return '' + row.userName + ''; } - return roleHtml; + return row.userName; } }, { From 753a182d66125a62b53e59616c2910c6431d11b4 Mon Sep 17 00:00:00 2001 From: Mehmet Erim Date: Thu, 7 Oct 2021 08:45:36 +0300 Subject: [PATCH 5/5] angular-ui: improve inactive user ux --- .../lib/defaults/default-users-entity-props.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/npm/ng-packs/packages/identity/src/lib/defaults/default-users-entity-props.ts b/npm/ng-packs/packages/identity/src/lib/defaults/default-users-entity-props.ts index 73235215ba..1cc121a89b 100644 --- a/npm/ng-packs/packages/identity/src/lib/defaults/default-users-entity-props.ts +++ b/npm/ng-packs/packages/identity/src/lib/defaults/default-users-entity-props.ts @@ -1,5 +1,7 @@ +import { LocalizationService } from '@abp/ng.core'; import { IdentityUserDto } from '@abp/ng.identity/proxy'; import { EntityProp, ePropType } from '@abp/ng.theme.shared/extensions'; +import { of } from 'rxjs'; export const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany([ { @@ -8,6 +10,20 @@ export const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany displayName: 'AbpIdentity::UserName', sortable: true, columnWidth: 250, + valueResolver: data => { + const l10n = data.getInjected(LocalizationService); + const t = l10n.instant.bind(l10n); + + const inactiveIcon = ``; + + return of( + ` + ${!data.record.isActive ? inactiveIcon : ''} + ${data.record.userName}`, + ); + }, }, { type: ePropType.String,