Skip to content

Commit

Permalink
Fix [Cross-project] The request for Jobs monitoring is missing in the…
Browse files Browse the repository at this point in the history
… breadcrumbs menu (#3014)
  • Loading branch information
adi-gini authored Jan 15, 2025
1 parent eb40995 commit 851238d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/elements/BreadcrumbsDropdown/BreadcrumbsDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ const BreadcrumbsDropdown = forwardRef(
listItem.id.toLocaleLowerCase().startsWith(searchValue.toLocaleLowerCase())
)
.map(listItem => {
const isItemSelected = selectedItem === listItem.id
const dropdownItemClassNames = classnames(
'breadcrumbs__dropdown-item',
'data-ellipsis',
selectedItem === listItem.id && 'breadcrumbs__dropdown-item_selected'
isItemSelected && 'breadcrumbs__dropdown-item_selected'
)

return (
Expand All @@ -81,15 +82,17 @@ const BreadcrumbsDropdown = forwardRef(
className={dropdownItemClassNames}
>
<span>{listItem.label}</span>
{selectedItem === listItem.id && <CheckmarkIcon className="checkmark" />}
{isItemSelected && <CheckmarkIcon className="checkmark" />}
</a>
) : (
<Link
to={
listItem.linkTo ||
`${link}/${listItem.id}${screen ? `/${screen}` : ''}${tab ? `/${tab}` : ''}`
}
onClick={onClick}
onClick={event => {
isItemSelected ? event.preventDefault() : onClick(event)
}}
id={listItem.id}
data-testid={`breadcrumbs-dropdown-item-${listItem.id}`}
key={listItem.id}
Expand All @@ -98,7 +101,7 @@ const BreadcrumbsDropdown = forwardRef(
<Tooltip template={<TextTooltipTemplate text={listItem.label} />}>
{listItem.label}
</Tooltip>
{selectedItem === listItem.id && <CheckmarkIcon className="checkmark" />}
{isItemSelected && <CheckmarkIcon className="checkmark" />}
</Link>
))
)
Expand Down
5 changes: 5 additions & 0 deletions src/elements/BreadcrumbsDropdown/breadcrumbsDropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@

&_selected {
font-weight: bold;

&:hover {
cursor: default;
background: white;
}
}

.checkmark {
Expand Down

0 comments on commit 851238d

Please sign in to comment.