@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
|
@@ -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
|
|
@@ -28,6 +28,7 @@ const _arrowUp = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/A
|
|
|
28
28
|
const _arrowDown = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ArrowDown"));
|
|
29
29
|
const _deleteOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DeleteOutline"));
|
|
30
30
|
const _components = require("@perses-dev/components");
|
|
31
|
+
const _constants = require("../../constants");
|
|
31
32
|
const _context = require("../../context");
|
|
32
33
|
function _interopRequireDefault(obj) {
|
|
33
34
|
return obj && obj.__esModule ? obj : {
|
|
@@ -54,10 +55,12 @@ function GridTitle(props) {
|
|
|
54
55
|
padding: (theme)=>theme.spacing(1),
|
|
55
56
|
backgroundColor: ({ palette })=>palette.mode === 'dark' ? palette.background.paper : palette.background.default
|
|
56
57
|
},
|
|
58
|
+
"data-testid": "panel-group-header",
|
|
57
59
|
children: collapse ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
58
60
|
children: [
|
|
59
61
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
60
62
|
onClick: collapse.onToggleOpen,
|
|
63
|
+
"aria-label": `${collapse.isOpen ? 'collapse' : 'expand'} group ${title}`,
|
|
61
64
|
children: collapse.isOpen ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_chevronDown.default, {}) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_chevronRight.default, {})
|
|
62
65
|
}),
|
|
63
66
|
text,
|
|
@@ -66,42 +69,42 @@ function GridTitle(props) {
|
|
|
66
69
|
marginLeft: "auto",
|
|
67
70
|
children: [
|
|
68
71
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
69
|
-
description:
|
|
72
|
+
description: _constants.TOOLTIP_TEXT.addPanelToGroup,
|
|
70
73
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
71
|
-
"aria-label":
|
|
74
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.addPanelToGroup(title),
|
|
72
75
|
onClick: openAddPanel,
|
|
73
76
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_chartBoxPlusOutline.default, {})
|
|
74
77
|
})
|
|
75
78
|
}),
|
|
76
79
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
77
|
-
description:
|
|
80
|
+
description: _constants.TOOLTIP_TEXT.editGroup,
|
|
78
81
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
79
|
-
"aria-label":
|
|
82
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.editGroup(title),
|
|
80
83
|
onClick: openEditPanelGroup,
|
|
81
84
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencilOutline.default, {})
|
|
82
85
|
})
|
|
83
86
|
}),
|
|
84
87
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
85
|
-
description:
|
|
88
|
+
description: _constants.TOOLTIP_TEXT.deleteGroup,
|
|
86
89
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
87
|
-
"aria-label":
|
|
90
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.deleteGroup(title),
|
|
88
91
|
onClick: ()=>openDeletePanelGroupDialog(panelGroupId),
|
|
89
92
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_deleteOutline.default, {})
|
|
90
93
|
})
|
|
91
94
|
}),
|
|
92
95
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
93
|
-
description:
|
|
96
|
+
description: _constants.TOOLTIP_TEXT.moveGroupDown,
|
|
94
97
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
95
|
-
"aria-label":
|
|
98
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.moveGroupDown(title),
|
|
96
99
|
disabled: moveDown === undefined,
|
|
97
100
|
onClick: moveDown,
|
|
98
101
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_arrowDown.default, {})
|
|
99
102
|
})
|
|
100
103
|
}),
|
|
101
104
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
102
|
-
description:
|
|
105
|
+
description: _constants.TOOLTIP_TEXT.moveGroupUp,
|
|
103
106
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
104
|
-
"aria-label":
|
|
107
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.moveGroupUp(title),
|
|
105
108
|
disabled: moveUp === undefined,
|
|
106
109
|
onClick: moveUp,
|
|
107
110
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_arrowUp.default, {})
|
|
@@ -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
|
|
@@ -56,8 +56,7 @@ function Panel(props) {
|
|
|
56
56
|
initialInView: false,
|
|
57
57
|
triggerOnce: true
|
|
58
58
|
});
|
|
59
|
-
|
|
60
|
-
const panelPadding = 1.5;
|
|
59
|
+
const chartsTheme = (0, _components.useChartsTheme)();
|
|
61
60
|
const handleMouseEnter = (e)=>{
|
|
62
61
|
setIsHovered(true);
|
|
63
62
|
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
@@ -80,6 +79,7 @@ function Panel(props) {
|
|
|
80
79
|
onMouseLeave: handleMouseLeave,
|
|
81
80
|
"aria-labelledby": headerId,
|
|
82
81
|
"aria-describedby": headerId,
|
|
82
|
+
"data-testid": "panel",
|
|
83
83
|
...others,
|
|
84
84
|
children: [
|
|
85
85
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_panelHeader.PanelHeader, {
|
|
@@ -89,7 +89,7 @@ function Panel(props) {
|
|
|
89
89
|
editHandlers: editHandlers,
|
|
90
90
|
isHovered: isHovered,
|
|
91
91
|
sx: {
|
|
92
|
-
paddingX:
|
|
92
|
+
paddingX: `${chartsTheme.container.padding.default}px`
|
|
93
93
|
}
|
|
94
94
|
}),
|
|
95
95
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.CardContent, {
|
|
@@ -99,10 +99,10 @@ function Panel(props) {
|
|
|
99
99
|
overflow: 'hidden',
|
|
100
100
|
flexGrow: 1,
|
|
101
101
|
margin: 0,
|
|
102
|
-
padding:
|
|
102
|
+
padding: 0,
|
|
103
103
|
// Override MUI default style for last-child
|
|
104
104
|
':last-child': {
|
|
105
|
-
padding:
|
|
105
|
+
padding: 0
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
ref: setContentElement,
|
|
@@ -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
|
|
@@ -97,7 +97,8 @@ describe('Panel', ()=>{
|
|
|
97
97
|
it('does not show description in edit mode', ()=>{
|
|
98
98
|
renderPanel(undefined, {
|
|
99
99
|
onEditPanelClick: jest.fn(),
|
|
100
|
-
onDeletePanelClick: jest.fn()
|
|
100
|
+
onDeletePanelClick: jest.fn(),
|
|
101
|
+
onDuplicatePanelClick: jest.fn()
|
|
101
102
|
});
|
|
102
103
|
const panel = getPanel();
|
|
103
104
|
_userEvent.default.hover(panel);
|
|
@@ -109,9 +110,11 @@ describe('Panel', ()=>{
|
|
|
109
110
|
it('can trigger panel actions in edit mode', ()=>{
|
|
110
111
|
const onEditPanelClick = jest.fn();
|
|
111
112
|
const onDeletePanelClick = jest.fn();
|
|
113
|
+
const onDuplicatePanelClick = jest.fn();
|
|
112
114
|
renderPanel(undefined, {
|
|
113
115
|
onEditPanelClick,
|
|
114
|
-
onDeletePanelClick
|
|
116
|
+
onDeletePanelClick,
|
|
117
|
+
onDuplicatePanelClick
|
|
115
118
|
});
|
|
116
119
|
const panel = getPanel();
|
|
117
120
|
_userEvent.default.hover(panel);
|
|
@@ -123,7 +126,12 @@ describe('Panel', ()=>{
|
|
|
123
126
|
name: /delete/i
|
|
124
127
|
});
|
|
125
128
|
_userEvent.default.click(deleteButton);
|
|
129
|
+
const duplicateButton = _react.screen.getByRole('button', {
|
|
130
|
+
name: /duplicate/i
|
|
131
|
+
});
|
|
132
|
+
_userEvent.default.click(duplicateButton);
|
|
126
133
|
expect(onEditPanelClick).toHaveBeenCalledTimes(1);
|
|
127
134
|
expect(onDeletePanelClick).toHaveBeenCalledTimes(1);
|
|
135
|
+
expect(onDuplicatePanelClick).toHaveBeenCalledTimes(1);
|
|
128
136
|
});
|
|
129
137
|
});
|
|
@@ -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
|
|
@@ -31,7 +31,8 @@ function PanelContent(props) {
|
|
|
31
31
|
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
32
32
|
variant: "rectangular",
|
|
33
33
|
width: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.width,
|
|
34
|
-
height: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.height
|
|
34
|
+
height: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.height,
|
|
35
|
+
"aria-label": "Loading..."
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
if (PanelComponent === undefined) {
|
|
@@ -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,6 +25,8 @@ const _informationOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-ma
|
|
|
25
25
|
const _pencilOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PencilOutline"));
|
|
26
26
|
const _deleteOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DeleteOutline"));
|
|
27
27
|
const _dragVertical = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DragVertical"));
|
|
28
|
+
const _contentCopy = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ContentCopy"));
|
|
29
|
+
const _constants = require("../../constants");
|
|
28
30
|
function _interopRequireDefault(obj) {
|
|
29
31
|
return obj && obj.__esModule ? obj : {
|
|
30
32
|
default: obj
|
|
@@ -39,9 +41,9 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
|
|
|
39
41
|
actions = /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
40
42
|
children: [
|
|
41
43
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
42
|
-
description:
|
|
44
|
+
description: _constants.TOOLTIP_TEXT.editPanel,
|
|
43
45
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
|
|
44
|
-
"aria-label":
|
|
46
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
|
|
45
47
|
size: "small",
|
|
46
48
|
onClick: editHandlers.onEditPanelClick,
|
|
47
49
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencilOutline.default, {
|
|
@@ -50,9 +52,25 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
|
|
|
50
52
|
})
|
|
51
53
|
}),
|
|
52
54
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
53
|
-
description:
|
|
55
|
+
description: _constants.TOOLTIP_TEXT.duplicatePanel,
|
|
54
56
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
|
|
55
|
-
"aria-label":
|
|
57
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
|
|
58
|
+
size: "small",
|
|
59
|
+
onClick: editHandlers.onDuplicatePanelClick,
|
|
60
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_contentCopy.default, {
|
|
61
|
+
fontSize: "inherit",
|
|
62
|
+
sx: {
|
|
63
|
+
// Shrink this icon a little bit to look more consistent
|
|
64
|
+
// with the other icons in the header.
|
|
65
|
+
transform: 'scale(0.925)'
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
71
|
+
description: _constants.TOOLTIP_TEXT.deletePanel,
|
|
72
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
|
|
73
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
|
|
56
74
|
size: "small",
|
|
57
75
|
onClick: editHandlers.onDeletePanelClick,
|
|
58
76
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_deleteOutline.default, {
|
|
@@ -61,9 +79,9 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
|
|
|
61
79
|
})
|
|
62
80
|
}),
|
|
63
81
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
64
|
-
description:
|
|
82
|
+
description: _constants.TOOLTIP_TEXT.movePanel,
|
|
65
83
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
|
|
66
|
-
"aria-label":
|
|
84
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
|
|
67
85
|
size: "small",
|
|
68
86
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_dragVertical.default, {
|
|
69
87
|
className: "drag-handle",
|
|
@@ -83,7 +101,7 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
|
|
|
83
101
|
description: description,
|
|
84
102
|
enterDelay: 100,
|
|
85
103
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
|
|
86
|
-
"aria-label": "
|
|
104
|
+
"aria-label": "panel description",
|
|
87
105
|
size: "small",
|
|
88
106
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_informationOutline.default, {
|
|
89
107
|
"aria-describedby": "info-tooltip",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-empty-function */ // Copyright
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-empty-function */ // 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
|
|
@@ -71,6 +71,7 @@ const PanelDrawer = ()=>{
|
|
|
71
71
|
SlideProps: {
|
|
72
72
|
onExited: handleExited
|
|
73
73
|
},
|
|
74
|
+
"data-testid": "panel-editor",
|
|
74
75
|
children: panelEditor !== undefined && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
75
76
|
children: [
|
|
76
77
|
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
@@ -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
|
|
@@ -73,6 +73,7 @@ function PanelGroupDialog() {
|
|
|
73
73
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_close.default, {})
|
|
74
74
|
}),
|
|
75
75
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.DialogContent, {
|
|
76
|
+
dividers: true,
|
|
76
77
|
sx: {
|
|
77
78
|
width: '500px'
|
|
78
79
|
},
|
|
@@ -90,6 +91,8 @@ function PanelGroupDialog() {
|
|
|
90
91
|
children: panelGroupEditor.mode === 'Edit' ? 'Apply' : 'Add'
|
|
91
92
|
}),
|
|
92
93
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
94
|
+
variant: "outlined",
|
|
95
|
+
color: "secondary",
|
|
93
96
|
onClick: panelGroupEditor.close,
|
|
94
97
|
children: "Cancel"
|
|
95
98
|
})
|
|
@@ -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
|
|
@@ -26,11 +26,12 @@ _export(exports, {
|
|
|
26
26
|
});
|
|
27
27
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
28
28
|
const _refresh = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Refresh"));
|
|
29
|
-
const _material = require("@mui/material");
|
|
30
29
|
const _components = require("@perses-dev/components");
|
|
31
30
|
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
32
31
|
const _core = require("@perses-dev/core");
|
|
32
|
+
const _constants = require("../../constants");
|
|
33
33
|
const _context = require("../../context");
|
|
34
|
+
const _toolbarIconButton = require("../ToolbarIconButton");
|
|
34
35
|
function _interopRequireDefault(obj) {
|
|
35
36
|
return obj && obj.__esModule ? obj : {
|
|
36
37
|
default: obj
|
|
@@ -96,7 +97,7 @@ const DEFAULT_HEIGHT = '34px';
|
|
|
96
97
|
function TimeRangeControls({ heightPx }) {
|
|
97
98
|
const { timeRange , setTimeRange , refresh } = (0, _pluginSystem.useTimeRange)();
|
|
98
99
|
const defaultTimeRange = (0, _context.useDefaultTimeRange)();
|
|
99
|
-
// Convert height
|
|
100
|
+
// Convert height to a string, then use the string for styling
|
|
100
101
|
const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;
|
|
101
102
|
// add time shortcut if one does not match duration from dashboard JSON
|
|
102
103
|
if (!TIME_OPTIONS.some((option)=>option.value.pastDuration === defaultTimeRange.pastDuration)) {
|
|
@@ -117,20 +118,17 @@ function TimeRangeControls({ heightPx }) {
|
|
|
117
118
|
onChange: setTimeRange,
|
|
118
119
|
height: height
|
|
119
120
|
}),
|
|
120
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
122
|
+
description: _constants.TOOLTIP_TEXT.refreshDashboard,
|
|
123
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_toolbarIconButton.ToolbarIconButton, {
|
|
124
|
+
"aria-label": _constants.TOOLTIP_TEXT.refreshDashboard,
|
|
125
|
+
onClick: refresh,
|
|
126
|
+
sx: {
|
|
127
|
+
height
|
|
128
|
+
},
|
|
129
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_refresh.default, {})
|
|
130
|
+
})
|
|
127
131
|
})
|
|
128
132
|
]
|
|
129
133
|
});
|
|
130
134
|
}
|
|
131
|
-
const RefreshIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
|
|
132
|
-
border: `1px solid ${theme.palette.grey[300]}`,
|
|
133
|
-
borderRadius: theme.shape.borderRadius,
|
|
134
|
-
padding: theme.spacing(0.5),
|
|
135
|
-
color: theme.palette.grey[900]
|
|
136
|
-
}));
|
|
@@ -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
|
|
@@ -61,7 +61,7 @@ describe('TimeRangeControls', ()=>{
|
|
|
61
61
|
renderTimeRangeControls(false);
|
|
62
62
|
expect(_react.screen.getByText('Last 30 minutes')).toBeInTheDocument();
|
|
63
63
|
const dateButton = _react.screen.getByRole('button', {
|
|
64
|
-
name: /
|
|
64
|
+
name: /time range/i
|
|
65
65
|
});
|
|
66
66
|
_userEvent.default.click(dateButton);
|
|
67
67
|
const firstSelected = _react.screen.getByRole('option', {
|
|
@@ -73,7 +73,7 @@ describe('TimeRangeControls', ()=>{
|
|
|
73
73
|
it('should update URL params with correct time range values', ()=>{
|
|
74
74
|
renderTimeRangeControls(true);
|
|
75
75
|
const dateButton = _react.screen.getByRole('button', {
|
|
76
|
-
name: /
|
|
76
|
+
name: /time range/i
|
|
77
77
|
});
|
|
78
78
|
_userEvent.default.click(dateButton);
|
|
79
79
|
const firstSelected = _react.screen.getByRole('option', {
|
|
@@ -0,0 +1,35 @@
|
|
|
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, "ToolbarIconButton", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>ToolbarIconButton
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
function ToolbarIconButton(props) {
|
|
24
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(IconButton, {
|
|
25
|
+
variant: "outlined",
|
|
26
|
+
color: "secondary",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const IconButton = (0, _material.styled)(_material.Button)(({ theme })=>({
|
|
31
|
+
// Using a button with some adjusted styles because it is easier to inherit
|
|
32
|
+
// styling and variants from themes than with an IconButton.
|
|
33
|
+
padding: theme.spacing(0.5),
|
|
34
|
+
minWidth: 'auto'
|
|
35
|
+
}));
|
|
@@ -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("./ToolbarIconButton"), 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,75 @@
|
|
|
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, "EditVariablesButton", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>EditVariablesButton
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = require("react");
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _pencilOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PencilOutline"));
|
|
25
|
+
const _components = require("@perses-dev/components");
|
|
26
|
+
const _constants = require("../../constants");
|
|
27
|
+
const _context = require("../../context");
|
|
28
|
+
const _variableEditor = require("./VariableEditor");
|
|
29
|
+
function _interopRequireDefault(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function EditVariablesButton() {
|
|
35
|
+
const [isVariableEditorOpen, setIsVariableEditorOpen] = (0, _react.useState)(false);
|
|
36
|
+
const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
|
|
37
|
+
const { setVariableDefinitions } = (0, _context.useTemplateVariableActions)();
|
|
38
|
+
const openVariableEditor = ()=>{
|
|
39
|
+
setIsVariableEditorOpen(true);
|
|
40
|
+
};
|
|
41
|
+
const closeVariableEditor = ()=>{
|
|
42
|
+
setIsVariableEditorOpen(false);
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
|
|
47
|
+
description: _constants.TOOLTIP_TEXT.editVariables,
|
|
48
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
49
|
+
startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencilOutline.default, {}),
|
|
50
|
+
onClick: openVariableEditor,
|
|
51
|
+
"aria-label": _constants.TOOLTIP_TEXT.editVariables,
|
|
52
|
+
children: "Variables"
|
|
53
|
+
})
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.Drawer, {
|
|
56
|
+
isOpen: isVariableEditorOpen,
|
|
57
|
+
onClose: closeVariableEditor,
|
|
58
|
+
PaperProps: {
|
|
59
|
+
sx: {
|
|
60
|
+
width: '50%'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"data-testid": "variable-editor",
|
|
64
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variableEditor.VariableEditor, {
|
|
65
|
+
variableDefinitions: variableDefinitions,
|
|
66
|
+
onCancel: closeVariableEditor,
|
|
67
|
+
onChange: (variables)=>{
|
|
68
|
+
setVariableDefinitions(variables);
|
|
69
|
+
setIsVariableEditorOpen(false);
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
}
|