dashboard workspace standard seeds (#16962)
# Introduction In this pull request we're introducing new standard page layout, tabs and widget ( 1 page layout, 1 tab and 8 widgets ) and also a new opportunity field Also now prefilling new records, 6 opportunities and a dashboard. ## Standard declaration ### New workspace creation Relies on existing standard declaration builder ### Backfill command We've been hacking through the standard builder in order to extract only the standard page layout entities, updated their entity dependencies to match the workspace ids so the validation passes ## Remark - Refactored the `PageLayoutWidget` configuration type to be dynamically typed through a generic discriminated union --------- Co-authored-by: prastoin <paul@twenty.com>
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
import { type WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
|
||||
import { type FlatPageLayoutWidget } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget.type';
|
||||
|
||||
export function isFlatPageLayoutWidgetConfigurationOfType<
|
||||
Widget extends FlatPageLayoutWidget<WidgetConfigurationType>,
|
||||
Type extends WidgetConfigurationType,
|
||||
>(
|
||||
widget: Pick<Widget, 'configuration'>,
|
||||
type: Type,
|
||||
): widget is Widget & FlatPageLayoutWidget<Type> {
|
||||
return widget.configuration.configurationType === type;
|
||||
}
|
||||
Reference in New Issue
Block a user