mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: some type fixes (#69860)
* some type fixes * restore empty object * undo 1 fix for now * commit betterer update * explicitly type slug and uid as string | undefined
This commit is contained in:
@@ -272,10 +272,10 @@ export class DashboardGrid extends PureComponent<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
interface GrafanaGridItemProps extends Record<string, any> {
|
||||
interface GrafanaGridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
gridWidth?: number;
|
||||
gridPos?: GridPos;
|
||||
isViewing: string;
|
||||
isViewing: boolean;
|
||||
windowHeight: number;
|
||||
windowWidth: number;
|
||||
children: any;
|
||||
@@ -306,8 +306,15 @@ const GrafanaGridItem = React.forwardRef<HTMLDivElement, GrafanaGridItemProps>((
|
||||
style.width = '100%';
|
||||
} else {
|
||||
// Normal grid layout. The grid framework passes width and height directly to children as style props.
|
||||
width = parseFloat(props.style.width);
|
||||
height = parseFloat(props.style.height);
|
||||
if (props.style) {
|
||||
const { width: styleWidth, height: styleHeight } = props.style;
|
||||
if (styleWidth != null) {
|
||||
width = typeof styleWidth === 'number' ? styleWidth : parseFloat(styleWidth);
|
||||
}
|
||||
if (styleHeight != null) {
|
||||
height = typeof styleHeight === 'number' ? styleHeight : parseFloat(styleHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// props.children[0] is our main children. RGL adds the drag handle at props.children[1]
|
||||
|
||||
Reference in New Issue
Block a user