@perses-dev/dashboards 0.50.1 → 0.51.0-beta.0
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/DownloadButton/DownloadButton.js +135 -29
- 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/components/Panel/HeaderIconButton.js +27 -0
- 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 -35
- 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 +30 -36
- 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 -1
- 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 +8 -11
- package/dist/cjs/context/VariableProvider/hydrationUtils.js +3 -6
- package/dist/cjs/context/VariableProvider/utils.js +2 -2
- package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/cjs/stories/decorators/WithVariables.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.d.ts +1 -5
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +94 -29
- 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/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/components/Panel/HeaderIconButton.js +19 -0
- 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 -35
- 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/Variables/BuiltinVariableAccordions.js +5 -12
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/Variable.js +30 -36
- 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 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +1 -1
- 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/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.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 +8 -11
- 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/utils.js +2 -2
- package/dist/context/VariableProvider/utils.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithVariables.js +1 -1
- package/dist/stories/decorators/WithVariables.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/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 +8 -7
|
@@ -38,11 +38,16 @@ const FakeTimeSeriesPlugin = {
|
|
|
38
38
|
content: FakeTimeSeriesChartOptionEditor
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
createInitialOptions: ()=>({})
|
|
41
|
+
createInitialOptions: ()=>({}),
|
|
42
|
+
supportedQueryTypes: [
|
|
43
|
+
'TimeSeriesQuery'
|
|
44
|
+
]
|
|
42
45
|
};
|
|
43
46
|
const MOCK_TIME_SERIES_PANEL = {
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
kind: 'Panel',
|
|
48
|
+
spec: {
|
|
49
|
+
name: 'TimeSeriesChart'
|
|
50
|
+
},
|
|
46
51
|
plugin: FakeTimeSeriesPlugin
|
|
47
52
|
};
|
|
48
53
|
const MOCK_PLUGINS = [
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -21,15 +21,15 @@ Object.defineProperty(exports, "renderWithContext", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
24
|
+
const _components = require("@perses-dev/components");
|
|
25
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _reactquery = require("@tanstack/react-query");
|
|
27
|
+
const _react = require("@testing-library/react");
|
|
27
28
|
const _history = require("history");
|
|
29
|
+
const _react1 = require("react");
|
|
30
|
+
const _reactrouterdom = require("react-router-dom");
|
|
28
31
|
const _usequeryparams = require("use-query-params");
|
|
29
32
|
const _reactrouter6 = require("use-query-params/adapters/react-router-6");
|
|
30
|
-
const _reactquery = require("@tanstack/react-query");
|
|
31
|
-
const _components = require("@perses-dev/components");
|
|
32
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
33
33
|
const _context = require("../context");
|
|
34
34
|
const _test = require("../test");
|
|
35
35
|
const _pluginregistry = require("./plugin-registry");
|
|
@@ -37,11 +37,11 @@ const _pluginregistry = require("./plugin-registry");
|
|
|
37
37
|
* Workaround for React router upgrade type errors.
|
|
38
38
|
* More details: https://stackoverflow.com/a/69948457/17575201
|
|
39
39
|
*/ const CustomRouter = ({ history, children })=>{
|
|
40
|
-
const [state, setState] = (0,
|
|
40
|
+
const [state, setState] = (0, _react1.useState)({
|
|
41
41
|
action: history.action,
|
|
42
42
|
location: history.location
|
|
43
43
|
});
|
|
44
|
-
(0,
|
|
44
|
+
(0, _react1.useLayoutEffect)(()=>history.listen(setState), [
|
|
45
45
|
history
|
|
46
46
|
]);
|
|
47
47
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactrouterdom.Router, {
|
|
@@ -61,7 +61,8 @@ function renderWithContext(ui, options, history) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
const customHistory = history
|
|
64
|
+
const customHistory = history ?? (0, _history.createMemoryHistory)();
|
|
65
|
+
const mockRegistry = (0, _pluginsystem.mockPluginRegistry)(..._pluginregistry.MOCK_PLUGINS);
|
|
65
66
|
const BaseRender = ()=>/*#__PURE__*/ (0, _jsxruntime.jsx)(CustomRouter, {
|
|
66
67
|
history: customHistory,
|
|
67
68
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactquery.QueryClientProvider, {
|
|
@@ -76,7 +77,8 @@ function renderWithContext(ui, options, history) {
|
|
|
76
77
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ChartsProvider, {
|
|
77
78
|
chartsTheme: _components.testChartsTheme,
|
|
78
79
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
|
|
79
|
-
|
|
80
|
+
pluginLoader: mockRegistry.pluginLoader,
|
|
81
|
+
defaultPluginKinds: mockRegistry.defaultPluginKinds,
|
|
80
82
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.DatasourceStoreProvider, {
|
|
81
83
|
..._test.defaultDatasourceProps,
|
|
82
84
|
children: ui
|
|
@@ -87,5 +89,5 @@ function renderWithContext(ui, options, history) {
|
|
|
87
89
|
})
|
|
88
90
|
})
|
|
89
91
|
});
|
|
90
|
-
return (0,
|
|
92
|
+
return (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(BaseRender, {}), options);
|
|
91
93
|
}
|
|
@@ -28,7 +28,7 @@ const _pluginsystem = require("@perses-dev/plugin-system");
|
|
|
28
28
|
const _components1 = require("../../components");
|
|
29
29
|
const _context = require("../../context");
|
|
30
30
|
const DashboardApp = (props)=>{
|
|
31
|
-
const { dashboardResource, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isCreating } = props;
|
|
31
|
+
const { dashboardResource, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isVariableEnabled, isDatasourceEnabled, isCreating } = props;
|
|
32
32
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
33
33
|
const { isEditMode, setEditMode } = (0, _context.useEditMode)();
|
|
34
34
|
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
@@ -49,8 +49,7 @@ const DashboardApp = (props)=>{
|
|
|
49
49
|
const onEditButtonClick = ()=>{
|
|
50
50
|
setEditMode(true);
|
|
51
51
|
setOriginalDashboard(dashboard);
|
|
52
|
-
|
|
53
|
-
setSavedDatasources((_dashboard_spec_datasources = dashboard.spec.datasources) !== null && _dashboard_spec_datasources !== void 0 ? _dashboard_spec_datasources : {});
|
|
52
|
+
setSavedDatasources(dashboard.spec.datasources ?? {});
|
|
54
53
|
};
|
|
55
54
|
const onCancelButtonClick = ()=>{
|
|
56
55
|
// check if dashboard has been modified
|
|
@@ -82,6 +81,8 @@ const DashboardApp = (props)=>{
|
|
|
82
81
|
initialVariableIsSticky: initialVariableIsSticky,
|
|
83
82
|
onSave: onSave,
|
|
84
83
|
isReadonly: isReadonly,
|
|
84
|
+
isVariableEnabled: isVariableEnabled,
|
|
85
|
+
isDatasourceEnabled: isDatasourceEnabled,
|
|
85
86
|
onEditButtonClick: onEditButtonClick,
|
|
86
87
|
onCancelButtonClick: onCancelButtonClick
|
|
87
88
|
}),
|
|
@@ -30,12 +30,10 @@ const _context = require("../../context");
|
|
|
30
30
|
const _DashboardProviderWithQueryParams = require("../../context/DashboardProvider/DashboardProviderWithQueryParams");
|
|
31
31
|
const _DashboardApp = require("./DashboardApp");
|
|
32
32
|
function ViewDashboard(props) {
|
|
33
|
-
const { dashboardResource, datasourceApi, externalVariableDefinitions, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isEditing, isCreating, sx, ...others } = props;
|
|
33
|
+
const { dashboardResource, datasourceApi, externalVariableDefinitions, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isVariableEnabled, isDatasourceEnabled, isEditing, isCreating, sx, ...others } = props;
|
|
34
34
|
const { spec } = dashboardResource;
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
var _spec_refreshInterval;
|
|
38
|
-
const dashboardRefreshInterval = (_spec_refreshInterval = spec.refreshInterval) !== null && _spec_refreshInterval !== void 0 ? _spec_refreshInterval : _core.DEFAULT_REFRESH_INTERVAL;
|
|
35
|
+
const dashboardDuration = spec.duration ?? _core.DEFAULT_DASHBOARD_DURATION;
|
|
36
|
+
const dashboardRefreshInterval = spec.refreshInterval ?? _core.DEFAULT_REFRESH_INTERVAL;
|
|
39
37
|
const initialTimeRange = (0, _pluginsystem.useInitialTimeRange)(dashboardDuration);
|
|
40
38
|
const initialRefreshInterval = (0, _pluginsystem.useInitialRefreshInterval)(dashboardRefreshInterval);
|
|
41
39
|
const { data } = (0, _pluginsystem.usePluginBuiltinVariableDefinitions)();
|
|
@@ -111,6 +109,8 @@ function ViewDashboard(props) {
|
|
|
111
109
|
onDiscard: onDiscard,
|
|
112
110
|
initialVariableIsSticky: initialVariableIsSticky,
|
|
113
111
|
isReadonly: isReadonly,
|
|
112
|
+
isVariableEnabled: isVariableEnabled,
|
|
113
|
+
isDatasourceEnabled: isDatasourceEnabled,
|
|
114
114
|
isCreating: isCreating
|
|
115
115
|
})
|
|
116
116
|
})
|
|
@@ -21,12 +21,10 @@ const HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view
|
|
|
21
21
|
/**
|
|
22
22
|
* Renders a Dashboard for the provided Dashboard spec.
|
|
23
23
|
*/ export function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }) {
|
|
24
|
-
var _boxRef_current;
|
|
25
24
|
const panelGroupIds = usePanelGroupIds();
|
|
26
25
|
const boxRef = useRef(null);
|
|
27
26
|
const isEmpty = !panelGroupIds.length;
|
|
28
|
-
|
|
29
|
-
const dashboardTopPosition = (_boxRef_current_getBoundingClientRect_top = (_boxRef_current = boxRef.current) === null || _boxRef_current === void 0 ? void 0 : _boxRef_current.getBoundingClientRect().top) !== null && _boxRef_current_getBoundingClientRect_top !== void 0 ? _boxRef_current_getBoundingClientRect_top : HEADER_HEIGHT;
|
|
27
|
+
const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;
|
|
30
28
|
const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;
|
|
31
29
|
return /*#__PURE__*/ _jsx(Box, {
|
|
32
30
|
...boxProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Dashboard/Dashboard.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 { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { ReactElement, useRef } from 'react';\nimport { usePanelGroupIds } from '../../context';\nimport { GridLayout } from '../GridLayout';\nimport { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard';\nimport { PanelOptions } from '../Panel';\nexport type DashboardProps = BoxProps & {\n /**\n * Props for `EmptyDashboard` component that will be rendered when the dashboard\n * is empty (i.e. has no panel groups). If not specified, the defaults will\n * be used.\n */\n emptyDashboardProps?: EmptyDashboardProps;\n panelOptions?: PanelOptions;\n};\nconst HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)\n\n/**\n * Renders a Dashboard for the provided Dashboard spec.\n */\nexport function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps): ReactElement {\n const panelGroupIds = usePanelGroupIds();\n const boxRef = useRef<HTMLDivElement>(null);\n const isEmpty = !panelGroupIds.length;\n const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;\n const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;\n\n return (\n <Box {...boxProps} sx={{ height: '100%' }} ref={boxRef}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n {isEmpty && (\n <Box sx={{ height: '100%', display: 'flex', alignItems: 'center' }}>\n <EmptyDashboard {...emptyDashboardProps} />\n </Box>\n )}\n {!isEmpty &&\n panelGroupIds.map((panelGroupId) => (\n <GridLayout\n key={panelGroupId}\n panelGroupId={panelGroupId}\n panelOptions={panelOptions}\n panelFullHeight={panelFullHeight}\n />\n ))}\n </ErrorBoundary>\n </Box>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","useRef","usePanelGroupIds","GridLayout","EmptyDashboard","HEADER_HEIGHT","Dashboard","emptyDashboardProps","panelOptions","boxProps","
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dashboard/Dashboard.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 { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { ReactElement, useRef } from 'react';\nimport { usePanelGroupIds } from '../../context';\nimport { GridLayout } from '../GridLayout';\nimport { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard';\nimport { PanelOptions } from '../Panel';\nexport type DashboardProps = BoxProps & {\n /**\n * Props for `EmptyDashboard` component that will be rendered when the dashboard\n * is empty (i.e. has no panel groups). If not specified, the defaults will\n * be used.\n */\n emptyDashboardProps?: EmptyDashboardProps;\n panelOptions?: PanelOptions;\n};\nconst HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)\n\n/**\n * Renders a Dashboard for the provided Dashboard spec.\n */\nexport function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps): ReactElement {\n const panelGroupIds = usePanelGroupIds();\n const boxRef = useRef<HTMLDivElement>(null);\n const isEmpty = !panelGroupIds.length;\n const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;\n const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;\n\n return (\n <Box {...boxProps} sx={{ height: '100%' }} ref={boxRef}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n {isEmpty && (\n <Box sx={{ height: '100%', display: 'flex', alignItems: 'center' }}>\n <EmptyDashboard {...emptyDashboardProps} />\n </Box>\n )}\n {!isEmpty &&\n panelGroupIds.map((panelGroupId) => (\n <GridLayout\n key={panelGroupId}\n panelGroupId={panelGroupId}\n panelOptions={panelOptions}\n panelFullHeight={panelFullHeight}\n />\n ))}\n </ErrorBoundary>\n </Box>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","useRef","usePanelGroupIds","GridLayout","EmptyDashboard","HEADER_HEIGHT","Dashboard","emptyDashboardProps","panelOptions","boxProps","panelGroupIds","boxRef","isEmpty","length","dashboardTopPosition","current","getBoundingClientRect","top","panelFullHeight","window","innerHeight","scrollY","sx","height","ref","FallbackComponent","display","alignItems","map","panelGroupId"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AAC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8
|
+
isVariableEnabled: boolean;
|
|
9
|
+
isDatasourceEnabled: boolean;
|
|
8
10
|
onEditButtonClick: () => void;
|
|
9
11
|
onCancelButtonClick: () => void;
|
|
10
12
|
onSave?: OnSaveDashboard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,eAAe,EAAe,MAAM,eAAe,CAAC;AAW7D,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,KAAG,
|
|
1
|
+
{"version":3,"file":"DashboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,eAAe,EAAe,MAAM,eAAe,CAAC;AAW7D,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,KAAG,YAgG/D,CAAC"}
|
|
@@ -25,7 +25,7 @@ import { EditJsonButton } from '../EditJsonButton';
|
|
|
25
25
|
import { SaveDashboardButton } from '../SaveDashboardButton';
|
|
26
26
|
import { DashboardStickyToolbar } from '../DashboardStickyToolbar';
|
|
27
27
|
export const DashboardToolbar = (props)=>{
|
|
28
|
-
const { dashboardName, dashboardTitleComponent, initialVariableIsSticky, isReadonly, onEditButtonClick, onCancelButtonClick, onSave } = props;
|
|
28
|
+
const { dashboardName, dashboardTitleComponent, initialVariableIsSticky, isReadonly, isVariableEnabled, isDatasourceEnabled, onEditButtonClick, onCancelButtonClick, onSave } = props;
|
|
29
29
|
const { isEditMode } = useEditMode();
|
|
30
30
|
const isBiggerThanSm = useMediaQuery(useTheme().breakpoints.up('sm'));
|
|
31
31
|
const isBiggerThanMd = useMediaQuery(useTheme().breakpoints.up('md'));
|
|
@@ -66,8 +66,8 @@ export const DashboardToolbar = (props)=>{
|
|
|
66
66
|
ml: 1,
|
|
67
67
|
whiteSpace: "nowrap",
|
|
68
68
|
children: [
|
|
69
|
-
/*#__PURE__*/ _jsx(EditVariablesButton, {}),
|
|
70
|
-
/*#__PURE__*/ _jsx(EditDatasourcesButton, {}),
|
|
69
|
+
isVariableEnabled && /*#__PURE__*/ _jsx(EditVariablesButton, {}),
|
|
70
|
+
isDatasourceEnabled && /*#__PURE__*/ _jsx(EditDatasourcesButton, {}),
|
|
71
71
|
/*#__PURE__*/ _jsx(AddPanelButton, {}),
|
|
72
72
|
/*#__PURE__*/ _jsx(AddGroupButton, {})
|
|
73
73
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/DashboardToolbar/DashboardToolbar.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 { Typography, Stack, Button, Box, useTheme, useMediaQuery, Alert } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { TimeRangeControls } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { OnSaveDashboard, useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { AddGroupButton } from '../AddGroupButton';\nimport { DownloadButton } from '../DownloadButton';\nimport { EditVariablesButton } from '../Variables';\nimport { EditDatasourcesButton } from '../Datasources';\nimport { EditButton } from '../EditButton';\nimport { EditJsonButton } from '../EditJsonButton';\nimport { SaveDashboardButton } from '../SaveDashboardButton';\nimport { DashboardStickyToolbar } from '../DashboardStickyToolbar';\n\nexport interface DashboardToolbarProps {\n dashboardName: string;\n dashboardTitleComponent?: JSX.Element;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n onEditButtonClick: () => void;\n onCancelButtonClick: () => void;\n onSave?: OnSaveDashboard;\n}\n\nexport const DashboardToolbar = (props: DashboardToolbarProps): ReactElement => {\n const {\n dashboardName,\n dashboardTitleComponent,\n initialVariableIsSticky,\n isReadonly,\n onEditButtonClick,\n onCancelButtonClick,\n onSave,\n } = props;\n\n const { isEditMode } = useEditMode();\n\n const isBiggerThanSm = useMediaQuery(useTheme().breakpoints.up('sm'));\n const isBiggerThanMd = useMediaQuery(useTheme().breakpoints.up('md'));\n\n const dashboardTitle = dashboardTitleComponent ? (\n dashboardTitleComponent\n ) : (\n <Typography variant=\"h2\">{dashboardName}</Typography>\n );\n\n const testId = 'dashboard-toolbar';\n\n return (\n <>\n <Stack data-testid={testId}>\n <Box\n px={2}\n py={1.5}\n display=\"flex\"\n sx={{ backgroundColor: (theme) => theme.palette.primary.main + (isEditMode ? '30' : '0') }}\n >\n {dashboardTitle}\n {isEditMode ? (\n <Stack direction=\"row\" gap={1} ml=\"auto\">\n {isReadonly && (\n <Alert severity=\"warning\" sx={{ backgroundColor: 'transparent', padding: 0 }}>\n Dashboard managed via code only. Download JSON and commit changes to save.\n </Alert>\n )}\n <Stack direction=\"row\" spacing={0.5} ml={1} whiteSpace=\"nowrap\">\n <EditVariablesButton
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DashboardToolbar/DashboardToolbar.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 { Typography, Stack, Button, Box, useTheme, useMediaQuery, Alert } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { TimeRangeControls } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { OnSaveDashboard, useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { AddGroupButton } from '../AddGroupButton';\nimport { DownloadButton } from '../DownloadButton';\nimport { EditVariablesButton } from '../Variables';\nimport { EditDatasourcesButton } from '../Datasources';\nimport { EditButton } from '../EditButton';\nimport { EditJsonButton } from '../EditJsonButton';\nimport { SaveDashboardButton } from '../SaveDashboardButton';\nimport { DashboardStickyToolbar } from '../DashboardStickyToolbar';\n\nexport interface DashboardToolbarProps {\n dashboardName: string;\n dashboardTitleComponent?: JSX.Element;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n isVariableEnabled: boolean;\n isDatasourceEnabled: boolean;\n onEditButtonClick: () => void;\n onCancelButtonClick: () => void;\n onSave?: OnSaveDashboard;\n}\n\nexport const DashboardToolbar = (props: DashboardToolbarProps): ReactElement => {\n const {\n dashboardName,\n dashboardTitleComponent,\n initialVariableIsSticky,\n isReadonly,\n isVariableEnabled,\n isDatasourceEnabled,\n onEditButtonClick,\n onCancelButtonClick,\n onSave,\n } = props;\n\n const { isEditMode } = useEditMode();\n\n const isBiggerThanSm = useMediaQuery(useTheme().breakpoints.up('sm'));\n const isBiggerThanMd = useMediaQuery(useTheme().breakpoints.up('md'));\n\n const dashboardTitle = dashboardTitleComponent ? (\n dashboardTitleComponent\n ) : (\n <Typography variant=\"h2\">{dashboardName}</Typography>\n );\n\n const testId = 'dashboard-toolbar';\n\n return (\n <>\n <Stack data-testid={testId}>\n <Box\n px={2}\n py={1.5}\n display=\"flex\"\n sx={{ backgroundColor: (theme) => theme.palette.primary.main + (isEditMode ? '30' : '0') }}\n >\n {dashboardTitle}\n {isEditMode ? (\n <Stack direction=\"row\" gap={1} ml=\"auto\">\n {isReadonly && (\n <Alert severity=\"warning\" sx={{ backgroundColor: 'transparent', padding: 0 }}>\n Dashboard managed via code only. Download JSON and commit changes to save.\n </Alert>\n )}\n <Stack direction=\"row\" spacing={0.5} ml={1} whiteSpace=\"nowrap\">\n {isVariableEnabled && <EditVariablesButton />}\n {isDatasourceEnabled && <EditDatasourcesButton />}\n <AddPanelButton />\n <AddGroupButton />\n </Stack>\n <SaveDashboardButton onSave={onSave} isDisabled={isReadonly} />\n <Button variant=\"outlined\" onClick={onCancelButtonClick}>\n Cancel\n </Button>\n </Stack>\n ) : (\n <>\n {isBiggerThanSm && (\n <Stack direction=\"row\" gap={1} ml=\"auto\">\n <EditButton onClick={onEditButtonClick} />\n </Stack>\n )}\n </>\n )}\n </Box>\n <Box\n sx={{\n display: 'flex',\n width: '100%',\n alignItems: 'start',\n padding: (theme) => theme.spacing(1, 2, 0, 2),\n flexDirection: isBiggerThanMd ? 'row' : 'column',\n flexWrap: 'nowrap',\n gap: 1,\n }}\n >\n <Box width=\"100%\">\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <DashboardStickyToolbar\n initialVariableIsSticky={initialVariableIsSticky}\n sx={{\n backgroundColor: ({ palette }) => palette.background.default,\n }}\n />\n </ErrorBoundary>\n </Box>\n <Stack direction=\"row\" ml=\"auto\" flexWrap=\"wrap\" justifyContent=\"end\">\n <Stack direction=\"row\" spacing={1} mt={1} ml={1}>\n <TimeRangeControls />\n <DownloadButton />\n <EditJsonButton isReadonly={!isEditMode} />\n </Stack>\n </Stack>\n </Box>\n </Stack>\n </>\n );\n};\n"],"names":["Typography","Stack","Button","Box","useTheme","useMediaQuery","Alert","ErrorBoundary","ErrorAlert","TimeRangeControls","useEditMode","AddPanelButton","AddGroupButton","DownloadButton","EditVariablesButton","EditDatasourcesButton","EditButton","EditJsonButton","SaveDashboardButton","DashboardStickyToolbar","DashboardToolbar","props","dashboardName","dashboardTitleComponent","initialVariableIsSticky","isReadonly","isVariableEnabled","isDatasourceEnabled","onEditButtonClick","onCancelButtonClick","onSave","isEditMode","isBiggerThanSm","breakpoints","up","isBiggerThanMd","dashboardTitle","variant","testId","data-testid","px","py","display","sx","backgroundColor","theme","palette","primary","main","direction","gap","ml","severity","padding","spacing","whiteSpace","isDisabled","onClick","width","alignItems","flexDirection","flexWrap","FallbackComponent","background","default","justifyContent","mt"],"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,UAAU,EAAEC,KAAK,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,KAAK,QAAQ,gBAAgB;AAC/F,SAASC,aAAa,EAAEC,UAAU,QAAQ,yBAAyB;AACnE,SAASC,iBAAiB,QAAQ,4BAA4B;AA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,WAAU;oCAAMK,SAAS;oCAAKH,IAAI;oCAAGI,YAAW;;wCACpD7B,mCAAqB,KAACZ;wCACtBa,qCAAuB,KAACZ;sDACzB,KAACJ;sDACD,KAACC;;;8CAEH,KAACM;oCAAoBY,QAAQA;oCAAQ0B,YAAY/B;;8CACjD,KAACvB;oCAAOmC,SAAQ;oCAAWoB,SAAS5B;8CAAqB;;;2CAK3D;sCACGG,gCACC,KAAC/B;gCAAMgD,WAAU;gCAAMC,KAAK;gCAAGC,IAAG;0CAChC,cAAA,KAACnC;oCAAWyC,SAAS7B;;;;;;8BAM/B,MAACzB;oBACCwC,IAAI;wBACFD,SAAS;wBACTgB,OAAO;wBACPC,YAAY;wBACZN,SAAS,CAACR,QAAUA,MAAMS,OAAO,CAAC,GAAG,GAAG,GAAG;wBAC3CM,eAAezB,iBAAiB,QAAQ;wBACxC0B,UAAU;wBACVX,KAAK;oBACP;;sCAEA,KAAC/C;4BAAIuD,OAAM;sCACT,cAAA,KAACnD;gCAAcuD,mBAAmBtD;0CAChC,cAAA,KAACW;oCACCK,yBAAyBA;oCACzBmB,IAAI;wCACFC,iBAAiB,CAAC,EAAEE,OAAO,EAAE,GAAKA,QAAQiB,UAAU,CAACC,OAAO;oCAC9D;;;;sCAIN,KAAC/D;4BAAMgD,WAAU;4BAAME,IAAG;4BAAOU,UAAS;4BAAOI,gBAAe;sCAC9D,cAAA,MAAChE;gCAAMgD,WAAU;gCAAMK,SAAS;gCAAGY,IAAI;gCAAGf,IAAI;;kDAC5C,KAAC1C;kDACD,KAACI;kDACD,KAACI;wCAAeQ,YAAY,CAACM;;;;;;;;;;AAO3C,EAAE"}
|
|
@@ -62,10 +62,9 @@ export function DatasourceEditor(props) {
|
|
|
62
62
|
};
|
|
63
63
|
const editDatasource = (name)=>{
|
|
64
64
|
setDatasourceFormAction('update');
|
|
65
|
-
var _datasources_name;
|
|
66
65
|
setDatasourceEdit({
|
|
67
66
|
name: name,
|
|
68
|
-
spec:
|
|
67
|
+
spec: datasources[name] ?? defaultSpec
|
|
69
68
|
});
|
|
70
69
|
};
|
|
71
70
|
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
@@ -161,8 +160,6 @@ export function DatasourceEditor(props) {
|
|
|
161
160
|
}),
|
|
162
161
|
/*#__PURE__*/ _jsx(TableBody, {
|
|
163
162
|
children: Object.entries(datasources).map(([name, spec])=>{
|
|
164
|
-
var _spec_display;
|
|
165
|
-
var _spec_display_description;
|
|
166
163
|
return /*#__PURE__*/ _jsxs(TableRow, {
|
|
167
164
|
children: [
|
|
168
165
|
/*#__PURE__*/ _jsx(TableCell, {
|
|
@@ -177,7 +174,7 @@ export function DatasourceEditor(props) {
|
|
|
177
174
|
children: spec.plugin.kind
|
|
178
175
|
}),
|
|
179
176
|
/*#__PURE__*/ _jsx(TableCell, {
|
|
180
|
-
children:
|
|
177
|
+
children: spec.display?.description ?? ''
|
|
181
178
|
}),
|
|
182
179
|
/*#__PURE__*/ _jsxs(TableCell, {
|
|
183
180
|
align: "right",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Datasources/DatasourceEditor.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 {\n Box,\n Button,\n IconButton,\n Stack,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport PencilIcon from 'mdi-material-ui/Pencil';\nimport TrashIcon from 'mdi-material-ui/TrashCan';\nimport { Action, DatasourceDefinition, DatasourceSpec } from '@perses-dev/core';\nimport { DatasourceEditorForm, ValidationProvider } from '@perses-dev/plugin-system';\nimport { ReactElement, useState } from 'react';\nimport { useImmer } from 'use-immer';\nimport { useDiscardChangesConfirmationDialog } from '../../context';\n\nexport function DatasourceEditor(props: {\n datasources: Record<string, DatasourceSpec>;\n onChange: (datasources: Record<string, DatasourceSpec>) => void;\n onCancel: () => void;\n}): ReactElement {\n const [datasources, setDatasources] = useImmer(props.datasources);\n const [datasourceFormAction, setDatasourceFormAction] = useState<Action>('update');\n const [datasourceEdit, setDatasourceEdit] = useState<DatasourceDefinition | null>(null);\n const defaultSpec: DatasourceSpec = {\n default: false,\n plugin: {\n // TODO: find a way to avoid assuming that the PrometheusDatasource plugin is installed\n kind: 'PrometheusDatasource',\n spec: {},\n },\n };\n\n const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } =\n useDiscardChangesConfirmationDialog();\n\n const handleCancel = (): void => {\n if (JSON.stringify(props.datasources) !== JSON.stringify(datasources)) {\n openDiscardChangesConfirmationDialog({\n onDiscardChanges: () => {\n closeDiscardChangesConfirmationDialog();\n props.onCancel();\n },\n onCancel: () => {\n closeDiscardChangesConfirmationDialog();\n },\n description:\n 'You have unapplied changes. Are you sure you want to discard these changes? Changes cannot be recovered.',\n });\n } else {\n props.onCancel();\n }\n };\n\n const removeDatasource = (name: string): void => {\n setDatasources((draft) => {\n delete draft[name];\n });\n };\n\n const addDatasource = (): void => {\n setDatasourceFormAction('create');\n setDatasourceEdit({\n name: 'NewDatasource',\n spec: defaultSpec,\n });\n };\n\n const editDatasource = (name: string): void => {\n setDatasourceFormAction('update');\n setDatasourceEdit({\n name: name,\n spec: datasources[name] ?? defaultSpec,\n });\n };\n\n return (\n <>\n {datasourceEdit ? (\n <ValidationProvider>\n <DatasourceEditorForm\n initialDatasourceDefinition={datasourceEdit}\n action={datasourceFormAction}\n isDraft={true}\n onActionChange={setDatasourceFormAction}\n onSave={(def: DatasourceDefinition) => {\n setDatasources((draft) => {\n delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed\n draft[def.name] = def.spec;\n setDatasourceEdit(null);\n });\n }}\n onClose={() => {\n setDatasourceEdit(null);\n }}\n />\n </ValidationProvider>\n ) : (\n <>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n padding: (theme) => theme.spacing(1, 2),\n borderBottom: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <Typography variant=\"h2\">Edit Dashboard Datasources</Typography>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n <Button\n disabled={props.datasources === datasources}\n variant=\"contained\"\n onClick={() => {\n props.onChange(datasources);\n }}\n >\n Apply\n </Button>\n <Button color=\"secondary\" variant=\"outlined\" onClick={handleCancel}>\n Cancel\n </Button>\n </Stack>\n </Box>\n <Box padding={2} sx={{ overflowY: 'scroll' }}>\n <Stack spacing={2}>\n <Stack spacing={2}>\n <TableContainer>\n <Table sx={{ minWidth: 650 }} aria-label=\"table of datasources\">\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Type</TableCell>\n <TableCell>Description</TableCell>\n <TableCell align=\"right\">Actions</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {Object.entries(datasources).map(([name, spec]) => {\n return (\n <TableRow key={name}>\n <TableCell component=\"th\" scope=\"row\" sx={{ fontWeight: 'bold' }}>\n {name}\n </TableCell>\n <TableCell>{spec.plugin.kind}</TableCell>\n <TableCell>{spec.display?.description ?? ''}</TableCell>\n <TableCell align=\"right\" sx={{ whiteSpace: 'nowrap' }}>\n <IconButton onClick={() => editDatasource(name)}>\n <PencilIcon />\n </IconButton>\n <IconButton onClick={() => removeDatasource(name)}>\n <TrashIcon />\n </IconButton>\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </TableContainer>\n <Box display=\"flex\">\n <Button\n variant=\"contained\"\n startIcon={<AddIcon />}\n sx={{ marginLeft: 'auto' }}\n onClick={addDatasource}\n >\n Add Datasource\n </Button>\n </Box>\n </Stack>\n </Stack>\n </Box>\n </>\n )}\n </>\n );\n}\n"],"names":["Box","Button","IconButton","Stack","Table","TableBody","TableCell","TableContainer","TableHead","TableRow","Typography","AddIcon","PencilIcon","TrashIcon","DatasourceEditorForm","ValidationProvider","useState","useImmer","useDiscardChangesConfirmationDialog","DatasourceEditor","props","datasources","setDatasources","datasourceFormAction","setDatasourceFormAction","datasourceEdit","setDatasourceEdit","defaultSpec","default","plugin","kind","spec","openDiscardChangesConfirmationDialog","closeDiscardChangesConfirmationDialog","handleCancel","JSON","stringify","onDiscardChanges","onCancel","description","removeDatasource","name","draft","addDatasource","editDatasource","initialDatasourceDefinition","action","isDraft","onActionChange","onSave","def","onClose","sx","display","alignItems","padding","theme","spacing","borderBottom","palette","divider","variant","direction","marginLeft","disabled","onClick","onChange","color","overflowY","minWidth","aria-label","align","Object","entries","map","component","scope","fontWeight","whiteSpace","startIcon"],"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,SACEA,GAAG,EACHC,MAAM,EACNC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,UAAU,QACL,gBAAgB;AACvB,OAAOC,aAAa,uBAAuB;AAC3C,OAAOC,gBAAgB,yBAAyB;AAChD,OAAOC,eAAe,2BAA2B;AAEjD,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,4BAA4B;AACrF,SAAuBC,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,mCAAmC,QAAQ,gBAAgB;AAEpE,OAAO,SAASC,iBAAiBC,KAIhC;IACC,MAAM,CAACC,aAAaC,eAAe,GAAGL,SAASG,MAAMC,WAAW;IAChE,MAAM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W,cAAzBR,uCAAAA,4BAA6B;;0EACzC,MAACzB;gEAAUiE,OAAM;gEAAQnB,IAAI;oEAAE0B,YAAY;gEAAS;;kFAClD,KAAC5E;wEAAW+D,SAAS,IAAMrB,eAAeH;kFACxC,cAAA,KAAC7B;;kFAEH,KAACV;wEAAW+D,SAAS,IAAMzB,iBAAiBC;kFAC1C,cAAA,KAAC5B;;;;;uDAXQ4B;gDAgBnB;;;;;8CAIN,KAACzC;oCAAIqD,SAAQ;8CACX,cAAA,KAACpD;wCACC4D,SAAQ;wCACRkB,yBAAW,KAACpE;wCACZyC,IAAI;4CAAEW,YAAY;wCAAO;wCACzBE,SAAStB;kDACV;;;;;;;;;;AAWnB"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Datasources/DatasourceEditor.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 {\n Box,\n Button,\n IconButton,\n Stack,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport PencilIcon from 'mdi-material-ui/Pencil';\nimport TrashIcon from 'mdi-material-ui/TrashCan';\nimport { Action, DatasourceDefinition, DatasourceSpec } from '@perses-dev/core';\nimport { DatasourceEditorForm, ValidationProvider } from '@perses-dev/plugin-system';\nimport { ReactElement, useState } from 'react';\nimport { useImmer } from 'use-immer';\nimport { useDiscardChangesConfirmationDialog } from '../../context';\n\nexport function DatasourceEditor(props: {\n datasources: Record<string, DatasourceSpec>;\n onChange: (datasources: Record<string, DatasourceSpec>) => void;\n onCancel: () => void;\n}): ReactElement {\n const [datasources, setDatasources] = useImmer(props.datasources);\n const [datasourceFormAction, setDatasourceFormAction] = useState<Action>('update');\n const [datasourceEdit, setDatasourceEdit] = useState<DatasourceDefinition | null>(null);\n const defaultSpec: DatasourceSpec = {\n default: false,\n plugin: {\n // TODO: find a way to avoid assuming that the PrometheusDatasource plugin is installed\n kind: 'PrometheusDatasource',\n spec: {},\n },\n };\n\n const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } =\n useDiscardChangesConfirmationDialog();\n\n const handleCancel = (): void => {\n if (JSON.stringify(props.datasources) !== JSON.stringify(datasources)) {\n openDiscardChangesConfirmationDialog({\n onDiscardChanges: () => {\n closeDiscardChangesConfirmationDialog();\n props.onCancel();\n },\n onCancel: () => {\n closeDiscardChangesConfirmationDialog();\n },\n description:\n 'You have unapplied changes. Are you sure you want to discard these changes? Changes cannot be recovered.',\n });\n } else {\n props.onCancel();\n }\n };\n\n const removeDatasource = (name: string): void => {\n setDatasources((draft) => {\n delete draft[name];\n });\n };\n\n const addDatasource = (): void => {\n setDatasourceFormAction('create');\n setDatasourceEdit({\n name: 'NewDatasource',\n spec: defaultSpec,\n });\n };\n\n const editDatasource = (name: string): void => {\n setDatasourceFormAction('update');\n setDatasourceEdit({\n name: name,\n spec: datasources[name] ?? defaultSpec,\n });\n };\n\n return (\n <>\n {datasourceEdit ? (\n <ValidationProvider>\n <DatasourceEditorForm\n initialDatasourceDefinition={datasourceEdit}\n action={datasourceFormAction}\n isDraft={true}\n onActionChange={setDatasourceFormAction}\n onSave={(def: DatasourceDefinition) => {\n setDatasources((draft) => {\n delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed\n draft[def.name] = def.spec;\n setDatasourceEdit(null);\n });\n }}\n onClose={() => {\n setDatasourceEdit(null);\n }}\n />\n </ValidationProvider>\n ) : (\n <>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n padding: (theme) => theme.spacing(1, 2),\n borderBottom: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <Typography variant=\"h2\">Edit Dashboard Datasources</Typography>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n <Button\n disabled={props.datasources === datasources}\n variant=\"contained\"\n onClick={() => {\n props.onChange(datasources);\n }}\n >\n Apply\n </Button>\n <Button color=\"secondary\" variant=\"outlined\" onClick={handleCancel}>\n Cancel\n </Button>\n </Stack>\n </Box>\n <Box padding={2} sx={{ overflowY: 'scroll' }}>\n <Stack spacing={2}>\n <Stack spacing={2}>\n <TableContainer>\n <Table sx={{ minWidth: 650 }} aria-label=\"table of datasources\">\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Type</TableCell>\n <TableCell>Description</TableCell>\n <TableCell align=\"right\">Actions</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {Object.entries(datasources).map(([name, spec]) => {\n return (\n <TableRow key={name}>\n <TableCell component=\"th\" scope=\"row\" sx={{ fontWeight: 'bold' }}>\n {name}\n </TableCell>\n <TableCell>{spec.plugin.kind}</TableCell>\n <TableCell>{spec.display?.description ?? ''}</TableCell>\n <TableCell align=\"right\" sx={{ whiteSpace: 'nowrap' }}>\n <IconButton onClick={() => editDatasource(name)}>\n <PencilIcon />\n </IconButton>\n <IconButton onClick={() => removeDatasource(name)}>\n <TrashIcon />\n </IconButton>\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </TableContainer>\n <Box display=\"flex\">\n <Button\n variant=\"contained\"\n startIcon={<AddIcon />}\n sx={{ marginLeft: 'auto' }}\n onClick={addDatasource}\n >\n Add Datasource\n </Button>\n </Box>\n </Stack>\n </Stack>\n </Box>\n </>\n )}\n </>\n );\n}\n"],"names":["Box","Button","IconButton","Stack","Table","TableBody","TableCell","TableContainer","TableHead","TableRow","Typography","AddIcon","PencilIcon","TrashIcon","DatasourceEditorForm","ValidationProvider","useState","useImmer","useDiscardChangesConfirmationDialog","DatasourceEditor","props","datasources","setDatasources","datasourceFormAction","setDatasourceFormAction","datasourceEdit","setDatasourceEdit","defaultSpec","default","plugin","kind","spec","openDiscardChangesConfirmationDialog","closeDiscardChangesConfirmationDialog","handleCancel","JSON","stringify","onDiscardChanges","onCancel","description","removeDatasource","name","draft","addDatasource","editDatasource","initialDatasourceDefinition","action","isDraft","onActionChange","onSave","def","onClose","sx","display","alignItems","padding","theme","spacing","borderBottom","palette","divider","variant","direction","marginLeft","disabled","onClick","onChange","color","overflowY","minWidth","aria-label","align","Object","entries","map","component","scope","fontWeight","whiteSpace","startIcon"],"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,SACEA,GAAG,EACHC,MAAM,EACNC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,UAAU,QACL,gBAAgB;AACvB,OAAOC,aAAa,uBAAuB;AAC3C,OAAOC,gBAAgB,yBAAyB;AAChD,OAAOC,eAAe,2BAA2B;AAEjD,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,4BAA4B;AACrF,SAAuBC,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,mCAAmC,QAAQ,gBAAgB;AAEpE,OAAO,SAASC,iBAAiBC,KAIhC;IACC,MAAM,CAACC,aAAaC,eAAe,GAAGL,SAASG,MAAMC,WAAW;IAChE,MAAM,CAACE,sBAAsBC,wBAAwB,GAAGR,SAAiB;IACzE,MAAM,CAACS,gBAAgBC,kBAAkB,GAAGV,SAAsC;IAClF,MAAMW,cAA8B;QAClCC,SAAS;QACTC,QAAQ;YACN,uFAAuF;YACvFC,MAAM;YACNC,MAAM,CAAC;QACT;IACF;IAEA,MAAM,EAAEC,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B,yBAAW,KAACpE;wCACZyC,IAAI;4CAAEW,YAAY;wCAAO;wCACzBE,SAAStB;kDACV;;;;;;;;;;AAWnB"}
|
|
@@ -34,13 +34,10 @@ export function EditDatasourcesButton() {
|
|
|
34
34
|
const handleChangeDatasources = (datasources)=>{
|
|
35
35
|
// Calculates the new list of datasources that are allowed to be used.
|
|
36
36
|
const newSavedDatasources = Object.keys(datasources).filter((key)=>{
|
|
37
|
-
var _datasources_key_plugin, _datasources_key, _savedDatasources_key_plugin, _savedDatasources_key, _datasources_key_plugin_spec, _datasources_key_plugin1, _datasources_key1, _savedDatasources_key_plugin_spec, _savedDatasources_key_plugin1, _savedDatasources_key1;
|
|
38
|
-
var _datasources_key_plugin_spec1;
|
|
39
37
|
// Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their
|
|
40
38
|
// proxy is the same as what we have saved.
|
|
41
|
-
const isDirect = 'directUrl' in (
|
|
42
|
-
|
|
43
|
-
const isSavedProxy = !isDirect && !('directUrl' in ((_savedDatasources_key_plugin_spec1 = (_savedDatasources_key = savedDatasources[key]) === null || _savedDatasources_key === void 0 ? void 0 : (_savedDatasources_key_plugin = _savedDatasources_key.plugin) === null || _savedDatasources_key_plugin === void 0 ? void 0 : _savedDatasources_key_plugin.spec) !== null && _savedDatasources_key_plugin_spec1 !== void 0 ? _savedDatasources_key_plugin_spec1 : {})) && ((_datasources_key1 = datasources[key]) === null || _datasources_key1 === void 0 ? void 0 : (_datasources_key_plugin1 = _datasources_key1.plugin) === null || _datasources_key_plugin1 === void 0 ? void 0 : (_datasources_key_plugin_spec = _datasources_key_plugin1.spec) === null || _datasources_key_plugin_spec === void 0 ? void 0 : _datasources_key_plugin_spec.proxy) === ((_savedDatasources_key1 = savedDatasources[key]) === null || _savedDatasources_key1 === void 0 ? void 0 : (_savedDatasources_key_plugin1 = _savedDatasources_key1.plugin) === null || _savedDatasources_key_plugin1 === void 0 ? void 0 : (_savedDatasources_key_plugin_spec = _savedDatasources_key_plugin1.spec) === null || _savedDatasources_key_plugin_spec === void 0 ? void 0 : _savedDatasources_key_plugin_spec.proxy);
|
|
39
|
+
const isDirect = 'directUrl' in (datasources[key]?.plugin?.spec ?? {});
|
|
40
|
+
const isSavedProxy = !isDirect && !('directUrl' in (savedDatasources[key]?.plugin?.spec ?? {})) && datasources[key]?.plugin?.spec?.proxy === savedDatasources[key]?.plugin?.spec?.proxy;
|
|
44
41
|
return isDirect || isSavedProxy;
|
|
45
42
|
}).reduce((obj, key)=>{
|
|
46
43
|
obj[key] = datasources[key];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Datasources/EditDatasourcesButton.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 { ReactElement, useState } from 'react';\nimport { Button } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\nimport { Drawer, InfoTooltip } from '@perses-dev/components';\nimport { DashboardResource, DatasourceSpec, EphemeralDashboardResource } from '@perses-dev/core';\nimport { useDatasourceStore } from '@perses-dev/plugin-system';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboard } from '../../context';\nimport { DatasourceEditor } from './DatasourceEditor';\n\nexport function EditDatasourcesButton(): ReactElement {\n const [isDatasourceEditorOpen, setIsDatasourceEditorOpen] = useState(false);\n const { getLocalDatasources, setLocalDatasources, getSavedDatasources, setSavedDatasources } = useDatasourceStore();\n const localDatasources: Record<string, DatasourceSpec> = getLocalDatasources();\n const savedDatasources: Record<string, DatasourceSpec> = getSavedDatasources();\n const { dashboard, setDashboard } = useDashboard();\n\n const openDatasourceEditor = (): void => {\n setIsDatasourceEditorOpen(true);\n };\n\n const closeDatasourceEditor = (): void => {\n setIsDatasourceEditorOpen(false);\n };\n\n const handleChangeDatasources = (datasources: Record<string, DatasourceSpec>): void => {\n // Calculates the new list of datasources that are allowed to be used.\n const newSavedDatasources: Record<string, DatasourceSpec> = Object.keys(datasources)\n .filter((key) => {\n // Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their\n // proxy is the same as what we have saved.\n const isDirect = 'directUrl' in (datasources[key]?.plugin?.spec ?? {});\n const isSavedProxy =\n !isDirect &&\n !('directUrl' in (savedDatasources[key]?.plugin?.spec ?? {})) &&\n datasources[key]?.plugin?.spec?.proxy === savedDatasources[key]?.plugin?.spec?.proxy;\n\n return isDirect || isSavedProxy;\n })\n .reduce(\n (obj, key) => {\n obj[key] = datasources[key] as DatasourceSpec;\n\n return obj;\n },\n {} as Record<string, DatasourceSpec>\n );\n\n setDashboard(\n dashboard.kind === 'Dashboard'\n ? ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n datasources: datasources,\n },\n } as DashboardResource)\n : ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n datasources: datasources,\n },\n } as EphemeralDashboardResource)\n );\n setSavedDatasources(newSavedDatasources);\n setLocalDatasources(datasources);\n setIsDatasourceEditorOpen(false);\n };\n\n return (\n <>\n <InfoTooltip description={TOOLTIP_TEXT.editDatasources}>\n <Button\n startIcon={<PencilIcon />}\n onClick={openDatasourceEditor}\n aria-label={TOOLTIP_TEXT.editDatasources}\n variant=\"text\"\n color=\"primary\"\n sx={editButtonStyle}\n >\n Datasources\n </Button>\n </InfoTooltip>\n <Drawer\n isOpen={isDatasourceEditorOpen}\n onClose={closeDatasourceEditor}\n PaperProps={{ sx: { width: '50%' } }}\n data-testid=\"datasource-editor\"\n >\n <DatasourceEditor\n datasources={localDatasources}\n onCancel={closeDatasourceEditor}\n onChange={handleChangeDatasources}\n />\n </Drawer>\n </>\n );\n}\n"],"names":["useState","Button","PencilIcon","Drawer","InfoTooltip","useDatasourceStore","TOOLTIP_TEXT","editButtonStyle","useDashboard","DatasourceEditor","EditDatasourcesButton","isDatasourceEditorOpen","setIsDatasourceEditorOpen","getLocalDatasources","setLocalDatasources","getSavedDatasources","setSavedDatasources","localDatasources","savedDatasources","dashboard","setDashboard","openDatasourceEditor","closeDatasourceEditor","handleChangeDatasources","datasources","newSavedDatasources","Object","keys","filter","key","isDirect","plugin","spec","isSavedProxy","proxy","reduce","obj","kind","description","editDatasources","startIcon","onClick","aria-label","variant","color","sx","isOpen","onClose","PaperProps","width","data-testid","onCancel","onChange"],"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,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,gBAAgB,gCAAgC;AACvD,SAASC,MAAM,EAAEC,WAAW,QAAQ,yBAAyB;AAE7D,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,YAAY,EAAEC,eAAe,QAAQ,kBAAkB;AAChE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD,OAAO,SAASC;IACd,MAAM,CAACC,wBAAwBC,0BAA0B,GAAGZ,SAAS;IACrE,MAAM,EAAEa,mBAAmB,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAE,GAAGX;IAC/F,MAAMY,mBAAmDJ;IACzD,MAAMK,mBAAmDH;IACzD,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAE,GAAGZ;IAEpC,MAAMa,uBAAuB;QAC3BT,0BAA0B;IAC5B;IAEA,MAAMU,wBAAwB;QAC5BV,0BAA0B;IAC5B;IAEA,MAAMW,0BAA0B,CAACC;QAC/B,sEAAsE;QACtE,MAAMC,sBAAsDC,OAAOC,IAAI,CAACH,aACrEI,MAAM,CAAC,CAACC;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Datasources/EditDatasourcesButton.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 { ReactElement, useState } from 'react';\nimport { Button } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\nimport { Drawer, InfoTooltip } from '@perses-dev/components';\nimport { DashboardResource, DatasourceSpec, EphemeralDashboardResource } from '@perses-dev/core';\nimport { useDatasourceStore } from '@perses-dev/plugin-system';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboard } from '../../context';\nimport { DatasourceEditor } from './DatasourceEditor';\n\nexport function EditDatasourcesButton(): ReactElement {\n const [isDatasourceEditorOpen, setIsDatasourceEditorOpen] = useState(false);\n const { getLocalDatasources, setLocalDatasources, getSavedDatasources, setSavedDatasources } = useDatasourceStore();\n const localDatasources: Record<string, DatasourceSpec> = getLocalDatasources();\n const savedDatasources: Record<string, DatasourceSpec> = getSavedDatasources();\n const { dashboard, setDashboard } = useDashboard();\n\n const openDatasourceEditor = (): void => {\n setIsDatasourceEditorOpen(true);\n };\n\n const closeDatasourceEditor = (): void => {\n setIsDatasourceEditorOpen(false);\n };\n\n const handleChangeDatasources = (datasources: Record<string, DatasourceSpec>): void => {\n // Calculates the new list of datasources that are allowed to be used.\n const newSavedDatasources: Record<string, DatasourceSpec> = Object.keys(datasources)\n .filter((key) => {\n // Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their\n // proxy is the same as what we have saved.\n const isDirect = 'directUrl' in (datasources[key]?.plugin?.spec ?? {});\n const isSavedProxy =\n !isDirect &&\n !('directUrl' in (savedDatasources[key]?.plugin?.spec ?? {})) &&\n datasources[key]?.plugin?.spec?.proxy === savedDatasources[key]?.plugin?.spec?.proxy;\n\n return isDirect || isSavedProxy;\n })\n .reduce(\n (obj, key) => {\n obj[key] = datasources[key] as DatasourceSpec;\n\n return obj;\n },\n {} as Record<string, DatasourceSpec>\n );\n\n setDashboard(\n dashboard.kind === 'Dashboard'\n ? ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n datasources: datasources,\n },\n } as DashboardResource)\n : ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n datasources: datasources,\n },\n } as EphemeralDashboardResource)\n );\n setSavedDatasources(newSavedDatasources);\n setLocalDatasources(datasources);\n setIsDatasourceEditorOpen(false);\n };\n\n return (\n <>\n <InfoTooltip description={TOOLTIP_TEXT.editDatasources}>\n <Button\n startIcon={<PencilIcon />}\n onClick={openDatasourceEditor}\n aria-label={TOOLTIP_TEXT.editDatasources}\n variant=\"text\"\n color=\"primary\"\n sx={editButtonStyle}\n >\n Datasources\n </Button>\n </InfoTooltip>\n <Drawer\n isOpen={isDatasourceEditorOpen}\n onClose={closeDatasourceEditor}\n PaperProps={{ sx: { width: '50%' } }}\n data-testid=\"datasource-editor\"\n >\n <DatasourceEditor\n datasources={localDatasources}\n onCancel={closeDatasourceEditor}\n onChange={handleChangeDatasources}\n />\n </Drawer>\n </>\n );\n}\n"],"names":["useState","Button","PencilIcon","Drawer","InfoTooltip","useDatasourceStore","TOOLTIP_TEXT","editButtonStyle","useDashboard","DatasourceEditor","EditDatasourcesButton","isDatasourceEditorOpen","setIsDatasourceEditorOpen","getLocalDatasources","setLocalDatasources","getSavedDatasources","setSavedDatasources","localDatasources","savedDatasources","dashboard","setDashboard","openDatasourceEditor","closeDatasourceEditor","handleChangeDatasources","datasources","newSavedDatasources","Object","keys","filter","key","isDirect","plugin","spec","isSavedProxy","proxy","reduce","obj","kind","description","editDatasources","startIcon","onClick","aria-label","variant","color","sx","isOpen","onClose","PaperProps","width","data-testid","onCancel","onChange"],"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,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,gBAAgB,gCAAgC;AACvD,SAASC,MAAM,EAAEC,WAAW,QAAQ,yBAAyB;AAE7D,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,YAAY,EAAEC,eAAe,QAAQ,kBAAkB;AAChE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD,OAAO,SAASC;IACd,MAAM,CAACC,wBAAwBC,0BAA0B,GAAGZ,SAAS;IACrE,MAAM,EAAEa,mBAAmB,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAE,GAAGX;IAC/F,MAAMY,mBAAmDJ;IACzD,MAAMK,mBAAmDH;IACzD,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAE,GAAGZ;IAEpC,MAAMa,uBAAuB;QAC3BT,0BAA0B;IAC5B;IAEA,MAAMU,wBAAwB;QAC5BV,0BAA0B;IAC5B;IAEA,MAAMW,0BAA0B,CAACC;QAC/B,sEAAsE;QACtE,MAAMC,sBAAsDC,OAAOC,IAAI,CAACH,aACrEI,MAAM,CAAC,CAACC;YACP,8FAA8F;YAC9F,2CAA2C;YAC3C,MAAMC,WAAW,eAAgBN,CAAAA,WAAW,CAACK,IAAI,EAAEE,QAAQC,QAAQ,CAAC,CAAA;YACpE,MAAMC,eACJ,CAACH,YACD,CAAE,CAAA,eAAgBZ,CAAAA,gBAAgB,CAACW,IAAI,EAAEE,QAAQC,QAAQ,CAAC,CAAA,CAAC,KAC3DR,WAAW,CAACK,IAAI,EAAEE,QAAQC,MAAME,UAAUhB,gBAAgB,CAACW,IAAI,EAAEE,QAAQC,MAAME;YAEjF,OAAOJ,YAAYG;QACrB,GACCE,MAAM,CACL,CAACC,KAAKP;YACJO,GAAG,CAACP,IAAI,GAAGL,WAAW,CAACK,IAAI;YAE3B,OAAOO;QACT,GACA,CAAC;QAGLhB,aACED,UAAUkB,IAAI,KAAK,cACd;YACC,GAAGlB,SAAS;YACZa,MAAM;gBACJ,GAAGb,UAAUa,IAAI;gBACjBR,aAAaA;YACf;QACF,IACC;YACC,GAAGL,SAAS;YACZa,MAAM;gBACJ,GAAGb,UAAUa,IAAI;gBACjBR,aAAaA;YACf;QACF;QAENR,oBAAoBS;QACpBX,oBAAoBU;QACpBZ,0BAA0B;IAC5B;IAEA,qBACE;;0BACE,KAACR;gBAAYkC,aAAahC,aAAaiC,eAAe;0BACpD,cAAA,KAACtC;oBACCuC,yBAAW,KAACtC;oBACZuC,SAASpB;oBACTqB,cAAYpC,aAAaiC,eAAe;oBACxCI,SAAQ;oBACRC,OAAM;oBACNC,IAAItC;8BACL;;;0BAIH,KAACJ;gBACC2C,QAAQnC;gBACRoC,SAASzB;gBACT0B,YAAY;oBAAEH,IAAI;wBAAEI,OAAO;oBAAM;gBAAE;gBACnCC,eAAY;0BAEZ,cAAA,KAACzC;oBACCe,aAAaP;oBACbkC,UAAU7B;oBACV8B,UAAU7B;;;;;AAKpB"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Dialog } from '@perses-dev/components';
|
|
15
|
-
import { useDeletePanelDialog } from '../../context';
|
|
15
|
+
import { useDeletePanelDialog, useViewPanel } from '../../context';
|
|
16
16
|
export const DeletePanelDialog = ()=>{
|
|
17
17
|
const { deletePanelDialog, closeDeletePanelDialog } = useDeletePanelDialog();
|
|
18
18
|
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
@@ -30,11 +30,13 @@ export const DeletePanelDialog = ()=>{
|
|
|
30
30
|
};
|
|
31
31
|
const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
32
32
|
const { deletePanel, closeDeletePanelDialog } = useDeletePanelDialog();
|
|
33
|
+
const { setViewPanel } = useViewPanel();
|
|
33
34
|
const handleDelete = (e)=>{
|
|
34
35
|
e.preventDefault();
|
|
35
36
|
const { panelGroupItemId } = deletePanelDialog;
|
|
36
37
|
deletePanel(panelGroupItemId);
|
|
37
38
|
closeDeletePanelDialog();
|
|
39
|
+
setViewPanel(undefined);
|
|
38
40
|
};
|
|
39
41
|
return /*#__PURE__*/ _jsxs("form", {
|
|
40
42
|
onSubmit: handleDelete,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/DeletePanelDialog/DeletePanelDialog.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 { FormEvent, ReactElement } from 'react';\nimport { Dialog } from '@perses-dev/components';\nimport { useDeletePanelDialog, DeletePanelDialogState } from '../../context';\n\nexport const DeletePanelDialog = (): ReactElement => {\n const { deletePanelDialog, closeDeletePanelDialog } = useDeletePanelDialog();\n\n return (\n <Dialog open={deletePanelDialog !== undefined}>\n <Dialog.Header onClose={() => closeDeletePanelDialog()}>Delete Panel</Dialog.Header>\n {deletePanelDialog && <DeletePanelForm deletePanelDialog={deletePanelDialog} />}\n </Dialog>\n );\n};\n\ninterface DeletePanelFormProps {\n deletePanelDialog: DeletePanelDialogState;\n}\n\nconst DeletePanelForm = ({ deletePanelDialog }: DeletePanelFormProps): ReactElement => {\n const { deletePanel, closeDeletePanelDialog } = useDeletePanelDialog();\n\n const handleDelete = (e: FormEvent): void => {\n e.preventDefault();\n const { panelGroupItemId } = deletePanelDialog;\n deletePanel(panelGroupItemId);\n closeDeletePanelDialog();\n };\n return (\n <form onSubmit={handleDelete}>\n <Dialog.Content>\n Are you sure you want to delete {deletePanelDialog.panelName} from {deletePanelDialog.panelGroupName}? This\n action cannot be undone.\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton>Delete</Dialog.PrimaryButton>\n <Dialog.SecondaryButton onClick={() => closeDeletePanelDialog()}>Cancel</Dialog.SecondaryButton>\n </Dialog.Actions>\n </form>\n );\n};\n"],"names":["Dialog","useDeletePanelDialog","DeletePanelDialog","deletePanelDialog","closeDeletePanelDialog","open","undefined","Header","onClose","DeletePanelForm","deletePanel","handleDelete","e","preventDefault","panelGroupItemId","form","onSubmit","Content","panelName","panelGroupName","Actions","PrimaryButton","SecondaryButton","onClick"],"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,MAAM,QAAQ,yBAAyB;AAChD,SAASC,oBAAoB,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DeletePanelDialog/DeletePanelDialog.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 { FormEvent, ReactElement } from 'react';\nimport { Dialog } from '@perses-dev/components';\nimport { useDeletePanelDialog, DeletePanelDialogState, useViewPanel } from '../../context';\n\nexport const DeletePanelDialog = (): ReactElement => {\n const { deletePanelDialog, closeDeletePanelDialog } = useDeletePanelDialog();\n\n return (\n <Dialog open={deletePanelDialog !== undefined}>\n <Dialog.Header onClose={() => closeDeletePanelDialog()}>Delete Panel</Dialog.Header>\n {deletePanelDialog && <DeletePanelForm deletePanelDialog={deletePanelDialog} />}\n </Dialog>\n );\n};\n\ninterface DeletePanelFormProps {\n deletePanelDialog: DeletePanelDialogState;\n}\n\nconst DeletePanelForm = ({ deletePanelDialog }: DeletePanelFormProps): ReactElement => {\n const { deletePanel, closeDeletePanelDialog } = useDeletePanelDialog();\n const { setViewPanel } = useViewPanel();\n\n const handleDelete = (e: FormEvent): void => {\n e.preventDefault();\n const { panelGroupItemId } = deletePanelDialog;\n deletePanel(panelGroupItemId);\n closeDeletePanelDialog();\n setViewPanel(undefined);\n };\n\n return (\n <form onSubmit={handleDelete}>\n <Dialog.Content>\n Are you sure you want to delete {deletePanelDialog.panelName} from {deletePanelDialog.panelGroupName}? This\n action cannot be undone.\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton>Delete</Dialog.PrimaryButton>\n <Dialog.SecondaryButton onClick={() => closeDeletePanelDialog()}>Cancel</Dialog.SecondaryButton>\n </Dialog.Actions>\n </form>\n );\n};\n"],"names":["Dialog","useDeletePanelDialog","useViewPanel","DeletePanelDialog","deletePanelDialog","closeDeletePanelDialog","open","undefined","Header","onClose","DeletePanelForm","deletePanel","setViewPanel","handleDelete","e","preventDefault","panelGroupItemId","form","onSubmit","Content","panelName","panelGroupName","Actions","PrimaryButton","SecondaryButton","onClick"],"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,MAAM,QAAQ,yBAAyB;AAChD,SAASC,oBAAoB,EAA0BC,YAAY,QAAQ,gBAAgB;AAE3F,OAAO,MAAMC,oBAAoB;IAC/B,MAAM,EAAEC,iBAAiB,EAAEC,sBAAsB,EAAE,GAAGJ;IAEtD,qBACE,MAACD;QAAOM,MAAMF,sBAAsBG;;0BAClC,KAACP,OAAOQ,MAAM;gBAACC,SAAS,IAAMJ;0BAA0B;;YACvDD,mCAAqB,KAACM;gBAAgBN,mBAAmBA;;;;AAGhE,EAAE;AAMF,MAAMM,kBAAkB,CAAC,EAAEN,iBAAiB,EAAwB;IAClE,MAAM,EAAEO,WAAW,EAAEN,sBAAsB,EAAE,GAAGJ;IAChD,MAAM,EAAEW,YAAY,EAAE,GAAGV;IAEzB,MAAMW,eAAe,CAACC;QACpBA,EAAEC,cAAc;QAChB,MAAM,EAAEC,gBAAgB,EAAE,GAAGZ;QAC7BO,YAAYK;QACZX;QACAO,aAAaL;IACf;IAEA,qBACE,MAACU;QAAKC,UAAUL;;0BACd,MAACb,OAAOmB,OAAO;;oBAAC;oBACmBf,kBAAkBgB,SAAS;oBAAC;oBAAOhB,kBAAkBiB,cAAc;oBAAC;;;0BAGvG,MAACrB,OAAOsB,OAAO;;kCACb,KAACtB,OAAOuB,aAAa;kCAAC;;kCACtB,KAACvB,OAAOwB,eAAe;wBAACC,SAAS,IAAMpB;kCAA0B;;;;;;AAIzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeletePanelGroupDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAKhD,eAAO,MAAM,sBAAsB,QAAO,
|
|
1
|
+
{"version":3,"file":"DeletePanelGroupDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAKhD,eAAO,MAAM,sBAAsB,QAAO,YA6CzC,CAAC"}
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';
|
|
15
15
|
import CloseIcon from 'mdi-material-ui/Close';
|
|
16
|
-
import { useDeletePanelGroupDialog } from '../../context';
|
|
16
|
+
import { useDeletePanelGroupDialog, useViewPanel } from '../../context';
|
|
17
17
|
export const DeletePanelGroupDialog = ()=>{
|
|
18
18
|
const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = useDeletePanelGroupDialog();
|
|
19
|
-
const
|
|
19
|
+
const { setViewPanel } = useViewPanel();
|
|
20
|
+
const panelGroupId = deletePanelGroupDialog?.panelGroupId;
|
|
20
21
|
const handleDelete = (e)=>{
|
|
21
22
|
e.preventDefault();
|
|
22
23
|
if (panelGroupId === undefined) {
|
|
@@ -24,8 +25,8 @@ export const DeletePanelGroupDialog = ()=>{
|
|
|
24
25
|
}
|
|
25
26
|
deletePanelGroup(panelGroupId);
|
|
26
27
|
closeDeletePanelGroupDialog();
|
|
28
|
+
setViewPanel(undefined);
|
|
27
29
|
};
|
|
28
|
-
var _deletePanelGroupDialog_panelGroupName;
|
|
29
30
|
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
30
31
|
open: deletePanelGroupDialog !== undefined,
|
|
31
32
|
children: [
|
|
@@ -52,7 +53,7 @@ export const DeletePanelGroupDialog = ()=>{
|
|
|
52
53
|
},
|
|
53
54
|
children: [
|
|
54
55
|
"Are you sure you want to delete ",
|
|
55
|
-
|
|
56
|
+
deletePanelGroupDialog?.panelGroupName ?? 'panel group',
|
|
56
57
|
"? This will delete all the panels within the group."
|
|
57
58
|
]
|
|
58
59
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.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 { FormEvent, ReactElement } from 'react';\nimport { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { useDeletePanelGroupDialog } from '../../context';\n\nexport const DeletePanelGroupDialog = (): ReactElement => {\n const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = useDeletePanelGroupDialog();\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.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 { FormEvent, ReactElement } from 'react';\nimport { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { useDeletePanelGroupDialog, useViewPanel } from '../../context';\n\nexport const DeletePanelGroupDialog = (): ReactElement => {\n const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = useDeletePanelGroupDialog();\n const { setViewPanel } = useViewPanel();\n const panelGroupId = deletePanelGroupDialog?.panelGroupId;\n\n const handleDelete = (e: FormEvent): void => {\n e.preventDefault();\n if (panelGroupId === undefined) {\n throw new Error('group index is undefined');\n }\n deletePanelGroup(panelGroupId);\n closeDeletePanelGroupDialog();\n setViewPanel(undefined);\n };\n\n return (\n <Dialog open={deletePanelGroupDialog !== undefined}>\n <DialogTitle>Delete Panel Group</DialogTitle>\n <IconButton\n aria-label=\"Close\"\n onClick={() => closeDeletePanelGroupDialog()}\n sx={(theme) => ({\n position: 'absolute',\n top: theme.spacing(0.5),\n right: theme.spacing(0.5),\n })}\n >\n <CloseIcon />\n </IconButton>\n <form onSubmit={handleDelete}>\n <DialogContent dividers sx={{ width: '500px' }}>\n Are you sure you want to delete {deletePanelGroupDialog?.panelGroupName ?? 'panel group'}? This will delete\n all the panels within the group.\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" type=\"submit\">\n Delete\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={() => closeDeletePanelGroupDialog()}>\n Cancel\n </Button>\n </DialogActions>\n </form>\n </Dialog>\n );\n};\n"],"names":["IconButton","Dialog","DialogTitle","DialogContent","DialogActions","Button","CloseIcon","useDeletePanelGroupDialog","useViewPanel","DeletePanelGroupDialog","deletePanelGroupDialog","closeDeletePanelGroupDialog","deletePanelGroup","setViewPanel","panelGroupId","handleDelete","e","preventDefault","undefined","Error","open","aria-label","onClick","sx","theme","position","top","spacing","right","form","onSubmit","dividers","width","panelGroupName","variant","type","color"],"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,UAAU,EAAEC,MAAM,EAAEC,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,MAAM,QAAQ,gBAAgB;AACtG,OAAOC,eAAe,wBAAwB;AAC9C,SAASC,yBAAyB,EAAEC,YAAY,QAAQ,gBAAgB;AAExE,OAAO,MAAMC,yBAAyB;IACpC,MAAM,EAAEC,sBAAsB,EAAEC,2BAA2B,EAAEC,gBAAgB,EAAE,GAAGL;IAClF,MAAM,EAAEM,YAAY,EAAE,GAAGL;IACzB,MAAMM,eAAeJ,wBAAwBI;IAE7C,MAAMC,eAAe,CAACC;QACpBA,EAAEC,cAAc;QAChB,IAAIH,iBAAiBI,WAAW;YAC9B,MAAM,IAAIC,MAAM;QAClB;QACAP,iBAAiBE;QACjBH;QACAE,aAAaK;IACf;IAEA,qBACE,MAACjB;QAAOmB,MAAMV,2BAA2BQ;;0BACvC,KAAChB;0BAAY;;0BACb,KAACF;gBACCqB,cAAW;gBACXC,SAAS,IAAMX;gBACfY,IAAI,CAACC,QAAW,CAAA;wBACdC,UAAU;wBACVC,KAAKF,MAAMG,OAAO,CAAC;wBACnBC,OAAOJ,MAAMG,OAAO,CAAC;oBACvB,CAAA;0BAEA,cAAA,KAACrB;;0BAEH,MAACuB;gBAAKC,UAAUf;;kCACd,MAACZ;wBAAc4B,QAAQ;wBAACR,IAAI;4BAAES,OAAO;wBAAQ;;4BAAG;4BACbtB,wBAAwBuB,kBAAkB;4BAAc;;;kCAG3F,MAAC7B;;0CACC,KAACC;gCAAO6B,SAAQ;gCAAYC,MAAK;0CAAS;;0CAG1C,KAAC9B;gCAAO6B,SAAQ;gCAAWE,OAAM;gCAAYd,SAAS,IAAMX;0CAA+B;;;;;;;;AAOrG,EAAE"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
heightPx?: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function DownloadButton({ heightPx }: DownloadButtonProps): ReactElement;
|
|
6
|
-
export {};
|
|
2
|
+
export declare function DownloadButton(): ReactElement;
|
|
7
3
|
//# sourceMappingURL=DownloadButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadButton.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DownloadButton.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"names":[],"mappings":"AAgBA,OAAc,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAKpD,wBAAgB,cAAc,IAAI,YAAY,CAgG7C"}
|