From 59c947995d54283598f43b099eb2186560579fd9 Mon Sep 17 00:00:00 2001 From: Yuan Tang Date: Mon, 18 Jul 2022 16:34:48 -0400 Subject: [PATCH] fix: Incorrect link to workflows list with the same author (#9173) Signed-off-by: Yuan Tang Signed-off-by: Reddy --- .../workflow-creator-info.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ui/src/app/workflows/components/workflow-creator-info/workflow-creator-info.tsx b/ui/src/app/workflows/components/workflow-creator-info/workflow-creator-info.tsx index 4d71f27ec6db..011750e5ed21 100644 --- a/ui/src/app/workflows/components/workflow-creator-info/workflow-creator-info.tsx +++ b/ui/src/app/workflows/components/workflow-creator-info/workflow-creator-info.tsx @@ -18,24 +18,25 @@ export class WorkflowCreatorInfo extends React.Component([ - ['Name', w.metadata.labels[labels.creator]], - ['Email', w.metadata.labels[labels.creatorEmail]], - ['Preferred username', w.metadata.labels[labels.creatorPreferredUsername]] + const creatorInfoMap = new Map([ + ['Name', [labels.creator, w.metadata.labels[labels.creator]]], + ['Email', [labels.creatorEmail, w.metadata.labels[labels.creatorEmail]]], + ['Preferred username', [labels.creatorPreferredUsername, w.metadata.labels[labels.creatorPreferredUsername]]] ]); - creatorInfoMap.forEach((value: string, key: string) => { - if (value !== '' && value !== undefined) { + creatorInfoMap.forEach((value: [string, string], key: string) => { + const [searchKey, searchValue] = value; + if (searchValue !== '' && searchValue !== undefined) { creatorLabels.push(
{ e.preventDefault(); - this.props.onChange(key, value); + this.props.onChange(searchKey, searchValue); }}>
{key}
-
{value}
+
{searchValue}
); }