@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
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./TemplateVariableProvider"), 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
|
}
|
|
@@ -21,13 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
decodeVariableValue: function() {
|
|
25
|
+
return decodeVariableValue;
|
|
26
|
+
},
|
|
27
|
+
encodeVariableValue: function() {
|
|
28
|
+
return encodeVariableValue;
|
|
29
|
+
},
|
|
30
|
+
getInitalValuesFromQueryParameters: function() {
|
|
31
|
+
return getInitalValuesFromQueryParameters;
|
|
32
|
+
},
|
|
33
|
+
getURLQueryParamName: function() {
|
|
34
|
+
return getURLQueryParamName;
|
|
35
|
+
},
|
|
36
|
+
useVariableQueryParams: function() {
|
|
37
|
+
return useVariableQueryParams;
|
|
38
|
+
}
|
|
29
39
|
});
|
|
30
|
-
const
|
|
40
|
+
const _usequeryparams = require("use-query-params");
|
|
31
41
|
const variableQueryParameterPrefix = 'var-';
|
|
32
42
|
function getURLQueryParamName(name) {
|
|
33
43
|
return `${variableQueryParameterPrefix}${name}`;
|
|
@@ -63,7 +73,7 @@ function useVariableQueryParams(defs) {
|
|
|
63
73
|
const name = getURLQueryParamName(def.spec.name);
|
|
64
74
|
config[name] = VariableValueParam;
|
|
65
75
|
});
|
|
66
|
-
return (0,
|
|
76
|
+
return (0, _usequeryparams.useQueryParams)(config, {
|
|
67
77
|
updateType: 'replaceIn'
|
|
68
78
|
});
|
|
69
79
|
}
|
|
@@ -21,10 +21,18 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
checkSavedDefaultVariableStatus: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
checkSavedDefaultVariableStatus: function() {
|
|
25
|
+
return checkSavedDefaultVariableStatus;
|
|
26
|
+
},
|
|
27
|
+
findVariableDefinitionByName: function() {
|
|
28
|
+
return findVariableDefinitionByName;
|
|
29
|
+
},
|
|
30
|
+
forEachVariableDefinition: function() {
|
|
31
|
+
return forEachVariableDefinition;
|
|
32
|
+
},
|
|
33
|
+
mergeVariableDefinitions: function() {
|
|
34
|
+
return mergeVariableDefinitions;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
37
|
function checkSavedDefaultVariableStatus(definitions, varState) {
|
|
30
38
|
let isSavedVariableModified = false;
|
|
@@ -35,15 +43,15 @@ function checkSavedDefaultVariableStatus(definitions, varState) {
|
|
|
35
43
|
const currentVariable = varState.get({
|
|
36
44
|
name
|
|
37
45
|
});
|
|
38
|
-
if ((currentVariable === null || currentVariable === void 0 ? void 0 : currentVariable.value) !== null && (currentVariable === null || currentVariable === void 0 ? void 0 : currentVariable.value) !== savedVariable.spec.
|
|
46
|
+
if ((currentVariable === null || currentVariable === void 0 ? void 0 : currentVariable.value) !== null && (currentVariable === null || currentVariable === void 0 ? void 0 : currentVariable.value) !== savedVariable.spec.defaultValue) {
|
|
39
47
|
modifiedVariableNames.push(name);
|
|
40
48
|
isSavedVariableModified = true;
|
|
41
49
|
}
|
|
42
50
|
} else if (savedVariable.kind === 'TextVariable') {
|
|
43
|
-
const
|
|
51
|
+
const currentVariable = varState.get({
|
|
44
52
|
name
|
|
45
53
|
});
|
|
46
|
-
const currentVariableValue = typeof (
|
|
54
|
+
const currentVariableValue = typeof (currentVariable === null || currentVariable === void 0 ? void 0 : currentVariable.value) === 'string' ? currentVariable.value : '';
|
|
47
55
|
if (savedVariable.spec.value !== currentVariableValue) {
|
|
48
56
|
modifiedVariableNames.push(name);
|
|
49
57
|
isSavedVariableModified = true;
|
|
@@ -14,18 +14,20 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
17
|
+
_export_star(require("./DashboardProvider"), exports);
|
|
18
|
+
_export_star(require("./DatasourceStoreProvider"), exports);
|
|
19
|
+
_export_star(require("./TemplateVariableProvider"), exports);
|
|
20
|
+
_export_star(require("./useDashboard"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
22
|
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
});
|
|
30
32
|
return from;
|
|
31
33
|
}
|
|
@@ -16,27 +16,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "useDashboard", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return useDashboard;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _core = require("@perses-dev/core");
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
+
const _DashboardProvider = require("./DashboardProvider");
|
|
25
|
+
const _TemplateVariableProvider = require("./TemplateVariableProvider");
|
|
24
26
|
function useDashboard() {
|
|
25
|
-
const { panels
|
|
27
|
+
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, ttl } = (0, _DashboardProvider.useDashboardStore)(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, ttl })=>({
|
|
26
28
|
panels,
|
|
27
29
|
panelGroups,
|
|
28
30
|
panelGroupOrder,
|
|
29
31
|
setDashboard,
|
|
32
|
+
kind,
|
|
30
33
|
metadata,
|
|
31
34
|
display,
|
|
32
35
|
duration,
|
|
33
|
-
refreshInterval
|
|
36
|
+
refreshInterval,
|
|
37
|
+
datasources,
|
|
38
|
+
ttl
|
|
34
39
|
}));
|
|
35
|
-
const { setVariableDefinitions
|
|
36
|
-
const variables = (0,
|
|
40
|
+
const { setVariableDefinitions } = (0, _TemplateVariableProvider.useTemplateVariableActions)();
|
|
41
|
+
const variables = (0, _TemplateVariableProvider.useTemplateVariableDefinitions)();
|
|
37
42
|
const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);
|
|
38
|
-
const dashboard = {
|
|
39
|
-
kind
|
|
43
|
+
const dashboard = kind === 'Dashboard' ? {
|
|
44
|
+
kind,
|
|
40
45
|
metadata,
|
|
41
46
|
spec: {
|
|
42
47
|
display,
|
|
@@ -44,7 +49,21 @@ function useDashboard() {
|
|
|
44
49
|
layouts,
|
|
45
50
|
variables,
|
|
46
51
|
duration,
|
|
47
|
-
refreshInterval
|
|
52
|
+
refreshInterval,
|
|
53
|
+
datasources
|
|
54
|
+
}
|
|
55
|
+
} : {
|
|
56
|
+
kind,
|
|
57
|
+
metadata,
|
|
58
|
+
spec: {
|
|
59
|
+
display,
|
|
60
|
+
panels,
|
|
61
|
+
layouts,
|
|
62
|
+
variables,
|
|
63
|
+
duration,
|
|
64
|
+
refreshInterval,
|
|
65
|
+
datasources,
|
|
66
|
+
ttl
|
|
48
67
|
}
|
|
49
68
|
};
|
|
50
69
|
const setDashboard = (dashboardResource)=>{
|
|
@@ -63,7 +82,7 @@ function convertPanelGroupsToLayouts(panelGroups, panelGroupOrder) {
|
|
|
63
82
|
if (group === undefined) {
|
|
64
83
|
throw new Error('panel group not found');
|
|
65
84
|
}
|
|
66
|
-
const { title
|
|
85
|
+
const { title, isCollapsed, itemLayouts, itemPanelKeys } = group;
|
|
67
86
|
let display = undefined;
|
|
68
87
|
if (title) {
|
|
69
88
|
display = {
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,17 +14,19 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
17
|
+
_export_star(require("./components"), exports);
|
|
18
|
+
_export_star(require("./context"), exports);
|
|
19
|
+
_export_star(require("./views"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
21
21
|
Object.keys(from).forEach(function(k) {
|
|
22
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
});
|
|
29
31
|
return from;
|
|
30
32
|
}
|
|
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "WithDashboard", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return WithDashboard;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _dashboards = require("@perses-dev/dashboards");
|
|
23
25
|
const _constants = require("./constants");
|
|
24
26
|
// Type guard because storybook types parameters as `any`
|
|
@@ -29,11 +31,11 @@ const WithDashboard = (Story, context)=>{
|
|
|
29
31
|
const initParameter = context.parameters.withDashboard;
|
|
30
32
|
const parameter = isWithDashboardParameter(initParameter) ? initParameter : undefined;
|
|
31
33
|
const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
|
|
32
|
-
return /*#__PURE__*/ (0,
|
|
34
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.DashboardProvider, {
|
|
33
35
|
initialState: {
|
|
34
36
|
dashboardResource: _constants.EMPTY_DASHBOARD_RESOURCE
|
|
35
37
|
},
|
|
36
38
|
...props,
|
|
37
|
-
children: /*#__PURE__*/ (0,
|
|
39
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
38
40
|
});
|
|
39
41
|
};
|
|
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "WithDatasourceStore", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return WithDatasourceStore;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _dashboards = require("@perses-dev/dashboards");
|
|
23
25
|
const _test = require("../../test");
|
|
24
26
|
// Type guard because storybook types parameters as `any`
|
|
@@ -29,9 +31,9 @@ const WithDatasourceStore = (Story, context)=>{
|
|
|
29
31
|
const initParameter = context.parameters.withDatasourceStore;
|
|
30
32
|
const parameter = isWithDatasourceStoreParameter(initParameter) ? initParameter : undefined;
|
|
31
33
|
const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
|
|
32
|
-
return /*#__PURE__*/ (0,
|
|
34
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.DatasourceStoreProvider, {
|
|
33
35
|
..._test.defaultDatasourceProps,
|
|
34
36
|
...props,
|
|
35
|
-
children: /*#__PURE__*/ (0,
|
|
37
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
36
38
|
});
|
|
37
39
|
};
|
|
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "WithTemplateVariables", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return WithTemplateVariables;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _dashboards = require("@perses-dev/dashboards");
|
|
23
25
|
// Type guard because storybook types parameters as `any`
|
|
24
26
|
function isWithTemplateVariableParameter(parameter) {
|
|
@@ -28,8 +30,8 @@ const WithTemplateVariables = (Story, context)=>{
|
|
|
28
30
|
const initParameter = context.parameters.withTemplateVariables;
|
|
29
31
|
const parameter = isWithTemplateVariableParameter(initParameter) ? initParameter : undefined;
|
|
30
32
|
const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
|
|
31
|
-
return /*#__PURE__*/ (0,
|
|
33
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.TemplateVariableProvider, {
|
|
32
34
|
...props,
|
|
33
|
-
children: /*#__PURE__*/ (0,
|
|
35
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
34
36
|
});
|
|
35
37
|
};
|
|
@@ -16,15 +16,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "EMPTY_DASHBOARD_RESOURCE", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return EMPTY_DASHBOARD_RESOURCE;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const EMPTY_DASHBOARD_RESOURCE = {
|
|
22
24
|
kind: 'Dashboard',
|
|
23
25
|
metadata: {
|
|
24
26
|
name: 'My Dashboard',
|
|
25
27
|
project: 'Storybook',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
createdAt: '2021-11-09T00:00:00Z',
|
|
29
|
+
updatedAt: '2021-11-09T00:00:00Z',
|
|
28
30
|
version: 0
|
|
29
31
|
},
|
|
30
32
|
spec: {
|
|
@@ -14,18 +14,20 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
17
|
+
_export_star(require("./constants"), exports);
|
|
18
|
+
_export_star(require("./WithDashboard"), exports);
|
|
19
|
+
_export_star(require("./WithDatasourceStore"), exports);
|
|
20
|
+
_export_star(require("./WithTemplateVariables"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
22
|
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
});
|
|
30
32
|
return from;
|
|
31
33
|
}
|
|
@@ -21,13 +21,17 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
createDashboardProviderSpy: function() {
|
|
25
|
+
return createDashboardProviderSpy;
|
|
26
|
+
},
|
|
27
|
+
getTestDashboard: function() {
|
|
28
|
+
return getTestDashboard;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const _react = require("react");
|
|
28
32
|
const _context = require("../context");
|
|
29
|
-
const _testDashboard = /*#__PURE__*/
|
|
30
|
-
function
|
|
33
|
+
const _testDashboard = /*#__PURE__*/ _interop_require_default(require("./testDashboard"));
|
|
34
|
+
function _interop_require_default(obj) {
|
|
31
35
|
return obj && obj.__esModule ? obj : {
|
|
32
36
|
default: obj
|
|
33
37
|
};
|
|
@@ -21,18 +21,24 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
defaultDatasourceProps: function() {
|
|
25
|
+
return defaultDatasourceProps;
|
|
26
|
+
},
|
|
27
|
+
prometheusDemo: function() {
|
|
28
|
+
return prometheusDemo;
|
|
29
|
+
},
|
|
30
|
+
prometheusDemoUrl: function() {
|
|
31
|
+
return prometheusDemoUrl;
|
|
32
|
+
}
|
|
27
33
|
});
|
|
28
|
-
const
|
|
34
|
+
const _dashboardprovider = require("./dashboard-provider");
|
|
29
35
|
const prometheusDemoUrl = 'https://prometheus.demo.do.prometheus.io';
|
|
30
36
|
const prometheusDemo = {
|
|
31
37
|
kind: 'GlobalDatasource',
|
|
32
38
|
metadata: {
|
|
33
39
|
name: 'PrometheusDemo',
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
createdAt: '0001-01-01T00:00:00Z',
|
|
41
|
+
updatedAt: '0001-01-01T00:00:00Z',
|
|
36
42
|
version: 0
|
|
37
43
|
},
|
|
38
44
|
spec: {
|
|
@@ -40,23 +46,21 @@ const prometheusDemo = {
|
|
|
40
46
|
plugin: {
|
|
41
47
|
kind: 'PrometheusDatasource',
|
|
42
48
|
spec: {
|
|
43
|
-
|
|
49
|
+
directUrl: prometheusDemoUrl
|
|
44
50
|
}
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
};
|
|
48
54
|
const defaultDatasourceProps = {
|
|
49
|
-
dashboardResource: (0,
|
|
55
|
+
dashboardResource: (0, _dashboardprovider.getTestDashboard)(),
|
|
50
56
|
datasourceApi: {
|
|
57
|
+
buildProxyUrl: ()=>'',
|
|
51
58
|
getDatasource: ()=>{
|
|
52
59
|
return Promise.resolve(undefined);
|
|
53
60
|
},
|
|
54
61
|
getGlobalDatasource: (selector)=>{
|
|
55
62
|
if (selector.kind === 'PrometheusDatasource') {
|
|
56
|
-
return Promise.resolve(
|
|
57
|
-
resource: prometheusDemo,
|
|
58
|
-
proxyUrl: prometheusDemoUrl
|
|
59
|
-
});
|
|
63
|
+
return Promise.resolve(prometheusDemo);
|
|
60
64
|
}
|
|
61
65
|
return Promise.resolve(undefined);
|
|
62
66
|
},
|
package/dist/cjs/test/index.js
CHANGED
|
@@ -14,18 +14,20 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
17
|
+
_export_star(require("./dashboard-provider"), exports);
|
|
18
|
+
_export_star(require("./datasource-provider"), exports);
|
|
19
|
+
_export_star(require("./plugin-registry"), exports);
|
|
20
|
+
_export_star(require("./render"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
22
|
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
});
|
|
30
32
|
return from;
|
|
31
33
|
}
|
|
@@ -16,17 +16,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "MOCK_PLUGINS", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return MOCK_PLUGINS;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const FakeTimeSeriesChartOptionEditor = ()=>{
|
|
23
|
-
return /*#__PURE__*/ (0,
|
|
25
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
24
26
|
children: "TimeSeriesChart options"
|
|
25
27
|
});
|
|
26
28
|
};
|
|
27
29
|
const FakeTimeSeriesPlugin = {
|
|
28
30
|
PanelComponent: ()=>{
|
|
29
|
-
return /*#__PURE__*/ (0,
|
|
31
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
30
32
|
children: "TimeSeriesChart panel"
|
|
31
33
|
});
|
|
32
34
|
},
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -16,23 +16,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "renderWithContext", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return renderWithContext;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
25
|
const _react1 = require("@testing-library/react");
|
|
24
|
-
const
|
|
26
|
+
const _reactrouterdom = require("react-router-dom");
|
|
25
27
|
const _history = require("history");
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
28
|
+
const _usequeryparams = require("use-query-params");
|
|
29
|
+
const _reactrouter6 = require("use-query-params/adapters/react-router-6");
|
|
30
|
+
const _reactquery = require("@tanstack/react-query");
|
|
29
31
|
const _components = require("@perses-dev/components");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
33
|
+
const _context = require("../context");
|
|
34
|
+
const _test = require("../test");
|
|
35
|
+
const _pluginregistry = require("./plugin-registry");
|
|
32
36
|
/*
|
|
33
37
|
* Workaround for React router upgrade type errors.
|
|
34
38
|
* More details: https://stackoverflow.com/a/69948457/17575201
|
|
35
|
-
*/ const CustomRouter = ({ history
|
|
39
|
+
*/ const CustomRouter = ({ history, children })=>{
|
|
36
40
|
const [state, setState] = (0, _react.useState)({
|
|
37
41
|
action: history.action,
|
|
38
42
|
location: history.location
|
|
@@ -40,7 +44,7 @@ const _pluginRegistry = require("./plugin-registry");
|
|
|
40
44
|
(0, _react.useLayoutEffect)(()=>history.listen(setState), [
|
|
41
45
|
history
|
|
42
46
|
]);
|
|
43
|
-
return /*#__PURE__*/ (0,
|
|
47
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactrouterdom.Router, {
|
|
44
48
|
location: state.location,
|
|
45
49
|
navigationType: state.action,
|
|
46
50
|
navigator: history,
|
|
@@ -49,7 +53,7 @@ const _pluginRegistry = require("./plugin-registry");
|
|
|
49
53
|
};
|
|
50
54
|
function renderWithContext(ui, options, history) {
|
|
51
55
|
// Create a new QueryClient for each test to avoid caching issues
|
|
52
|
-
const queryClient = new
|
|
56
|
+
const queryClient = new _reactquery.QueryClient({
|
|
53
57
|
defaultOptions: {
|
|
54
58
|
queries: {
|
|
55
59
|
refetchOnWindowFocus: false,
|
|
@@ -58,27 +62,30 @@ function renderWithContext(ui, options, history) {
|
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
64
|
const customHistory = history !== null && history !== void 0 ? history : (0, _history.createMemoryHistory)();
|
|
61
|
-
const BaseRender = ()=>/*#__PURE__*/ (0,
|
|
65
|
+
const BaseRender = ()=>/*#__PURE__*/ (0, _jsxruntime.jsx)(CustomRouter, {
|
|
62
66
|
history: customHistory,
|
|
63
|
-
children: /*#__PURE__*/ (0,
|
|
67
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactquery.QueryClientProvider, {
|
|
64
68
|
client: queryClient,
|
|
65
|
-
children: /*#__PURE__*/ (0,
|
|
66
|
-
adapter:
|
|
67
|
-
children: /*#__PURE__*/ (0,
|
|
69
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_usequeryparams.QueryParamProvider, {
|
|
70
|
+
adapter: _reactrouter6.ReactRouter6Adapter,
|
|
71
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.SnackbarProvider, {
|
|
68
72
|
anchorOrigin: {
|
|
69
73
|
vertical: 'bottom',
|
|
70
74
|
horizontal: 'right'
|
|
71
75
|
},
|
|
72
|
-
children: /*#__PURE__*/ (0,
|
|
76
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ChartsProvider, {
|
|
73
77
|
chartsTheme: _components.testChartsTheme,
|
|
74
|
-
children: /*#__PURE__*/ (0,
|
|
75
|
-
...(0,
|
|
76
|
-
children:
|
|
78
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
|
|
79
|
+
...(0, _pluginsystem.mockPluginRegistry)(..._pluginregistry.MOCK_PLUGINS),
|
|
80
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.DatasourceStoreProvider, {
|
|
81
|
+
..._test.defaultDatasourceProps,
|
|
82
|
+
children: ui
|
|
83
|
+
})
|
|
77
84
|
})
|
|
78
85
|
})
|
|
79
86
|
})
|
|
80
87
|
})
|
|
81
88
|
})
|
|
82
89
|
});
|
|
83
|
-
return (0, _react1.render)(/*#__PURE__*/ (0,
|
|
90
|
+
return (0, _react1.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(BaseRender, {}), options);
|
|
84
91
|
}
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const _reactintersectionobserver = require("react-intersection-observer");
|
|
18
18
|
require("@testing-library/jest-dom/extend-expect");
|
|
19
19
|
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
20
20
|
jest.mock('echarts/core');
|
|
21
21
|
// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation
|
|
22
22
|
// for other options)
|
|
23
|
-
(0,
|
|
23
|
+
(0, _reactintersectionobserver.defaultFallbackInView)(true);
|