@perses-dev/explore 0.43.0 → 0.44.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ExploreToolbar/ExploreToolbar.js +1 -1
- package/dist/cjs/components/PanelEditor/PanelEditorForm.js +4 -4
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +1 -1
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/cjs/context/usePanelEditor.js +2 -2
- package/dist/cjs/context/useTimeSeriesQueryEditorActions.js +3 -3
- package/dist/cjs/views/ViewExplore/ViewExplore.js +1 -1
- package/dist/cjs/views/ViewExplore/ViewExploreApp.js +1 -1
- package/dist/components/ExploreToolbar/ExploreToolbar.d.ts +1 -1
- package/dist/components/ExploreToolbar/ExploreToolbar.d.ts.map +1 -1
- package/dist/components/ExploreToolbar/ExploreToolbar.js +1 -1
- package/dist/components/ExploreToolbar/ExploreToolbar.js.map +1 -1
- package/dist/components/PanelEditor/PanelEditorForm.d.ts +1 -1
- package/dist/components/PanelEditor/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelEditor/PanelEditorForm.js +4 -4
- package/dist/components/PanelEditor/PanelEditorForm.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
- package/dist/context/usePanelEditor.js +2 -2
- package/dist/context/usePanelEditor.js.map +1 -1
- package/dist/context/useTimeSeriesQueryEditorActions.js +3 -3
- package/dist/context/useTimeSeriesQueryEditorActions.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/views/ViewExplore/ViewExplore.d.ts +1 -1
- package/dist/views/ViewExplore/ViewExplore.d.ts.map +1 -1
- package/dist/views/ViewExplore/ViewExplore.js +1 -1
- package/dist/views/ViewExplore/ViewExplore.js.map +1 -1
- package/dist/views/ViewExplore/ViewExploreApp.d.ts +1 -1
- package/dist/views/ViewExplore/ViewExploreApp.d.ts.map +1 -1
- package/dist/views/ViewExplore/ViewExploreApp.js +1 -1
- package/dist/views/ViewExplore/ViewExploreApp.js.map +1 -1
- package/package.json +7 -7
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _dashboards = require("@perses-dev/dashboards");
|
|
26
26
|
const ExploreToolbar = (props)=>{
|
|
27
|
-
const { exploreTitleComponent
|
|
27
|
+
const { exploreTitleComponent } = props;
|
|
28
28
|
const isBiggerThanLg = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('lg'));
|
|
29
29
|
const testId = 'explore-toolbar';
|
|
30
30
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
@@ -37,9 +37,9 @@ function _interop_require_default(obj) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
function PanelEditorForm(props) {
|
|
40
|
-
const { exploreTitleComponent
|
|
41
|
-
const { setQueries
|
|
42
|
-
const { plugin
|
|
40
|
+
const { exploreTitleComponent, initialValues: { panelDefinition: initialPanelDef } } = props;
|
|
41
|
+
const { setQueries, setPlugin, panelDefinition } = (0, _usePanelEditor.usePanelEditor)(initialPanelDef);
|
|
42
|
+
const { plugin } = panelDefinition.spec;
|
|
43
43
|
var _panelDefinition_spec_queries;
|
|
44
44
|
const queries = (_panelDefinition_spec_queries = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries !== void 0 ? _panelDefinition_spec_queries : [];
|
|
45
45
|
// Use common plugin editor logic even though we've split the inputs up in this form
|
|
@@ -57,7 +57,7 @@ function PanelEditorForm(props) {
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
const onChange = (queries)=>setQueries(queries);
|
|
60
|
-
const { handleQueryChange
|
|
60
|
+
const { handleQueryChange, handleQueryAdd, handleQueryCollapseExpand, handleQueryDelete, queriesCollapsed, defaultTimeSeriesQueryKind } = (0, _useTimeSeriesQueryEditorActions.useTimeSeriesQueryEditorActions)({
|
|
61
61
|
onChange,
|
|
62
62
|
queries
|
|
63
63
|
});
|
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "TimeSeriesQueryEditor", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _TimeSeriesQueryInput = require("./TimeSeriesQueryInput");
|
|
25
25
|
function TimeSeriesQueryEditor(props) {
|
|
26
|
-
const { queries
|
|
26
|
+
const { queries, handleQueryChange, handleQueryCollapseExpand, handleQueryDelete, queriesCollapsed, defaultTimeSeriesQueryKind } = props;
|
|
27
27
|
const hasMoreThanOneQuery = queries.length > 1;
|
|
28
28
|
const queryDefinitions = queries.length ? queries : [
|
|
29
29
|
{
|
|
@@ -33,7 +33,7 @@ function _interop_require_default(obj) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
function TimeSeriesQueryInput(props) {
|
|
36
|
-
const { index
|
|
36
|
+
const { index, query, isCollapsed, onDelete, onChange, onCollapseExpand } = props;
|
|
37
37
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
38
38
|
spacing: 1,
|
|
39
39
|
children: [
|
|
@@ -76,8 +76,8 @@ function TimeSeriesQueryInput(props) {
|
|
|
76
76
|
}, index);
|
|
77
77
|
}
|
|
78
78
|
function QueryEditor(props) {
|
|
79
|
-
const { value
|
|
80
|
-
const { spec: { plugin
|
|
79
|
+
const { value, onChange, ...others } = props;
|
|
80
|
+
const { spec: { plugin } } = value;
|
|
81
81
|
const handlePluginChange = (next)=>{
|
|
82
82
|
onChange((0, _immer.default)(value, (draft)=>{
|
|
83
83
|
draft.spec.plugin = next;
|
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "usePanelEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _react = require("react");
|
|
24
24
|
const usePanelEditor = (panelDefinition)=>{
|
|
25
|
-
const { display
|
|
25
|
+
const { display, plugin: pluginDefinition, queries: initialQueries } = panelDefinition.spec;
|
|
26
26
|
const [name, setName] = (0, _react.useState)(display.name);
|
|
27
27
|
const [description, setDescription] = (0, _react.useState)(display.description);
|
|
28
28
|
const [plugin, setPlugin] = (0, _react.useState)(pluginDefinition);
|
|
@@ -47,7 +47,7 @@ const usePanelEditor = (panelDefinition)=>{
|
|
|
47
47
|
]);
|
|
48
48
|
// reset panel definition
|
|
49
49
|
const setPanelDefinition = (0, _react.useCallback)((panelDefinition)=>{
|
|
50
|
-
const { display
|
|
50
|
+
const { display, plugin, queries } = panelDefinition.spec;
|
|
51
51
|
setName(display.name);
|
|
52
52
|
setDescription(display.description);
|
|
53
53
|
setPlugin(plugin);
|
|
@@ -30,11 +30,11 @@ function _interop_require_default(obj) {
|
|
|
30
30
|
}
|
|
31
31
|
const DEFAULT_QUERY_PLUGIN_TYPE = 'TimeSeriesQuery';
|
|
32
32
|
const useTimeSeriesQueryEditorActions = (props)=>{
|
|
33
|
-
const { queries
|
|
34
|
-
const { defaultPluginKinds
|
|
33
|
+
const { queries, onChange } = props;
|
|
34
|
+
const { defaultPluginKinds } = (0, _pluginsystem.usePluginRegistry)();
|
|
35
35
|
var _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE;
|
|
36
36
|
const defaultTimeSeriesQueryKind = (_defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds[DEFAULT_QUERY_PLUGIN_TYPE]) !== null && _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE !== void 0 ? _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE : '';
|
|
37
|
-
const { data: defaultQueryPlugin
|
|
37
|
+
const { data: defaultQueryPlugin } = (0, _pluginsystem.usePlugin)(DEFAULT_QUERY_PLUGIN_TYPE, defaultTimeSeriesQueryKind, {
|
|
38
38
|
useErrorBoundary: true,
|
|
39
39
|
enabled: true
|
|
40
40
|
});
|
|
@@ -28,7 +28,7 @@ const _components = require("@perses-dev/components");
|
|
|
28
28
|
const _dashboards = require("@perses-dev/dashboards");
|
|
29
29
|
const _ViewExploreApp = require("./ViewExploreApp");
|
|
30
30
|
function ViewExplore(props) {
|
|
31
|
-
const { dashboardResource
|
|
31
|
+
const { dashboardResource, datasourceApi, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;
|
|
32
32
|
const initialTimeRange = (0, _pluginsystem.useInitialTimeRange)(_core.DEFAULT_DASHBOARD_DURATION);
|
|
33
33
|
const initialRefreshInterval = (0, _pluginsystem.useInitialRefreshInterval)(_core.DEFAULT_REFRESH_INTERVAL);
|
|
34
34
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.DatasourceStoreProvider, {
|
|
@@ -25,7 +25,7 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
26
|
const _PanelEditorForm = require("../../components/PanelEditor/PanelEditorForm");
|
|
27
27
|
function ViewExploreApp(props) {
|
|
28
|
-
const { exploreTitleComponent
|
|
28
|
+
const { exploreTitleComponent } = props;
|
|
29
29
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
30
30
|
const data = {
|
|
31
31
|
groupId: 0,
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
export interface ExploreToolbarProps {
|
|
3
3
|
exploreTitleComponent?: JSX.Element;
|
|
4
4
|
}
|
|
5
|
-
export declare const ExploreToolbar: (props: ExploreToolbarProps) => JSX.Element;
|
|
5
|
+
export declare const ExploreToolbar: (props: ExploreToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=ExploreToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExploreToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ExploreToolbar/ExploreToolbar.tsx"],"names":[],"mappings":";AAgBA,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ExploreToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ExploreToolbar/ExploreToolbar.tsx"],"names":[],"mappings":";AAgBA,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,4CAuBxD,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { Stack, Box, useTheme, useMediaQuery } from '@mui/material';
|
|
15
15
|
import { TimeRangeControls } from '@perses-dev/dashboards';
|
|
16
16
|
export const ExploreToolbar = (props)=>{
|
|
17
|
-
const { exploreTitleComponent
|
|
17
|
+
const { exploreTitleComponent } = props;
|
|
18
18
|
const isBiggerThanLg = useMediaQuery(useTheme().breakpoints.up('lg'));
|
|
19
19
|
const testId = 'explore-toolbar';
|
|
20
20
|
return /*#__PURE__*/ _jsx(Stack, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ExploreToolbar/ExploreToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, Box, useTheme, useMediaQuery } from '@mui/material';\nimport { TimeRangeControls } from '@perses-dev/dashboards';\n\nexport interface ExploreToolbarProps {\n exploreTitleComponent?: JSX.Element;\n}\n\nexport const ExploreToolbar = (props: ExploreToolbarProps) => {\n const { exploreTitleComponent } = props;\n\n const isBiggerThanLg = useMediaQuery(useTheme().breakpoints.up('lg'));\n\n const testId = 'explore-toolbar';\n\n return (\n <Stack data-testid={testId}>\n <Box sx={{ display: 'flex', width: '100%' }}>\n {exploreTitleComponent}\n <Stack\n direction=\"row\"\n spacing={1}\n ml=\"auto\"\n flexWrap={isBiggerThanLg ? 'nowrap' : 'wrap-reverse'}\n justifyContent=\"end\"\n >\n <TimeRangeControls />\n </Stack>\n </Box>\n </Stack>\n );\n};\n"],"names":["Stack","Box","useTheme","useMediaQuery","TimeRangeControls","ExploreToolbar","props","exploreTitleComponent","isBiggerThanLg","breakpoints","up","testId","data-testid","sx","display","width","direction","spacing","ml","flexWrap","justifyContent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,gBAAgB;AACpE,SAASC,iBAAiB,QAAQ,yBAAyB;AAM3D,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ExploreToolbar/ExploreToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, Box, useTheme, useMediaQuery } from '@mui/material';\nimport { TimeRangeControls } from '@perses-dev/dashboards';\n\nexport interface ExploreToolbarProps {\n exploreTitleComponent?: JSX.Element;\n}\n\nexport const ExploreToolbar = (props: ExploreToolbarProps) => {\n const { exploreTitleComponent } = props;\n\n const isBiggerThanLg = useMediaQuery(useTheme().breakpoints.up('lg'));\n\n const testId = 'explore-toolbar';\n\n return (\n <Stack data-testid={testId}>\n <Box sx={{ display: 'flex', width: '100%' }}>\n {exploreTitleComponent}\n <Stack\n direction=\"row\"\n spacing={1}\n ml=\"auto\"\n flexWrap={isBiggerThanLg ? 'nowrap' : 'wrap-reverse'}\n justifyContent=\"end\"\n >\n <TimeRangeControls />\n </Stack>\n </Box>\n </Stack>\n );\n};\n"],"names":["Stack","Box","useTheme","useMediaQuery","TimeRangeControls","ExploreToolbar","props","exploreTitleComponent","isBiggerThanLg","breakpoints","up","testId","data-testid","sx","display","width","direction","spacing","ml","flexWrap","justifyContent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,gBAAgB;AACpE,SAASC,iBAAiB,QAAQ,yBAAyB;AAM3D,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAME,iBAAiBL,cAAcD,WAAWO,WAAW,CAACC,EAAE,CAAC;IAE/D,MAAMC,SAAS;IAEf,qBACE,KAACX;QAAMY,eAAaD;kBAClB,cAAA,MAACV;YAAIY,IAAI;gBAAEC,SAAS;gBAAQC,OAAO;YAAO;;gBACvCR;8BACD,KAACP;oBACCgB,WAAU;oBACVC,SAAS;oBACTC,IAAG;oBACHC,UAAUX,iBAAiB,WAAW;oBACtCY,gBAAe;8BAEf,cAAA,KAAChB;;;;;AAKX,EAAE"}
|
|
@@ -11,5 +11,5 @@ export interface PanelSpecEditorProps {
|
|
|
11
11
|
onQueriesChange: (queries: QueryDefinition[]) => void;
|
|
12
12
|
onPluginSpecChange: (spec: UnknownSpec) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function PanelEditorForm(props: PanelEditorProps): JSX.Element;
|
|
14
|
+
export declare function PanelEditorForm(props: PanelEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
//# sourceMappingURL=PanelEditorForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEditor/PanelEditorForm.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,wBAAwB,CAAC;AAMzE,OAAO,EAAE,MAAM,EAAc,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOrG,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,iBAAiB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACtD,kBAAkB,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CACjD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"PanelEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEditor/PanelEditorForm.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,wBAAwB,CAAC;AAMzE,OAAO,EAAE,MAAM,EAAc,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOrG,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,iBAAiB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACtD,kBAAkB,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CACjD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,2CAyEtD"}
|
|
@@ -22,9 +22,9 @@ import { ExploreToolbar } from '../ExploreToolbar';
|
|
|
22
22
|
import { useTimeSeriesQueryEditorActions } from '../../context/useTimeSeriesQueryEditorActions';
|
|
23
23
|
import { usePanelEditor } from '../../context/usePanelEditor';
|
|
24
24
|
export function PanelEditorForm(props) {
|
|
25
|
-
const { exploreTitleComponent
|
|
26
|
-
const { setQueries
|
|
27
|
-
const { plugin
|
|
25
|
+
const { exploreTitleComponent, initialValues: { panelDefinition: initialPanelDef } } = props;
|
|
26
|
+
const { setQueries, setPlugin, panelDefinition } = usePanelEditor(initialPanelDef);
|
|
27
|
+
const { plugin } = panelDefinition.spec;
|
|
28
28
|
var _panelDefinition_spec_queries;
|
|
29
29
|
const queries = (_panelDefinition_spec_queries = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries !== void 0 ? _panelDefinition_spec_queries : [];
|
|
30
30
|
// Use common plugin editor logic even though we've split the inputs up in this form
|
|
@@ -42,7 +42,7 @@ export function PanelEditorForm(props) {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
const onChange = (queries)=>setQueries(queries);
|
|
45
|
-
const { handleQueryChange
|
|
45
|
+
const { handleQueryChange, handleQueryAdd, handleQueryCollapseExpand, handleQueryDelete, queriesCollapsed, defaultTimeSeriesQueryKind } = useTimeSeriesQueryEditorActions({
|
|
46
46
|
onChange,
|
|
47
47
|
queries
|
|
48
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PanelEditor/PanelEditorForm.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelEditorValues, PanelPreview } from '@perses-dev/dashboards';\nimport { usePluginEditor } from '@perses-dev/plugin-system';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { Button, Grid, Stack, Typography } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { Action, Definition, PanelDefinition, QueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport { SetStateAction } from 'react';\nimport { TimeSeriesQueryEditor } from '../TimeSeriesQueryEditor';\nimport { ExploreToolbar } from '../ExploreToolbar';\nimport { useTimeSeriesQueryEditorActions } from '../../context/useTimeSeriesQueryEditorActions';\nimport { usePanelEditor } from '../../context/usePanelEditor';\n\nexport interface PanelEditorProps {\n initialValues: PanelEditorValues;\n initialAction: Action;\n exploreTitleComponent?: JSX.Element;\n}\n\nexport interface PanelSpecEditorProps {\n panelDefinition: PanelDefinition;\n onQueriesChange: (queries: QueryDefinition[]) => void;\n onPluginSpecChange: (spec: UnknownSpec) => void;\n}\n\nexport function PanelEditorForm(props: PanelEditorProps) {\n const {\n exploreTitleComponent,\n initialValues: { panelDefinition: initialPanelDef },\n } = props;\n\n const { setQueries, setPlugin, panelDefinition } = usePanelEditor(initialPanelDef);\n const { plugin } = panelDefinition.spec;\n const queries = panelDefinition.spec.queries ?? [];\n\n // Use common plugin editor logic even though we've split the inputs up in this form\n const pluginEditor = usePluginEditor({\n pluginType: 'Panel',\n value: { kind: plugin.kind, spec: plugin.spec },\n onChange: (plugin: SetStateAction<Definition<UnknownSpec>>) => {\n setPlugin(plugin);\n },\n onHideQueryEditorChange: (isHidden: boolean | undefined) => {\n setQueries(undefined, isHidden);\n },\n });\n\n const onChange = (queries: QueryDefinition[]) => setQueries(queries);\n\n const {\n handleQueryChange,\n handleQueryAdd,\n handleQueryCollapseExpand,\n handleQueryDelete,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n } = useTimeSeriesQueryEditorActions({ onChange, queries });\n\n const form = useForm({\n mode: 'onBlur',\n defaultValues: {\n type: pluginEditor.pendingKind ? pluginEditor.pendingKind : plugin.kind,\n },\n });\n\n return (\n <Stack sx={{ width: '100%' }} px={2} pb={2} pt={1.5} gap={2}>\n <ExploreToolbar exploreTitleComponent={exploreTitleComponent} />\n <FormProvider {...form}>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Stack gap={1}>\n {/* Maybe in the future we should have something like PanelSpecEditor as we have on the Dashboard System */}\n <TimeSeriesQueryEditor\n handleQueryChange={handleQueryChange}\n handleQueryCollapseExpand={handleQueryCollapseExpand}\n handleQueryDelete={handleQueryDelete}\n queriesCollapsed={queriesCollapsed}\n queries={queries}\n defaultTimeSeriesQueryKind={defaultTimeSeriesQueryKind}\n />\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginRight: 'auto' }} onClick={handleQueryAdd}>\n Add Query\n </Button>\n </Stack>\n </Grid>\n <Grid item xs={12}>\n <Stack gap={1}>\n <Typography variant=\"h4\">Preview</Typography>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <PanelPreview panelDefinition={panelDefinition} />\n </ErrorBoundary>\n </Stack>\n </Grid>\n </Grid>\n </FormProvider>\n </Stack>\n );\n}\n"],"names":["PanelPreview","usePluginEditor","FormProvider","useForm","Button","Grid","Stack","Typography","AddIcon","ErrorAlert","ErrorBoundary","TimeSeriesQueryEditor","ExploreToolbar","useTimeSeriesQueryEditorActions","usePanelEditor","PanelEditorForm","props","exploreTitleComponent","initialValues","panelDefinition","initialPanelDef","setQueries","setPlugin","plugin","spec","queries","pluginEditor","pluginType","value","kind","onChange","onHideQueryEditorChange","isHidden","undefined","handleQueryChange","handleQueryAdd","handleQueryCollapseExpand","handleQueryDelete","queriesCollapsed","defaultTimeSeriesQueryKind","form","mode","defaultValues","type","pendingKind","sx","width","px","pb","pt","gap","container","spacing","item","xs","variant","startIcon","marginRight","onClick","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAA4BA,YAAY,QAAQ,yBAAyB;AACzE,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,YAAY,EAAEC,OAAO,QAAQ,kBAAkB;AACxD,SAASC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAChE,OAAOC,aAAa,uBAAuB;AAC3C,SAASC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAGnE,SAASC,qBAAqB,QAAQ,2BAA2B;AACjE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,+BAA+B,QAAQ,gDAAgD;AAChG,SAASC,cAAc,QAAQ,+BAA+B;AAc9D,OAAO,SAASC,gBAAgBC,KAAuB;IACrD,MAAM,EACJC,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/PanelEditor/PanelEditorForm.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelEditorValues, PanelPreview } from '@perses-dev/dashboards';\nimport { usePluginEditor } from '@perses-dev/plugin-system';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { Button, Grid, Stack, Typography } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { Action, Definition, PanelDefinition, QueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport { SetStateAction } from 'react';\nimport { TimeSeriesQueryEditor } from '../TimeSeriesQueryEditor';\nimport { ExploreToolbar } from '../ExploreToolbar';\nimport { useTimeSeriesQueryEditorActions } from '../../context/useTimeSeriesQueryEditorActions';\nimport { usePanelEditor } from '../../context/usePanelEditor';\n\nexport interface PanelEditorProps {\n initialValues: PanelEditorValues;\n initialAction: Action;\n exploreTitleComponent?: JSX.Element;\n}\n\nexport interface PanelSpecEditorProps {\n panelDefinition: PanelDefinition;\n onQueriesChange: (queries: QueryDefinition[]) => void;\n onPluginSpecChange: (spec: UnknownSpec) => void;\n}\n\nexport function PanelEditorForm(props: PanelEditorProps) {\n const {\n exploreTitleComponent,\n initialValues: { panelDefinition: initialPanelDef },\n } = props;\n\n const { setQueries, setPlugin, panelDefinition } = usePanelEditor(initialPanelDef);\n const { plugin } = panelDefinition.spec;\n const queries = panelDefinition.spec.queries ?? [];\n\n // Use common plugin editor logic even though we've split the inputs up in this form\n const pluginEditor = usePluginEditor({\n pluginType: 'Panel',\n value: { kind: plugin.kind, spec: plugin.spec },\n onChange: (plugin: SetStateAction<Definition<UnknownSpec>>) => {\n setPlugin(plugin);\n },\n onHideQueryEditorChange: (isHidden: boolean | undefined) => {\n setQueries(undefined, isHidden);\n },\n });\n\n const onChange = (queries: QueryDefinition[]) => setQueries(queries);\n\n const {\n handleQueryChange,\n handleQueryAdd,\n handleQueryCollapseExpand,\n handleQueryDelete,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n } = useTimeSeriesQueryEditorActions({ onChange, queries });\n\n const form = useForm({\n mode: 'onBlur',\n defaultValues: {\n type: pluginEditor.pendingKind ? pluginEditor.pendingKind : plugin.kind,\n },\n });\n\n return (\n <Stack sx={{ width: '100%' }} px={2} pb={2} pt={1.5} gap={2}>\n <ExploreToolbar exploreTitleComponent={exploreTitleComponent} />\n <FormProvider {...form}>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Stack gap={1}>\n {/* Maybe in the future we should have something like PanelSpecEditor as we have on the Dashboard System */}\n <TimeSeriesQueryEditor\n handleQueryChange={handleQueryChange}\n handleQueryCollapseExpand={handleQueryCollapseExpand}\n handleQueryDelete={handleQueryDelete}\n queriesCollapsed={queriesCollapsed}\n queries={queries}\n defaultTimeSeriesQueryKind={defaultTimeSeriesQueryKind}\n />\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginRight: 'auto' }} onClick={handleQueryAdd}>\n Add Query\n </Button>\n </Stack>\n </Grid>\n <Grid item xs={12}>\n <Stack gap={1}>\n <Typography variant=\"h4\">Preview</Typography>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <PanelPreview panelDefinition={panelDefinition} />\n </ErrorBoundary>\n </Stack>\n </Grid>\n </Grid>\n </FormProvider>\n </Stack>\n );\n}\n"],"names":["PanelPreview","usePluginEditor","FormProvider","useForm","Button","Grid","Stack","Typography","AddIcon","ErrorAlert","ErrorBoundary","TimeSeriesQueryEditor","ExploreToolbar","useTimeSeriesQueryEditorActions","usePanelEditor","PanelEditorForm","props","exploreTitleComponent","initialValues","panelDefinition","initialPanelDef","setQueries","setPlugin","plugin","spec","queries","pluginEditor","pluginType","value","kind","onChange","onHideQueryEditorChange","isHidden","undefined","handleQueryChange","handleQueryAdd","handleQueryCollapseExpand","handleQueryDelete","queriesCollapsed","defaultTimeSeriesQueryKind","form","mode","defaultValues","type","pendingKind","sx","width","px","pb","pt","gap","container","spacing","item","xs","variant","startIcon","marginRight","onClick","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAA4BA,YAAY,QAAQ,yBAAyB;AACzE,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,YAAY,EAAEC,OAAO,QAAQ,kBAAkB;AACxD,SAASC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAChE,OAAOC,aAAa,uBAAuB;AAC3C,SAASC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAGnE,SAASC,qBAAqB,QAAQ,2BAA2B;AACjE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,+BAA+B,QAAQ,gDAAgD;AAChG,SAASC,cAAc,QAAQ,+BAA+B;AAc9D,OAAO,SAASC,gBAAgBC,KAAuB;IACrD,MAAM,EACJC,qBAAqB,EACrBC,eAAe,EAAEC,iBAAiBC,eAAe,EAAE,EACpD,GAAGJ;IAEJ,MAAM,EAAEK,UAAU,EAAEC,SAAS,EAAEH,eAAe,EAAE,GAAGL,eAAeM;IAClE,MAAM,EAAEG,MAAM,EAAE,GAAGJ,gBAAgBK,IAAI;QACvBL;IAAhB,MAAMM,UAAUN,CAAAA,gCAAAA,gBAAgBK,IAAI,CAACC,OAAO,cAA5BN,2CAAAA,gCAAgC,EAAE;IAElD,oFAAoF;IACpF,MAAMO,eAAezB,gBAAgB;QACnC0B,YAAY;QACZC,OAAO;YAAEC,MAAMN,OAAOM,IAAI;YAAEL,MAAMD,OAAOC,IAAI;QAAC;QAC9CM,UAAU,CAACP;YACTD,UAAUC;QACZ;QACAQ,yBAAyB,CAACC;YACxBX,WAAWY,WAAWD;QACxB;IACF;IAEA,MAAMF,WAAW,CAACL,UAA+BJ,WAAWI;IAE5D,MAAM,EACJS,iBAAiB,EACjBC,cAAc,EACdC,yBAAyB,EACzBC,iBAAiB,EACjBC,gBAAgB,EAChBC,0BAA0B,EAC3B,GAAG1B,gCAAgC;QAAEiB;QAAUL;IAAQ;IAExD,MAAMe,OAAOrC,QAAQ;QACnBsC,MAAM;QACNC,eAAe;YACbC,MAAMjB,aAAakB,WAAW,GAAGlB,aAAakB,WAAW,GAAGrB,OAAOM,IAAI;QACzE;IACF;IAEA,qBACE,MAACvB;QAAMuC,IAAI;YAAEC,OAAO;QAAO;QAAGC,IAAI;QAAGC,IAAI;QAAGC,IAAI;QAAKC,KAAK;;0BACxD,KAACtC;gBAAeK,uBAAuBA;;0BACvC,KAACf;gBAAc,GAAGsC,IAAI;0BACpB,cAAA,MAACnC;oBAAK8C,SAAS;oBAACC,SAAS;;sCACvB,KAAC/C;4BAAKgD,IAAI;4BAACC,IAAI;sCACb,cAAA,MAAChD;gCAAM4C,KAAK;;kDAEV,KAACvC;wCACCuB,mBAAmBA;wCACnBE,2BAA2BA;wCAC3BC,mBAAmBA;wCACnBC,kBAAkBA;wCAClBb,SAASA;wCACTc,4BAA4BA;;kDAE9B,KAACnC;wCAAOmD,SAAQ;wCAAYC,yBAAW,KAAChD;wCAAYqC,IAAI;4CAAEY,aAAa;wCAAO;wCAAGC,SAASvB;kDAAgB;;;;;sCAK9G,KAAC9B;4BAAKgD,IAAI;4BAACC,IAAI;sCACb,cAAA,MAAChD;gCAAM4C,KAAK;;kDACV,KAAC3C;wCAAWgD,SAAQ;kDAAK;;kDACzB,KAAC7C;wCAAciD,mBAAmBlD;kDAChC,cAAA,KAACT;4CAAamB,iBAAiBA;;;;;;;;;;;AAQ/C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/core';
|
|
3
2
|
export interface TimeSeriesQueryEditorProps {
|
|
4
3
|
queries: QueryDefinition[];
|
|
@@ -8,5 +7,5 @@ export interface TimeSeriesQueryEditorProps {
|
|
|
8
7
|
handleQueryCollapseExpand: (index: number) => void;
|
|
9
8
|
defaultTimeSeriesQueryKind: string;
|
|
10
9
|
}
|
|
11
|
-
export declare function TimeSeriesQueryEditor(props: TimeSeriesQueryEditorProps): JSX.Element;
|
|
10
|
+
export declare function TimeSeriesQueryEditor(props: TimeSeriesQueryEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
//# sourceMappingURL=TimeSeriesQueryEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG9E,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChF,gBAAgB,EAAE,OAAO,EAAE,CAAC;IAC5B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,yBAAyB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CA0CtE"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { TimeSeriesQueryInput } from './TimeSeriesQueryInput';
|
|
15
15
|
export function TimeSeriesQueryEditor(props) {
|
|
16
|
-
const { queries
|
|
16
|
+
const { queries, handleQueryChange, handleQueryCollapseExpand, handleQueryDelete, queriesCollapsed, defaultTimeSeriesQueryKind } = props;
|
|
17
17
|
const hasMoreThanOneQuery = queries.length > 1;
|
|
18
18
|
const queryDefinitions = queries.length ? queries : [
|
|
19
19
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { TimeSeriesQueryInput } from './TimeSeriesQueryInput';\n\nexport interface TimeSeriesQueryEditorProps {\n queries: QueryDefinition[];\n handleQueryChange: (index: number, queryDef: TimeSeriesQueryDefinition) => void;\n queriesCollapsed: boolean[];\n handleQueryDelete: (index: number) => void;\n handleQueryCollapseExpand: (index: number) => void;\n defaultTimeSeriesQueryKind: string;\n}\n\nexport function TimeSeriesQueryEditor(props: TimeSeriesQueryEditorProps) {\n const {\n queries,\n handleQueryChange,\n handleQueryCollapseExpand,\n handleQueryDelete,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n } = props;\n\n const hasMoreThanOneQuery = queries.length > 1;\n const queryDefinitions: TimeSeriesQueryDefinition[] = queries.length\n ? queries\n : [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: defaultTimeSeriesQueryKind,\n spec: {\n query: '',\n },\n },\n },\n },\n ];\n\n return (\n <>\n {queryDefinitions.map((query: TimeSeriesQueryDefinition, i: number) => (\n <TimeSeriesQueryInput\n key={i}\n index={i}\n query={query}\n onChange={handleQueryChange}\n isCollapsed={!!queriesCollapsed[i]}\n onDelete={hasMoreThanOneQuery ? handleQueryDelete : undefined}\n onCollapseExpand={handleQueryCollapseExpand}\n />\n ))}\n </>\n );\n}\n"],"names":["TimeSeriesQueryInput","TimeSeriesQueryEditor","props","queries","handleQueryChange","handleQueryCollapseExpand","handleQueryDelete","queriesCollapsed","defaultTimeSeriesQueryKind","hasMoreThanOneQuery","length","queryDefinitions","kind","spec","plugin","query","map","i","index","onChange","isCollapsed","onDelete","undefined","onCollapseExpand"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAW9D,OAAO,SAASC,sBAAsBC,KAAiC;IACrE,MAAM,EACJC,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { TimeSeriesQueryInput } from './TimeSeriesQueryInput';\n\nexport interface TimeSeriesQueryEditorProps {\n queries: QueryDefinition[];\n handleQueryChange: (index: number, queryDef: TimeSeriesQueryDefinition) => void;\n queriesCollapsed: boolean[];\n handleQueryDelete: (index: number) => void;\n handleQueryCollapseExpand: (index: number) => void;\n defaultTimeSeriesQueryKind: string;\n}\n\nexport function TimeSeriesQueryEditor(props: TimeSeriesQueryEditorProps) {\n const {\n queries,\n handleQueryChange,\n handleQueryCollapseExpand,\n handleQueryDelete,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n } = props;\n\n const hasMoreThanOneQuery = queries.length > 1;\n const queryDefinitions: TimeSeriesQueryDefinition[] = queries.length\n ? queries\n : [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: defaultTimeSeriesQueryKind,\n spec: {\n query: '',\n },\n },\n },\n },\n ];\n\n return (\n <>\n {queryDefinitions.map((query: TimeSeriesQueryDefinition, i: number) => (\n <TimeSeriesQueryInput\n key={i}\n index={i}\n query={query}\n onChange={handleQueryChange}\n isCollapsed={!!queriesCollapsed[i]}\n onDelete={hasMoreThanOneQuery ? handleQueryDelete : undefined}\n onCollapseExpand={handleQueryCollapseExpand}\n />\n ))}\n </>\n );\n}\n"],"names":["TimeSeriesQueryInput","TimeSeriesQueryEditor","props","queries","handleQueryChange","handleQueryCollapseExpand","handleQueryDelete","queriesCollapsed","defaultTimeSeriesQueryKind","hasMoreThanOneQuery","length","queryDefinitions","kind","spec","plugin","query","map","i","index","onChange","isCollapsed","onDelete","undefined","onCollapseExpand"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAW9D,OAAO,SAASC,sBAAsBC,KAAiC;IACrE,MAAM,EACJC,OAAO,EACPC,iBAAiB,EACjBC,yBAAyB,EACzBC,iBAAiB,EACjBC,gBAAgB,EAChBC,0BAA0B,EAC3B,GAAGN;IAEJ,MAAMO,sBAAsBN,QAAQO,MAAM,GAAG;IAC7C,MAAMC,mBAAgDR,QAAQO,MAAM,GAChEP,UACA;QACE;YACES,MAAM;YACNC,MAAM;gBACJC,QAAQ;oBACNF,MAAMJ;oBACNK,MAAM;wBACJE,OAAO;oBACT;gBACF;YACF;QACF;KACD;IAEL,qBACE;kBACGJ,iBAAiBK,GAAG,CAAC,CAACD,OAAkCE,kBACvD,KAACjB;gBAECkB,OAAOD;gBACPF,OAAOA;gBACPI,UAAUf;gBACVgB,aAAa,CAAC,CAACb,gBAAgB,CAACU,EAAE;gBAClCI,UAAUZ,sBAAsBH,oBAAoBgB;gBACpDC,kBAAkBlB;eANbY;;AAWf"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TimeSeriesQueryDefinition } from '@perses-dev/core';
|
|
3
2
|
export interface TimeSeriesQueryInputProps {
|
|
4
3
|
query: TimeSeriesQueryDefinition;
|
|
@@ -8,5 +7,5 @@ export interface TimeSeriesQueryInputProps {
|
|
|
8
7
|
onDelete?: (index: number) => void;
|
|
9
8
|
isCollapsed?: boolean;
|
|
10
9
|
}
|
|
11
|
-
export declare function TimeSeriesQueryInput(props: TimeSeriesQueryInputProps): JSX.Element;
|
|
10
|
+
export declare function TimeSeriesQueryInput(props: TimeSeriesQueryInputProps): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
//# sourceMappingURL=TimeSeriesQueryInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeSeriesQueryInput.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeSeriesQueryInput.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAc,yBAAyB,EAAe,MAAM,kBAAkB,CAAC;AAKtF,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,yBAAyB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACpE,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAuBpE"}
|
|
@@ -18,7 +18,7 @@ import DeleteIcon from 'mdi-material-ui/DeleteOutline';
|
|
|
18
18
|
import { PluginEditor } from '@perses-dev/plugin-system';
|
|
19
19
|
import produce from 'immer';
|
|
20
20
|
export function TimeSeriesQueryInput(props) {
|
|
21
|
-
const { index
|
|
21
|
+
const { index, query, isCollapsed, onDelete, onChange, onCollapseExpand } = props;
|
|
22
22
|
return /*#__PURE__*/ _jsxs(Stack, {
|
|
23
23
|
spacing: 1,
|
|
24
24
|
children: [
|
|
@@ -61,8 +61,8 @@ export function TimeSeriesQueryInput(props) {
|
|
|
61
61
|
}, index);
|
|
62
62
|
}
|
|
63
63
|
function QueryEditor(props) {
|
|
64
|
-
const { value
|
|
65
|
-
const { spec: { plugin
|
|
64
|
+
const { value, onChange, ...others } = props;
|
|
65
|
+
const { spec: { plugin } } = value;
|
|
66
66
|
const handlePluginChange = (next)=>{
|
|
67
67
|
onChange(produce(value, (draft)=>{
|
|
68
68
|
draft.spec.plugin = next;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps, IconButton, Stack, Typography } from '@mui/material';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport { Definition, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport { PluginEditor, PluginEditorProps } from '@perses-dev/plugin-system';\nimport produce from 'immer';\nimport { WritableDraft } from 'immer/dist/internal';\n\nexport interface TimeSeriesQueryInputProps {\n query: TimeSeriesQueryDefinition;\n index: number;\n onChange: (index: number, query: TimeSeriesQueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n onDelete?: (index: number) => void;\n isCollapsed?: boolean;\n}\n\nexport function TimeSeriesQueryInput(props: TimeSeriesQueryInputProps) {\n const { index, query, isCollapsed, onDelete, onChange, onCollapseExpand } = props;\n return (\n <Stack key={index} spacing={1}>\n <Stack direction=\"row\" alignItems=\"center\" borderBottom={1} borderColor={(theme) => theme.palette.divider}>\n <IconButton size=\"small\" onClick={() => onCollapseExpand(index)}>\n {isCollapsed ? <ChevronRight /> : <ChevronDown />}\n </IconButton>\n <Typography variant=\"overline\" component=\"h4\">\n Query {index + 1}\n </Typography>\n <IconButton\n size=\"small\"\n // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible\n sx={{ marginLeft: 'auto', visibility: `${onDelete ? 'visible' : 'hidden'}` }}\n onClick={() => onDelete && onDelete(index)}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n {!isCollapsed && <QueryEditor value={query} onChange={(next) => onChange(index, next)} />}\n </Stack>\n );\n}\n\n// Props on MUI Box that we don't want people to pass because we're either redefining them or providing them in\n// this component\ntype OmittedMuiProps = 'children' | 'value' | 'onChange';\n\ninterface QueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n value: TimeSeriesQueryDefinition;\n onChange: (next: TimeSeriesQueryDefinition) => void;\n}\n\nfunction QueryEditor(props: QueryEditorProps) {\n const { value, onChange, ...others } = props;\n const {\n spec: { plugin },\n } = value;\n\n const handlePluginChange: PluginEditorProps['onChange'] = (next: WritableDraft<Definition<UnknownSpec>>) => {\n onChange(\n produce(value, (draft) => {\n draft.spec.plugin = next;\n })\n );\n };\n\n return (\n <Box {...others}>\n {/* If TimeSeriesQuery plugins ever have common props on the definition, the inputs could go here */}\n <PluginEditor\n isExplore={true}\n pluginType=\"TimeSeriesQuery\"\n pluginKindLabel=\"Query Type\"\n value={plugin}\n onChange={handlePluginChange}\n />\n </Box>\n );\n}\n"],"names":["Box","IconButton","Stack","Typography","ChevronDown","ChevronRight","DeleteIcon","PluginEditor","produce","TimeSeriesQueryInput","props","index","query","isCollapsed","onDelete","onChange","onCollapseExpand","spacing","direction","alignItems","borderBottom","borderColor","theme","palette","divider","size","onClick","variant","component","sx","marginLeft","visibility","QueryEditor","value","next","others","spec","plugin","handlePluginChange","draft","isExplore","pluginType","pluginKindLabel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAYC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAC7E,OAAOC,iBAAiB,8BAA8B;AACtD,OAAOC,kBAAkB,+BAA+B;AACxD,OAAOC,gBAAgB,gCAAgC;AAEvD,SAASC,YAAY,QAA2B,4BAA4B;AAC5E,OAAOC,aAAa,QAAQ;AAY5B,OAAO,SAASC,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps, IconButton, Stack, Typography } from '@mui/material';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport { Definition, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport { PluginEditor, PluginEditorProps } from '@perses-dev/plugin-system';\nimport produce from 'immer';\nimport { WritableDraft } from 'immer/dist/internal';\n\nexport interface TimeSeriesQueryInputProps {\n query: TimeSeriesQueryDefinition;\n index: number;\n onChange: (index: number, query: TimeSeriesQueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n onDelete?: (index: number) => void;\n isCollapsed?: boolean;\n}\n\nexport function TimeSeriesQueryInput(props: TimeSeriesQueryInputProps) {\n const { index, query, isCollapsed, onDelete, onChange, onCollapseExpand } = props;\n return (\n <Stack key={index} spacing={1}>\n <Stack direction=\"row\" alignItems=\"center\" borderBottom={1} borderColor={(theme) => theme.palette.divider}>\n <IconButton size=\"small\" onClick={() => onCollapseExpand(index)}>\n {isCollapsed ? <ChevronRight /> : <ChevronDown />}\n </IconButton>\n <Typography variant=\"overline\" component=\"h4\">\n Query {index + 1}\n </Typography>\n <IconButton\n size=\"small\"\n // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible\n sx={{ marginLeft: 'auto', visibility: `${onDelete ? 'visible' : 'hidden'}` }}\n onClick={() => onDelete && onDelete(index)}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n {!isCollapsed && <QueryEditor value={query} onChange={(next) => onChange(index, next)} />}\n </Stack>\n );\n}\n\n// Props on MUI Box that we don't want people to pass because we're either redefining them or providing them in\n// this component\ntype OmittedMuiProps = 'children' | 'value' | 'onChange';\n\ninterface QueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n value: TimeSeriesQueryDefinition;\n onChange: (next: TimeSeriesQueryDefinition) => void;\n}\n\nfunction QueryEditor(props: QueryEditorProps) {\n const { value, onChange, ...others } = props;\n const {\n spec: { plugin },\n } = value;\n\n const handlePluginChange: PluginEditorProps['onChange'] = (next: WritableDraft<Definition<UnknownSpec>>) => {\n onChange(\n produce(value, (draft) => {\n draft.spec.plugin = next;\n })\n );\n };\n\n return (\n <Box {...others}>\n {/* If TimeSeriesQuery plugins ever have common props on the definition, the inputs could go here */}\n <PluginEditor\n isExplore={true}\n pluginType=\"TimeSeriesQuery\"\n pluginKindLabel=\"Query Type\"\n value={plugin}\n onChange={handlePluginChange}\n />\n </Box>\n );\n}\n"],"names":["Box","IconButton","Stack","Typography","ChevronDown","ChevronRight","DeleteIcon","PluginEditor","produce","TimeSeriesQueryInput","props","index","query","isCollapsed","onDelete","onChange","onCollapseExpand","spacing","direction","alignItems","borderBottom","borderColor","theme","palette","divider","size","onClick","variant","component","sx","marginLeft","visibility","QueryEditor","value","next","others","spec","plugin","handlePluginChange","draft","isExplore","pluginType","pluginKindLabel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAYC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAC7E,OAAOC,iBAAiB,8BAA8B;AACtD,OAAOC,kBAAkB,+BAA+B;AACxD,OAAOC,gBAAgB,gCAAgC;AAEvD,SAASC,YAAY,QAA2B,4BAA4B;AAC5E,OAAOC,aAAa,QAAQ;AAY5B,OAAO,SAASC,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,GAAGN;IAC5E,qBACE,MAACR;QAAkBe,SAAS;;0BAC1B,MAACf;gBAAMgB,WAAU;gBAAMC,YAAW;gBAASC,cAAc;gBAAGC,aAAa,CAACC,QAAUA,MAAMC,OAAO,CAACC,OAAO;;kCACvG,KAACvB;wBAAWwB,MAAK;wBAAQC,SAAS,IAAMV,iBAAiBL;kCACtDE,4BAAc,KAACR,kCAAkB,KAACD;;kCAErC,MAACD;wBAAWwB,SAAQ;wBAAWC,WAAU;;4BAAK;4BACrCjB,QAAQ;;;kCAEjB,KAACV;wBACCwB,MAAK;wBACL,2GAA2G;wBAC3GI,IAAI;4BAAEC,YAAY;4BAAQC,YAAY,CAAC,EAAEjB,WAAW,YAAY,SAAS,CAAC;wBAAC;wBAC3EY,SAAS,IAAMZ,YAAYA,SAASH;kCAEpC,cAAA,KAACL;;;;YAGJ,CAACO,6BAAe,KAACmB;gBAAYC,OAAOrB;gBAAOG,UAAU,CAACmB,OAASnB,SAASJ,OAAOuB;;;OAjBtEvB;AAoBhB;AAWA,SAASqB,YAAYtB,KAAuB;IAC1C,MAAM,EAAEuB,KAAK,EAAElB,QAAQ,EAAE,GAAGoB,QAAQ,GAAGzB;IACvC,MAAM,EACJ0B,MAAM,EAAEC,MAAM,EAAE,EACjB,GAAGJ;IAEJ,MAAMK,qBAAoD,CAACJ;QACzDnB,SACEP,QAAQyB,OAAO,CAACM;YACdA,MAAMH,IAAI,CAACC,MAAM,GAAGH;QACtB;IAEJ;IAEA,qBACE,KAAClC;QAAK,GAAGmC,MAAM;kBAEb,cAAA,KAAC5B;YACCiC,WAAW;YACXC,YAAW;YACXC,iBAAgB;YAChBT,OAAOI;YACPtB,UAAUuB;;;AAIlB"}
|
|
@@ -15,7 +15,7 @@ import { useCallback, useMemo, useState } from 'react';
|
|
|
15
15
|
* UsePanelEditor is used in PanelEditorForm
|
|
16
16
|
* This hook stores the states of panel definition and returns the onChange handlers for each state
|
|
17
17
|
*/ export const usePanelEditor = (panelDefinition)=>{
|
|
18
|
-
const { display
|
|
18
|
+
const { display, plugin: pluginDefinition, queries: initialQueries } = panelDefinition.spec;
|
|
19
19
|
const [name, setName] = useState(display.name);
|
|
20
20
|
const [description, setDescription] = useState(display.description);
|
|
21
21
|
const [plugin, setPlugin] = useState(pluginDefinition);
|
|
@@ -40,7 +40,7 @@ import { useCallback, useMemo, useState } from 'react';
|
|
|
40
40
|
]);
|
|
41
41
|
// reset panel definition
|
|
42
42
|
const setPanelDefinition = useCallback((panelDefinition)=>{
|
|
43
|
-
const { display
|
|
43
|
+
const { display, plugin, queries } = panelDefinition.spec;
|
|
44
44
|
setName(display.name);
|
|
45
45
|
setDescription(display.description);
|
|
46
46
|
setPlugin(plugin);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/usePanelEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback, useMemo, useState } from 'react';\nimport { PanelDefinition, QueryDefinition } from '@perses-dev/core';\n\n/**\n * UsePanelEditor is used in PanelEditorForm\n * This hook stores the states of panel definition and returns the onChange handlers for each state\n */\nexport const usePanelEditor = (panelDefinition: PanelDefinition) => {\n const { display, plugin: pluginDefinition, queries: initialQueries } = panelDefinition.spec;\n const [name, setName] = useState(display.name);\n const [description, setDescription] = useState(display.description);\n const [plugin, setPlugin] = useState(pluginDefinition);\n\n // need to keep track of prevQueries if switching from a panel with no queries (ex: markdown) to one with queries\n const [prevQueries, setPrevQueries] = useState(initialQueries);\n const [currentQueries, setCurrentQueries] = useState(initialQueries);\n\n /**\n * If hideQueryEditor is true, set panelDefinition.spec.queries to undefined.\n * If hideQueryEditor is false and query is undefined, set panelDefinition.spec.queries to previous queries.\n */\n const setQueries = useCallback(\n (queries?: QueryDefinition[], hideQueryEditor?: boolean) => {\n if (hideQueryEditor) {\n setPrevQueries(currentQueries);\n setCurrentQueries(undefined);\n } else {\n setCurrentQueries(queries === undefined ? prevQueries : queries);\n }\n },\n [setCurrentQueries, currentQueries, setPrevQueries, prevQueries]\n );\n\n // reset panel definition\n const setPanelDefinition = useCallback(\n (panelDefinition: PanelDefinition) => {\n const { display, plugin, queries } = panelDefinition.spec;\n setName(display.name);\n setDescription(display.description);\n setPlugin(plugin);\n setQueries(queries);\n },\n [setName, setDescription, setPlugin, setQueries]\n );\n\n return useMemo(\n () => ({\n panelDefinition: {\n kind: 'Panel',\n spec: {\n display: { name, description },\n plugin,\n queries: currentQueries,\n },\n } as PanelDefinition,\n setName,\n setDescription,\n setQueries,\n setPlugin,\n setPanelDefinition,\n }),\n [name, description, plugin, currentQueries, setName, setDescription, setQueries, setPlugin, setPanelDefinition]\n );\n};\n"],"names":["useCallback","useMemo","useState","usePanelEditor","panelDefinition","display","plugin","pluginDefinition","queries","initialQueries","spec","name","setName","description","setDescription","setPlugin","prevQueries","setPrevQueries","currentQueries","setCurrentQueries","setQueries","hideQueryEditor","undefined","setPanelDefinition","kind"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAGvD;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"sources":["../../src/context/usePanelEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback, useMemo, useState } from 'react';\nimport { PanelDefinition, QueryDefinition } from '@perses-dev/core';\n\n/**\n * UsePanelEditor is used in PanelEditorForm\n * This hook stores the states of panel definition and returns the onChange handlers for each state\n */\nexport const usePanelEditor = (panelDefinition: PanelDefinition) => {\n const { display, plugin: pluginDefinition, queries: initialQueries } = panelDefinition.spec;\n const [name, setName] = useState(display.name);\n const [description, setDescription] = useState(display.description);\n const [plugin, setPlugin] = useState(pluginDefinition);\n\n // need to keep track of prevQueries if switching from a panel with no queries (ex: markdown) to one with queries\n const [prevQueries, setPrevQueries] = useState(initialQueries);\n const [currentQueries, setCurrentQueries] = useState(initialQueries);\n\n /**\n * If hideQueryEditor is true, set panelDefinition.spec.queries to undefined.\n * If hideQueryEditor is false and query is undefined, set panelDefinition.spec.queries to previous queries.\n */\n const setQueries = useCallback(\n (queries?: QueryDefinition[], hideQueryEditor?: boolean) => {\n if (hideQueryEditor) {\n setPrevQueries(currentQueries);\n setCurrentQueries(undefined);\n } else {\n setCurrentQueries(queries === undefined ? prevQueries : queries);\n }\n },\n [setCurrentQueries, currentQueries, setPrevQueries, prevQueries]\n );\n\n // reset panel definition\n const setPanelDefinition = useCallback(\n (panelDefinition: PanelDefinition) => {\n const { display, plugin, queries } = panelDefinition.spec;\n setName(display.name);\n setDescription(display.description);\n setPlugin(plugin);\n setQueries(queries);\n },\n [setName, setDescription, setPlugin, setQueries]\n );\n\n return useMemo(\n () => ({\n panelDefinition: {\n kind: 'Panel',\n spec: {\n display: { name, description },\n plugin,\n queries: currentQueries,\n },\n } as PanelDefinition,\n setName,\n setDescription,\n setQueries,\n setPlugin,\n setPanelDefinition,\n }),\n [name, description, plugin, currentQueries, setName, setDescription, setQueries, setPlugin, setPanelDefinition]\n );\n};\n"],"names":["useCallback","useMemo","useState","usePanelEditor","panelDefinition","display","plugin","pluginDefinition","queries","initialQueries","spec","name","setName","description","setDescription","setPlugin","prevQueries","setPrevQueries","currentQueries","setCurrentQueries","setQueries","hideQueryEditor","undefined","setPanelDefinition","kind"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAGvD;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,OAAO,EAAEC,QAAQC,gBAAgB,EAAEC,SAASC,cAAc,EAAE,GAAGL,gBAAgBM,IAAI;IAC3F,MAAM,CAACC,MAAMC,QAAQ,GAAGV,SAASG,QAAQM,IAAI;IAC7C,MAAM,CAACE,aAAaC,eAAe,GAAGZ,SAASG,QAAQQ,WAAW;IAClE,MAAM,CAACP,QAAQS,UAAU,GAAGb,SAASK;IAErC,iHAAiH;IACjH,MAAM,CAACS,aAAaC,eAAe,GAAGf,SAASO;IAC/C,MAAM,CAACS,gBAAgBC,kBAAkB,GAAGjB,SAASO;IAErD;;;GAGC,GACD,MAAMW,aAAapB,YACjB,CAACQ,SAA6Ba;QAC5B,IAAIA,iBAAiB;YACnBJ,eAAeC;YACfC,kBAAkBG;QACpB,OAAO;YACLH,kBAAkBX,YAAYc,YAAYN,cAAcR;QAC1D;IACF,GACA;QAACW;QAAmBD;QAAgBD;QAAgBD;KAAY;IAGlE,yBAAyB;IACzB,MAAMO,qBAAqBvB,YACzB,CAACI;QACC,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAEE,OAAO,EAAE,GAAGJ,gBAAgBM,IAAI;QACzDE,QAAQP,QAAQM,IAAI;QACpBG,eAAeT,QAAQQ,WAAW;QAClCE,UAAUT;QACVc,WAAWZ;IACb,GACA;QAACI;QAASE;QAAgBC;QAAWK;KAAW;IAGlD,OAAOnB,QACL,IAAO,CAAA;YACLG,iBAAiB;gBACfoB,MAAM;gBACNd,MAAM;oBACJL,SAAS;wBAAEM;wBAAME;oBAAY;oBAC7BP;oBACAE,SAASU;gBACX;YACF;YACAN;YACAE;YACAM;YACAL;YACAQ;QACF,CAAA,GACA;QAACZ;QAAME;QAAaP;QAAQY;QAAgBN;QAASE;QAAgBM;QAAYL;QAAWQ;KAAmB;AAEnH,EAAE"}
|
|
@@ -15,11 +15,11 @@ import produce from 'immer';
|
|
|
15
15
|
import { useCallback, useMemo, useState } from 'react';
|
|
16
16
|
const DEFAULT_QUERY_PLUGIN_TYPE = 'TimeSeriesQuery';
|
|
17
17
|
export const useTimeSeriesQueryEditorActions = (props)=>{
|
|
18
|
-
const { queries
|
|
19
|
-
const { defaultPluginKinds
|
|
18
|
+
const { queries, onChange } = props;
|
|
19
|
+
const { defaultPluginKinds } = usePluginRegistry();
|
|
20
20
|
var _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE;
|
|
21
21
|
const defaultTimeSeriesQueryKind = (_defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds[DEFAULT_QUERY_PLUGIN_TYPE]) !== null && _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE !== void 0 ? _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE : '';
|
|
22
|
-
const { data: defaultQueryPlugin
|
|
22
|
+
const { data: defaultQueryPlugin } = usePlugin(DEFAULT_QUERY_PLUGIN_TYPE, defaultTimeSeriesQueryKind, {
|
|
23
23
|
useErrorBoundary: true,
|
|
24
24
|
enabled: true
|
|
25
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/useTimeSeriesQueryEditorActions.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { usePlugin, usePluginRegistry } from '@perses-dev/plugin-system';\nimport produce from 'immer';\nimport { useCallback, useMemo, useState } from 'react';\n\nconst DEFAULT_QUERY_PLUGIN_TYPE = 'TimeSeriesQuery';\n\nexport interface TimeSeriesQueryEditorActionsProps {\n queries: QueryDefinition[];\n onChange: (queries: QueryDefinition[]) => void;\n}\n\nexport const useTimeSeriesQueryEditorActions = (props: TimeSeriesQueryEditorActionsProps) => {\n const { queries, onChange } = props;\n const { defaultPluginKinds } = usePluginRegistry();\n const defaultTimeSeriesQueryKind = defaultPluginKinds?.[DEFAULT_QUERY_PLUGIN_TYPE] ?? '';\n const { data: defaultQueryPlugin } = usePlugin(DEFAULT_QUERY_PLUGIN_TYPE, defaultTimeSeriesQueryKind, {\n useErrorBoundary: true,\n enabled: true,\n });\n\n const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(() => false));\n\n const handleQueryChange = useCallback(\n (index: number, queryDef: QueryDefinition) => {\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft[index] = queryDef;\n return;\n }\n draft = [queryDef];\n })\n );\n },\n [onChange, queries]\n );\n\n const handleQueryAdd = useCallback(() => {\n if (!defaultQueryPlugin) return;\n onChange(\n produce(queries, (draft) => {\n const queryDef: TimeSeriesQueryDefinition = {\n kind: DEFAULT_QUERY_PLUGIN_TYPE,\n spec: {\n plugin: { kind: defaultTimeSeriesQueryKind, spec: defaultQueryPlugin.createInitialOptions() },\n },\n };\n\n if (draft) {\n draft.push(queryDef);\n } else {\n draft = [...queries, queryDef];\n }\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.push(false);\n return [...queriesCollapsed];\n });\n }, [defaultQueryPlugin, defaultTimeSeriesQueryKind, onChange, queries, setQueriesCollapsed]);\n\n const handleQueryDelete = useCallback(\n (index: number) => {\n onChange(\n produce(queries, (draft) => {\n draft.splice(index, 1);\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.splice(index, 1);\n return [...queriesCollapsed];\n });\n },\n [onChange, setQueriesCollapsed, queries]\n );\n\n const handleQueryCollapseExpand = useCallback(\n (index: number) => {\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed[index] = !queriesCollapsed[index];\n return [...queriesCollapsed];\n });\n },\n [setQueriesCollapsed]\n );\n\n return useMemo(() => {\n return {\n handleQueryChange,\n handleQueryAdd,\n handleQueryDelete,\n handleQueryCollapseExpand,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n };\n }, [\n handleQueryChange,\n handleQueryAdd,\n handleQueryDelete,\n handleQueryCollapseExpand,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n ]);\n};\n"],"names":["usePlugin","usePluginRegistry","produce","useCallback","useMemo","useState","DEFAULT_QUERY_PLUGIN_TYPE","useTimeSeriesQueryEditorActions","props","queries","onChange","defaultPluginKinds","defaultTimeSeriesQueryKind","data","defaultQueryPlugin","useErrorBoundary","enabled","queriesCollapsed","setQueriesCollapsed","map","handleQueryChange","index","queryDef","draft","handleQueryAdd","kind","spec","plugin","createInitialOptions","push","handleQueryDelete","splice","handleQueryCollapseExpand"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,SAAS,EAAEC,iBAAiB,QAAQ,4BAA4B;AACzE,OAAOC,aAAa,QAAQ;AAC5B,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAEvD,MAAMC,4BAA4B;AAOlC,OAAO,MAAMC,kCAAkC,CAACC;IAC9C,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"sources":["../../src/context/useTimeSeriesQueryEditorActions.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition, TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { usePlugin, usePluginRegistry } from '@perses-dev/plugin-system';\nimport produce from 'immer';\nimport { useCallback, useMemo, useState } from 'react';\n\nconst DEFAULT_QUERY_PLUGIN_TYPE = 'TimeSeriesQuery';\n\nexport interface TimeSeriesQueryEditorActionsProps {\n queries: QueryDefinition[];\n onChange: (queries: QueryDefinition[]) => void;\n}\n\nexport const useTimeSeriesQueryEditorActions = (props: TimeSeriesQueryEditorActionsProps) => {\n const { queries, onChange } = props;\n const { defaultPluginKinds } = usePluginRegistry();\n const defaultTimeSeriesQueryKind = defaultPluginKinds?.[DEFAULT_QUERY_PLUGIN_TYPE] ?? '';\n const { data: defaultQueryPlugin } = usePlugin(DEFAULT_QUERY_PLUGIN_TYPE, defaultTimeSeriesQueryKind, {\n useErrorBoundary: true,\n enabled: true,\n });\n\n const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(() => false));\n\n const handleQueryChange = useCallback(\n (index: number, queryDef: QueryDefinition) => {\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft[index] = queryDef;\n return;\n }\n draft = [queryDef];\n })\n );\n },\n [onChange, queries]\n );\n\n const handleQueryAdd = useCallback(() => {\n if (!defaultQueryPlugin) return;\n onChange(\n produce(queries, (draft) => {\n const queryDef: TimeSeriesQueryDefinition = {\n kind: DEFAULT_QUERY_PLUGIN_TYPE,\n spec: {\n plugin: { kind: defaultTimeSeriesQueryKind, spec: defaultQueryPlugin.createInitialOptions() },\n },\n };\n\n if (draft) {\n draft.push(queryDef);\n } else {\n draft = [...queries, queryDef];\n }\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.push(false);\n return [...queriesCollapsed];\n });\n }, [defaultQueryPlugin, defaultTimeSeriesQueryKind, onChange, queries, setQueriesCollapsed]);\n\n const handleQueryDelete = useCallback(\n (index: number) => {\n onChange(\n produce(queries, (draft) => {\n draft.splice(index, 1);\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.splice(index, 1);\n return [...queriesCollapsed];\n });\n },\n [onChange, setQueriesCollapsed, queries]\n );\n\n const handleQueryCollapseExpand = useCallback(\n (index: number) => {\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed[index] = !queriesCollapsed[index];\n return [...queriesCollapsed];\n });\n },\n [setQueriesCollapsed]\n );\n\n return useMemo(() => {\n return {\n handleQueryChange,\n handleQueryAdd,\n handleQueryDelete,\n handleQueryCollapseExpand,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n };\n }, [\n handleQueryChange,\n handleQueryAdd,\n handleQueryDelete,\n handleQueryCollapseExpand,\n queriesCollapsed,\n defaultTimeSeriesQueryKind,\n ]);\n};\n"],"names":["usePlugin","usePluginRegistry","produce","useCallback","useMemo","useState","DEFAULT_QUERY_PLUGIN_TYPE","useTimeSeriesQueryEditorActions","props","queries","onChange","defaultPluginKinds","defaultTimeSeriesQueryKind","data","defaultQueryPlugin","useErrorBoundary","enabled","queriesCollapsed","setQueriesCollapsed","map","handleQueryChange","index","queryDef","draft","handleQueryAdd","kind","spec","plugin","createInitialOptions","push","handleQueryDelete","splice","handleQueryCollapseExpand"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,SAAS,EAAEC,iBAAiB,QAAQ,4BAA4B;AACzE,OAAOC,aAAa,QAAQ;AAC5B,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAEvD,MAAMC,4BAA4B;AAOlC,OAAO,MAAMC,kCAAkC,CAACC;IAC9C,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGF;IAC9B,MAAM,EAAEG,kBAAkB,EAAE,GAAGV;QACIU;IAAnC,MAAMC,6BAA6BD,CAAAA,gDAAAA,+BAAAA,yCAAAA,kBAAoB,CAACL,0BAA0B,cAA/CK,2DAAAA,gDAAmD;IACtF,MAAM,EAAEE,MAAMC,kBAAkB,EAAE,GAAGd,UAAUM,2BAA2BM,4BAA4B;QACpGG,kBAAkB;QAClBC,SAAS;IACX;IAEA,MAAM,CAACC,kBAAkBC,oBAAoB,GAAGb,SAASI,QAAQU,GAAG,CAAC,IAAM;IAE3E,MAAMC,oBAAoBjB,YACxB,CAACkB,OAAeC;QACdZ,SACER,QAAQO,SAAS,CAACc;YAChB,IAAIA,OAAO;gBACTA,KAAK,CAACF,MAAM,GAAGC;gBACf;YACF;YACAC,QAAQ;gBAACD;aAAS;QACpB;IAEJ,GACA;QAACZ;QAAUD;KAAQ;IAGrB,MAAMe,iBAAiBrB,YAAY;QACjC,IAAI,CAACW,oBAAoB;QACzBJ,SACER,QAAQO,SAAS,CAACc;YAChB,MAAMD,WAAsC;gBAC1CG,MAAMnB;gBACNoB,MAAM;oBACJC,QAAQ;wBAAEF,MAAMb;wBAA4Bc,MAAMZ,mBAAmBc,oBAAoB;oBAAG;gBAC9F;YACF;YAEA,IAAIL,OAAO;gBACTA,MAAMM,IAAI,CAACP;YACb,OAAO;gBACLC,QAAQ;uBAAId;oBAASa;iBAAS;YAChC;QACF;QAEFJ,oBAAoB,CAACD;YACnBA,iBAAiBY,IAAI,CAAC;YACtB,OAAO;mBAAIZ;aAAiB;QAC9B;IACF,GAAG;QAACH;QAAoBF;QAA4BF;QAAUD;QAASS;KAAoB;IAE3F,MAAMY,oBAAoB3B,YACxB,CAACkB;QACCX,SACER,QAAQO,SAAS,CAACc;YAChBA,MAAMQ,MAAM,CAACV,OAAO;QACtB;QAEFH,oBAAoB,CAACD;YACnBA,iBAAiBc,MAAM,CAACV,OAAO;YAC/B,OAAO;mBAAIJ;aAAiB;QAC9B;IACF,GACA;QAACP;QAAUQ;QAAqBT;KAAQ;IAG1C,MAAMuB,4BAA4B7B,YAChC,CAACkB;QACCH,oBAAoB,CAACD;YACnBA,gBAAgB,CAACI,MAAM,GAAG,CAACJ,gBAAgB,CAACI,MAAM;YAClD,OAAO;mBAAIJ;aAAiB;QAC9B;IACF,GACA;QAACC;KAAoB;IAGvB,OAAOd,QAAQ;QACb,OAAO;YACLgB;YACAI;YACAM;YACAE;YACAf;YACAL;QACF;IACF,GAAG;QACDQ;QACAI;QACAM;QACAE;QACAf;QACAL;KACD;AACH,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { defaultFallbackInView } from 'react-intersection-observer';\n\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n\n// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation\n// for other options)\ndefaultFallbackInView(true);\n"],"names":["defaultFallbackInView","jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,qBAAqB,QAAQ,8BAA8B;AAEpE,iCAAiC;AACjC,OAAO,0CAA0C;AAEjD,iFAAiF;AACjFC,KAAKC,
|
|
1
|
+
{"version":3,"sources":["../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { defaultFallbackInView } from 'react-intersection-observer';\n\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n\n// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation\n// for other options)\ndefaultFallbackInView(true);\n"],"names":["defaultFallbackInView","jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,qBAAqB,QAAQ,8BAA8B;AAEpE,iCAAiC;AACjC,OAAO,0CAA0C;AAEjD,iFAAiF;AACjFC,KAAKC,IAAI,CAAC;AAEV,qHAAqH;AACrH,qBAAqB;AACrBF,sBAAsB"}
|
|
@@ -8,5 +8,5 @@ export interface ViewExploreProps extends Omit<BoxProps, 'children'> {
|
|
|
8
8
|
externalVariableDefinitions?: TemplateVariableProviderProps['externalVariableDefinitions'];
|
|
9
9
|
exploreTitleComponent?: JSX.Element;
|
|
10
10
|
}
|
|
11
|
-
export declare function ViewExplore(props: ViewExploreProps): JSX.Element;
|
|
11
|
+
export declare function ViewExplore(props: ViewExploreProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=ViewExplore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewExplore.d.ts","sourceRoot":"","sources":["../../../src/views/ViewExplore/ViewExplore.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM9C,OAAO,EAAwD,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE3G,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAI9B,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IAClE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,4BAA4B,CAAC,eAAe,CAAC,CAAC;IAC7D,2BAA2B,CAAC,EAAE,6BAA6B,CAAC,6BAA6B,CAAC,CAAC;IAC3F,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ViewExplore.d.ts","sourceRoot":"","sources":["../../../src/views/ViewExplore/ViewExplore.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM9C,OAAO,EAAwD,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE3G,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAI9B,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IAClE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,4BAA4B,CAAC,eAAe,CAAC,CAAC;IAC7D,2BAA2B,CAAC,EAAE,6BAA6B,CAAC,6BAA6B,CAAC,CAAC;IAC3F,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAoClD"}
|
|
@@ -18,7 +18,7 @@ import { ErrorAlert, ErrorBoundary, combineSx } from '@perses-dev/components';
|
|
|
18
18
|
import { DatasourceStoreProvider, DashboardProvider, TemplateVariableProvider } from '@perses-dev/dashboards';
|
|
19
19
|
import { ViewExploreApp } from './ViewExploreApp';
|
|
20
20
|
export function ViewExplore(props) {
|
|
21
|
-
const { dashboardResource
|
|
21
|
+
const { dashboardResource, datasourceApi, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;
|
|
22
22
|
const initialTimeRange = useInitialTimeRange(DEFAULT_DASHBOARD_DURATION);
|
|
23
23
|
const initialRefreshInterval = useInitialRefreshInterval(DEFAULT_REFRESH_INTERVAL);
|
|
24
24
|
return /*#__PURE__*/ _jsx(DatasourceStoreProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/ViewExplore/ViewExplore.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport {\n TimeRangeProviderWithQueryParams,\n useInitialRefreshInterval,\n useInitialTimeRange,\n} from '@perses-dev/plugin-system';\nimport { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL, DashboardResource } from '@perses-dev/core';\nimport { ErrorAlert, ErrorBoundary, combineSx } from '@perses-dev/components';\nimport {\n DatasourceStoreProviderProps,\n TemplateVariableProviderProps,\n DatasourceStoreProvider,\n DashboardProvider,\n TemplateVariableProvider,\n} from '@perses-dev/dashboards';\nimport { ViewExploreApp } from './ViewExploreApp';\n\nexport interface ViewExploreProps extends Omit<BoxProps, 'children'> {\n dashboardResource: DashboardResource;\n datasourceApi: DatasourceStoreProviderProps['datasourceApi'];\n externalVariableDefinitions?: TemplateVariableProviderProps['externalVariableDefinitions'];\n exploreTitleComponent?: JSX.Element;\n}\n\nexport function ViewExplore(props: ViewExploreProps) {\n const { dashboardResource, datasourceApi, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;\n\n const initialTimeRange = useInitialTimeRange(DEFAULT_DASHBOARD_DURATION);\n const initialRefreshInterval = useInitialRefreshInterval(DEFAULT_REFRESH_INTERVAL);\n\n return (\n <DatasourceStoreProvider dashboardResource={dashboardResource} datasourceApi={datasourceApi}>\n <DashboardProvider initialState={{ dashboardResource, isEditMode: true }}>\n <TimeRangeProviderWithQueryParams\n initialTimeRange={initialTimeRange}\n initialRefreshInterval={initialRefreshInterval}\n >\n <TemplateVariableProvider externalVariableDefinitions={externalVariableDefinitions}>\n <Box\n sx={combineSx(\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n sx\n )}\n {...others}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <ViewExploreApp exploreTitleComponent={exploreTitleComponent} />\n </ErrorBoundary>\n </Box>\n </TemplateVariableProvider>\n </TimeRangeProviderWithQueryParams>\n </DashboardProvider>\n </DatasourceStoreProvider>\n );\n}\n"],"names":["Box","TimeRangeProviderWithQueryParams","useInitialRefreshInterval","useInitialTimeRange","DEFAULT_DASHBOARD_DURATION","DEFAULT_REFRESH_INTERVAL","ErrorAlert","ErrorBoundary","combineSx","DatasourceStoreProvider","DashboardProvider","TemplateVariableProvider","ViewExploreApp","ViewExplore","props","dashboardResource","datasourceApi","externalVariableDefinitions","sx","exploreTitleComponent","others","initialTimeRange","initialRefreshInterval","initialState","isEditMode","display","width","height","position","overflow","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SACEC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd,4BAA4B;AACnC,SAASC,0BAA0B,EAAEC,wBAAwB,QAA2B,mBAAmB;AAC3G,SAASC,UAAU,EAAEC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAC9E,SAGEC,uBAAuB,EACvBC,iBAAiB,EACjBC,wBAAwB,QACnB,yBAAyB;AAChC,SAASC,cAAc,QAAQ,mBAAmB;AASlD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"sources":["../../../src/views/ViewExplore/ViewExplore.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport {\n TimeRangeProviderWithQueryParams,\n useInitialRefreshInterval,\n useInitialTimeRange,\n} from '@perses-dev/plugin-system';\nimport { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL, DashboardResource } from '@perses-dev/core';\nimport { ErrorAlert, ErrorBoundary, combineSx } from '@perses-dev/components';\nimport {\n DatasourceStoreProviderProps,\n TemplateVariableProviderProps,\n DatasourceStoreProvider,\n DashboardProvider,\n TemplateVariableProvider,\n} from '@perses-dev/dashboards';\nimport { ViewExploreApp } from './ViewExploreApp';\n\nexport interface ViewExploreProps extends Omit<BoxProps, 'children'> {\n dashboardResource: DashboardResource;\n datasourceApi: DatasourceStoreProviderProps['datasourceApi'];\n externalVariableDefinitions?: TemplateVariableProviderProps['externalVariableDefinitions'];\n exploreTitleComponent?: JSX.Element;\n}\n\nexport function ViewExplore(props: ViewExploreProps) {\n const { dashboardResource, datasourceApi, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;\n\n const initialTimeRange = useInitialTimeRange(DEFAULT_DASHBOARD_DURATION);\n const initialRefreshInterval = useInitialRefreshInterval(DEFAULT_REFRESH_INTERVAL);\n\n return (\n <DatasourceStoreProvider dashboardResource={dashboardResource} datasourceApi={datasourceApi}>\n <DashboardProvider initialState={{ dashboardResource, isEditMode: true }}>\n <TimeRangeProviderWithQueryParams\n initialTimeRange={initialTimeRange}\n initialRefreshInterval={initialRefreshInterval}\n >\n <TemplateVariableProvider externalVariableDefinitions={externalVariableDefinitions}>\n <Box\n sx={combineSx(\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n sx\n )}\n {...others}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <ViewExploreApp exploreTitleComponent={exploreTitleComponent} />\n </ErrorBoundary>\n </Box>\n </TemplateVariableProvider>\n </TimeRangeProviderWithQueryParams>\n </DashboardProvider>\n </DatasourceStoreProvider>\n );\n}\n"],"names":["Box","TimeRangeProviderWithQueryParams","useInitialRefreshInterval","useInitialTimeRange","DEFAULT_DASHBOARD_DURATION","DEFAULT_REFRESH_INTERVAL","ErrorAlert","ErrorBoundary","combineSx","DatasourceStoreProvider","DashboardProvider","TemplateVariableProvider","ViewExploreApp","ViewExplore","props","dashboardResource","datasourceApi","externalVariableDefinitions","sx","exploreTitleComponent","others","initialTimeRange","initialRefreshInterval","initialState","isEditMode","display","width","height","position","overflow","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SACEC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd,4BAA4B;AACnC,SAASC,0BAA0B,EAAEC,wBAAwB,QAA2B,mBAAmB;AAC3G,SAASC,UAAU,EAAEC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAC9E,SAGEC,uBAAuB,EACvBC,iBAAiB,EACjBC,wBAAwB,QACnB,yBAAyB;AAChC,SAASC,cAAc,QAAQ,mBAAmB;AASlD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,iBAAiB,EAAEC,aAAa,EAAEC,2BAA2B,EAAEC,EAAE,EAAEC,qBAAqB,EAAE,GAAGC,QAAQ,GAAGN;IAEhH,MAAMO,mBAAmBlB,oBAAoBC;IAC7C,MAAMkB,yBAAyBpB,0BAA0BG;IAEzD,qBACE,KAACI;QAAwBM,mBAAmBA;QAAmBC,eAAeA;kBAC5E,cAAA,KAACN;YAAkBa,cAAc;gBAAER;gBAAmBS,YAAY;YAAK;sBACrE,cAAA,KAACvB;gBACCoB,kBAAkBA;gBAClBC,wBAAwBA;0BAExB,cAAA,KAACX;oBAAyBM,6BAA6BA;8BACrD,cAAA,KAACjB;wBACCkB,IAAIV,UACF;4BACEiB,SAAS;4BACTC,OAAO;4BACPC,QAAQ;4BACRC,UAAU;4BACVC,UAAU;wBACZ,GACAX;wBAED,GAAGE,MAAM;kCAEV,cAAA,KAACb;4BAAcuB,mBAAmBxB;sCAChC,cAAA,KAACM;gCAAeO,uBAAuBA;;;;;;;;AAQvD"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
export interface ViewAppProps {
|
|
3
3
|
exploreTitleComponent?: JSX.Element;
|
|
4
4
|
}
|
|
5
|
-
export declare function ViewExploreApp(props: ViewAppProps): JSX.Element;
|
|
5
|
+
export declare function ViewExploreApp(props: ViewAppProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=ViewExploreApp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewExploreApp.d.ts","sourceRoot":"","sources":["../../../src/views/ViewExplore/ViewExploreApp.tsx"],"names":[],"mappings":";AAkBA,MAAM,WAAW,YAAY;IAC3B,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"ViewExploreApp.d.ts","sourceRoot":"","sources":["../../../src/views/ViewExplore/ViewExploreApp.tsx"],"names":[],"mappings":";AAkBA,MAAM,WAAW,YAAY;IAC3B,qBAAqB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,2CAoCjD"}
|
|
@@ -15,7 +15,7 @@ import { Box } from '@mui/material';
|
|
|
15
15
|
import { ChartsProvider, useChartsTheme } from '@perses-dev/components';
|
|
16
16
|
import { PanelEditorForm } from '../../components/PanelEditor/PanelEditorForm';
|
|
17
17
|
export function ViewExploreApp(props) {
|
|
18
|
-
const { exploreTitleComponent
|
|
18
|
+
const { exploreTitleComponent } = props;
|
|
19
19
|
const chartsTheme = useChartsTheme();
|
|
20
20
|
const data = {
|
|
21
21
|
groupId: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/ViewExplore/ViewExploreApp.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { ChartsProvider, useChartsTheme } from '@perses-dev/components';\nimport { PanelEditorValues } from '@perses-dev/dashboards';\nimport { PanelEditorForm } from '../../components/PanelEditor/PanelEditorForm';\n\nexport interface ViewAppProps {\n exploreTitleComponent?: JSX.Element;\n}\n\nexport function ViewExploreApp(props: ViewAppProps) {\n const { exploreTitleComponent } = props;\n\n const chartsTheme = useChartsTheme();\n const data: PanelEditorValues = {\n groupId: 0,\n panelDefinition: {\n kind: 'Panel',\n spec: {\n display: {\n name: '',\n },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {},\n },\n queries: [],\n },\n },\n };\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <ChartsProvider chartsTheme={chartsTheme} enablePinning={false}>\n <PanelEditorForm initialAction=\"update\" initialValues={data} exploreTitleComponent={exploreTitleComponent} />\n </ChartsProvider>\n </Box>\n );\n}\n"],"names":["Box","ChartsProvider","useChartsTheme","PanelEditorForm","ViewExploreApp","props","exploreTitleComponent","chartsTheme","data","groupId","panelDefinition","kind","spec","display","name","plugin","queries","sx","flexGrow","overflowX","overflowY","flexDirection","enablePinning","initialAction","initialValues"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,EAAEC,cAAc,QAAQ,yBAAyB;AAExE,SAASC,eAAe,QAAQ,+CAA+C;AAM/E,OAAO,SAASC,eAAeC,KAAmB;IAChD,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"sources":["../../../src/views/ViewExplore/ViewExploreApp.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { ChartsProvider, useChartsTheme } from '@perses-dev/components';\nimport { PanelEditorValues } from '@perses-dev/dashboards';\nimport { PanelEditorForm } from '../../components/PanelEditor/PanelEditorForm';\n\nexport interface ViewAppProps {\n exploreTitleComponent?: JSX.Element;\n}\n\nexport function ViewExploreApp(props: ViewAppProps) {\n const { exploreTitleComponent } = props;\n\n const chartsTheme = useChartsTheme();\n const data: PanelEditorValues = {\n groupId: 0,\n panelDefinition: {\n kind: 'Panel',\n spec: {\n display: {\n name: '',\n },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {},\n },\n queries: [],\n },\n },\n };\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <ChartsProvider chartsTheme={chartsTheme} enablePinning={false}>\n <PanelEditorForm initialAction=\"update\" initialValues={data} exploreTitleComponent={exploreTitleComponent} />\n </ChartsProvider>\n </Box>\n );\n}\n"],"names":["Box","ChartsProvider","useChartsTheme","PanelEditorForm","ViewExploreApp","props","exploreTitleComponent","chartsTheme","data","groupId","panelDefinition","kind","spec","display","name","plugin","queries","sx","flexGrow","overflowX","overflowY","flexDirection","enablePinning","initialAction","initialValues"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,EAAEC,cAAc,QAAQ,yBAAyB;AAExE,SAASC,eAAe,QAAQ,+CAA+C;AAM/E,OAAO,SAASC,eAAeC,KAAmB;IAChD,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAME,cAAcL;IACpB,MAAMM,OAA0B;QAC9BC,SAAS;QACTC,iBAAiB;YACfC,MAAM;YACNC,MAAM;gBACJC,SAAS;oBACPC,MAAM;gBACR;gBACAC,QAAQ;oBACNJ,MAAM;oBACNC,MAAM,CAAC;gBACT;gBACAI,SAAS,EAAE;YACb;QACF;IACF;IAEA,qBACE,KAAChB;QACCiB,IAAI;YACFC,UAAU;YACVC,WAAW;YACXC,WAAW;YACXP,SAAS;YACTQ,eAAe;QACjB;kBAEA,cAAA,KAACpB;YAAeM,aAAaA;YAAae,eAAe;sBACvD,cAAA,KAACnB;gBAAgBoB,eAAc;gBAASC,eAAehB;gBAAMF,uBAAuBA;;;;AAI5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/explore",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0-rc1",
|
|
4
4
|
"description": "The explore feature in Perses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"lint:fix": "eslint --fix src --ext .ts,.tsx"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@perses-dev/components": "0.
|
|
33
|
-
"@perses-dev/core": "0.
|
|
34
|
-
"@perses-dev/plugin-system": "0.
|
|
35
|
-
"@perses-dev/dashboards": "0.
|
|
32
|
+
"@perses-dev/components": "0.44.0-rc1",
|
|
33
|
+
"@perses-dev/core": "0.44.0-rc1",
|
|
34
|
+
"@perses-dev/plugin-system": "0.44.0-rc1",
|
|
35
|
+
"@perses-dev/dashboards": "0.44.0-rc1",
|
|
36
36
|
"@types/react-grid-layout": "^1.3.2",
|
|
37
37
|
"date-fns": "^2.28.0",
|
|
38
38
|
"immer": "^9.0.15",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"zustand": "^4.3.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@perses-dev/internal-utils": "0.
|
|
50
|
-
"@perses-dev/storybook": "0.
|
|
49
|
+
"@perses-dev/internal-utils": "0.44.0-rc1",
|
|
50
|
+
"@perses-dev/storybook": "0.44.0-rc1",
|
|
51
51
|
"history": "^5.3.0",
|
|
52
52
|
"intersection-observer": "^0.12.2"
|
|
53
53
|
},
|