import { WidgetDataProviderType, DashboardTableContextDataProviderType, } from '@baserow/modules/dashboard/dataProviderTypes' import { DashboardSearchType } from '@baserow/modules/dashboard/searchTypes' import { searchTypeRegistry } from '@baserow/modules/core/search/types/registry' import dashboardApplicationStore from '@baserow/modules/dashboard/store/dashboardApplication' import { DashboardApplicationType } from '@baserow/modules/dashboard/applicationTypes' import { DashboardLastViewedItemType } from '@baserow/modules/dashboard/lastViewedItemTypes' import { DateFilterWidgetType, SummaryWidgetType, TextFilterWidgetType, } from '@baserow/modules/dashboard/widgetTypes' export default defineNuxtPlugin({ name: 'dashboard', dependsOn: ['core', 'store'], async setup(nuxtApp) { const { $store, $registry } = nuxtApp const context = { app: nuxtApp } if (!$store.hasModule('dashboardApplication')) { $store.registerModuleNuxtSafe( 'dashboardApplication', dashboardApplicationStore ) $store.registerModuleNuxtSafe( 'template/dashboardApplication', dashboardApplicationStore ) } $registry.registerNamespace('dashboardDataProvider') $registry.register( 'dashboardDataProvider', new WidgetDataProviderType(context) ) $registry.registerNamespace('dashboardWidget') $registry.register( 'dashboardDataProvider', new DashboardTableContextDataProviderType(context) ) $registry.register('application', new DashboardApplicationType(context)) $registry.register( 'lastViewedItem', new DashboardLastViewedItemType(context) ) $registry.register('dashboardWidget', new SummaryWidgetType(context)) $registry.register('dashboardWidget', new TextFilterWidgetType(context)) $registry.register('dashboardWidget', new DateFilterWidgetType(context)) searchTypeRegistry.register(new DashboardSearchType(context)) }, })