diff --git a/src/lib/features/personal-dashboard/personal-dashboard-controller.e2e.test.ts b/src/lib/features/personal-dashboard/personal-dashboard-controller.e2e.test.ts index 33379ff7214e..179c793ea691 100644 --- a/src/lib/features/personal-dashboard/personal-dashboard-controller.e2e.test.ts +++ b/src/lib/features/personal-dashboard/personal-dashboard-controller.e2e.test.ts @@ -110,7 +110,11 @@ test('should return personal dashboard with membered projects', async () => { type: 'root', }, ], - owners: [], + owners: [ + { + ownerType: 'system', + }, + ], }, { name: projectA.name, @@ -122,7 +126,15 @@ test('should return personal dashboard with membered projects', async () => { type: 'project', }, ], - owners: [], + owners: [ + { + email: 'user1@test.com', + imageUrl: + 'https://gravatar.com/avatar/a8cc79d8407a64b0d8982df34e3525afd298a479fe68f300651380730dbf23e9?s=42&d=retro&r=g', + name: 'user1@test.com', + ownerType: 'user', + }, + ], }, { name: projectC.name, @@ -134,7 +146,15 @@ test('should return personal dashboard with membered projects', async () => { type: 'project', }, ], - owners: [], + owners: [ + { + email: 'user2@test.com', + imageUrl: + 'https://gravatar.com/avatar/706150f3ef810ea66acb30c6d55f1a7e545338747072609e47df71c7c7ccc6a4?s=42&d=retro&r=g', + name: 'user2@test.com', + ownerType: 'user', + }, + ], }, ], }); @@ -184,7 +204,11 @@ test('should return projects where users are part of a group', async () => { type: 'root', }, ], - owners: [], + owners: [ + { + ownerType: 'system', + }, + ], }, { name: projectA.name, @@ -201,7 +225,19 @@ test('should return projects where users are part of a group', async () => { type: 'project', }, ], - owners: [], + owners: [ + { + email: 'user1@test.com', + imageUrl: + 'https://gravatar.com/avatar/a8cc79d8407a64b0d8982df34e3525afd298a479fe68f300651380730dbf23e9?s=42&d=retro&r=g', + name: 'user1@test.com', + ownerType: 'user', + }, + { + name: 'groupA', + ownerType: 'group', + }, + ], }, ], }); diff --git a/src/lib/features/project/project-owners-read-model.ts b/src/lib/features/project/project-owners-read-model.ts index 5a995fe79d5c..7f282231f0ac 100644 --- a/src/lib/features/project/project-owners-read-model.ts +++ b/src/lib/features/project/project-owners-read-model.ts @@ -63,7 +63,10 @@ export class ProjectOwnersReadModel implements IProjectOwnersReadModel { const data: UserProjectOwner = { ownerType: 'user', - name: user?.name || user?.username, + name: + user?.name || + user?.username || + processSensitiveData(user?.email), email: processSensitiveData(user?.email), imageUrl: generateImageUrl(user), };