msyavuz commented on code in PR #36314:
URL: https://github.com/apache/superset/pull/36314#discussion_r2726944889
##########
superset-frontend/src/dashboard/containers/DashboardComponent.jsx:
##########
@@ -49,6 +49,8 @@ const propTypes = {
directPathToChild: PropTypes.arrayOf(PropTypes.string),
directPathLastUpdated: PropTypes.number,
isComponentVisible: PropTypes.bool,
+ onDrop: PropTypes.func,
+ onHover: PropTypes.func,
Review Comment:
Is this intentional?
##########
superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx:
##########
@@ -388,7 +398,7 @@ const Tab = props => {
} = props;
return (
<TabTitleContainer
- isHighlighted={isHighlighted}
+ isHighlighted={!!isHighlighted}
Review Comment:
Isn't this already a boolean?
##########
superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.test.tsx:
##########
@@ -28,8 +28,9 @@ import DashboardComponent from
'src/dashboard/containers/DashboardComponent';
import { EditableTitle } from '@superset-ui/core/components';
import { setEditMode, onRefresh } from 'src/dashboard/actions/dashboardState';
-import Tab from './Tab';
+import Tab, { RENDER_TAB, RENDER_TAB_CONTENT } from './Tab';
import Markdown from '../Markdown';
+import { LayoutItem } from 'src/dashboard/types';
Review Comment:
Bot is correct on this one
##########
superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx:
##########
@@ -32,46 +32,47 @@ import {
DragDroppable,
Droppable,
} from 'src/dashboard/components/dnd/DragDroppable';
-import { componentShape } from 'src/dashboard/util/propShapes';
import { TAB_TYPE } from 'src/dashboard/util/componentTypes';
-import { Link } from 'react-router-dom';
+import type { LayoutItem, RootState } from 'src/dashboard/types';
-export const RENDER_TAB = 'RENDER_TAB';
-export const RENDER_TAB_CONTENT = 'RENDER_TAB_CONTENT';
+export const RENDER_TAB = 'RENDER_TAB' as const;
+export const RENDER_TAB_CONTENT = 'RENDER_TAB_CONTENT' as const;
// Delay before refreshing charts to ensure they are fully mounted
const CHART_MOUNT_DELAY = 100;
-const propTypes = {
- dashboardId: PropTypes.number.isRequired,
- id: PropTypes.string.isRequired,
- parentId: PropTypes.string.isRequired,
- component: componentShape.isRequired,
- parentComponent: componentShape.isRequired,
- index: PropTypes.number.isRequired,
- depth: PropTypes.number.isRequired,
- renderType: PropTypes.oneOf([RENDER_TAB, RENDER_TAB_CONTENT]).isRequired,
- onDropOnTab: PropTypes.func,
- onDropPositionChange: PropTypes.func,
- onDragTab: PropTypes.func,
- onHoverTab: PropTypes.func,
- editMode: PropTypes.bool.isRequired,
- embeddedMode: PropTypes.bool,
- onTabTitleEditingChange: PropTypes.func,
+interface TabProps {
+ dashboardId: number;
+ id: string;
+ parentId: string;
+ component: LayoutItem;
+ parentComponent: LayoutItem;
+ index: number;
+ depth: number;
+ renderType: typeof RENDER_TAB | typeof RENDER_TAB_CONTENT;
+ onDropOnTab: (...args: unknown[]) => unknown;
Review Comment:
Should this be optional as well?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]