IFrame widget improvements (#15483)
changes - - make iframe side panel to match others -- ie use SidePanelHeader for title - make url optional in configuration to match that of the other widgets (allow partial saves) - render No data status when error or no url - split widget sizes into two -- graph widget sizes and widget sizes (graph widgets are a subset of chart widgets)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { DEFAULT_WIDGET_SIZE } from '@/page-layout/constants/DefaultWidgetSize';
|
||||
import { WIDGET_SIZES } from '@/page-layout/constants/WidgetSizes';
|
||||
import { GRAPH_WIDGET_SIZES } from '@/page-layout/constants/GraphWidgetSizes';
|
||||
import { type GraphType } from '~/generated/graphql';
|
||||
|
||||
export const getWidgetSize = (
|
||||
graphType: GraphType,
|
||||
type: 'default' | 'minimum',
|
||||
): { w: number; h: number } => {
|
||||
const sizeConfig = WIDGET_SIZES[graphType] ?? DEFAULT_WIDGET_SIZE;
|
||||
const sizeConfig = GRAPH_WIDGET_SIZES[graphType] ?? DEFAULT_WIDGET_SIZE;
|
||||
return sizeConfig[type];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user