@perses-dev/dashboards 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
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 +11 -8
- package/dist/cjs/components/AddGroupButton/index.js +10 -8
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +12 -13
- package/dist/cjs/components/AddPanelButton/index.js +10 -8
- package/dist/cjs/components/Dashboard/Dashboard.js +12 -10
- package/dist/cjs/components/Dashboard/index.js +10 -8
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +53 -22
- package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +82 -103
- package/dist/cjs/components/DashboardToolbar/index.js +10 -8
- package/dist/cjs/components/Datasources/DatasourceEditor.js +236 -0
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +112 -0
- package/dist/cjs/components/{ToolbarIconButton → Datasources}/index.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +16 -14
- package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +18 -16
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +6 -4
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/DownloadButton/DownloadButton.js +13 -12
- package/dist/cjs/components/DownloadButton/index.js +10 -8
- package/dist/cjs/components/EditButton/EditButton.js +9 -7
- package/dist/cjs/components/EditButton/index.js +10 -8
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +15 -12
- package/dist/cjs/components/EditJsonButton/index.js +10 -8
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +54 -25
- package/dist/cjs/components/EditJsonDialog/index.js +10 -8
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +21 -19
- package/dist/cjs/components/EmptyDashboard/index.js +10 -8
- package/dist/cjs/components/GridLayout/GridContainer.js +6 -4
- package/dist/cjs/components/GridLayout/GridItemContent.js +37 -19
- package/dist/cjs/components/GridLayout/GridLayout.js +21 -19
- package/dist/cjs/components/GridLayout/GridTitle.js +40 -39
- package/dist/cjs/components/GridLayout/index.js +13 -11
- package/dist/cjs/components/Panel/Panel.js +19 -23
- package/dist/cjs/components/Panel/PanelContent.js +11 -8
- package/dist/cjs/components/Panel/PanelHeader.js +35 -33
- package/dist/cjs/components/Panel/index.js +10 -8
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +237 -144
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +13 -12
- package/dist/cjs/components/PanelDrawer/index.js +11 -8
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +5 -3
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +16 -12
- package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +48 -46
- package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +26 -24
- package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +14 -14
- package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +141 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +19 -17
- package/dist/cjs/components/Variables/TemplateVariable.js +261 -107
- package/dist/cjs/components/Variables/VariableEditor.js +282 -207
- package/dist/cjs/components/Variables/VariableList.js +24 -22
- package/dist/cjs/components/Variables/index.js +14 -11
- package/dist/cjs/components/index.js +30 -29
- package/dist/cjs/constants/grid-layout-config.js +6 -2
- package/dist/cjs/constants/index.js +12 -9
- package/dist/cjs/constants/styles.js +42 -0
- package/dist/cjs/constants/user-interface-text.js +8 -3
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +48 -35
- package/dist/cjs/context/DashboardProvider/common.js +6 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +81 -49
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/index.js +12 -10
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +17 -17
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -8
- package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +177 -50
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +150 -39
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +12 -10
- package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +15 -7
- package/dist/cjs/context/index.js +13 -11
- package/dist/cjs/context/useDashboard.js +30 -11
- package/dist/cjs/index.js +12 -10
- package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
- package/dist/cjs/stories/decorators/constants.js +5 -3
- package/dist/cjs/stories/decorators/index.js +13 -11
- package/dist/cjs/test/dashboard-provider.js +8 -4
- package/dist/cjs/test/datasource-provider.js +16 -12
- package/dist/cjs/test/index.js +13 -11
- package/dist/cjs/test/plugin-registry.js +6 -4
- package/dist/cjs/test/render.js +28 -21
- package/dist/cjs/test/setup-tests.js +2 -2
- package/dist/cjs/test/testDashboard.js +13 -11
- package/dist/cjs/utils/index.js +10 -9
- package/dist/cjs/utils/panelUtils.js +11 -5
- package/dist/cjs/{components/TimeRangeControls → validation}/index.js +10 -8
- package/dist/cjs/{utils/time.js → validation/panel.js} +11 -9
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +32 -18
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -21
- package/dist/cjs/views/ViewDashboard/index.js +10 -8
- package/dist/cjs/views/index.js +10 -8
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +3 -2
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddGroupButton/index.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +4 -7
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/AddPanelButton/index.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +38 -9
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +63 -86
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +7 -0
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -0
- package/dist/components/Datasources/DatasourceEditor.js +223 -0
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.js +99 -0
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -0
- package/dist/components/Datasources/index.d.ts +3 -0
- package/dist/components/Datasources/index.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls → Datasources}/index.js +2 -1
- package/dist/components/Datasources/index.js.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -3
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +1 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditButton/index.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +4 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +7 -6
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonButton/index.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +5 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +43 -16
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EditJsonDialog/index.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/EmptyDashboard/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +31 -15
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +6 -6
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +5 -6
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +2 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +7 -13
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +3 -3
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +4 -3
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +2 -2
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +2 -2
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +5 -3
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +231 -142
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +4 -5
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.d.ts +1 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -1
- package/dist/components/PanelDrawer/index.js +1 -0
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.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.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +8 -8
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QuerySummaryTable/index.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -8
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +8 -10
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/SaveDashboardButton/index.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +7 -0
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js +128 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +7 -7
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +12 -4
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +244 -100
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +4 -4
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +232 -161
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +2 -3
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +11 -13
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +1 -0
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/grid-layout-config.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/styles.d.ts +5 -0
- package/dist/constants/styles.d.ts.map +1 -0
- package/dist/{utils/time.js → constants/styles.js} +10 -10
- package/dist/constants/styles.js.map +1 -0
- package/dist/constants/user-interface-text.d.ts +2 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +2 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +7 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +16 -9
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +17 -17
- 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 +5 -5
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +11 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +4 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +17 -12
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +172 -47
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +15 -8
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +115 -23
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +7 -7
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.js +3 -3
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.d.ts +3 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +24 -7
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
- package/dist/stories/decorators/constants.js +2 -2
- package/dist/stories/decorators/constants.js.map +1 -1
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +5 -7
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +9 -4
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +10 -10
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/{components/ToolbarIconButton → validation}/index.js +1 -1
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/panel.d.ts +19 -0
- package/dist/validation/panel.d.ts.map +1 -0
- package/dist/validation/panel.js +21 -0
- package/dist/validation/panel.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +19 -7
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -2
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +53 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -183
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -38
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -165
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
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, "DatasourceEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return DatasourceEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
26
|
+
const _Pencil = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Pencil"));
|
|
27
|
+
const _TrashCan = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/TrashCan"));
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
29
|
+
const _react = require("react");
|
|
30
|
+
const _useimmer = require("use-immer");
|
|
31
|
+
const _context = require("../../context");
|
|
32
|
+
function _interop_require_default(obj) {
|
|
33
|
+
return obj && obj.__esModule ? obj : {
|
|
34
|
+
default: obj
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function DatasourceEditor(props) {
|
|
38
|
+
const [datasources, setDatasources] = (0, _useimmer.useImmer)(props.datasources);
|
|
39
|
+
const [datasourceFormAction, setDatasourceFormAction] = (0, _react.useState)('update');
|
|
40
|
+
const [datasourceEdit, setDatasourceEdit] = (0, _react.useState)(null);
|
|
41
|
+
const defaultSpec = {
|
|
42
|
+
default: false,
|
|
43
|
+
plugin: {
|
|
44
|
+
// TODO: find a way to avoid assuming that the PrometheusDatasource plugin is installed
|
|
45
|
+
kind: 'PrometheusDatasource',
|
|
46
|
+
spec: {}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
50
|
+
const handleCancel = ()=>{
|
|
51
|
+
if (JSON.stringify(props.datasources) !== JSON.stringify(datasources)) {
|
|
52
|
+
openDiscardChangesConfirmationDialog({
|
|
53
|
+
onDiscardChanges: ()=>{
|
|
54
|
+
closeDiscardChangesConfirmationDialog();
|
|
55
|
+
props.onCancel();
|
|
56
|
+
},
|
|
57
|
+
onCancel: ()=>{
|
|
58
|
+
closeDiscardChangesConfirmationDialog();
|
|
59
|
+
},
|
|
60
|
+
description: 'You have unapplied changes. Are you sure you want to discard these changes? Changes cannot be recovered.'
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
props.onCancel();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const removeDatasource = (name)=>{
|
|
67
|
+
setDatasources((draft)=>{
|
|
68
|
+
delete draft[name];
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const addDatasource = ()=>{
|
|
72
|
+
setDatasourceFormAction('create');
|
|
73
|
+
setDatasourceEdit({
|
|
74
|
+
name: 'NewDatasource',
|
|
75
|
+
spec: defaultSpec
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const editDatasource = (name)=>{
|
|
79
|
+
setDatasourceFormAction('update');
|
|
80
|
+
var _datasources_name;
|
|
81
|
+
setDatasourceEdit({
|
|
82
|
+
name: name,
|
|
83
|
+
spec: (_datasources_name = datasources[name]) !== null && _datasources_name !== void 0 ? _datasources_name : defaultSpec
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
87
|
+
children: datasourceEdit ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceEditorForm, {
|
|
88
|
+
initialDatasourceDefinition: datasourceEdit,
|
|
89
|
+
initialAction: datasourceFormAction,
|
|
90
|
+
isDraft: true,
|
|
91
|
+
onSave: (name, spec)=>{
|
|
92
|
+
setDatasources((draft)=>{
|
|
93
|
+
delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed
|
|
94
|
+
draft[name] = spec;
|
|
95
|
+
setDatasourceEdit(null);
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
onClose: ()=>{
|
|
99
|
+
setDatasourceEdit(null);
|
|
100
|
+
}
|
|
101
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
104
|
+
sx: {
|
|
105
|
+
display: 'flex',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
padding: (theme)=>theme.spacing(1, 2),
|
|
108
|
+
borderBottom: (theme)=>`1px solid ${theme.palette.divider}`
|
|
109
|
+
},
|
|
110
|
+
children: [
|
|
111
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
112
|
+
variant: "h2",
|
|
113
|
+
children: "Edit Dashboard Datasources"
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
116
|
+
direction: "row",
|
|
117
|
+
spacing: 1,
|
|
118
|
+
marginLeft: "auto",
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
121
|
+
disabled: props.datasources === datasources,
|
|
122
|
+
variant: "contained",
|
|
123
|
+
onClick: ()=>{
|
|
124
|
+
props.onChange(datasources);
|
|
125
|
+
},
|
|
126
|
+
children: "Apply"
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
129
|
+
color: "secondary",
|
|
130
|
+
variant: "outlined",
|
|
131
|
+
onClick: handleCancel,
|
|
132
|
+
children: "Cancel"
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
139
|
+
padding: 2,
|
|
140
|
+
sx: {
|
|
141
|
+
overflowY: 'scroll'
|
|
142
|
+
},
|
|
143
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
144
|
+
spacing: 2,
|
|
145
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
146
|
+
spacing: 2,
|
|
147
|
+
children: [
|
|
148
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableContainer, {
|
|
149
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Table, {
|
|
150
|
+
sx: {
|
|
151
|
+
minWidth: 650
|
|
152
|
+
},
|
|
153
|
+
"aria-label": "table of datasources",
|
|
154
|
+
children: [
|
|
155
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableHead, {
|
|
156
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
157
|
+
children: [
|
|
158
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
159
|
+
children: "Name"
|
|
160
|
+
}),
|
|
161
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
162
|
+
children: "Type"
|
|
163
|
+
}),
|
|
164
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
165
|
+
children: "Description"
|
|
166
|
+
}),
|
|
167
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
168
|
+
align: "right",
|
|
169
|
+
children: "Actions"
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
})
|
|
173
|
+
}),
|
|
174
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
175
|
+
children: Object.entries(datasources).map(([name, spec])=>{
|
|
176
|
+
var _spec_display;
|
|
177
|
+
var _spec_display_description;
|
|
178
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
179
|
+
children: [
|
|
180
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
181
|
+
component: "th",
|
|
182
|
+
scope: "row",
|
|
183
|
+
sx: {
|
|
184
|
+
fontWeight: 'bold'
|
|
185
|
+
},
|
|
186
|
+
children: name
|
|
187
|
+
}),
|
|
188
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
189
|
+
children: spec.plugin.kind
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
192
|
+
children: (_spec_display_description = (_spec_display = spec.display) === null || _spec_display === void 0 ? void 0 : _spec_display.description) !== null && _spec_display_description !== void 0 ? _spec_display_description : ''
|
|
193
|
+
}),
|
|
194
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableCell, {
|
|
195
|
+
align: "right",
|
|
196
|
+
sx: {
|
|
197
|
+
whiteSpace: 'nowrap'
|
|
198
|
+
},
|
|
199
|
+
children: [
|
|
200
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
201
|
+
onClick: ()=>editDatasource(name),
|
|
202
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Pencil.default, {})
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
205
|
+
onClick: ()=>removeDatasource(name),
|
|
206
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TrashCan.default, {})
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
})
|
|
210
|
+
]
|
|
211
|
+
}, name);
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
})
|
|
216
|
+
}),
|
|
217
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
218
|
+
display: "flex",
|
|
219
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
220
|
+
variant: "contained",
|
|
221
|
+
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
|
|
222
|
+
sx: {
|
|
223
|
+
marginLeft: 'auto'
|
|
224
|
+
},
|
|
225
|
+
onClick: addDatasource,
|
|
226
|
+
children: "Add Datasource"
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
]
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
]
|
|
234
|
+
})
|
|
235
|
+
});
|
|
236
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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, "EditDatasourcesButton", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return EditDatasourcesButton;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = require("react");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
|
|
27
|
+
const _components = require("@perses-dev/components");
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
29
|
+
const _constants = require("../../constants");
|
|
30
|
+
const _context = require("../../context");
|
|
31
|
+
const _DatasourceEditor = require("./DatasourceEditor");
|
|
32
|
+
function _interop_require_default(obj) {
|
|
33
|
+
return obj && obj.__esModule ? obj : {
|
|
34
|
+
default: obj
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function EditDatasourcesButton() {
|
|
38
|
+
const [isDatasourceEditorOpen, setIsDatasourceEditorOpen] = (0, _react.useState)(false);
|
|
39
|
+
const { getLocalDatasources, setLocalDatasources, getSavedDatasources, setSavedDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
40
|
+
const localDatasources = getLocalDatasources();
|
|
41
|
+
const savedDatasources = getSavedDatasources();
|
|
42
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
43
|
+
const openDatasourceEditor = ()=>{
|
|
44
|
+
setIsDatasourceEditorOpen(true);
|
|
45
|
+
};
|
|
46
|
+
const closeDatasourceEditor = ()=>{
|
|
47
|
+
setIsDatasourceEditorOpen(false);
|
|
48
|
+
};
|
|
49
|
+
const handleChangeDatasources = (datasources)=>{
|
|
50
|
+
// Calculates the new list of datasources that are allowed to be used.
|
|
51
|
+
const newSavedDatasources = Object.keys(datasources).filter((key)=>{
|
|
52
|
+
var _datasources_key_plugin, _datasources_key, _savedDatasources_key_plugin, _savedDatasources_key, _datasources_key_plugin_spec, _datasources_key_plugin1, _datasources_key1, _savedDatasources_key_plugin_spec, _savedDatasources_key_plugin1, _savedDatasources_key1;
|
|
53
|
+
var _datasources_key_plugin_spec1;
|
|
54
|
+
// Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their
|
|
55
|
+
// proxy is the same as what we have saved.
|
|
56
|
+
const isDirect = 'directUrl' in ((_datasources_key_plugin_spec1 = (_datasources_key = datasources[key]) === null || _datasources_key === void 0 ? void 0 : (_datasources_key_plugin = _datasources_key.plugin) === null || _datasources_key_plugin === void 0 ? void 0 : _datasources_key_plugin.spec) !== null && _datasources_key_plugin_spec1 !== void 0 ? _datasources_key_plugin_spec1 : {});
|
|
57
|
+
var _savedDatasources_key_plugin_spec1;
|
|
58
|
+
const isSavedProxy = !isDirect && !('directUrl' in ((_savedDatasources_key_plugin_spec1 = (_savedDatasources_key = savedDatasources[key]) === null || _savedDatasources_key === void 0 ? void 0 : (_savedDatasources_key_plugin = _savedDatasources_key.plugin) === null || _savedDatasources_key_plugin === void 0 ? void 0 : _savedDatasources_key_plugin.spec) !== null && _savedDatasources_key_plugin_spec1 !== void 0 ? _savedDatasources_key_plugin_spec1 : {})) && ((_datasources_key1 = datasources[key]) === null || _datasources_key1 === void 0 ? void 0 : (_datasources_key_plugin1 = _datasources_key1.plugin) === null || _datasources_key_plugin1 === void 0 ? void 0 : (_datasources_key_plugin_spec = _datasources_key_plugin1.spec) === null || _datasources_key_plugin_spec === void 0 ? void 0 : _datasources_key_plugin_spec.proxy) === ((_savedDatasources_key1 = savedDatasources[key]) === null || _savedDatasources_key1 === void 0 ? void 0 : (_savedDatasources_key_plugin1 = _savedDatasources_key1.plugin) === null || _savedDatasources_key_plugin1 === void 0 ? void 0 : (_savedDatasources_key_plugin_spec = _savedDatasources_key_plugin1.spec) === null || _savedDatasources_key_plugin_spec === void 0 ? void 0 : _savedDatasources_key_plugin_spec.proxy);
|
|
59
|
+
return isDirect || isSavedProxy;
|
|
60
|
+
}).reduce((obj, key)=>{
|
|
61
|
+
obj[key] = datasources[key];
|
|
62
|
+
return obj;
|
|
63
|
+
}, {});
|
|
64
|
+
setDashboard(dashboard.kind === 'Dashboard' ? {
|
|
65
|
+
...dashboard,
|
|
66
|
+
spec: {
|
|
67
|
+
...dashboard.spec,
|
|
68
|
+
datasources: datasources
|
|
69
|
+
}
|
|
70
|
+
} : {
|
|
71
|
+
...dashboard,
|
|
72
|
+
spec: {
|
|
73
|
+
...dashboard.spec,
|
|
74
|
+
datasources: datasources
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
setSavedDatasources(newSavedDatasources);
|
|
78
|
+
setLocalDatasources(datasources);
|
|
79
|
+
setIsDatasourceEditorOpen(false);
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
84
|
+
description: _constants.TOOLTIP_TEXT.editDatasources,
|
|
85
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
86
|
+
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {}),
|
|
87
|
+
onClick: openDatasourceEditor,
|
|
88
|
+
"aria-label": _constants.TOOLTIP_TEXT.editDatasources,
|
|
89
|
+
variant: "text",
|
|
90
|
+
color: "primary",
|
|
91
|
+
sx: _constants.editButtonStyle,
|
|
92
|
+
children: "Datasources"
|
|
93
|
+
})
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.Drawer, {
|
|
96
|
+
isOpen: isDatasourceEditorOpen,
|
|
97
|
+
onClose: closeDatasourceEditor,
|
|
98
|
+
PaperProps: {
|
|
99
|
+
sx: {
|
|
100
|
+
width: '50%'
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"data-testid": "datasource-editor",
|
|
104
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DatasourceEditor.DatasourceEditor, {
|
|
105
|
+
datasources: localDatasources,
|
|
106
|
+
onCancel: closeDatasourceEditor,
|
|
107
|
+
onChange: handleChangeDatasources
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
_export_star(require("./EditDatasourcesButton"), exports);
|
|
18
|
+
_export_star(require("./DatasourceEditor"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
26
29
|
});
|
|
27
30
|
return from;
|
|
28
31
|
}
|
|
@@ -16,38 +16,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "DeletePanelDialog", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return DeletePanelDialog;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _components = require("@perses-dev/components");
|
|
23
25
|
const _context = require("../../context");
|
|
24
26
|
const DeletePanelDialog = ()=>{
|
|
25
|
-
const { deletePanelDialog
|
|
26
|
-
return /*#__PURE__*/ (0,
|
|
27
|
+
const { deletePanelDialog, closeDeletePanelDialog } = (0, _context.useDeletePanelDialog)();
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog, {
|
|
27
29
|
open: deletePanelDialog !== undefined,
|
|
28
30
|
children: [
|
|
29
|
-
/*#__PURE__*/ (0,
|
|
31
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.Dialog.Header, {
|
|
30
32
|
onClose: ()=>closeDeletePanelDialog(),
|
|
31
33
|
children: "Delete Panel"
|
|
32
34
|
}),
|
|
33
|
-
deletePanelDialog && /*#__PURE__*/ (0,
|
|
35
|
+
deletePanelDialog && /*#__PURE__*/ (0, _jsxruntime.jsx)(DeletePanelForm, {
|
|
34
36
|
deletePanelDialog: deletePanelDialog
|
|
35
37
|
})
|
|
36
38
|
]
|
|
37
39
|
});
|
|
38
40
|
};
|
|
39
|
-
const DeletePanelForm = ({ deletePanelDialog
|
|
40
|
-
const { deletePanel
|
|
41
|
+
const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
42
|
+
const { deletePanel, closeDeletePanelDialog } = (0, _context.useDeletePanelDialog)();
|
|
41
43
|
const handleDelete = (e)=>{
|
|
42
44
|
e.preventDefault();
|
|
43
|
-
const { panelGroupItemId
|
|
45
|
+
const { panelGroupItemId } = deletePanelDialog;
|
|
44
46
|
deletePanel(panelGroupItemId);
|
|
45
47
|
closeDeletePanelDialog();
|
|
46
48
|
};
|
|
47
|
-
return /*#__PURE__*/ (0,
|
|
49
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("form", {
|
|
48
50
|
onSubmit: handleDelete,
|
|
49
51
|
children: [
|
|
50
|
-
/*#__PURE__*/ (0,
|
|
52
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog.Content, {
|
|
51
53
|
children: [
|
|
52
54
|
"Are you sure you want to delete ",
|
|
53
55
|
deletePanelDialog.panelName,
|
|
@@ -56,12 +58,12 @@ const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
|
56
58
|
"? This action cannot be undone."
|
|
57
59
|
]
|
|
58
60
|
}),
|
|
59
|
-
/*#__PURE__*/ (0,
|
|
61
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog.Actions, {
|
|
60
62
|
children: [
|
|
61
|
-
/*#__PURE__*/ (0,
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.Dialog.PrimaryButton, {
|
|
62
64
|
children: "Delete"
|
|
63
65
|
}),
|
|
64
|
-
/*#__PURE__*/ (0,
|
|
66
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.Dialog.SecondaryButton, {
|
|
65
67
|
onClick: ()=>closeDeletePanelDialog(),
|
|
66
68
|
children: "Cancel"
|
|
67
69
|
})
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./DeletePanelDialog"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
|
@@ -16,19 +16,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "DeletePanelGroupDialog", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return DeletePanelGroupDialog;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
|
-
const
|
|
25
|
+
const _Close = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Close"));
|
|
24
26
|
const _context = require("../../context");
|
|
25
|
-
function
|
|
27
|
+
function _interop_require_default(obj) {
|
|
26
28
|
return obj && obj.__esModule ? obj : {
|
|
27
29
|
default: obj
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
const DeletePanelGroupDialog = ()=>{
|
|
31
|
-
const { deletePanelGroupDialog
|
|
33
|
+
const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _context.useDeletePanelGroupDialog)();
|
|
32
34
|
const panelGroupId = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupId;
|
|
33
35
|
const handleDelete = (e)=>{
|
|
34
36
|
e.preventDefault();
|
|
@@ -38,14 +40,14 @@ const DeletePanelGroupDialog = ()=>{
|
|
|
38
40
|
deletePanelGroup(panelGroupId);
|
|
39
41
|
closeDeletePanelGroupDialog();
|
|
40
42
|
};
|
|
41
|
-
var
|
|
42
|
-
return /*#__PURE__*/ (0,
|
|
43
|
+
var _deletePanelGroupDialog_panelGroupName;
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Dialog, {
|
|
43
45
|
open: deletePanelGroupDialog !== undefined,
|
|
44
46
|
children: [
|
|
45
|
-
/*#__PURE__*/ (0,
|
|
47
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogTitle, {
|
|
46
48
|
children: "Delete Panel Group"
|
|
47
49
|
}),
|
|
48
|
-
/*#__PURE__*/ (0,
|
|
50
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
49
51
|
"aria-label": "Close",
|
|
50
52
|
onClick: ()=>closeDeletePanelGroupDialog(),
|
|
51
53
|
sx: (theme)=>({
|
|
@@ -53,30 +55,30 @@ const DeletePanelGroupDialog = ()=>{
|
|
|
53
55
|
top: theme.spacing(0.5),
|
|
54
56
|
right: theme.spacing(0.5)
|
|
55
57
|
}),
|
|
56
|
-
children: /*#__PURE__*/ (0,
|
|
58
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Close.default, {})
|
|
57
59
|
}),
|
|
58
|
-
/*#__PURE__*/ (0,
|
|
60
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("form", {
|
|
59
61
|
onSubmit: handleDelete,
|
|
60
62
|
children: [
|
|
61
|
-
/*#__PURE__*/ (0,
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.DialogContent, {
|
|
62
64
|
dividers: true,
|
|
63
65
|
sx: {
|
|
64
66
|
width: '500px'
|
|
65
67
|
},
|
|
66
68
|
children: [
|
|
67
69
|
"Are you sure you want to delete ",
|
|
68
|
-
(
|
|
70
|
+
(_deletePanelGroupDialog_panelGroupName = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupName) !== null && _deletePanelGroupDialog_panelGroupName !== void 0 ? _deletePanelGroupDialog_panelGroupName : 'panel group',
|
|
69
71
|
"? This will delete all the panels within the group."
|
|
70
72
|
]
|
|
71
73
|
}),
|
|
72
|
-
/*#__PURE__*/ (0,
|
|
74
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.DialogActions, {
|
|
73
75
|
children: [
|
|
74
|
-
/*#__PURE__*/ (0,
|
|
76
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
75
77
|
variant: "contained",
|
|
76
78
|
type: "submit",
|
|
77
79
|
children: "Delete"
|
|
78
80
|
}),
|
|
79
|
-
/*#__PURE__*/ (0,
|
|
81
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
80
82
|
variant: "outlined",
|
|
81
83
|
color: "secondary",
|
|
82
84
|
onClick: ()=>closeDeletePanelGroupDialog(),
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./DeletePanelGroupDialog"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js
CHANGED
|
@@ -16,17 +16,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "DashboardDiscardChangesConfirmationDialog", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return DashboardDiscardChangesConfirmationDialog;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _components = require("@perses-dev/components");
|
|
23
25
|
const _context = require("../../context");
|
|
24
26
|
const DashboardDiscardChangesConfirmationDialog = ()=>{
|
|
25
|
-
const { discardChangesConfirmationDialog: dialog
|
|
27
|
+
const { discardChangesConfirmationDialog: dialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
26
28
|
if (dialog === undefined) {
|
|
27
29
|
return null;
|
|
28
30
|
}
|
|
29
|
-
return /*#__PURE__*/ (0,
|
|
31
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.DiscardChangesConfirmationDialog, {
|
|
30
32
|
description: dialog.description || 'You have unsaved changes in this dashboard. Are you sure you want to discard these changes? Changes cannot be recovered.',
|
|
31
33
|
isOpen: true,
|
|
32
34
|
onCancel: dialog.onCancel,
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./DiscardChangesConfirmationDialog"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|