Unverified Commit 9666065a authored by Allison Suarez Miranda's avatar Allison Suarez Miranda Committed by GitHub

fix: table with multiple badges not triggering the correct search (#767)

* fixed issue with badge search
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* added text name as parameter instead
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>
parent 1451a7ec
...@@ -58,12 +58,7 @@ const ActionableBadge: React.FC<ActionableBadgeProps> = ({ ...@@ -58,12 +58,7 @@ const ActionableBadge: React.FC<ActionableBadgeProps> = ({
}; };
export class BadgeList extends React.Component<BadgeListProps> { export class BadgeList extends React.Component<BadgeListProps> {
idx = 0; handleClick = (index: number, badgeText: string, e) => {
handleClick = (e) => {
const badgeText = this.props.badges[this.idx].badge_name
? this.props.badges[this.idx].badge_name
: this.props.badges[this.idx].tag_name;
logClick(e, { logClick(e, {
target_type: 'badge', target_type: 'badge',
label: badgeText, label: badgeText,
...@@ -98,12 +93,13 @@ export class BadgeList extends React.Component<BadgeListProps> { ...@@ -98,12 +93,13 @@ export class BadgeList extends React.Component<BadgeListProps> {
<ActionableBadge <ActionableBadge
displayName={badgeConfig.displayName} displayName={badgeConfig.displayName}
style={badgeConfig.style} style={badgeConfig.style}
action={this.handleClick} action={(e) =>
this.handleClick(index, badgeConfig.displayName, e)
}
key={`badge-${index}`} key={`badge-${index}`}
/> />
); );
} }
this.idx++;
})} })}
</span> </span>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment