Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Incorrect link to workflows list with the same author #9173

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,25 @@ export class WorkflowCreatorInfo extends React.Component<WorkflowCreatorInfoProp
const w = this.props.workflow;
const creatorLabels = [];
if (w.metadata.labels) {
const creatorInfoMap = new Map<string, string>([
['Name', w.metadata.labels[labels.creator]],
['Email', w.metadata.labels[labels.creatorEmail]],
['Preferred username', w.metadata.labels[labels.creatorPreferredUsername]]
const creatorInfoMap = new Map<string, [string, string]>([
['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(
<div
title={`List workflows created by ${key}=${value}`}
title={`List workflows created by ${key}=${searchValue}`}
className='tag'
key={`${w.metadata.uid}-${key}`}
onClick={async e => {
e.preventDefault();
this.props.onChange(key, value);
this.props.onChange(searchKey, searchValue);
}}>
<div className='key'>{key}</div>
<div className='value'>{value}</div>
<div className='value'>{searchValue}</div>
</div>
);
}
Expand Down