From b38482de3f37d1a861bffc06989fc599502279de Mon Sep 17 00:00:00 2001 From: Victor Marin Date: Fri, 22 Nov 2024 17:16:10 +0200 Subject: [PATCH] wip add adHoc + groupby vars to scenes-react --- .../src/react-demo/DynamicVariablesPage.tsx | 103 +++++++++++++- packages/scenes-react/src/index.ts | 2 + .../variables/AdHocFiltersVariable.test.tsx | 0 .../src/variables/AdHocFiltersVariable.tsx | 133 ++++++++++++++++++ .../src/variables/GroupByVariable.test.tsx | 0 .../src/variables/GroupByVariable.tsx | 107 ++++++++++++++ 6 files changed, 338 insertions(+), 7 deletions(-) create mode 100644 packages/scenes-react/src/variables/AdHocFiltersVariable.test.tsx create mode 100644 packages/scenes-react/src/variables/AdHocFiltersVariable.tsx create mode 100644 packages/scenes-react/src/variables/GroupByVariable.test.tsx create mode 100644 packages/scenes-react/src/variables/GroupByVariable.tsx diff --git a/packages/scenes-app/src/react-demo/DynamicVariablesPage.tsx b/packages/scenes-app/src/react-demo/DynamicVariablesPage.tsx index 0ec6244af..70909e4a2 100644 --- a/packages/scenes-app/src/react-demo/DynamicVariablesPage.tsx +++ b/packages/scenes-app/src/react-demo/DynamicVariablesPage.tsx @@ -1,10 +1,20 @@ -import { CustomVariable, DataSourceVariable, QueryVariable, VariableControl } from '@grafana/scenes-react'; +import { + AdHocFiltersVariable, + CustomVariable, + DataSourceVariable, + GroupByVariable, + QueryVariable, + VariableControl, + VizPanel, + useQueryRunner, +} from '@grafana/scenes-react'; import { Button, Stack } from '@grafana/ui'; import React from 'react'; import { PageWrapper } from './PageWrapper'; import { PlainGraphWithRandomWalk } from './PlainGraphWithRandomWalk'; import { DemoVizLayout } from './utils'; import { VariableHide, VariableRefresh, VariableSort } from '@grafana/schema'; +import { VizConfigBuilders } from '@grafana/scenes'; export function DynamicVariablesPage() { const [regexDsVar, setRegexDsVar] = React.useState(undefined); @@ -41,12 +51,12 @@ export function DynamicVariablesPage() { -