4135a6473a
# Introduction In this pull-request we're refactoring the page layout widget configuration entity to be containing its discriminated key simplifying underlying code and maintainability - Made the configuration and title non nullable - Introduced a generic predicate for the `widgetConfigurationType` - Upgraded command to remove `graphType` and insert new `configurationType` to existing entries - Migrated frontend to new type system --------- Co-authored-by: bosiraphael <raphael.bosi@gmail.com> Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com>
28 lines
775 B
TypeScript
28 lines
775 B
TypeScript
import { type WidgetSizeConfig } from '@/page-layout/types/WidgetSizeConfig';
|
|
import { WidgetConfigurationType } from '~/generated/graphql';
|
|
|
|
export const GRAPH_WIDGET_SIZES: Partial<
|
|
Record<WidgetConfigurationType, WidgetSizeConfig>
|
|
> = {
|
|
[WidgetConfigurationType.AGGREGATE_CHART]: {
|
|
default: { w: 2, h: 2 },
|
|
minimum: { w: 2, h: 2 },
|
|
},
|
|
[WidgetConfigurationType.GAUGE_CHART]: {
|
|
default: { w: 3, h: 4 },
|
|
minimum: { w: 3, h: 4 },
|
|
},
|
|
[WidgetConfigurationType.PIE_CHART]: {
|
|
default: { w: 4, h: 4 },
|
|
minimum: { w: 3, h: 4 },
|
|
},
|
|
[WidgetConfigurationType.BAR_CHART]: {
|
|
default: { w: 6, h: 6 },
|
|
minimum: { w: 4, h: 4 },
|
|
},
|
|
[WidgetConfigurationType.LINE_CHART]: {
|
|
default: { w: 6, h: 10 },
|
|
minimum: { w: 4, h: 4 },
|
|
},
|
|
};
|