Add email to index for user entity

Signed-off-by: Scott Guymer <scott.guymer@philips.com>
This commit is contained in:
Scott Guymer
2023-07-24 11:56:37 +02:00
parent bdb004c8ad
commit 98d3f2fa31
2 changed files with 8 additions and 1 deletions
@@ -42,6 +42,7 @@ const userEntity = {
spec: {
profile: {
displayName: 'User 1',
email: 'test@test.com',
},
},
};
@@ -94,7 +95,7 @@ describe('DefaultCatalogCollatorEntityTransformer', () => {
expect(document).toMatchObject({
title: userEntity.metadata.name,
text: `${userEntity.metadata.description} : ${userEntity.spec.profile.displayName}`,
text: `${userEntity.metadata.description} : ${userEntity.spec.profile.displayName} : ${userEntity.spec.profile.email}}`,
namespace: 'default',
componentType: 'other',
lifecycle: '',
@@ -27,6 +27,12 @@ const getDocumentText = (entity: Entity): string => {
}
}
if (isUserEntity(entity)) {
if (entity.spec?.profile?.email) {
documentTexts.push(entity.spec.profile.email);
}
}
return documentTexts.join(' : ');
};