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:
@@ -0,0 +1,29 @@
|
||||
import { type WidgetSizeConfig } from '@/page-layout/types/WidgetSizeConfig';
|
||||
import { GraphType } from '~/generated-metadata/graphql';
|
||||
|
||||
export const GRAPH_WIDGET_SIZES: Record<GraphType, WidgetSizeConfig> = {
|
||||
[GraphType.AGGREGATE]: {
|
||||
default: { w: 2, h: 2 },
|
||||
minimum: { w: 2, h: 2 },
|
||||
},
|
||||
[GraphType.GAUGE]: {
|
||||
default: { w: 3, h: 4 },
|
||||
minimum: { w: 3, h: 4 },
|
||||
},
|
||||
[GraphType.PIE]: {
|
||||
default: { w: 4, h: 4 },
|
||||
minimum: { w: 3, h: 4 },
|
||||
},
|
||||
[GraphType.VERTICAL_BAR]: {
|
||||
default: { w: 6, h: 6 },
|
||||
minimum: { w: 4, h: 4 },
|
||||
},
|
||||
[GraphType.HORIZONTAL_BAR]: {
|
||||
default: { w: 6, h: 6 },
|
||||
minimum: { w: 4, h: 4 },
|
||||
},
|
||||
[GraphType.LINE]: {
|
||||
default: { w: 6, h: 10 },
|
||||
minimum: { w: 4, h: 4 },
|
||||
},
|
||||
};
|
||||
@@ -1,33 +1,9 @@
|
||||
import { GraphType } from '~/generated-metadata/graphql';
|
||||
import { type WidgetSizeConfig } from '@/page-layout/types/WidgetSizeConfig';
|
||||
import { WidgetType } from '~/generated/graphql';
|
||||
|
||||
type WidgetSizeConfig = {
|
||||
default: { w: number; h: number };
|
||||
minimum: { w: number; h: number };
|
||||
};
|
||||
|
||||
export const WIDGET_SIZES: Record<GraphType, WidgetSizeConfig> = {
|
||||
[GraphType.AGGREGATE]: {
|
||||
default: { w: 2, h: 2 },
|
||||
minimum: { w: 2, h: 2 },
|
||||
},
|
||||
[GraphType.GAUGE]: {
|
||||
default: { w: 3, h: 4 },
|
||||
minimum: { w: 3, h: 4 },
|
||||
},
|
||||
[GraphType.PIE]: {
|
||||
default: { w: 4, h: 4 },
|
||||
minimum: { w: 3, h: 4 },
|
||||
},
|
||||
[GraphType.VERTICAL_BAR]: {
|
||||
export const WIDGET_SIZES: Partial<Record<WidgetType, WidgetSizeConfig>> = {
|
||||
[WidgetType.IFRAME]: {
|
||||
default: { w: 6, h: 6 },
|
||||
minimum: { w: 4, h: 4 },
|
||||
},
|
||||
[GraphType.HORIZONTAL_BAR]: {
|
||||
default: { w: 6, h: 6 },
|
||||
minimum: { w: 4, h: 4 },
|
||||
},
|
||||
[GraphType.LINE]: {
|
||||
default: { w: 6, h: 10 },
|
||||
minimum: { w: 4, h: 4 },
|
||||
minimum: { w: 4, h: 5 },
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user