From 8b7a55b55d9062c600fb8218f84dfec746f00d56 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Mon, 13 Feb 2023 11:20:10 -0500 Subject: [PATCH] Add comments Signed-off-by: Aramis Sennyey --- .../src/components/EntityRefLink/humanize.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-react/src/components/EntityRefLink/humanize.ts b/plugins/catalog-react/src/components/EntityRefLink/humanize.ts index 3781935ad5..815dac0758 100644 --- a/plugins/catalog-react/src/components/EntityRefLink/humanize.ts +++ b/plugins/catalog-react/src/components/EntityRefLink/humanize.ts @@ -68,9 +68,15 @@ export function humanizeEntityRef( } /** - * Convert an entity to its more common name. + * Convert an entity to its more readable name if available. + * + * If an entity is either User or Group, this will be its `spec.profile.displayName`. + * Otherwise, this is `metadata.title`. + * + * If neither of those are found or populated, fallback to `humanizeEntityRef`. * * @param entity Entity to convert. + * @param opts If entity readable name is not available, opts will be used to specify humanizeEntityRef options. * @returns Readable name, defaults to unique identifier. */ export function humanizeEntity(