Skip to content

Commit

Permalink
Do not highlight Analytics in header when on project/task/job perform…
Browse files Browse the repository at this point in the history
…ance page (#8060)
  • Loading branch information
bsekachev committed Jun 21, 2024
1 parent d89b074 commit 933fbb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cvat-ui/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ function HeaderComponent(props: Props): JSX.Element {
.map(({ component, weight }): typeof menuItems[0] => [component({ targetProps: props }), weight]),
);

const getButtonClassName = (value: string): string => {
const getButtonClassName = (value: string, highlightable = true): string => {
// eslint-disable-next-line security/detect-non-literal-regexp
const regex = new RegExp(`${value}$`);
const baseClass = `cvat-header-${value}-button cvat-header-button`;
return location.pathname.match(regex) ?
return highlightable && location.pathname.match(regex) ?
`${baseClass} cvat-active-header-button` : baseClass;
};

Expand Down Expand Up @@ -489,7 +489,7 @@ function HeaderComponent(props: Props): JSX.Element {
) : null}
{isAnalyticsPluginActive && user.isSuperuser ? (
<Button
className={getButtonClassName('analytics')}
className={getButtonClassName('analytics', false)}
type='link'
href='/analytics'
onClick={(event: React.MouseEvent): void => {
Expand Down

0 comments on commit 933fbb3

Please sign in to comment.