@perses-dev/dashboards 0.50.3 → 0.51.0-beta.1
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/Dashboard/Dashboard.js +1 -3
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +3 -3
- package/dist/cjs/components/Datasources/DatasourceEditor.js +2 -5
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +2 -0
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -3
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +5 -7
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +1 -1
- package/dist/cjs/components/GridLayout/GridItemContent.js +4 -3
- package/dist/cjs/components/GridLayout/GridLayout.js +5 -6
- package/dist/cjs/components/GridLayout/GridTitle.js +3 -3
- package/dist/cjs/{stories/decorators/constants.js → components/Panel/HeaderIconButton.js} +8 -20
- package/dist/cjs/components/Panel/Panel.js +16 -10
- package/dist/cjs/components/Panel/PanelActions.js +365 -0
- package/dist/cjs/components/Panel/PanelContent.js +59 -13
- package/dist/cjs/components/Panel/PanelHeader.js +14 -141
- package/dist/cjs/components/Panel/PanelLinks.js +5 -6
- package/dist/cjs/components/Panel/PanelPluginLoader.js +56 -0
- package/dist/cjs/components/Panel/index.js +1 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +17 -33
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +4 -5
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +2 -4
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +5 -12
- package/dist/cjs/components/Variables/Variable.js +20 -35
- package/dist/cjs/components/Variables/VariableEditor.js +14 -23
- package/dist/cjs/components/Variables/VariableList.js +4 -6
- package/dist/cjs/constants/styles.js +12 -0
- package/dist/cjs/constants/user-interface-text.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +5 -6
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +1 -1
- package/dist/cjs/context/DashboardProvider/common.js +2 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +13 -3
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +3 -6
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +3 -4
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +1 -2
- package/dist/cjs/context/DatasourceStoreProvider.js +15 -22
- package/dist/cjs/context/VariableProvider/VariableProvider.js +12 -20
- package/dist/cjs/context/VariableProvider/hydrationUtils.js +3 -6
- package/dist/cjs/context/VariableProvider/utils.js +2 -2
- package/dist/cjs/test/datasource-provider.js +1 -1
- package/dist/cjs/test/plugin-registry.js +8 -3
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +4 -3
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +5 -5
- package/dist/components/Dashboard/Dashboard.js +1 -3
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +3 -3
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +2 -5
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +3 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +5 -4
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +5 -7
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +5 -4
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +6 -7
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +3 -3
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
- package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
- package/dist/{stories/decorators/index.js → components/Panel/HeaderIconButton.js} +7 -6
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +7 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +22 -11
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +22 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +352 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +5 -4
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +61 -15
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +7 -11
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +18 -140
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.js +5 -6
- package/dist/components/Panel/PanelLinks.js.map +1 -1
- package/dist/components/Panel/PanelPluginLoader.d.ts +13 -0
- package/dist/components/Panel/PanelPluginLoader.d.ts.map +1 -0
- package/dist/components/Panel/PanelPluginLoader.js +51 -0
- package/dist/components/Panel/PanelPluginLoader.js.map +1 -0
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +1 -0
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +17 -33
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +4 -5
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +2 -4
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +5 -12
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/Variable.js +20 -35
- package/dist/components/Variables/Variable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.js +14 -23
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.js +4 -6
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/constants/styles.d.ts +3 -0
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +3 -0
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +1 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +1 -0
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +5 -6
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -1
- package/dist/context/DashboardProvider/common.js +2 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +11 -2
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +13 -4
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +1 -2
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +3 -6
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +3 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.js +1 -2
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +15 -22
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.js +9 -12
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -1
- package/dist/context/VariableProvider/hydrationUtils.js +3 -6
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -1
- package/dist/context/VariableProvider/utils.js +2 -2
- package/dist/context/VariableProvider/utils.js.map +1 -1
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +1 -1
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +8 -3
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +9 -7
- package/dist/test/render.js.map +1 -1
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +4 -3
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +5 -5
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -10
- package/dist/cjs/stories/decorators/WithDashboard.js +0 -41
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +0 -39
- package/dist/cjs/stories/decorators/WithVariables.js +0 -37
- package/dist/cjs/stories/decorators/index.js +0 -33
- package/dist/stories/decorators/WithDashboard.js +0 -33
- package/dist/stories/decorators/WithDashboard.js.map +0 -1
- package/dist/stories/decorators/WithDatasourceStore.js +0 -31
- package/dist/stories/decorators/WithDatasourceStore.js.map +0 -1
- package/dist/stories/decorators/WithVariables.js +0 -29
- package/dist/stories/decorators/WithVariables.js.map +0 -1
- package/dist/stories/decorators/constants.js +0 -31
- package/dist/stories/decorators/constants.js.map +0 -1
- package/dist/stories/decorators/index.js.map +0 -1
|
@@ -87,10 +87,10 @@ function PanelLinks({ links }) {
|
|
|
87
87
|
function LinkButton({ link }) {
|
|
88
88
|
const { url, name, tooltip, targetBlank } = useLink(link);
|
|
89
89
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
90
|
-
description: tooltip
|
|
90
|
+
description: tooltip ?? url,
|
|
91
91
|
enterDelay: 100,
|
|
92
92
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
93
|
-
"aria-label": name
|
|
93
|
+
"aria-label": name ?? url,
|
|
94
94
|
size: "small",
|
|
95
95
|
href: url,
|
|
96
96
|
target: targetBlank ? '_blank' : '_self',
|
|
@@ -110,19 +110,18 @@ function LinkButton({ link }) {
|
|
|
110
110
|
function LinkMenuItem({ link }) {
|
|
111
111
|
const { url, name, tooltip, targetBlank } = useLink(link);
|
|
112
112
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
113
|
-
description: tooltip
|
|
113
|
+
description: tooltip ?? url,
|
|
114
114
|
enterDelay: 100,
|
|
115
115
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
116
116
|
component: _material.Link,
|
|
117
117
|
href: url,
|
|
118
118
|
target: targetBlank ? '_blank' : '_self',
|
|
119
|
-
children: name
|
|
119
|
+
children: name ?? url
|
|
120
120
|
})
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
function useLink(link) {
|
|
124
|
-
|
|
125
|
-
const url = (_useReplaceVariablesInString = (0, _pluginsystem.useReplaceVariablesInString)(link.url)) !== null && _useReplaceVariablesInString !== void 0 ? _useReplaceVariablesInString : link.url;
|
|
124
|
+
const url = (0, _pluginsystem.useReplaceVariablesInString)(link.url) ?? link.url;
|
|
126
125
|
const name = (0, _pluginsystem.useReplaceVariablesInString)(link.name);
|
|
127
126
|
const tooltip = (0, _pluginsystem.useReplaceVariablesInString)(link.tooltip);
|
|
128
127
|
if (link.renderVariables === false) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "PanelPluginLoader", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PanelPluginLoader;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
function PanelPluginLoader(props) {
|
|
27
|
+
const { kind, spec, contentDimensions, definition, queryResults } = props;
|
|
28
|
+
const { data: plugin, isLoading: isPanelLoading } = (0, _pluginsystem.usePlugin)('Panel', kind, {
|
|
29
|
+
throwOnError: true
|
|
30
|
+
});
|
|
31
|
+
const PanelComponent = plugin?.PanelComponent;
|
|
32
|
+
const supportedQueryTypes = plugin?.supportedQueryTypes || [];
|
|
33
|
+
// Show fullsize skeleton if the panel plugin is loading.
|
|
34
|
+
if (isPanelLoading) {
|
|
35
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
|
|
36
|
+
variant: "rectangular",
|
|
37
|
+
width: contentDimensions?.width,
|
|
38
|
+
height: contentDimensions?.height,
|
|
39
|
+
"aria-label": "Loading..."
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (PanelComponent === undefined) {
|
|
43
|
+
throw new Error(`Missing PanelComponent from panel plugin for kind '${kind}'`);
|
|
44
|
+
}
|
|
45
|
+
for (const queryResult of queryResults){
|
|
46
|
+
if (!supportedQueryTypes.includes(queryResult.definition.kind)) {
|
|
47
|
+
throw new Error(`This panel does not support queries of type '${queryResult.definition.kind}'. Supported query types: ${supportedQueryTypes.join(', ')}.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(PanelComponent, {
|
|
51
|
+
spec: spec,
|
|
52
|
+
contentDimensions: contentDimensions,
|
|
53
|
+
definition: definition,
|
|
54
|
+
queryResults: queryResults
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./Panel"), exports);
|
|
18
|
+
_export_star(require("./PanelPluginLoader"), exports);
|
|
18
19
|
function _export_star(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
21
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -44,7 +44,7 @@ const PanelDrawer = ()=>{
|
|
|
44
44
|
};
|
|
45
45
|
// Don't call closeDrawer on the store until the Drawer has completely transitioned out and reset close state
|
|
46
46
|
const handleExited = ()=>{
|
|
47
|
-
panelEditor
|
|
47
|
+
panelEditor?.close();
|
|
48
48
|
setIsClosing(false);
|
|
49
49
|
};
|
|
50
50
|
// Disables closing on click out. This is a quick-win solution to avoid losing draft changes.
|
|
@@ -58,11 +58,14 @@ const PanelDrawer = ()=>{
|
|
|
58
58
|
onExited: handleExited
|
|
59
59
|
},
|
|
60
60
|
"data-testid": "panel-editor",
|
|
61
|
-
children: panelEditor && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
children: panelEditor && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
62
|
+
FallbackComponent: _components.ErrorAlert,
|
|
63
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelEditorForm.PanelEditorForm, {
|
|
64
|
+
initialAction: panelEditor.mode,
|
|
65
|
+
initialValues: panelEditor.initialValues,
|
|
66
|
+
onSave: handleSave,
|
|
67
|
+
onClose: handleClose
|
|
68
|
+
})
|
|
66
69
|
})
|
|
67
70
|
});
|
|
68
71
|
};
|
|
@@ -179,22 +179,19 @@ function PanelEditorForm(props) {
|
|
|
179
179
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
180
180
|
control: form.control,
|
|
181
181
|
name: "panelDefinition.spec.display.name",
|
|
182
|
-
render: ({ field, fieldState })
|
|
183
|
-
var _fieldState_error;
|
|
184
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
182
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
185
183
|
...field,
|
|
186
184
|
required: true,
|
|
187
185
|
fullWidth: true,
|
|
188
186
|
label: "Name",
|
|
189
187
|
error: !!fieldState.error,
|
|
190
|
-
helperText:
|
|
191
|
-
value: watchedName
|
|
188
|
+
helperText: fieldState.error?.message,
|
|
189
|
+
value: watchedName ?? '',
|
|
192
190
|
onChange: (event)=>{
|
|
193
191
|
field.onChange(event);
|
|
194
192
|
setName(event.target.value);
|
|
195
193
|
}
|
|
196
|
-
})
|
|
197
|
-
}
|
|
194
|
+
})
|
|
198
195
|
})
|
|
199
196
|
}),
|
|
200
197
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
@@ -203,28 +200,22 @@ function PanelEditorForm(props) {
|
|
|
203
200
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
204
201
|
control: form.control,
|
|
205
202
|
name: "groupId",
|
|
206
|
-
render: ({ field, fieldState })
|
|
207
|
-
var _fieldState_error;
|
|
208
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
203
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
209
204
|
select: true,
|
|
210
205
|
...field,
|
|
211
206
|
required: true,
|
|
212
207
|
fullWidth: true,
|
|
213
208
|
label: "Group",
|
|
214
209
|
error: !!fieldState.error,
|
|
215
|
-
helperText:
|
|
210
|
+
helperText: fieldState.error?.message,
|
|
216
211
|
onChange: (event)=>{
|
|
217
212
|
field.onChange(event);
|
|
218
213
|
},
|
|
219
|
-
children: panelGroups.map((panelGroup, index)
|
|
220
|
-
var _panelGroup_title;
|
|
221
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
214
|
+
children: panelGroups.map((panelGroup, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
222
215
|
value: panelGroup.id,
|
|
223
|
-
children:
|
|
224
|
-
}, panelGroup.id)
|
|
225
|
-
|
|
226
|
-
});
|
|
227
|
-
}
|
|
216
|
+
children: panelGroup.title ?? `Group ${index + 1}`
|
|
217
|
+
}, panelGroup.id))
|
|
218
|
+
})
|
|
228
219
|
})
|
|
229
220
|
}),
|
|
230
221
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
@@ -233,21 +224,18 @@ function PanelEditorForm(props) {
|
|
|
233
224
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
234
225
|
control: form.control,
|
|
235
226
|
name: "panelDefinition.spec.display.description",
|
|
236
|
-
render: ({ field, fieldState })
|
|
237
|
-
var _fieldState_error;
|
|
238
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
227
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
239
228
|
...field,
|
|
240
229
|
fullWidth: true,
|
|
241
230
|
label: "Description",
|
|
242
231
|
error: !!fieldState.error,
|
|
243
|
-
helperText:
|
|
244
|
-
value: watchedDescription
|
|
232
|
+
helperText: fieldState.error?.message,
|
|
233
|
+
value: watchedDescription ?? '',
|
|
245
234
|
onChange: (event)=>{
|
|
246
235
|
field.onChange(event);
|
|
247
236
|
setDescription(event.target.value);
|
|
248
237
|
}
|
|
249
|
-
})
|
|
250
|
-
}
|
|
238
|
+
})
|
|
251
239
|
})
|
|
252
240
|
}),
|
|
253
241
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
@@ -256,10 +244,7 @@ function PanelEditorForm(props) {
|
|
|
256
244
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
257
245
|
control: form.control,
|
|
258
246
|
name: "panelDefinition.spec.plugin.kind",
|
|
259
|
-
render: ({ field, fieldState })
|
|
260
|
-
var _pluginEditor_error, _fieldState_error;
|
|
261
|
-
var _pluginEditor_error_message;
|
|
262
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
247
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
263
248
|
...field,
|
|
264
249
|
pluginTypes: [
|
|
265
250
|
'Panel'
|
|
@@ -269,7 +254,7 @@ function PanelEditorForm(props) {
|
|
|
269
254
|
label: "Type",
|
|
270
255
|
disabled: pluginEditor.isLoading,
|
|
271
256
|
error: !!pluginEditor.error || !!fieldState.error,
|
|
272
|
-
helperText:
|
|
257
|
+
helperText: pluginEditor.error?.message ?? fieldState.error?.message,
|
|
273
258
|
value: {
|
|
274
259
|
type: 'Panel',
|
|
275
260
|
kind: watchedPluginKind
|
|
@@ -278,8 +263,7 @@ function PanelEditorForm(props) {
|
|
|
278
263
|
field.onChange(event.kind);
|
|
279
264
|
pluginEditor.onSelectionChange(event);
|
|
280
265
|
}
|
|
281
|
-
})
|
|
282
|
-
}
|
|
266
|
+
})
|
|
283
267
|
})
|
|
284
268
|
}),
|
|
285
269
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Grid, {
|
|
@@ -34,15 +34,14 @@ function PanelPreview({ panelDefinition }) {
|
|
|
34
34
|
width = boxRef.current.getBoundingClientRect().width;
|
|
35
35
|
}
|
|
36
36
|
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
37
|
-
const { data: plugin,
|
|
38
|
-
if (
|
|
37
|
+
const { data: plugin, isPending } = (0, _pluginsystem.usePlugin)('Panel', panelDefinition.spec.plugin.kind);
|
|
38
|
+
if (isPending) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
if (panelDefinition.spec.plugin.kind === '') {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
const queries = (_panelDefinition_spec_queries = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries !== void 0 ? _panelDefinition_spec_queries : [];
|
|
44
|
+
const queries = panelDefinition.spec.queries ?? [];
|
|
46
45
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
47
46
|
const definitions = queries.length ? queries.map((query)=>{
|
|
48
47
|
return {
|
|
@@ -57,7 +56,7 @@ function PanelPreview({ panelDefinition }) {
|
|
|
57
56
|
definitions: definitions,
|
|
58
57
|
options: {
|
|
59
58
|
suggestedStepMs,
|
|
60
|
-
...plugin
|
|
59
|
+
...plugin?.queryOptions
|
|
61
60
|
},
|
|
62
61
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Panel.Panel, {
|
|
63
62
|
definition: panelDefinition
|
|
@@ -38,7 +38,7 @@ function PanelGroupDialog() {
|
|
|
38
38
|
const handleClose = ()=>setIsClosing(true);
|
|
39
39
|
// Don't call close on the store until the Dialog has completely transitioned out
|
|
40
40
|
const handleExited = ()=>{
|
|
41
|
-
panelGroupEditor
|
|
41
|
+
panelGroupEditor?.close();
|
|
42
42
|
setIsClosing(false);
|
|
43
43
|
};
|
|
44
44
|
// Dialog is open if we have a model and we're not transitioning out
|
|
@@ -34,7 +34,7 @@ function QuerySummaryTable(props) {
|
|
|
34
34
|
// for displaying a summary of recent query results
|
|
35
35
|
const queryClient = (0, _reactquery.useQueryClient)();
|
|
36
36
|
const queries = queryClient.getQueryCache().findAll();
|
|
37
|
-
const activeQueries = queries.filter((query)=>query.state.status === '
|
|
37
|
+
const activeQueries = queries.filter((query)=>query.state.status === 'pending');
|
|
38
38
|
const completedQueries = queries.filter((query)=>query.state.status === 'success');
|
|
39
39
|
const querySummary = (0, _pluginsystem.useActiveTimeSeriesQueries)();
|
|
40
40
|
if (datasourceClient.isLoading === true) {
|
|
@@ -42,12 +42,10 @@ function QuerySummaryTable(props) {
|
|
|
42
42
|
}
|
|
43
43
|
const warnings = [];
|
|
44
44
|
querySummary.forEach((query)=>{
|
|
45
|
-
var _queryData_metadata;
|
|
46
45
|
const queryData = query.state.data;
|
|
47
|
-
if (queryData &&
|
|
48
|
-
var _queryData_metadata_notices_;
|
|
46
|
+
if (queryData && queryData.metadata?.notices) {
|
|
49
47
|
const queryKey = query.queryKey;
|
|
50
|
-
const warningMessage =
|
|
48
|
+
const warningMessage = queryData.metadata.notices[0]?.message;
|
|
51
49
|
if (warningMessage) {
|
|
52
50
|
warnings.push({
|
|
53
51
|
query: String(queryKey[0].spec.plugin.spec.query),
|
|
@@ -29,10 +29,8 @@ const _components = require("@perses-dev/components");
|
|
|
29
29
|
const _context = require("../../context");
|
|
30
30
|
const SaveChangesConfirmationDialog = ()=>{
|
|
31
31
|
const { saveChangesConfirmationDialog: dialog } = (0, _context.useSaveChangesConfirmationDialog)();
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
var _dialog_isSavedVariableModified;
|
|
35
|
-
const isSavedVariableModified = (_dialog_isSavedVariableModified = dialog === null || dialog === void 0 ? void 0 : dialog.isSavedVariableModified) !== null && _dialog_isSavedVariableModified !== void 0 ? _dialog_isSavedVariableModified : true;
|
|
32
|
+
const isSavedDurationModified = dialog?.isSavedDurationModified ?? true;
|
|
33
|
+
const isSavedVariableModified = dialog?.isSavedVariableModified ?? true;
|
|
36
34
|
const [saveDefaultTimeRange, setSaveDefaultTimeRange] = (0, _react.useState)(isSavedDurationModified);
|
|
37
35
|
const [saveDefaultVariables, setSaveDefaultVariables] = (0, _react.useState)(isSavedVariableModified);
|
|
38
36
|
const { getSavedVariablesStatus } = (0, _context.useVariableDefinitionActions)();
|
|
@@ -59,9 +59,7 @@ function BuiltinVariableAccordions({ builtinVariableDefinitions }) {
|
|
|
59
59
|
builtinVariablesBySource
|
|
60
60
|
]);
|
|
61
61
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
62
|
-
children: sources.map((source)
|
|
63
|
-
var _builtinVariablesBySource_source;
|
|
64
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Accordion, {
|
|
62
|
+
children: sources.map((source)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Accordion, {
|
|
65
63
|
sx: (theme)=>({
|
|
66
64
|
'.MuiAccordionSummary-root': {
|
|
67
65
|
backgroundColor: theme.palette.background.lighter
|
|
@@ -110,10 +108,7 @@ function BuiltinVariableAccordions({ builtinVariableDefinitions }) {
|
|
|
110
108
|
})
|
|
111
109
|
}),
|
|
112
110
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
113
|
-
children: (
|
|
114
|
-
var _v_spec_display;
|
|
115
|
-
var _v_spec_display_description;
|
|
116
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
111
|
+
children: (builtinVariablesBySource[source] ?? []).map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
117
112
|
children: [
|
|
118
113
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
119
114
|
component: "th",
|
|
@@ -124,18 +119,16 @@ function BuiltinVariableAccordions({ builtinVariableDefinitions }) {
|
|
|
124
119
|
children: v.spec.name
|
|
125
120
|
}),
|
|
126
121
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
127
|
-
children:
|
|
122
|
+
children: v.spec.display?.description ?? ''
|
|
128
123
|
})
|
|
129
124
|
]
|
|
130
|
-
}, source + '-' + v.spec.name)
|
|
131
|
-
})
|
|
125
|
+
}, source + '-' + v.spec.name))
|
|
132
126
|
})
|
|
133
127
|
]
|
|
134
128
|
})
|
|
135
129
|
})
|
|
136
130
|
})
|
|
137
131
|
]
|
|
138
|
-
}, source)
|
|
139
|
-
})
|
|
132
|
+
}, source))
|
|
140
133
|
});
|
|
141
134
|
}
|
|
@@ -47,9 +47,8 @@ function variableOptionToVariableValue(options) {
|
|
|
47
47
|
return options.value;
|
|
48
48
|
}
|
|
49
49
|
function Variable({ name, source }) {
|
|
50
|
-
var _ctx_definition;
|
|
51
50
|
const ctx = (0, _context.useVariableDefinitionAndState)(name, source);
|
|
52
|
-
const kind =
|
|
51
|
+
const kind = ctx.definition?.kind;
|
|
53
52
|
switch(kind){
|
|
54
53
|
case 'TextVariable':
|
|
55
54
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TextVariable, {
|
|
@@ -70,22 +69,16 @@ function Variable({ name, source }) {
|
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
71
|
function useListVariableState(spec, state, variablesOptionsQuery) {
|
|
73
|
-
const allowMultiple =
|
|
74
|
-
const allowAllValue =
|
|
75
|
-
const sort = spec
|
|
76
|
-
const loading = (0, _react.useMemo)(()=>
|
|
77
|
-
var _variablesOptionsQuery_isFetching;
|
|
78
|
-
return (_variablesOptionsQuery_isFetching = variablesOptionsQuery.isFetching) !== null && _variablesOptionsQuery_isFetching !== void 0 ? _variablesOptionsQuery_isFetching : false;
|
|
79
|
-
}, [
|
|
72
|
+
const allowMultiple = spec?.allowMultiple === true;
|
|
73
|
+
const allowAllValue = spec?.allowAllValue === true;
|
|
74
|
+
const sort = spec?.sort;
|
|
75
|
+
const loading = (0, _react.useMemo)(()=>variablesOptionsQuery.isFetching ?? false, [
|
|
80
76
|
variablesOptionsQuery.isFetching
|
|
81
77
|
]);
|
|
82
|
-
const options = (0, _react.useMemo)(()=>
|
|
83
|
-
var _variablesOptionsQuery_data;
|
|
84
|
-
return (_variablesOptionsQuery_data = variablesOptionsQuery.data) !== null && _variablesOptionsQuery_data !== void 0 ? _variablesOptionsQuery_data : [];
|
|
85
|
-
}, [
|
|
78
|
+
const options = (0, _react.useMemo)(()=>variablesOptionsQuery.data ?? [], [
|
|
86
79
|
variablesOptionsQuery.data
|
|
87
80
|
]);
|
|
88
|
-
let value = state
|
|
81
|
+
let value = state?.value;
|
|
89
82
|
// Make sure value is an array if allowMultiple is true
|
|
90
83
|
if (allowMultiple && !Array.isArray(value)) {
|
|
91
84
|
value = typeof value === 'string' ? [
|
|
@@ -146,8 +139,7 @@ function useListVariableState(spec, state, variablesOptionsQuery) {
|
|
|
146
139
|
allowMultiple
|
|
147
140
|
]);
|
|
148
141
|
value = (0, _react.useMemo)(()=>{
|
|
149
|
-
|
|
150
|
-
const firstOptionValue = viewOptions === null || viewOptions === void 0 ? void 0 : (_viewOptions_ = viewOptions[allowAllValue ? 1 : 0]) === null || _viewOptions_ === void 0 ? void 0 : _viewOptions_.value;
|
|
142
|
+
const firstOptionValue = viewOptions?.[allowAllValue ? 1 : 0]?.value;
|
|
151
143
|
// If there is no value but there are options, or the value is not in options, we set the value to the first option.
|
|
152
144
|
if (firstOptionValue) {
|
|
153
145
|
if (!valueIsInOptions || !value || value.length === 0) {
|
|
@@ -169,13 +161,12 @@ function useListVariableState(spec, state, variablesOptionsQuery) {
|
|
|
169
161
|
// an array, hence this conditional
|
|
170
162
|
if (Array.isArray(value)) {
|
|
171
163
|
return viewOptions.filter((o)=>{
|
|
172
|
-
return value
|
|
164
|
+
return value?.includes(o.value);
|
|
173
165
|
});
|
|
174
166
|
} else {
|
|
175
|
-
|
|
176
|
-
return (_viewOptions_find = viewOptions.find((o)=>{
|
|
167
|
+
return viewOptions.find((o)=>{
|
|
177
168
|
return value === o.value;
|
|
178
|
-
})
|
|
169
|
+
}) ?? {
|
|
179
170
|
value: '',
|
|
180
171
|
label: ''
|
|
181
172
|
};
|
|
@@ -212,19 +203,17 @@ const getWidthPx = (inputValue, kind)=>{
|
|
|
212
203
|
}
|
|
213
204
|
};
|
|
214
205
|
function ListVariable({ name, source }) {
|
|
215
|
-
var _definition_spec_display;
|
|
216
206
|
const ctx = (0, _context.useVariableDefinitionAndState)(name, source);
|
|
217
207
|
const definition = ctx.definition;
|
|
218
208
|
const variablesOptionsQuery = (0, _pluginsystem.useListVariablePluginValues)(definition);
|
|
219
209
|
const { setVariableValue, setVariableLoading, setVariableOptions } = (0, _context.useVariableDefinitionActions)();
|
|
220
|
-
const { selectedOptions, value, loading, options, viewOptions } = useListVariableState(definition
|
|
210
|
+
const { selectedOptions, value, loading, options, viewOptions } = useListVariableState(definition?.spec, ctx.state, variablesOptionsQuery);
|
|
221
211
|
const [inputWidth, setInputWidth] = (0, _react.useState)(_constants.MIN_VARIABLE_WIDTH);
|
|
222
212
|
// Used for multiple value variables, it will not clear variable input when selecting an option
|
|
223
213
|
const [inputValue, setInputValue] = (0, _react.useState)('');
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
const allowAllValue = (definition === null || definition === void 0 ? void 0 : definition.spec.allowAllValue) === true;
|
|
214
|
+
const title = definition?.spec.display?.name ?? name;
|
|
215
|
+
const allowMultiple = definition?.spec.allowMultiple === true;
|
|
216
|
+
const allowAllValue = definition?.spec.allowAllValue === true;
|
|
228
217
|
// Update value when changed
|
|
229
218
|
(0, _react.useEffect)(()=>{
|
|
230
219
|
if (value) {
|
|
@@ -316,21 +305,17 @@ function ListVariable({ name, source }) {
|
|
|
316
305
|
});
|
|
317
306
|
}
|
|
318
307
|
function TextVariable({ name, source }) {
|
|
319
|
-
var _definition_spec_display;
|
|
320
308
|
const ctx = (0, _context.useVariableDefinitionAndState)(name, source);
|
|
321
309
|
const state = ctx.state;
|
|
322
310
|
const definition = ctx.definition;
|
|
323
|
-
|
|
324
|
-
const [tempValue, setTempValue] = (0, _react.useState)((_state_value = state === null || state === void 0 ? void 0 : state.value) !== null && _state_value !== void 0 ? _state_value : '');
|
|
311
|
+
const [tempValue, setTempValue] = (0, _react.useState)(state?.value ?? '');
|
|
325
312
|
const [inputWidth, setInputWidth] = (0, _react.useState)(getWidthPx(tempValue, 'text'));
|
|
326
313
|
const { setVariableValue } = (0, _context.useVariableDefinitionActions)();
|
|
327
314
|
(0, _react.useEffect)(()=>{
|
|
328
|
-
|
|
329
|
-
setTempValue((_state_value = state === null || state === void 0 ? void 0 : state.value) !== null && _state_value !== void 0 ? _state_value : '');
|
|
315
|
+
setTempValue(state?.value ?? '');
|
|
330
316
|
}, [
|
|
331
|
-
state
|
|
317
|
+
state?.value
|
|
332
318
|
]);
|
|
333
|
-
var _definition_spec_display_name, _definition_spec_constant;
|
|
334
319
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
335
320
|
title: tempValue,
|
|
336
321
|
value: tempValue,
|
|
@@ -340,10 +325,10 @@ function TextVariable({ name, source }) {
|
|
|
340
325
|
},
|
|
341
326
|
onBlur: ()=>setVariableValue(name, tempValue, source),
|
|
342
327
|
placeholder: name,
|
|
343
|
-
label:
|
|
328
|
+
label: definition?.spec.display?.name ?? name,
|
|
344
329
|
slotProps: {
|
|
345
330
|
input: {
|
|
346
|
-
readOnly:
|
|
331
|
+
readOnly: definition?.spec.constant ?? false
|
|
347
332
|
}
|
|
348
333
|
},
|
|
349
334
|
sx: {
|
|
@@ -51,8 +51,7 @@ function _interop_require_default(obj) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
function getVariableLabelByKind(kind) {
|
|
54
|
-
|
|
55
|
-
return (_VARIABLE_TYPES_find = _pluginsystem.VARIABLE_TYPES.find((variableType)=>variableType.kind === kind)) === null || _VARIABLE_TYPES_find === void 0 ? void 0 : _VARIABLE_TYPES_find.label;
|
|
54
|
+
return _pluginsystem.VARIABLE_TYPES.find((variableType)=>variableType.kind === kind)?.label;
|
|
56
55
|
}
|
|
57
56
|
function getValidation(variableDefinitions) {
|
|
58
57
|
const errors = [];
|
|
@@ -268,16 +267,13 @@ function VariableEditor(props) {
|
|
|
268
267
|
})
|
|
269
268
|
}),
|
|
270
269
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
271
|
-
children: variableDefinitions.map((v, idx)
|
|
272
|
-
var _v_spec_display, _v_spec_display1;
|
|
273
|
-
var _getVariableLabelByKind, _v_spec_display_description;
|
|
274
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
270
|
+
children: variableDefinitions.map((v, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
275
271
|
children: [
|
|
276
272
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
277
273
|
component: "th",
|
|
278
274
|
scope: "row",
|
|
279
275
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
280
|
-
checked:
|
|
276
|
+
checked: v.spec.display?.hidden !== true,
|
|
281
277
|
onChange: (e)=>{
|
|
282
278
|
toggleVariableVisibility(idx, e.target.checked);
|
|
283
279
|
}
|
|
@@ -297,10 +293,10 @@ function VariableEditor(props) {
|
|
|
297
293
|
})
|
|
298
294
|
}),
|
|
299
295
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
300
|
-
children:
|
|
296
|
+
children: getVariableLabelByKind(v.kind) ?? v.kind
|
|
301
297
|
}),
|
|
302
298
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
303
|
-
children:
|
|
299
|
+
children: v.spec.display?.description ?? ''
|
|
304
300
|
}),
|
|
305
301
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(TableCell, {
|
|
306
302
|
align: "right",
|
|
@@ -329,8 +325,7 @@ function VariableEditor(props) {
|
|
|
329
325
|
]
|
|
330
326
|
})
|
|
331
327
|
]
|
|
332
|
-
}, v.spec.name)
|
|
333
|
-
})
|
|
328
|
+
}, v.spec.name))
|
|
334
329
|
})
|
|
335
330
|
]
|
|
336
331
|
})
|
|
@@ -430,16 +425,13 @@ function VariableEditor(props) {
|
|
|
430
425
|
})
|
|
431
426
|
}),
|
|
432
427
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
433
|
-
children: extVar.definitions.map((v)
|
|
434
|
-
var _v_spec_display, _v_spec_display1;
|
|
435
|
-
var _getVariableLabelByKind, _v_spec_display_description;
|
|
436
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
428
|
+
children: extVar.definitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
437
429
|
children: [
|
|
438
430
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
439
431
|
component: "th",
|
|
440
432
|
scope: "row",
|
|
441
433
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
442
|
-
checked:
|
|
434
|
+
checked: v.spec.display?.hidden !== true,
|
|
443
435
|
disabled: true
|
|
444
436
|
})
|
|
445
437
|
}),
|
|
@@ -458,10 +450,10 @@ function VariableEditor(props) {
|
|
|
458
450
|
})
|
|
459
451
|
}),
|
|
460
452
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
461
|
-
children:
|
|
453
|
+
children: getVariableLabelByKind(v.kind) ?? v.kind
|
|
462
454
|
}),
|
|
463
455
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
464
|
-
children:
|
|
456
|
+
children: v.spec.display?.description ?? ''
|
|
465
457
|
}),
|
|
466
458
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(TableCell, {
|
|
467
459
|
align: "right",
|
|
@@ -495,8 +487,7 @@ function VariableEditor(props) {
|
|
|
495
487
|
]
|
|
496
488
|
})
|
|
497
489
|
]
|
|
498
|
-
}, v.spec.name)
|
|
499
|
-
})
|
|
490
|
+
}, v.spec.name))
|
|
500
491
|
})
|
|
501
492
|
]
|
|
502
493
|
})
|
|
@@ -522,13 +513,13 @@ function VariableName(props) {
|
|
|
522
513
|
const { name, state } = props;
|
|
523
514
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
524
515
|
children: [
|
|
525
|
-
!
|
|
526
|
-
!
|
|
516
|
+
!state?.overridden && `${name} `,
|
|
517
|
+
!state?.overridden && state?.overriding && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
527
518
|
fontWeight: "normal",
|
|
528
519
|
color: (theme)=>theme.palette.primary.main,
|
|
529
520
|
children: "(overriding)"
|
|
530
521
|
}),
|
|
531
|
-
|
|
522
|
+
state?.overridden && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
532
523
|
children: [
|
|
533
524
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
534
525
|
color: (theme)=>theme.palette.grey[500],
|