From a23565e33ba4ddc2f1594f56b63610c013fcf6df Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Tue, 4 Feb 2025 19:58:23 +0100 Subject: [PATCH] chore: fix sonar and build issues --- .../ui/src/components/Icons/create-icon.tsx | 7 +- .../Visualization/Canvas/Canvas.tsx | 1 - .../Canvas/__snapshots__/Canvas.test.tsx.snap | 264 +++++++++--------- 3 files changed, 135 insertions(+), 137 deletions(-) diff --git a/packages/ui/src/components/Icons/create-icon.tsx b/packages/ui/src/components/Icons/create-icon.tsx index 8ab400c35..abd89ad1d 100644 --- a/packages/ui/src/components/Icons/create-icon.tsx +++ b/packages/ui/src/components/Icons/create-icon.tsx @@ -31,7 +31,7 @@ export function createIcon({ svgPath, }: IconDefinition): ComponentClass { return class SVGIcon extends Component { - static displayName = name; + static readonly displayName = name; id = `icon-title-${currentId++}`; @@ -47,10 +47,9 @@ export function createIcon({ className={classes} viewBox={viewBox} fill="currentColor" - aria-labelledby={hasTitle ? this.id : null} - aria-hidden={hasTitle ? null : true} + aria-labelledby={hasTitle ? this.id : undefined} + aria-hidden={hasTitle ? undefined : true} transform={transform} - role="img" width="1em" height="1em" {...(props as Omit, 'ref'>)} // Lie. diff --git a/packages/ui/src/components/Visualization/Canvas/Canvas.tsx b/packages/ui/src/components/Visualization/Canvas/Canvas.tsx index 4ce4a40c6..3c8c3e91a 100644 --- a/packages/ui/src/components/Visualization/Canvas/Canvas.tsx +++ b/packages/ui/src/components/Visualization/Canvas/Canvas.tsx @@ -1,4 +1,3 @@ -import { Icon } from '@patternfly/react-core'; import { CatalogIcon } from '@patternfly/react-icons'; import { Model, diff --git a/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap b/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap index 787532ef0..3ba3408d4 100644 --- a/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap +++ b/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap @@ -717,18 +717,18 @@ exports[`Canvas Catalog button should NOT be present if \`CatalogModalContext\` - + + @@ -756,18 +756,18 @@ exports[`Canvas Catalog button should NOT be present if \`CatalogModalContext\` - + + @@ -1523,18 +1523,18 @@ exports[`Canvas Catalog button should be present if \`CatalogModalContext\` is p - + + @@ -1562,18 +1562,18 @@ exports[`Canvas Catalog button should be present if \`CatalogModalContext\` is p - + + @@ -1940,18 +1940,18 @@ exports[`Canvas Empty state should render empty state when there is no visible f - + + @@ -1979,18 +1979,18 @@ exports[`Canvas Empty state should render empty state when there is no visible f - + + @@ -2383,18 +2383,18 @@ exports[`Canvas Empty state should render empty state when there is no visual en - + + @@ -2422,18 +2422,18 @@ exports[`Canvas Empty state should render empty state when there is no visual en - + + @@ -3189,18 +3189,18 @@ exports[`Canvas should render correctly 1`] = ` - + + @@ -3228,18 +3228,18 @@ exports[`Canvas should render correctly 1`] = ` - + + @@ -3995,18 +3995,18 @@ exports[`Canvas should render correctly with more routes 1`] = ` - + + @@ -4034,18 +4034,18 @@ exports[`Canvas should render correctly with more routes 1`] = ` - + +