@perses-dev/dashboards 0.21.1 → 0.23.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/AddGroupButton/AddGroupButton.js +43 -0
- package/dist/cjs/components/AddGroupButton/index.js +28 -0
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +43 -0
- package/dist/cjs/components/AddPanelButton/index.js +28 -0
- package/dist/cjs/components/Dashboard/Dashboard.js +1 -1
- package/dist/cjs/components/Dashboard/index.js +1 -1
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +50 -22
- package/dist/cjs/components/DashboardToolbar/index.js +1 -1
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +9 -31
- package/dist/cjs/components/DeletePanelDialog/index.js +1 -1
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +2 -1
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +1 -1
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +2 -1
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +17 -53
- package/dist/cjs/components/DownloadButton/index.js +1 -1
- package/dist/cjs/components/GridLayout/GridContainer.js +2 -1
- package/dist/cjs/components/GridLayout/GridItemContent.js +3 -2
- package/dist/cjs/components/GridLayout/GridLayout.js +6 -8
- package/dist/cjs/components/GridLayout/GridTitle.js +14 -11
- package/dist/cjs/components/GridLayout/index.js +1 -1
- package/dist/cjs/components/Panel/Panel.js +6 -6
- package/dist/cjs/components/Panel/Panel.test.js +11 -3
- package/dist/cjs/components/Panel/PanelContent.js +3 -2
- package/dist/cjs/components/Panel/PanelHeader.js +26 -8
- package/dist/cjs/components/Panel/index.js +1 -1
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +2 -1
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +1 -1
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +1 -1
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +1 -1
- package/dist/cjs/components/PanelDrawer/index.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +4 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/index.js +1 -1
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +14 -16
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +3 -3
- package/dist/cjs/components/TimeRangeControls/index.js +1 -1
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +35 -0
- package/dist/cjs/components/ToolbarIconButton/index.js +28 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +75 -0
- package/dist/cjs/components/Variables/Variable.js +1 -1
- package/dist/cjs/components/Variables/VariableEditor.js +10 -6
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +6 -7
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/cjs/components/Variables/VariableList.js +45 -111
- package/dist/cjs/components/Variables/index.js +4 -2
- package/dist/cjs/components/Variables/variable-model.js +1 -1
- package/dist/cjs/components/Variables/variable-model.test.js +1 -1
- package/dist/cjs/components/index.js +5 -2
- package/dist/cjs/{utils/functions.js → constants/grid-layout-config.js} +14 -6
- package/dist/cjs/constants/index.js +29 -0
- package/dist/cjs/constants/user-interface-text.js +61 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +28 -3
- package/dist/cjs/context/DashboardProvider/common.js +1 -1
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +7 -5
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +62 -0
- package/dist/cjs/context/DashboardProvider/index.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +9 -38
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-slice.js +1 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +1 -1
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +8 -8
- package/dist/cjs/context/TemplateVariableProvider/index.js +1 -1
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +1 -1
- package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +1 -1
- package/dist/cjs/context/index.js +1 -1
- package/dist/cjs/context/useDashboard.js +5 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/test/dashboard-provider.js +1 -1
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/plugin-registry.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test/testDashboard.js +1 -1
- package/dist/cjs/utils/index.js +28 -0
- package/dist/cjs/utils/panelUtils.js +168 -0
- package/dist/cjs/utils/panelUtils.test.js +195 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +5 -2
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +5 -3
- package/dist/cjs/views/ViewDashboard/index.js +1 -1
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +1 -1
- package/dist/cjs/views/index.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +3 -0
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -0
- package/dist/components/AddGroupButton/AddGroupButton.js +32 -0
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -0
- package/dist/components/AddGroupButton/index.d.ts +2 -0
- package/dist/components/AddGroupButton/index.d.ts.map +1 -0
- package/dist/{utils/functions.js → components/AddGroupButton/index.js} +3 -5
- package/dist/components/AddGroupButton/index.js.map +1 -0
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +3 -0
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -0
- package/dist/components/AddPanelButton/AddPanelButton.js +32 -0
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -0
- package/dist/components/AddPanelButton/index.d.ts +2 -0
- package/dist/components/AddPanelButton/index.d.ts.map +1 -0
- package/dist/components/AddPanelButton/index.js +15 -0
- package/dist/components/AddPanelButton/index.js.map +1 -0
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +51 -23
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +8 -25
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +2 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +2 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +5 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +18 -15
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +2 -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 +3 -2
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +6 -8
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +14 -11
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.js +7 -7
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/Panel.test.js +11 -3
- package/dist/components/Panel/Panel.test.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +3 -2
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +1 -0
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +26 -8
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +2 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.js +1 -1
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +4 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/PanelGroupDialog/index.js +1 -1
- package/dist/components/PanelGroupDialog/index.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +15 -17
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +3 -3
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +29 -0
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
- package/dist/components/ToolbarIconButton/index.d.ts +2 -0
- package/dist/components/ToolbarIconButton/index.d.ts.map +1 -0
- package/dist/components/ToolbarIconButton/index.js +15 -0
- package/dist/components/ToolbarIconButton/index.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts +3 -0
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -0
- package/dist/components/Variables/EditVariablesButton.js +64 -0
- package/dist/components/Variables/EditVariablesButton.js.map +1 -0
- package/dist/components/Variables/Variable.js +1 -1
- package/dist/components/Variables/Variable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +10 -6
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +8 -9
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +47 -74
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +3 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +4 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.js +1 -1
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/Variables/variable-model.test.js +1 -1
- package/dist/components/Variables/variable-model.test.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/grid-layout-config.d.ts +6 -0
- package/dist/constants/grid-layout-config.d.ts.map +1 -0
- package/dist/constants/grid-layout-config.js +19 -0
- package/dist/constants/grid-layout-config.js.map +1 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +16 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/user-interface-text.d.ts +30 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -0
- package/dist/constants/user-interface-text.js +49 -0
- package/dist/constants/user-interface-text.js.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +29 -4
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.js +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +7 -5
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.d.ts +19 -0
- package/dist/context/DashboardProvider/duplicate-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/duplicate-panel-slice.js +58 -0
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -0
- package/dist/context/DashboardProvider/index.d.ts +1 -1
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +4 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +7 -36
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +1 -1
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +8 -8
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.test.js +1 -1
- package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +5 -3
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/test/dashboard-provider.js +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +1 -1
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/panelUtils.d.ts +27 -0
- package/dist/utils/panelUtils.d.ts.map +1 -0
- package/dist/utils/panelUtils.js +174 -0
- package/dist/utils/panelUtils.js.map +1 -0
- package/dist/utils/panelUtils.test.d.ts +2 -0
- package/dist/utils/panelUtils.test.d.ts.map +1 -0
- package/dist/utils/panelUtils.test.js +193 -0
- package/dist/utils/panelUtils.test.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +5 -2
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +5 -3
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +1 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -1
- package/dist/views/index.js +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/utils/functions.d.ts +0 -2
- package/dist/utils/functions.d.ts.map +0 -1
- package/dist/utils/functions.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2023 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, "AddGroupButton", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>AddGroupButton
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
const _plusBoxOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PlusBoxOutline"));
|
|
24
|
+
const _components = require("@perses-dev/components");
|
|
25
|
+
const _constants = require("../../constants");
|
|
26
|
+
const _context = require("../../context");
|
|
27
|
+
function _interopRequireDefault(obj) {
|
|
28
|
+
return obj && obj.__esModule ? obj : {
|
|
29
|
+
default: obj
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const AddGroupButton = ()=>{
|
|
33
|
+
const { openAddPanelGroup } = (0, _context.useDashboardActions)();
|
|
34
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
35
|
+
description: _constants.TOOLTIP_TEXT.addGroup,
|
|
36
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
37
|
+
startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plusBoxOutline.default, {}),
|
|
38
|
+
onClick: openAddPanelGroup,
|
|
39
|
+
"aria-label": _constants.TOOLTIP_TEXT.addGroup,
|
|
40
|
+
children: "Panel Group"
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
_exportStar(require("./AddGroupButton"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2023 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, "AddPanelButton", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>AddPanelButton
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
const _chartBoxPlusOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ChartBoxPlusOutline"));
|
|
24
|
+
const _components = require("@perses-dev/components");
|
|
25
|
+
const _constants = require("../../constants");
|
|
26
|
+
const _context = require("../../context");
|
|
27
|
+
function _interopRequireDefault(obj) {
|
|
28
|
+
return obj && obj.__esModule ? obj : {
|
|
29
|
+
default: obj
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const AddPanelButton = ()=>{
|
|
33
|
+
const { openAddPanel } = (0, _context.useDashboardActions)();
|
|
34
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
35
|
+
description: _constants.TOOLTIP_TEXT.addPanel,
|
|
36
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
37
|
+
startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_chartBoxPlusOutline.default, {}),
|
|
38
|
+
onClick: openAddPanel,
|
|
39
|
+
"aria-label": _constants.TOOLTIP_TEXT.addPanel,
|
|
40
|
+
children: "Panel"
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
_exportStar(require("./AddPanelButton"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -19,16 +19,16 @@ Object.defineProperty(exports, "DashboardToolbar", {
|
|
|
19
19
|
get: ()=>DashboardToolbar
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = require("react");
|
|
22
23
|
const _material = require("@mui/material");
|
|
23
24
|
const _pencilOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PencilOutline"));
|
|
24
|
-
const _plusBoxOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PlusBoxOutline"));
|
|
25
|
-
const _chartBoxPlusOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ChartBoxPlusOutline"));
|
|
26
25
|
const _components = require("@perses-dev/components");
|
|
27
|
-
const _react = require("react");
|
|
28
26
|
const _context = require("../../context");
|
|
29
|
-
const
|
|
30
|
-
const
|
|
27
|
+
const _addPanelButton = require("../AddPanelButton");
|
|
28
|
+
const _addGroupButton = require("../AddGroupButton");
|
|
31
29
|
const _downloadButton = require("../DownloadButton");
|
|
30
|
+
const _timeRangeControls = require("../TimeRangeControls");
|
|
31
|
+
const _variables = require("../Variables");
|
|
32
32
|
function _interopRequireDefault(obj) {
|
|
33
33
|
return obj && obj.__esModule ? obj : {
|
|
34
34
|
default: obj
|
|
@@ -36,11 +36,11 @@ function _interopRequireDefault(obj) {
|
|
|
36
36
|
}
|
|
37
37
|
const DashboardToolbar = (props)=>{
|
|
38
38
|
const { dashboardName , dashboardTitleComponent , initialVariableIsSticky , isReadonly , onEditButtonClick , onCancelButtonClick , onSave , } = props;
|
|
39
|
+
const dashboard = (0, _context.useDashboard)();
|
|
39
40
|
const { isEditMode , setEditMode } = (0, _context.useEditMode)();
|
|
41
|
+
const isBiggerThanMd = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('md'));
|
|
42
|
+
const isBiggerThanSm = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('sm'));
|
|
40
43
|
const [isSavingDashboard, setSavingDashboard] = (0, _react.useState)(false);
|
|
41
|
-
const dashboard = (0, _context.useDashboard)();
|
|
42
|
-
const { openAddPanelGroup , openAddPanel } = (0, _context.useDashboardActions)();
|
|
43
|
-
const isLaptopSize = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('sm'));
|
|
44
44
|
const dashboardTitle = dashboardTitleComponent ? dashboardTitleComponent : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
45
45
|
variant: "h2",
|
|
46
46
|
children: dashboardName
|
|
@@ -58,9 +58,11 @@ const DashboardToolbar = (props)=>{
|
|
|
58
58
|
setEditMode(false);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
+
const testId = 'dashboard-toolbar';
|
|
61
62
|
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
62
63
|
children: isEditMode ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
63
64
|
spacing: 1,
|
|
65
|
+
"data-testid": testId,
|
|
64
66
|
children: [
|
|
65
67
|
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
66
68
|
p: 2,
|
|
@@ -102,8 +104,8 @@ const DashboardToolbar = (props)=>{
|
|
|
102
104
|
sx: {
|
|
103
105
|
display: 'flex',
|
|
104
106
|
width: '100%',
|
|
105
|
-
alignItems: '
|
|
106
|
-
padding: (theme)=>theme.spacing(
|
|
107
|
+
alignItems: 'start',
|
|
108
|
+
padding: (theme)=>theme.spacing(1, 2, 2, 2)
|
|
107
109
|
},
|
|
108
110
|
children: [
|
|
109
111
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ErrorBoundary, {
|
|
@@ -115,6 +117,7 @@ const DashboardToolbar = (props)=>{
|
|
|
115
117
|
}
|
|
116
118
|
})
|
|
117
119
|
}),
|
|
120
|
+
isBiggerThanMd ? // On bigger screens, make it one row
|
|
118
121
|
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
119
122
|
direction: "row",
|
|
120
123
|
spacing: 1,
|
|
@@ -123,19 +126,42 @@ const DashboardToolbar = (props)=>{
|
|
|
123
126
|
whiteSpace: 'nowrap'
|
|
124
127
|
},
|
|
125
128
|
children: [
|
|
126
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
children: "Add Panel Group"
|
|
130
|
-
}),
|
|
131
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
132
|
-
startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_chartBoxPlusOutline.default, {}),
|
|
133
|
-
onClick: openAddPanel,
|
|
134
|
-
children: "Add Panel"
|
|
135
|
-
}),
|
|
129
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_variables.EditVariablesButton, {}),
|
|
130
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_addPanelButton.AddPanelButton, {}),
|
|
131
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_addGroupButton.AddGroupButton, {}),
|
|
136
132
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeRangeControls.TimeRangeControls, {}),
|
|
137
133
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_downloadButton.DownloadButton, {})
|
|
138
134
|
]
|
|
135
|
+
}) : // On smaller screens, make it two rows
|
|
136
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
137
|
+
spacing: 1,
|
|
138
|
+
children: [
|
|
139
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
140
|
+
direction: "row",
|
|
141
|
+
spacing: 1,
|
|
142
|
+
marginLeft: "auto",
|
|
143
|
+
sx: {
|
|
144
|
+
whiteSpace: 'nowrap'
|
|
145
|
+
},
|
|
146
|
+
children: [
|
|
147
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeRangeControls.TimeRangeControls, {}),
|
|
148
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_downloadButton.DownloadButton, {})
|
|
149
|
+
]
|
|
150
|
+
}),
|
|
151
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
152
|
+
direction: "row",
|
|
153
|
+
spacing: 1,
|
|
154
|
+
marginLeft: "auto",
|
|
155
|
+
sx: {
|
|
156
|
+
whiteSpace: 'nowrap'
|
|
157
|
+
},
|
|
158
|
+
children: [
|
|
159
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_variables.EditVariablesButton, {}),
|
|
160
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_addPanelButton.AddPanelButton, {}),
|
|
161
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_addGroupButton.AddGroupButton, {})
|
|
162
|
+
]
|
|
163
|
+
})
|
|
164
|
+
]
|
|
139
165
|
})
|
|
140
166
|
]
|
|
141
167
|
})
|
|
@@ -143,6 +169,7 @@ const DashboardToolbar = (props)=>{
|
|
|
143
169
|
}) : /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
144
170
|
spacing: 1,
|
|
145
171
|
padding: 2,
|
|
172
|
+
"data-testid": testId,
|
|
146
173
|
children: [
|
|
147
174
|
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
148
175
|
sx: {
|
|
@@ -158,8 +185,9 @@ const DashboardToolbar = (props)=>{
|
|
|
158
185
|
children: [
|
|
159
186
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeRangeControls.TimeRangeControls, {}),
|
|
160
187
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_downloadButton.DownloadButton, {}),
|
|
161
|
-
|
|
188
|
+
isBiggerThanSm && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
162
189
|
variant: "outlined",
|
|
190
|
+
color: "secondary",
|
|
163
191
|
startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencilOutline.default, {}),
|
|
164
192
|
onClick: onEditButtonClick,
|
|
165
193
|
sx: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -19,32 +19,17 @@ Object.defineProperty(exports, "DeletePanelDialog", {
|
|
|
19
19
|
get: ()=>DeletePanelDialog
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const
|
|
23
|
-
const _close = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Close"));
|
|
22
|
+
const _components = require("@perses-dev/components");
|
|
24
23
|
const _context = require("../../context");
|
|
25
|
-
function _interopRequireDefault(obj) {
|
|
26
|
-
return obj && obj.__esModule ? obj : {
|
|
27
|
-
default: obj
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
24
|
const DeletePanelDialog = ()=>{
|
|
31
25
|
const { deletePanelDialog , closeDeletePanelDialog } = (0, _context.useDeletePanelDialog)();
|
|
32
|
-
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(
|
|
26
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_components.Dialog, {
|
|
33
27
|
open: deletePanelDialog !== undefined,
|
|
34
28
|
children: [
|
|
35
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(
|
|
29
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.Dialog.Header, {
|
|
30
|
+
onClose: ()=>closeDeletePanelDialog(),
|
|
36
31
|
children: "Delete Panel"
|
|
37
32
|
}),
|
|
38
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
39
|
-
"aria-label": "Close",
|
|
40
|
-
onClick: ()=>closeDeletePanelDialog(),
|
|
41
|
-
sx: (theme)=>({
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
top: theme.spacing(0.5),
|
|
44
|
-
right: theme.spacing(0.5)
|
|
45
|
-
}),
|
|
46
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_close.default, {})
|
|
47
|
-
}),
|
|
48
33
|
deletePanelDialog && /*#__PURE__*/ (0, _jsxRuntime.jsx)(DeletePanelForm, {
|
|
49
34
|
deletePanelDialog: deletePanelDialog
|
|
50
35
|
})
|
|
@@ -62,11 +47,7 @@ const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
|
62
47
|
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)("form", {
|
|
63
48
|
onSubmit: handleDelete,
|
|
64
49
|
children: [
|
|
65
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(
|
|
66
|
-
dividers: true,
|
|
67
|
-
sx: {
|
|
68
|
-
width: '500px'
|
|
69
|
-
},
|
|
50
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_components.Dialog.Content, {
|
|
70
51
|
children: [
|
|
71
52
|
"Are you sure you want to delete ",
|
|
72
53
|
deletePanelDialog.panelName,
|
|
@@ -75,15 +56,12 @@ const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
|
75
56
|
"? This action cannot be undone."
|
|
76
57
|
]
|
|
77
58
|
}),
|
|
78
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(
|
|
59
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_components.Dialog.Actions, {
|
|
79
60
|
children: [
|
|
80
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(
|
|
81
|
-
variant: "contained",
|
|
82
|
-
type: "submit",
|
|
61
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.Dialog.PrimaryButton, {
|
|
83
62
|
children: "Delete"
|
|
84
63
|
}),
|
|
85
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(
|
|
86
|
-
variant: "outlined",
|
|
64
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.Dialog.SecondaryButton, {
|
|
87
65
|
onClick: ()=>closeDeletePanelDialog(),
|
|
88
66
|
children: "Cancel"
|
|
89
67
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -78,6 +78,7 @@ const DeletePanelGroupDialog = ()=>{
|
|
|
78
78
|
}),
|
|
79
79
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
80
80
|
variant: "outlined",
|
|
81
|
+
color: "secondary",
|
|
81
82
|
onClick: ()=>closeDeletePanelGroupDialog(),
|
|
82
83
|
children: "Cancel"
|
|
83
84
|
})
|
package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -63,6 +63,7 @@ const DiscardChangesConfirmationDialog = ()=>{
|
|
|
63
63
|
}),
|
|
64
64
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
65
65
|
variant: "outlined",
|
|
66
|
+
color: "secondary",
|
|
66
67
|
onClick: dialog.onCancel,
|
|
67
68
|
children: "Cancel"
|
|
68
69
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -19,57 +19,21 @@ Object.defineProperty(exports, "DownloadButton", {
|
|
|
19
19
|
get: ()=>DownloadButton
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _react =
|
|
22
|
+
const _react = require("react");
|
|
23
23
|
const _downloadOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DownloadOutline"));
|
|
24
|
-
const
|
|
24
|
+
const _components = require("@perses-dev/components");
|
|
25
|
+
const _constants = require("../../constants");
|
|
25
26
|
const _context = require("../../context");
|
|
27
|
+
const _toolbarIconButton = require("../ToolbarIconButton");
|
|
26
28
|
function _interopRequireDefault(obj) {
|
|
27
29
|
return obj && obj.__esModule ? obj : {
|
|
28
30
|
default: obj
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
if (typeof WeakMap !== "function") return null;
|
|
33
|
-
var cacheBabelInterop = new WeakMap();
|
|
34
|
-
var cacheNodeInterop = new WeakMap();
|
|
35
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
36
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
37
|
-
})(nodeInterop);
|
|
38
|
-
}
|
|
39
|
-
function _interopRequireWildcard(obj, nodeInterop) {
|
|
40
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
44
|
-
return {
|
|
45
|
-
default: obj
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
49
|
-
if (cache && cache.has(obj)) {
|
|
50
|
-
return cache.get(obj);
|
|
51
|
-
}
|
|
52
|
-
var newObj = {};
|
|
53
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
54
|
-
for(var key in obj){
|
|
55
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
56
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
57
|
-
if (desc && (desc.get || desc.set)) {
|
|
58
|
-
Object.defineProperty(newObj, key, desc);
|
|
59
|
-
} else {
|
|
60
|
-
newObj[key] = obj[key];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
newObj.default = obj;
|
|
65
|
-
if (cache) {
|
|
66
|
-
cache.set(obj, newObj);
|
|
67
|
-
}
|
|
68
|
-
return newObj;
|
|
69
|
-
}
|
|
70
|
-
function DownloadButton() {
|
|
33
|
+
function DownloadButton({ heightPx }) {
|
|
71
34
|
const { dashboard } = (0, _context.useDashboard)();
|
|
72
35
|
const hiddenLinkRef = (0, _react.useRef)(null);
|
|
36
|
+
const height = heightPx === undefined ? undefined : `${heightPx}px`;
|
|
73
37
|
const onDownloadButtonClick = ()=>{
|
|
74
38
|
if (!hiddenLinkRef || !hiddenLinkRef.current) return;
|
|
75
39
|
// Create blob URL
|
|
@@ -86,10 +50,16 @@ function DownloadButton() {
|
|
|
86
50
|
};
|
|
87
51
|
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
88
52
|
children: [
|
|
89
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
53
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
54
|
+
description: _constants.TOOLTIP_TEXT.downloadDashboard,
|
|
55
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_toolbarIconButton.ToolbarIconButton, {
|
|
56
|
+
"aria-label": _constants.TOOLTIP_TEXT.downloadDashboard,
|
|
57
|
+
onClick: onDownloadButtonClick,
|
|
58
|
+
sx: {
|
|
59
|
+
height
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_downloadOutline.default, {})
|
|
62
|
+
})
|
|
93
63
|
}),
|
|
94
64
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)("a", {
|
|
95
65
|
ref: hiddenLinkRef,
|
|
@@ -101,9 +71,3 @@ function DownloadButton() {
|
|
|
101
71
|
]
|
|
102
72
|
});
|
|
103
73
|
}
|
|
104
|
-
const DownloadIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
|
|
105
|
-
border: `1px solid ${theme.palette.grey[300]}`,
|
|
106
|
-
borderRadius: theme.shape.borderRadius,
|
|
107
|
-
padding: '4px',
|
|
108
|
-
color: theme.palette.grey[900]
|
|
109
|
-
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -42,6 +42,7 @@ function GridContainer(props) {
|
|
|
42
42
|
transitionProperty: isFirstRender ? 'none' : 'transform'
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
+
"data-testid": "panel-group",
|
|
45
46
|
children: props.children
|
|
46
47
|
});
|
|
47
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -25,12 +25,13 @@ function GridItemContent(props) {
|
|
|
25
25
|
const { panelGroupItemId } = props;
|
|
26
26
|
const panelDefinition = (0, _context.usePanel)(panelGroupItemId);
|
|
27
27
|
const { isEditMode } = (0, _context.useEditMode)();
|
|
28
|
-
const { openEditPanel , openDeletePanelDialog } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
28
|
+
const { openEditPanel , openDeletePanelDialog , duplicatePanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
29
29
|
// Provide actions to the panel when in edit mode
|
|
30
30
|
let editHandlers = undefined;
|
|
31
31
|
if (isEditMode) {
|
|
32
32
|
editHandlers = {
|
|
33
33
|
onEditPanelClick: openEditPanel,
|
|
34
|
+
onDuplicatePanelClick: duplicatePanel,
|
|
34
35
|
onDeletePanelClick: openDeletePanelDialog
|
|
35
36
|
};
|
|
36
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -24,11 +24,11 @@ const _reactGridLayout = require("react-grid-layout");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
26
|
const _context = require("../../context");
|
|
27
|
+
const _constants = require("../../constants");
|
|
27
28
|
const _gridTitle = require("./GridTitle");
|
|
28
29
|
const _gridItemContent = require("./GridItemContent");
|
|
29
30
|
const _gridContainer = require("./GridContainer");
|
|
30
31
|
const ResponsiveGridLayout = (0, _reactGridLayout.WidthProvider)(_reactGridLayout.Responsive);
|
|
31
|
-
const SMALL_LAYOUT_BREAKPOINT = 'sm';
|
|
32
32
|
function GridLayout(props) {
|
|
33
33
|
const { panelGroupId /*...others */ } = props;
|
|
34
34
|
const theme = (0, _material.useTheme)();
|
|
@@ -42,7 +42,7 @@ function GridLayout(props) {
|
|
|
42
42
|
// a bug in react-layout-grid where `currentLayout` does not adjust properly
|
|
43
43
|
// when going to a smaller breakpoint and then back to a larger breakpoint.
|
|
44
44
|
// https://github.com/react-grid-layout/react-grid-layout/issues/1663
|
|
45
|
-
const smallLayout = allLayouts[
|
|
45
|
+
const smallLayout = allLayouts[_constants.GRID_LAYOUT_SMALL_BREAKPOINT];
|
|
46
46
|
if (smallLayout) {
|
|
47
47
|
updatePanelGroupLayouts(smallLayout);
|
|
48
48
|
}
|
|
@@ -61,16 +61,14 @@ function GridLayout(props) {
|
|
|
61
61
|
in: isOpen,
|
|
62
62
|
unmountOnExit: true,
|
|
63
63
|
appear: false,
|
|
64
|
+
"data-testid": "panel-group-content",
|
|
64
65
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(ResponsiveGridLayout, {
|
|
65
66
|
className: "layout",
|
|
66
67
|
breakpoints: {
|
|
67
68
|
sm: theme.breakpoints.values.sm,
|
|
68
69
|
xxs: 0
|
|
69
70
|
},
|
|
70
|
-
cols:
|
|
71
|
-
sm: 24,
|
|
72
|
-
xxs: 2
|
|
73
|
-
},
|
|
71
|
+
cols: _constants.GRID_LAYOUT_COLS,
|
|
74
72
|
rowHeight: 30,
|
|
75
73
|
draggableHandle: '.drag-handle',
|
|
76
74
|
resizeHandles: [
|
|
@@ -83,7 +81,7 @@ function GridLayout(props) {
|
|
|
83
81
|
10
|
|
84
82
|
],
|
|
85
83
|
layouts: {
|
|
86
|
-
[
|
|
84
|
+
[_constants.GRID_LAYOUT_SMALL_BREAKPOINT]: groupDefinition.itemLayouts
|
|
87
85
|
},
|
|
88
86
|
onLayoutChange: handleLayoutChange,
|
|
89
87
|
children: groupDefinition.itemLayouts.map(({ i })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|