geido commented on code in PR #26602:
URL: https://github.com/apache/superset/pull/26602#discussion_r1557961896


##########
superset-frontend/src/components/Icons/AntdEnhanced.tsx:
##########
@@ -25,9 +25,10 @@ import IconType from './IconType';
 const AntdEnhancedIcons = Object.keys(AntdIcons)
   .filter(k => !k.includes('TwoTone'))
   .map(k => ({
-    [k]: (props: IconType) => (
-      <StyledIcon component={AntdIcons[k]} {...props} />
-    ),
+    [k]: (props: IconType) => {
+      const whatRole = props.onClick ? 'button' : props?.role || 'img';

Review Comment:
   ```suggestion
         const whatRole = props?.onClick ? 'button' : 'img';
   ```



##########
superset-frontend/src/components/Label/index.tsx:
##########
@@ -93,6 +93,7 @@ export default function Label(props: LabelProps) {
   return (
     <Tag
       onClick={onClick}
+      role={onClick ? 'button' : undefined}

Review Comment:
   We should move this logic inside the Tag component



##########
superset-frontend/src/explore/components/controls/FixedOrMetricControl/index.jsx:
##########
@@ -127,7 +127,7 @@ export default class FixedOrMetricControl extends 
React.Component {
           <Collapse.Panel
             showArrow={false}
             header={
-              <Label onClick={() => undefined}>

Review Comment:
   Can we git blame this and see why it was done in the first place?



##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx:
##########
@@ -81,6 +84,7 @@ const CrossFilterTag = (props: {
       `}
       closable
       onClose={() => removeCrossFilter(filter.emitterId)}
+      closeIcon={customCloseIcon}

Review Comment:
   All the time you have a closable Tag, the x should get a role button, so I 
believe it makes sense to move this within the `Tag` component



##########
superset-frontend/src/components/Icons/Icon.tsx:
##########
@@ -68,10 +68,13 @@ export const Icon = (props: IconProps) => {
     };
   }, [fileName, ImportedSVG]);
 
+  const whatRole = props?.onClick ? 'button' : iconProps?.role || 'img';

Review Comment:
   ```suggestion
     const whatRole = props?.onClick ? 'button' : 'img';
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to