From 28d4943a9303d8937b8d46e5f9c048cdd594a498 Mon Sep 17 00:00:00 2001 From: Mykyta Maliarchuk Date: Fri, 27 Oct 2023 12:43:34 +0200 Subject: [PATCH 1/2] [ACS-6222] fixed missing display name for groups --- .../user-name-column.component.spec.ts | 15 +++++++++++++++ .../user-name-column.component.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.spec.ts b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.spec.ts index e21559849b3..d8c7926171a 100644 --- a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.spec.ts +++ b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.spec.ts @@ -104,6 +104,21 @@ describe('UserNameColumnComponent', () => { expect(element.querySelector('[title="fake authority"]').textContent.trim()).toBe('fake authority'); }); + it('should display group id when display name is not provided', () => { + component.context = { + row: { + obj: { + entry: { + group: { id: 'fake_group_id' } + } + } + } + }; + component.ngOnInit(); + fixture.detectChanges(); + expect(element.querySelector('[title="fake_group_id"]').textContent.trim()).toBe('fake_group_id'); + }); + it('should render group for authorityId', () => { component.context = { row: { diff --git a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts index 6cae307c896..560845be032 100644 --- a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts @@ -72,7 +72,7 @@ export class UserNameColumnComponent implements OnInit { private updateGroup(group: Group) { if (group) { - this.displayText$.next(group.displayName); + group.displayName ? this.displayText$.next(group.displayName) : this.displayText$.next(group.id); } } } From c28b2e69477ba8eef261aebc49b7e536cded18c7 Mon Sep 17 00:00:00 2001 From: Mykyta Maliarchuk Date: Fri, 27 Oct 2023 13:10:44 +0200 Subject: [PATCH 2/2] [ACS-6222] cr fix --- .../components/user-name-column/user-name-column.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts index 560845be032..d914db0bdd1 100644 --- a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts @@ -72,7 +72,7 @@ export class UserNameColumnComponent implements OnInit { private updateGroup(group: Group) { if (group) { - group.displayName ? this.displayText$.next(group.displayName) : this.displayText$.next(group.id); + this.displayText$.next(group.displayName || group.id); } } }