diff --git a/gradle/changelog/fix-missing-aria-label-in-secon-navigation.yaml b/gradle/changelog/fix-missing-aria-label-in-secon-navigation.yaml new file mode 100644 index 0000000000..cf7ef1c1fe --- /dev/null +++ b/gradle/changelog/fix-missing-aria-label-in-secon-navigation.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: missing arial-label in second navigation for bluespice, smeagol and documentation plugin diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 4e77c71329..5ff157de50 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -77742,7 +77742,6 @@ exports[`Storyshots Secondary Navigation Active when match 1`] = ` >
  • ; -const ExternalLink: FC = ({ to, children, className }) => ( - +const ExternalLink: FC = ({ to, children, className, ...props }) => ( + {children} ); diff --git a/scm-ui/ui-components/src/navigation/ExternalNavLink.tsx b/scm-ui/ui-components/src/navigation/ExternalNavLink.tsx index bd098f28a0..dd77c5012b 100644 --- a/scm-ui/ui-components/src/navigation/ExternalNavLink.tsx +++ b/scm-ui/ui-components/src/navigation/ExternalNavLink.tsx @@ -41,7 +41,7 @@ const ExternalNavLink: FC = ({ to, icon, label }) => { return (
  • - + {showIcon} {isSecondaryNavigation && collapsed ? null : label} diff --git a/scm-ui/ui-components/src/navigation/NavLink.tsx b/scm-ui/ui-components/src/navigation/NavLink.tsx index 062a1b2c2f..e2ece41298 100644 --- a/scm-ui/ui-components/src/navigation/NavLink.tsx +++ b/scm-ui/ui-components/src/navigation/NavLink.tsx @@ -20,7 +20,7 @@ import { Link } from "react-router-dom"; import { useSecondaryNavigation } from "../useSecondaryNavigation"; import { RoutingProps } from "./RoutingProps"; import useActiveMatch from "./useActiveMatch"; -import { createAttributesForTesting } from "../devBuild"; +import { createAttributesForTesting } from "@scm-manager/ui-core"; import { SecondaryNavigationContext } from "./SecondaryNavigationContext"; import { SubNavigationContext } from "./SubNavigationContext"; @@ -66,7 +66,7 @@ const NavLink: FC = ({ to, activeWhenMatch, activeOnlyWhenExact, title, t className={classNames(active ? "is-active" : "", collapsed ? "has-text-centered" : "")} to={to} {...createAttributesForTesting(testId)} - aria-label={title} + aria-label={collapsed ? title : undefined} {...(active ? { "aria-current": "page" } : {})} > {children ? ( diff --git a/scm-ui/ui-components/src/navigation/SubNavigation.tsx b/scm-ui/ui-components/src/navigation/SubNavigation.tsx index 2944f84302..f377bdbd47 100644 --- a/scm-ui/ui-components/src/navigation/SubNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SubNavigation.tsx @@ -74,7 +74,7 @@ const SubNavigation: FC = ({ className={classNames(active ? "is-active" : "", collapsed ? "has-text-centered" : "")} to={to} {...createAttributesForTesting(testId)} - aria-label={title} + aria-label={collapsed ? title : undefined} {...(active ? { "aria-current": "page" } : {})} > {collapsed ? "" : label}