feat(dashboard): support per-target multi-datasource queries - #2238
Conversation
Allow each panel query target to carry its own datasource so a single panel can mix datasources. Mixed panels render via SingleTargetQueryEditor reusing each datasource's existing QueryBuilder; single-datasource panels keep the existing per-plugin builder path. - Add ITarget.datasource and a v4 migrator that normalizes legacy __mode__/expr targets to kind-based targets on dashboard load. - Introduce datasource registry/contract/service/requestState for the new /api/n9e/v2/query-batch rendering path with expression dependency resolution. - Unify expression detection on isExpressionTarget across plugin builders so migrated targets keep rendering after save/reload. - Omit field.key when spreading onto nested Form.Items to fix React duplicate-key warnings; add query.mixed_datasource i18n key.
|
Important Review skippedToo many files! This PR contains 275 files, which is 175 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (275)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Spread elasticsearch/opensearch query.values into one backend query per value, preserving the first value's RefID and allocating unique sub RefIDs for the rest. Normalize responses back to the originating target while letting an exact-match RefID win over a value-query prefix match. Also port each datasource's legacy isQueryReady short-circuit so unprepared targets are silently skipped without triggering validation.
… usage - migrate Menu.Item children to Menu items prop in DashboardLinks, Detail/Title, Renderer/Main - add hidden input child to hidden Form.Item in ES QueryPanel/Values, OrganizeFields, TransformationsEditorNG - reset fields before setFieldsValue in DataLinks FormModal - move setTableFields side effect from useMemo to useEffect in TableNG
…datasource-query # Conflicts: # src/pages/dashboard/Editor/index.tsx # src/pages/dashboard/Renderer/Renderer/Main.tsx # src/pages/dashboard/Renderer/Renderer/TableNG/index.tsx # src/pages/dashboard/Renderer/Renderer/Timeseries/index.tsx
Strip the `key` field before spreading Form.List field props onto Form.Item / Form.List to silence the React key-spread warning across the Elasticsearch query editor and plugin AdvancedSettings components.
Replace `any` across dashboard query/variable/renderer modules with JsonObject and typed series shapes, extract getDashboardQueryStep from the legacy prometheus executor, and add a `check:dashboard-types` script that enforces no-implicit-any on active dashboard code.
Set up jsdom + testing-library harness: jest.setup injects jest-dom matchers and jsdom-missing browser APIs; jest.config maps plus: virtual modules to a stub and proxies .less/.css to identity-obj-proxy; add renderWithProviders / resetGlobalState helpers and dashboardQuery fixtures. Cover the unified query contract validation, the useQuery hook (debounce, viewport deferral, stale-response drop, unmount safety), and the ExpressionPanel interactions. Also export setGlobalState from dashboard globalState for test resets, and memoize TableNG overrides key before passing to useEffect deps.
…rer types
- destroy G2/TsGraph instances in BarChart/Heatmap/Stat on unmount to
avoid leaked event listeners
- remove tooltip overlay DOM and mouseup listener in tooltipPlugin destroy
- null gridApiRef on grid pre-destroy; guard undefined field in cell renderer
- narrow cellOptions, DashboardSeries and TableCellValue types across
TableNG and normalizeData
- fix ITransformation.id literal type ('string' -> string)
…ling - Preserve user-saved field order in Organize editor; only append new columns - Clamp activeIndex to valid range and guard getFormattedRowData against undefined tableData - Snapshot/restore frame ids across transformation pipeline; keep columns and rows keys in sync - Fix MergeTransformation losing rows when tables share no common fields - Match organize fields by displayName with name fallback; preserve TableData extras - Configure Vite optimizeDeps define for react-draggable and add n9e-plus dev proxy - Add tests for Organize editor, normalizeData, getFormattedRowData, Merge, OrganizeFields
Tighten TypeScript across dashboard renderer, editor, variables and transformations: narrow per-panel `custom` JsonObject destructuring, widen IThresholds step value to number | null with downstream ?? 0 and type guards, unify getCalculatedValuesBySeries return via the new CalculatedSeriesValue interface, fix getBuiltInVariables call to match its (range, params?) signature, and add null safety in transformations. Also show a brief summary of configured maxDataPoints / time options next to the QueryOptions button, covered by a jest test.
…logs series metadata - Row edit modal keeps original row.name when input is cleared instead of overwriting with empty - Populate n9e_internal (id, refId, metric) for victorialogs base series so legend highlight and override matching work
…hanged Cache the query-key fingerprint of the last successfully loaded data in useQuery. When a panel scrolls out and back into the viewport with unchanged query parameters, reuse the already loaded series instead of re-requesting. Transport errors and empty-query early returns do not record a fingerprint so retries still occur when appropriate.
…asource cate Add data-driven fixtures and per-cate tests across all 22 supported datasource cates for the migrator, query contract and legacy rendering integration. Relocate dashboard fixtures under the module's test dir, and document the 4.0.0 multi-datasource changes in README/CHANGELOG.
Replace _.isArray/_.isNumber/_.isString/_.isNaN with Array.isArray/ typeof checks and Number.isNaN per the native-narrowing guideline. Drop dead defensive guards in upgradeTableToNG (caught by try/catch fallback) and fix labelValuesToRows fields producing [undefined] when aggrDimension is falsy.
Align mock state with newly required ICommonState field; cast return to ICommonState to keep the minimal test state set compatible.
There was a problem hiding this comment.
Pull request overview
This PR upgrades the dashboard runtime/editor to support per-target mixed datasources within a single panel by introducing a new target contract (targets[].datasource, kind-based targets) and a new batch query execution path (with dependency-aware expressions). It also includes a large TypeScript tightening pass across dashboard/renderer/plugins plus expanded Jest + Testing Library infrastructure and fixtures to validate the migration/runtime behavior.
Changes:
- Add mixed-datasource target model (
kind: 'query' | 'expression', per-target datasource) and supporting editor registry/components to render each target with the appropriate plugin builder. - Introduce new dashboard query-batch service/request state helpers + tests, plus migration/test fixtures for legacy dashboards.
- Broad TS typing improvements and bug fixes across renderer/transformations/variables, plus Jest infra updates (jsdom, jest-dom, plus:* stubs, css/less mapping).
Reviewed changes
Copilot reviewed 272 out of 276 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Add local dev proxy rewrites for legacy perms/operation endpoints. |
| src/utils/request.tsx | Response interceptor tweak for dashboard query endpoint parsing. |
| src/test/resetGlobalState.ts | Test helper to reset dashboard global state singleton. |
| src/test/renderWithProviders.tsx | Testing helper for rendering with CommonStateContext. |
| src/test/mocks/plusStub.tsx | Jest stub for plus:* virtual modules. |
| src/test/jest-dom.d.ts | Ensure @testing-library/jest-dom types are included by TS. |
| src/plugins/victorialogs/utils.ts | Add internal series identity fields (id/refId/metric). |
| src/plugins/victorialogs/ExplorerNG/Main/Metric/index.tsx | Tighten formatter return types. |
| src/plugins/TDengine/Dashboard/QueryBuilder.tsx | Avoid spreading field.key into nested Form.Item. |
| src/plugins/TDengine/components/AdvancedSettings.tsx | Avoid spreading prefixField.key into nested Form.Item. |
| src/plugins/prometheus/Dashboard/variableDatasource.ts | Type datasource lookup result for settings access. |
| src/plugins/pgsql/Dashboard/QueryBuilder.tsx | Use isExpressionTarget; omit field.key when spreading. |
| src/plugins/pgsql/components/AdvancedSettings.tsx | Avoid spreading prefixField.key into nested Form.Item. |
| src/plugins/mysql/Dashboard/QueryBuilder.tsx | Use isExpressionTarget; omit field.key when spreading. |
| src/plugins/mysql/components/AdvancedSettings.tsx | Avoid spreading prefixField.key into nested Form.Item. |
| src/plugins/loki/ExplorerNG/Main/Metric/index.tsx | Tighten formatter return types. |
| src/plugins/iotdb/Dashboard/QueryBuilder.tsx | Avoid spreading field.key into nested Form.Item. |
| src/plugins/elasticsearch/ExplorerNG/Main/SQL/Timeseries.tsx | Tighten formatter return types. |
| src/plugins/doris/ExplorerNG/Main/SQL/Timeseries.tsx | Tighten formatter return types. |
| src/plugins/doris/Dashboard/SQLBuilder.tsx | Avoid spreading field.key into nested Form.Item. |
| src/plugins/doris/Dashboard/QueryStringBuilder.tsx | Avoid spreading field.key into nested Form.Item. |
| src/plugins/doris/Dashboard/QueryBuilder.tsx | Use isExpressionTarget; omit field.key when spreading. |
| src/plugins/doris/components/AdvancedSettings.tsx | Avoid spreading prefixField.key into nested Form.Item. |
| src/plugins/clickHouse/ExplorerNG/Main/SQL/Timeseries.tsx | Tighten formatter return types. |
| src/plugins/clickHouse/Dashboard/QueryBuilder.tsx | Use isExpressionTarget; omit field.key when spreading. |
| src/plugins/clickHouse/components/AdvancedSettings.tsx | Avoid spreading prefixField.key into nested Form.Item. |
| src/pages/dashboard/Variables/VariableManagerContext.tsx | Improve stable signatures/typing for variable dependency recalculation. |
| src/pages/dashboard/Variables/Variable/Textbox.tsx | Tighten event typing; avoid any; use currentTarget. |
| src/pages/dashboard/Variables/Variable/index.tsx | Replace JSON.stringify deps with useDeepCompareEffect. |
| src/pages/dashboard/Variables/Variable/DatasourceIdentifier.tsx | Use native array filtering; improve option typing/labels. |
| src/pages/dashboard/Variables/Variable/Datasource.tsx | Improve typing and remove any casts in options/value. |
| src/pages/dashboard/Variables/utils/replaceTemplateVariables.ts | Tighten scoped var typing; adjust variable extraction. |
| src/pages/dashboard/Variables/utils/includes.ts | Use Array.isArray; expand value types to number support. |
| src/pages/dashboard/Variables/utils/getVariableDependencies.ts | Handle non-string queries safely; widen dependency value type. |
| src/pages/dashboard/Variables/utils/getValueByOptions.ts | Allow options with numeric values. |
| src/pages/dashboard/Variables/utils/formatString.ts | Add typed interpolation values; support numeric datasource inputs. |
| src/pages/dashboard/Variables/types.ts | Replace any default with JsonObject; widen value/options types. |
| src/pages/dashboard/Variables/index.tsx | Type query param values and coerce __variable_value_fixed to boolean. |
| src/pages/dashboard/Variables/EditModal/Variable/index.tsx | Use useDeepCompareEffect for form syncing. |
| src/pages/dashboard/Variables/EditModal/Variable/DatasourceIdentifier.tsx | Make grouped list access safe; avoid stringify deps; widen types. |
| src/pages/dashboard/Variables/EditModal/Variable/Datasource.tsx | Make grouped list access safe; avoid stringify deps; numeric IDs. |
| src/pages/dashboard/Variables/EditModal/Variable/Custom.tsx | Avoid stringify deps for custom variable definition updates. |
| src/pages/dashboard/Variables/EditModal/Preview.tsx | Widen option value types. |
| src/pages/dashboard/Variables/EditModal/index.tsx | Tighten table render param types. |
| src/pages/dashboard/Variables/datasource.ts | Define VariableDatasourceQuery; type datasource list; remove any. |
| src/pages/dashboard/VariableConfig/index.tsx | Use useDeepCompareEffect for config/range refresh handling. |
| src/pages/dashboard/VariableConfig/EditItems.tsx | Narrow dashboard type to needed fields; tighten render types. |
| src/pages/dashboard/VariableConfig/EditItem.tsx | Narrow dashboard type to needed fields. |
| src/pages/dashboard/VariableConfig/DisplayItem.tsx | Replace stringify deps with useDeepCompareEffect. |
| src/pages/dashboard/utils/validateDashboardConfig.ts | Tighten plain object type guard return type. |
| src/pages/dashboard/utils/upgradeTableToNG.test.ts | Add additional migration correctness tests. |
| src/pages/dashboard/utils/json.ts | Add JSON parsing/type guards + error message helper. |
| src/pages/dashboard/utils/json.test.ts | Unit tests for new JSON helpers. |
| src/pages/dashboard/utils/index.ts | Type JSONParse return; add ignore markers for legacy conversion block. |
| src/pages/dashboard/utils/getDefaultTargets.ts | Validate plus-provided defaults against ITarget shape. |
| src/pages/dashboard/transformations/types.ts | Add table field types; allow null datapoint values. |
| src/pages/dashboard/transformations/SeriesToRowsTransformation/index.ts | Tighten row typing to DataPoint-compatible values. |
| src/pages/dashboard/transformations/RowsToFieldsTransformation/index.ts | Use TableCellValue type for derived field values. |
| src/pages/dashboard/transformations/RenameByRegexTransformation/index.ts | Tighten datapoint typing to DataPoint[string]. |
| src/pages/dashboard/transformations/ReduceTransformation/index.ts | Guard empty series access; handle null values safely. |
| src/pages/dashboard/transformations/PartitionByValuesTransformation/index.ts | Tighten Map key/value typing; avoid any. |
| src/pages/dashboard/transformations/OrganizeFieldsTransformation/index.ts | Prefer displayName matching; preserve table fields via spread. |
| src/pages/dashboard/transformations/MergeTransformation/index.ts | Fix no-common-field merge collapsing rows; tighten types. |
| src/pages/dashboard/transformations/MergeTransformation/index.test.ts | Add test covering no-common-field merge behavior. |
| src/pages/dashboard/transformations/index.ts | Make pipeline input/output explicit; add registered ID type guard. |
| src/pages/dashboard/transformations/GroupByTransformation/index.ts | Tighten typing; handle null dp values; improve table state typing. |
| src/pages/dashboard/transformations/FilterByValuesTransformation/index.ts | Tighten filter predicate value type. |
| src/pages/dashboard/transformations/ExtractFieldsTransformation/index.ts | Tighten extracted datapoint typing. |
| src/pages/dashboard/test/fixtures/legacyDashboards.ts | Add legacy dashboard fixtures for migration tests. |
| src/pages/dashboard/test/fixtures/dashboardQuery.ts | Add query request/response/series mock factories. |
| src/pages/dashboard/Share/index.tsx | Improve datasource URL migration typing and parsing robustness. |
| src/pages/dashboard/Renderer/utils/valueFormatter.ts | Type value formatter inputs/options; better narrowing; reduce any. |
| src/pages/dashboard/Renderer/utils/replaceFieldWithVariable.ts | Tighten scoped var typing and safe string conversions. |
| src/pages/dashboard/Renderer/utils/replaceExpressionDetail.ts | Add typed detail expression data + safer string conversion. |
| src/pages/dashboard/Renderer/utils/replaceExpressionBracket.ts | Add parameter types; remove var; tighten regex match typing. |
| src/pages/dashboard/Renderer/utils/localeCompare.ts | Replace any params with unknown. |
| src/pages/dashboard/Renderer/utils/interpolateTemplate.ts | Tighten values + variable config typing. |
| src/pages/dashboard/Renderer/utils/getTextWidth.ts | Add FontStyle interface and typed helpers. |
| src/pages/dashboard/Renderer/utils/getSerieName.ts | Ensure string coercion for metric name access. |
| src/pages/dashboard/Renderer/utils/getOverridePropertiesByName.ts | Type overrides and matcher input/output shapes. |
| src/pages/dashboard/Renderer/utils/formatToTable.ts | Mark legacy renderer section with ignore block markers. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/utils/secondYAxisBuilder.ts | Type override-derived standard options; cast formatter output. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/utils/getStartAndEndByTargets.ts | Type targets as ITarget[]. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/utils/getDataFrameAndBaseSeries.ts | Export OldSeriesItem; tighten internal series typing. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/components/ResetZoomButton.tsx | Allow getUplot() to return undefined. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/components/NameWithTooltip.tsx | Add explicit record/children prop typing. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/components/Legend/Link.tsx | Type link data; adjust scoped var typing/cast. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/components/Legend/LegendTable.tsx | Tighten sorter and wrapper props typing; avoid lodash array guard. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/components/Annotation/annotationsPlugin.tsx | Tighten annotation typing; handle undefined uPlot ref safely. |
| src/pages/dashboard/Renderer/Renderer/TimeSeriesNG/components/Annotation/AddButton.tsx | Allow uplotRef to be undefined. |
| src/pages/dashboard/Renderer/Renderer/Text/index.tsx | Type series and cast custom/content inputs safely. |
| src/pages/dashboard/Renderer/Renderer/TableNG/rowDetailUtils.ts | Handle undefined formatted row safely. |
| src/pages/dashboard/Renderer/Renderer/TableNG/CustomColumnFilter/index.tsx | Add local filter-pass param typing. |
| src/pages/dashboard/Renderer/Renderer/TableNG/CellRenderer/types.ts | Allow non-number/null stats; add guidance comment. |
| src/pages/dashboard/Renderer/Renderer/TableNG/CellRenderer/index.tsx | Narrow override props types for safe access. |
| src/pages/dashboard/Renderer/Renderer/TableNG/CellRenderer/Gauge/LCDBar.tsx | Use CSSProperties; guard null stat comparisons. |
| src/pages/dashboard/Renderer/Renderer/TableNG/CellRenderer/Gauge/BasicBar.tsx | Guard non-number stats in percentage calculation. |
| src/pages/dashboard/Renderer/Renderer/Table/utils.ts | Cast override options to expected types for formatting. |
| src/pages/dashboard/Renderer/Renderer/Table/Cell.tsx | Narrow custom link structure; adjust template var calls. |
| src/pages/dashboard/Renderer/Renderer/Stat/utils.ts | Initialize font sizes to numeric values. |
| src/pages/dashboard/Renderer/Renderer/index.tsx | Simplify datasource resolution path; tighten annotations + spanNulls typing. |
| src/pages/dashboard/Renderer/Renderer/Iframe/index.tsx | Type series and cast iframe props safely. |
| src/pages/dashboard/Renderer/Renderer/Hexbin/utils.ts | Add types for calculated values and function params. |
| src/pages/dashboard/Renderer/Renderer/Hexbin/render.ts | Add typed placeholder points and record accessors. |
| src/pages/dashboard/Renderer/Renderer/Gauge/Gauge.tsx | Replace any; improve arc typing and formatted value types. |
| src/pages/dashboard/Renderer/Renderer/BarGauge/utils.ts | Add BarGaugeValue typing and typed column key extraction. |
| src/pages/dashboard/Renderer/Renderer/BarGauge/LCDBars/LCDBar.tsx | Type item and scopedVars cast for interpolation. |
| src/pages/dashboard/Renderer/Renderer/BarGauge/LCDBars/index.tsx | Type values as BarGaugeValue[]. |
| src/pages/dashboard/Renderer/Renderer/BarGauge/BasicDisplayMode.tsx | Type item; scopedVars cast for interpolation. |
| src/pages/dashboard/Renderer/Inspect/index.tsx | Type inspect payload; remove stringify deps. |
| src/pages/dashboard/Renderer/datasource/utils/index.tsx | Type breakpoint completion input; early-return if step undefined. |
| src/pages/dashboard/Renderer/datasource/target.ts | Add helpers: expression detection, result type inference, refId generation. |
| src/pages/dashboard/Renderer/datasource/target.test.ts | Unit tests for target helpers. |
| src/pages/dashboard/Renderer/datasource/service.ts | Add query-batch fetch service wrapper. |
| src/pages/dashboard/Renderer/datasource/requestState.ts | Add request sequencing + immutable accept helper. |
| src/pages/dashboard/Renderer/datasource/requestState.test.ts | Unit tests for request sequencing/revision behavior. |
| src/pages/dashboard/Renderer/datasource/queryStep.ts | Add query-batch step calculation helper. |
| src/pages/dashboard/Renderer/datasource/queryStep.test.ts | Tests for query step calculation. |
| src/pages/dashboard/Renderer/datasource/prometheus.ts | Guard optional expr for interpolation/signal key building. |
| src/pages/dashboard/Renderer/datasource/elasticsearch/types.ts | Add filter_language typing and legacy syntax compat comment. |
| src/pages/dashboard/Renderer/datasource/elasticsearch/index.ts | Cast values shape for raw-data detection. |
| src/pages/dashboard/Panels/Row.tsx | Type row panel; avoid overwriting name with empty input. |
| src/pages/dashboard/Panels/EditorModal.tsx | Type modal handle/data and panels; forwardRef typing. |
| src/pages/dashboard/locale/zh_HK.ts | Add i18n key for mixed datasource label. |
| src/pages/dashboard/locale/zh_CN.ts | Add i18n key for mixed datasource label. |
| src/pages/dashboard/locale/ru_RU.ts | Add i18n key for mixed datasource label. |
| src/pages/dashboard/locale/ja_JP.ts | Add i18n key for mixed datasource label. |
| src/pages/dashboard/locale/en_US.ts | Add i18n key for mixed datasource label. |
| src/pages/dashboard/List/utils.ts | Type export/import utilities; semver valid return normalization. |
| src/pages/dashboard/List/PublicForm.tsx | Use JSON helpers to parse configs; tighten types for form + vars. |
| src/pages/dashboard/List/index.tsx | Tighten table/list row typing; type actions; avoid any[]. |
| src/pages/dashboard/List/ImportGrafanaURLFormModal.tsx | Cast JSONParse results to IDashboardConfig. |
| src/pages/dashboard/List/Import/index.tsx | Type BetaIcon props and import function arg. |
| src/pages/dashboard/List/Import/ImportBuiltinContent.tsx | Add props interface; pass minimal typed dashboard shape. |
| src/pages/dashboard/List/Header.tsx | Tighten types for selected keys and search change callback. |
| src/pages/dashboard/List/FormModal.tsx | Use useDeepCompareEffect; tighten form values typing. |
| src/pages/dashboard/List/BatchClone.tsx | Tighten business group option typing. |
| src/pages/dashboard/hooks/useStableValue.ts | Add small-object stable value hook using deep compare. |
| src/pages/dashboard/globalState.ts | Export setGlobalState; tighten series/meta typing. |
| src/pages/dashboard/external-modules.d.ts | Add local module typings for semver/react-beforeunload/react-color. |
| src/pages/dashboard/Editor/util.tsx | Normalize panel initial values immutably; ensure thresholds mode default. |
| src/pages/dashboard/Editor/upgradeTableToNG.integration.test.ts | Integration test for legacy table upgrade + query request contract. |
| src/pages/dashboard/Editor/TransformationsEditorNG/TimeSeriesTable/useColumns.tsx | Type transformations and avoid any[] slices. |
| src/pages/dashboard/Editor/TransformationsEditorNG/Organize/useColumns.tsx | Type transformations and avoid any[] slices. |
| src/pages/dashboard/Editor/TransformationsEditorNG/Organize/index.tsx | Preserve user ordering; use deep-compare effect; tighten sortable typing. |
| src/pages/dashboard/Editor/TransformationsEditorNG/JoinByField/useColumns.tsx | Type transformations and avoid any[] slices. |
| src/pages/dashboard/Editor/TransformationsEditorNG/index.tsx | Render hidden input for Form.Item hidden to keep field registered. |
| src/pages/dashboard/Editor/TransformationsEditorNG/GroupedAggregateTable/useColumns.tsx | Type transformations and avoid any[] slices. |
| src/pages/dashboard/Editor/TransformationsEditor/OrganizeFields/OrganizeFields.tsx | Replace stringify deps with useDeepCompareEffect; tighten typing. |
| src/pages/dashboard/Editor/TransformationsEditor/OrganizeFields/index.tsx | Render hidden input for hidden Form.Item. |
| src/pages/dashboard/Editor/style.less | Add styles for single-target query editor adapter layout. |
| src/pages/dashboard/Editor/QueryEditor/registry.ts | Add datasource editor registry + default target creation. |
| src/pages/dashboard/Editor/QueryEditor/registry.test.ts | Unit test for registry default query target creation. |
| src/pages/dashboard/Editor/QueryEditor/QueryOptions.tsx | Add options summary display using describeTimeRange. |
| src/pages/dashboard/Editor/QueryEditor/QueryBuilder.tsx | Make datasourceValue optional. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/types.ts | Add typed ES editor option/value types. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/Time/index.tsx | Type Form.List fields; omit key when spreading. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/IndexSelect.tsx | Type options; omit key when spreading; FormList typing. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/IndexPatternSelect.tsx | Type index patterns and omit key when spreading. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/index.tsx | Type datasourceValue prop explicitly. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/GroupBy/index.tsx | Type Form.List field; omit key; type field options. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/GroupBy/Histgram.tsx | Type prefix field; omit key when spreading. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/GroupBy/Filters.tsx | Type fields and omit key when spreading inside nested lists. |
| src/pages/dashboard/Editor/QueryEditor/Elasticsearch/DateField.tsx | Type options; omit key when spreading. |
| src/pages/dashboard/Editor/QueryEditor/components/SingleTargetQueryPanel.tsx | New mixed-query panel wrapper component (refId + datasource selector). |
| src/pages/dashboard/Editor/QueryEditor/components/SingleTargetQueryPanel.test.ts | Test ensuring datasource selector stays in panel header markup. |
| src/pages/dashboard/Editor/QueryEditor/components/DatasourceSelect/DatasourceSelectExtra/index.tsx | Adjust typing for datasourceValue across plugins/plus. |
| src/pages/dashboard/Editor/QueryEditor/components/ClusterSelect/index.tsx | Type datasource variables list. |
| src/pages/dashboard/Editor/Options/Timeseries/Overrides/index.tsx | Type targets as ITarget[]. |
| src/pages/dashboard/Editor/Options/Timeseries/index.tsx | Type targets as ITarget[]. |
| src/pages/dashboard/Editor/Options/TableNG/index.tsx | Type targets as ITarget[]. |
| src/pages/dashboard/Editor/Options/Table/index.tsx | Type targets as ITarget[]. |
| src/pages/dashboard/Editor/Options/Stat/index.tsx | Type targets as ITarget[]. |
| src/pages/dashboard/Editor/Options/index.tsx | Type options map; ensure invalid type renders as element. |
| src/pages/dashboard/Editor/formInitialValuesPolicy.test.ts | Enforce “no Form.initialValues” policy via AST scan. |
| src/pages/dashboard/Editor/Fields/Thresholds/index.tsx | Type thresholds initial value. |
| src/pages/dashboard/Editor/Fields/StandardOptions/index.tsx | Type unit options mapping result. |
| src/pages/dashboard/Editor/Fields/Overrides/index.tsx | Type targets; add richer override header label component. |
| src/pages/dashboard/Editor/Fields/DataLinks/FormModal.tsx | Reset+set form fields on open; avoid stale state. |
| src/pages/dashboard/Editor/config.tsx | Type thresholds defaults. |
| src/pages/dashboard/Editor/Components/Markdown/index.tsx | Replace any style with CSSProperties. |
| src/pages/dashboard/Editor/Components/ExpressionPanel/index.tsx | Strongly type Form.List props; stop spreading key; use expression field. |
| src/pages/dashboard/Editor/Components/ExpressionPanel/index.test.ts | AST test enforcing no spread of field directly. |
| src/pages/dashboard/Editor/Components/Collapse/style.less | Formatting-only tweak. |
| src/pages/dashboard/Editor/Components/AddQueryButtons/index.tsx | Type props; create expression targets with new kind/expression fields. |
| src/pages/dashboard/Detail/utils/index.test.ts | Add test coverage for datasource value resolution. |
| src/pages/dashboard/DashboardLinks/Edit.tsx | Tighten types for dashboards/options/form list item props. |
| src/pages/dashboard/config.tsx | Type icon props; bump DASHBOARD_VERSION to 4.0.0. |
| src/pages/dashboard/Components/UnitPicker/utils.tsx | Add UnitOption typing; tighten option/filter helpers. |
| src/pages/dashboard/Components/UnitPicker/OutlinedUnitPicker.tsx | Type adjusted unit options callback. |
| src/pages/dashboard/Components/UnitPicker/index.tsx | Type adjusted unit options callback. |
| src/pages/dashboard/Components/UnitPicker/CustomUnitPicker.tsx | Type adjusted unit options callback. |
| src/pages/dashboard/Components/QueryExtraActions.tsx | Avoid spreading field.key and add key explicitly. |
| src/pages/dashboard/Components/ModalHOC.tsx | Add generic typing for wrapped modal props/config. |
| src/pages/dashboard/Components/ColorRangeMenu/index.tsx | Type Menu onClick handler. |
| src/pages/dashboard/CHANGELOG.md | Add 4.0.0 release notes for mixed datasource queries and migrations. |
| src/pages/chart/index.tsx | Display mixed datasource label using i18n key. |
| src/components/UPlotChart/plugins/tooltipPlugin.ts | Fix overlay cleanup and outside-click handling teardown. |
| src/components/G2PieChart/index.tsx | Make positon optional. |
| scripts/check-dashboard-types/tsconfig.json | Add stricter TS config for dashboard type checking. |
| package.json | Add dashboard type check script and testing-library/jsdom deps. |
| jest.setup.ts | Add jest-dom + browser API stubs for jsdom tests. |
| jest.config.ts | Add plus:* mapping, css/less mapping, jest setup, include tsx tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| _.map(scopedVars, (value, key) => { | ||
| return { | ||
| name: key, | ||
| value, | ||
| value: value.value, | ||
| } as IVariable; |
| return <DatasourceSelectExtra datasourceCate={datasourceCate} datasourceValue={datasourceValue as number} />; | ||
|
|
||
| return null; | ||
| } |
| if ( | ||
| _.some([`/api/${N9E_PATHNAME}/proxy`, '/probe/v1'], (item) => { | ||
| _.some([`/api/${N9E_PATHNAME}/proxy`, '/probe/v1', '/api/n9e/dashboard/query'], (item) => { | ||
| return url.includes(item); | ||
| }) | ||
| ) { |
Allow each panel query target to carry its own datasource so a single panel can mix datasources. Mixed panels render via SingleTargetQueryEditor reusing each datasource's existing QueryBuilder; single-datasource panels keep the existing per-plugin builder path.