rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2770113524
##########
superset-frontend/src/dashboard/components/gridComponents/Column/Column.tsx:
##########
@@ -109,7 +115,7 @@ const ColumnStyles = styled.div`
`}
`;
-const emptyColumnContentStyles = theme => css`
+const emptyColumnContentStyles = (theme: import('@emotion/react').Theme) =>
css`
Review Comment:
Good catch. The inline `import('@emotion/react').Theme` is used here because
this is an Emotion CSS function parameter, and the Emotion theme type is what
Emotion's `css` prop actually receives. `SupersetTheme` extends the Emotion
theme with Superset-specific tokens. Since this function only uses base theme
properties (`sizeUnit`, `colorTextLabel`), either type would work. Happy to
switch to `SupersetTheme` for consistency if you feel strongly, but it's
functionally equivalent here.
##########
superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.tsx:
##########
@@ -32,47 +32,63 @@ import HoverMenu from
'src/dashboard/components/menu/HoverMenu';
import ResizableContainer from
'src/dashboard/components/resizable/ResizableContainer';
import MarkdownModeDropdown from
'src/dashboard/components/menu/MarkdownModeDropdown';
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
-import { componentShape } from 'src/dashboard/util/propShapes';
+import type { LayoutItem } from 'src/dashboard/types';
+import type { DropResult } from
'src/dashboard/components/dnd/dragDroppableConfig';
import { ROW_TYPE, COLUMN_TYPE } from 'src/dashboard/util/componentTypes';
import {
GRID_MIN_COLUMN_COUNT,
GRID_MIN_ROW_UNITS,
GRID_BASE_UNIT,
} from 'src/dashboard/util/constants';
-const propTypes = {
- id: PropTypes.string.isRequired,
- parentId: PropTypes.string.isRequired,
- component: componentShape.isRequired,
- parentComponent: componentShape.isRequired,
- index: PropTypes.number.isRequired,
- depth: PropTypes.number.isRequired,
- editMode: PropTypes.bool.isRequired,
-
- // from redux
- logEvent: PropTypes.func.isRequired,
- addDangerToast: PropTypes.func.isRequired,
- undoLength: PropTypes.number.isRequired,
- redoLength: PropTypes.number.isRequired,
+interface EditorInstance {
+ resize?: (force: boolean) => void;
+ getSession?: () => { setUseWrapMode: (wrap: boolean) => void };
+ focus?: () => void;
+}
+
+interface MarkdownOwnProps {
+ id: string;
+ parentId: string;
+ component: LayoutItem;
+ parentComponent: LayoutItem;
+ index: number;
+ depth: number;
+ editMode: boolean;
// grid related
- availableColumnCount: PropTypes.number.isRequired,
- columnWidth: PropTypes.number.isRequired,
- onResizeStart: PropTypes.func.isRequired,
- onResize: PropTypes.func.isRequired,
- onResizeStop: PropTypes.func.isRequired,
+ availableColumnCount: number;
+ columnWidth: number;
+ onResizeStart: import('re-resizable').ResizeStartCallback;
+ onResize: import('re-resizable').ResizeCallback;
Review Comment:
Same situation as Column.tsx — Emotion's `Theme` is used for the CSS
function parameter. Functionally equivalent to `SupersetTheme` in this context.
--
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]