Files
baserow/web-frontend/modules/dashboard/plugin.js
Peter EvansandJeremie Pardou f07d8c895e feat: set up dashboard filters from a table and create the widgets they filter (#6771)
* feat: set up dashboard filters from a table and create the widgets they filter

* feat: refine dashboard filter setup and widget association

Support multi-table filters, guided widget configuration, same-table condition copying in display order, and automatic linking defaults. Preserve independent target settings and undo/redo behavior.

* fix: show copied filter conditions after widget association

* test: cover guided dashboard widget creation from a filter

* test: cover dashboard filter copying across tables

* refactor: simplify dashboard filter configuration

* fix: restore dashboard filter links exactly on undo and redo

* feat: set up a new widget and how a filter narrows it down in one modal

* feat: fold the add-widget modal into collapsible sections that fit chart settings

* fix: cancel queued updates when destroying dashboard charts

* fix: reference dashboard option context by table

* refactor: rename dashboard table context provider

* fix: label dashboard table context as field options

* fix: shorten dashboard table options label

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-11-23 15:00:35 +00:00

54 lines
1.8 KiB
JavaScript

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 {
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))
searchTypeRegistry.register(new DashboardSearchType(context))
},
})