Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2294 Fix Accessibility Violations - 2 #2295

Merged
merged 9 commits into from
Jan 16, 2025
2 changes: 1 addition & 1 deletion canvas_modules/common-canvas/src/icons/icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default class Icon extends React.Component {
icon = this.getCanvasIcon(this.props.type);
if (typeof icon !== "undefined") {
const className = classNames("canvas-icon", iconClassName, this.props.className);
icon = <SVG src={icon} className={className} disabled={this.props.disabled} />;
icon = <SVG src={icon} className={className} disabled={this.props.disabled} aria-label={this.props.type} />;
} else {
icon = <div />;
}
Expand Down
13 changes: 4 additions & 9 deletions canvas_modules/common-canvas/src/toolbar/toolbar-button-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import React from "react";
import PropTypes from "prop-types";

import Tooltip from "../tooltip/tooltip.jsx";
import ArrangeHorizontally from "./../../assets/images/arrange_horizontally.svg";
srikant-ch5 marked this conversation as resolved.
Show resolved Hide resolved
import ArrangeVertically from "./../../assets/images/arrange_vertically.svg";
import ToggleNotificationPanel from "./../../assets/images/notification_counter_icon.svg";

import { Button } from "@carbon/react";
import SVG from "react-inlinesvg";
Expand All @@ -29,7 +26,7 @@ import { StopFilledAlt, Play, Undo, Redo, Chat, ChatOff, Result,
Cut, Copy, Paste, Edit, ColorPalette, Maximize, Minimize,
Launch, AddComment, TrashCan, ZoomIn, ZoomOut,
Checkmark, ChevronRight, ChevronDown, ChevronUp,
CenterToFit, OpenPanelFilledLeft } from "@carbon/react/icons";
CenterToFit, OpenPanelFilledLeft, ArrangeVertical, ArrangeHorizontal, NotificationCounter } from "@carbon/react/icons";
import { TOOLBAR_STOP, TOOLBAR_RUN, TOOLBAR_UNDO, TOOLBAR_REDO,
TOOLBAR_CUT, TOOLBAR_COPY, TOOLBAR_PASTE, TOOLBAR_CLIPBOARD,
TOOLBAR_CREATE_COMMENT, TOOLBAR_CREATE_AUTO_COMMENT,
Expand Down Expand Up @@ -123,14 +120,12 @@ class ToolbarButtonItem extends React.Component {
return <OpenPanelFilledLeft disabled={disabled} />;
case (TOOLBAR_TOGGLE_PALETTE):
return <OpenPanelFilledLeft disabled={disabled} />;

// Non-carbon icons
case (TOOLBAR_ARRANGE_HORIZONALLY):
return <SVG src={ArrangeHorizontally} disabled={disabled} />;
return <ArrangeHorizontal disabled={disabled} />;
case (TOOLBAR_ARRANGE_VERTICALLY):
return <SVG src={ArrangeVertically} disabled={disabled} />;
return <ArrangeVertical disabled={disabled} />;
case (TOOLBAR_TOGGLE_NOTIFICATION_PANEL):
return <SVG src={ToggleNotificationPanel} disabled={disabled} />;
return <NotificationCounter disabled={disabled} />;

default:
return null;
Expand Down
Loading