@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
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 +1 -1
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +9 -2
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +6 -6
- package/dist/cjs/components/Datasources/DatasourceEditor.js +19 -20
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/cjs/components/EditButton/EditButton.js +1 -1
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/cjs/components/GridLayout/GridContainer.js +16 -11
- package/dist/cjs/components/GridLayout/GridItemContent.js +24 -10
- package/dist/cjs/components/GridLayout/GridLayout.js +63 -14
- package/dist/cjs/components/GridLayout/GridTitle.js +8 -9
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +15 -11
- package/dist/cjs/components/Panel/PanelActions.js +216 -0
- package/dist/cjs/components/Panel/PanelContent.js +6 -6
- package/dist/cjs/components/Panel/PanelHeader.js +36 -103
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +67 -62
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +7 -9
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +8 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +5 -5
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +48 -56
- package/dist/cjs/components/Variables/VariableEditor.js +39 -46
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +17 -9
- package/dist/cjs/constants/user-interface-text.js +6 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +24 -17
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +5 -5
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +51 -43
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +11 -16
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +13 -8
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +32 -31
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +128 -131
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
- package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +8 -8
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +6 -6
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +24 -9
- package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/cjs/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/cjs/stories/decorators/index.js +2 -2
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/plugin-registry.js +4 -2
- package/dist/cjs/test/render.js +14 -12
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -11
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +3 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +9 -2
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +20 -21
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -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/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -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/DownloadButton/DownloadButton.d.ts +2 -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/EditButton/EditButton.d.ts +2 -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/EditJsonButton/EditJsonButton.d.ts +2 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +5 -3
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +16 -11
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +25 -11
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +65 -16
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -3
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +8 -9
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
- package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls/index.js → Panel/HeaderIconButton.js} +7 -3
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -7
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +16 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +16 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +203 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +2 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +6 -6
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +9 -9
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +39 -106
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.d.ts +6 -0
- package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
- package/dist/components/Panel/PanelLinks.js +123 -0
- package/dist/components/Panel/PanelLinks.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -4
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +70 -65
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -3
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -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/QuerySummaryTable/QuerySummaryTable.d.ts +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -10
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +9 -9
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +3 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +6 -6
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -6
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +49 -57
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +40 -47
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -4
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +21 -20
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/styles.d.ts +4 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +5 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +11 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +22 -15
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
- 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 +2 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +36 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +26 -19
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.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 +4 -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.d.ts +1 -2
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +8 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -3
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +8 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.d.ts +21 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +10 -10
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +32 -31
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +117 -116
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
- package/dist/context/VariableProvider/index.d.ts +2 -0
- package/dist/context/VariableProvider/index.d.ts.map +1 -0
- package/dist/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/context/VariableProvider/index.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
- package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/context/VariableProvider/utils.js.map +1 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -2
- 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 -9
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/stories/decorators/WithVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +2 -2
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +2 -2
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +4 -2
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +10 -8
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.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/views/ViewDashboard/DashboardApp.d.ts +4 -4
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -4
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +11 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -210
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- package/dist/cjs/utils/time.js +0 -29
- 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 -186
- 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 +0 -15
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/components/Variables/TemplateVariable.d.ts.map +0 -1
- package/dist/components/Variables/TemplateVariable.js.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
- package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/index.js +0 -15
- package/dist/context/TemplateVariableProvider/index.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.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 +0 -23
- package/dist/utils/time.js.map +0 -1
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/panel.d.ts +0 -19
- package/dist/validation/panel.d.ts.map +0 -1
- package/dist/validation/panel.js +0 -21
- package/dist/validation/panel.js.map +0 -1
|
@@ -21,29 +21,29 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
useEditMode: function() {
|
|
25
|
-
return useEditMode;
|
|
26
|
-
},
|
|
27
24
|
useDashboardActions: function() {
|
|
28
25
|
return useDashboardActions;
|
|
29
26
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
27
|
+
useDashboardDuration: function() {
|
|
28
|
+
return useDashboardDuration;
|
|
32
29
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
30
|
+
useDeletePanelDialog: function() {
|
|
31
|
+
return useDeletePanelDialog;
|
|
35
32
|
},
|
|
36
|
-
|
|
37
|
-
return
|
|
33
|
+
useDeletePanelGroupDialog: function() {
|
|
34
|
+
return useDeletePanelGroupDialog;
|
|
38
35
|
},
|
|
39
|
-
|
|
40
|
-
return
|
|
36
|
+
useDiscardChangesConfirmationDialog: function() {
|
|
37
|
+
return useDiscardChangesConfirmationDialog;
|
|
41
38
|
},
|
|
42
|
-
|
|
43
|
-
return
|
|
39
|
+
useEditJsonDialog: function() {
|
|
40
|
+
return useEditJsonDialog;
|
|
44
41
|
},
|
|
45
|
-
|
|
46
|
-
return
|
|
42
|
+
useEditMode: function() {
|
|
43
|
+
return useEditMode;
|
|
44
|
+
},
|
|
45
|
+
useListPanelGroups: function() {
|
|
46
|
+
return useListPanelGroups;
|
|
47
47
|
},
|
|
48
48
|
usePanel: function() {
|
|
49
49
|
return usePanel;
|
|
@@ -54,38 +54,41 @@ _export(exports, {
|
|
|
54
54
|
usePanelEditor: function() {
|
|
55
55
|
return usePanelEditor;
|
|
56
56
|
},
|
|
57
|
-
|
|
58
|
-
return
|
|
57
|
+
usePanelGroup: function() {
|
|
58
|
+
return usePanelGroup;
|
|
59
59
|
},
|
|
60
|
-
|
|
61
|
-
return
|
|
60
|
+
usePanelGroupActions: function() {
|
|
61
|
+
return usePanelGroupActions;
|
|
62
|
+
},
|
|
63
|
+
usePanelGroupEditor: function() {
|
|
64
|
+
return usePanelGroupEditor;
|
|
65
|
+
},
|
|
66
|
+
usePanelGroupIds: function() {
|
|
67
|
+
return usePanelGroupIds;
|
|
62
68
|
},
|
|
63
69
|
useSaveChangesConfirmationDialog: function() {
|
|
64
70
|
return useSaveChangesConfirmationDialog;
|
|
65
71
|
},
|
|
66
|
-
|
|
67
|
-
return
|
|
68
|
-
},
|
|
69
|
-
useEditJsonDialog: function() {
|
|
70
|
-
return useEditJsonDialog;
|
|
72
|
+
useViewPanel: function() {
|
|
73
|
+
return useViewPanel;
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
76
|
const _react = require("react");
|
|
74
77
|
const _DashboardProvider = require("./DashboardProvider");
|
|
75
|
-
const selectEditMode = ({ isEditMode
|
|
78
|
+
const selectEditMode = ({ isEditMode, setEditMode })=>({
|
|
76
79
|
isEditMode,
|
|
77
80
|
setEditMode
|
|
78
81
|
});
|
|
79
82
|
function useEditMode() {
|
|
80
83
|
return (0, _DashboardProvider.useDashboardStore)(selectEditMode);
|
|
81
84
|
}
|
|
82
|
-
const selectDashboardActions = ({ setDashboard
|
|
85
|
+
const selectDashboardActions = ({ setDashboard, openAddPanelGroup, openAddPanel })=>({
|
|
83
86
|
setDashboard,
|
|
84
87
|
openAddPanelGroup,
|
|
85
88
|
openAddPanel
|
|
86
89
|
});
|
|
87
90
|
function useDashboardActions() {
|
|
88
|
-
const { setDashboard
|
|
91
|
+
const { setDashboard, openAddPanelGroup, openAddPanel } = (0, _DashboardProvider.useDashboardStore)(selectDashboardActions);
|
|
89
92
|
return {
|
|
90
93
|
setDashboard,
|
|
91
94
|
openAddPanelGroup: ()=>openAddPanelGroup(),
|
|
@@ -122,15 +125,15 @@ function usePanelGroup(panelGroupId) {
|
|
|
122
125
|
}
|
|
123
126
|
return panelGroup;
|
|
124
127
|
}
|
|
125
|
-
const selectPanelGroupActions = ({ openEditPanelGroup
|
|
128
|
+
const selectPanelGroupActions = ({ openEditPanelGroup, deletePanelGroup, openAddPanel, updatePanelGroupLayouts })=>({
|
|
126
129
|
openEditPanelGroup,
|
|
127
130
|
deletePanelGroup,
|
|
128
131
|
openAddPanel,
|
|
129
132
|
updatePanelGroupLayouts
|
|
130
133
|
});
|
|
131
134
|
function usePanelGroupActions(panelGroupId) {
|
|
132
|
-
const { moveUp
|
|
133
|
-
const { openEditPanelGroup
|
|
135
|
+
const { moveUp, moveDown } = useMovePanelGroup(panelGroupId);
|
|
136
|
+
const { openEditPanelGroup, deletePanelGroup, openAddPanel, updatePanelGroupLayouts } = (0, _DashboardProvider.useDashboardStore)(selectPanelGroupActions);
|
|
134
137
|
return {
|
|
135
138
|
openEditPanelGroup: ()=>openEditPanelGroup(panelGroupId),
|
|
136
139
|
deletePanelGroup: ()=>deletePanelGroup(panelGroupId),
|
|
@@ -165,14 +168,14 @@ const selectPanelGroupEditor = (state)=>state.panelGroupEditor;
|
|
|
165
168
|
function usePanelGroupEditor() {
|
|
166
169
|
return (0, _DashboardProvider.useDashboardStore)(selectPanelGroupEditor);
|
|
167
170
|
}
|
|
168
|
-
const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog
|
|
171
|
+
const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog, openDeletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup })=>({
|
|
169
172
|
deletePanelGroupDialog,
|
|
170
173
|
openDeletePanelGroupDialog,
|
|
171
174
|
closeDeletePanelGroupDialog,
|
|
172
175
|
deletePanelGroup
|
|
173
176
|
});
|
|
174
177
|
function useDeletePanelGroupDialog() {
|
|
175
|
-
const { deletePanelGroupDialog
|
|
178
|
+
const { deletePanelGroupDialog, openDeletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _DashboardProvider.useDashboardStore)(selectDeletePanelGroupDialog);
|
|
176
179
|
return {
|
|
177
180
|
deletePanelGroupDialog,
|
|
178
181
|
deletePanelGroup,
|
|
@@ -181,10 +184,9 @@ function useDeletePanelGroupDialog() {
|
|
|
181
184
|
};
|
|
182
185
|
}
|
|
183
186
|
function usePanel(panelGroupItemId) {
|
|
184
|
-
const { panelGroupId
|
|
187
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
185
188
|
const panel = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>{
|
|
186
|
-
|
|
187
|
-
const panelKey = (_store_panelGroups_panelGroupId = store.panelGroups[panelGroupId]) === null || _store_panelGroups_panelGroupId === void 0 ? void 0 : _store_panelGroups_panelGroupId.itemPanelKeys[panelGroupLayoutId];
|
|
189
|
+
const panelKey = store.panelGroups[panelGroupId]?.itemPanelKeys[panelGroupLayoutId];
|
|
188
190
|
if (panelKey === undefined) return;
|
|
189
191
|
return store.panels[panelKey];
|
|
190
192
|
}, [
|
|
@@ -196,24 +198,26 @@ function usePanel(panelGroupItemId) {
|
|
|
196
198
|
}
|
|
197
199
|
return panel;
|
|
198
200
|
}
|
|
199
|
-
const selectPanelActions = ({ openEditPanel
|
|
201
|
+
const selectPanelActions = ({ openEditPanel, openDeletePanelDialog, duplicatePanel, setViewPanel })=>({
|
|
200
202
|
openEditPanel,
|
|
201
203
|
openDeletePanelDialog,
|
|
202
|
-
duplicatePanel
|
|
204
|
+
duplicatePanel,
|
|
205
|
+
setViewPanel
|
|
203
206
|
});
|
|
204
207
|
function usePanelActions(panelGroupItemId) {
|
|
205
|
-
const { openEditPanel
|
|
208
|
+
const { openEditPanel, openDeletePanelDialog, duplicatePanel, setViewPanel } = (0, _DashboardProvider.useDashboardStore)(selectPanelActions);
|
|
206
209
|
return {
|
|
207
210
|
openEditPanel: ()=>openEditPanel(panelGroupItemId),
|
|
208
211
|
openDeletePanelDialog: ()=>openDeletePanelDialog(panelGroupItemId),
|
|
209
|
-
duplicatePanel: ()=>duplicatePanel(panelGroupItemId)
|
|
212
|
+
duplicatePanel: ()=>duplicatePanel(panelGroupItemId),
|
|
213
|
+
viewPanel: (panelGroupItemId)=>setViewPanel(panelGroupItemId)
|
|
210
214
|
};
|
|
211
215
|
}
|
|
212
216
|
const selectPanelEditor = (state)=>state.panelEditor;
|
|
213
217
|
function usePanelEditor() {
|
|
214
218
|
return (0, _DashboardProvider.useDashboardStore)(selectPanelEditor);
|
|
215
219
|
}
|
|
216
|
-
const selectDeletePanelDialog = ({ deletePanelDialog
|
|
220
|
+
const selectDeletePanelDialog = ({ deletePanelDialog, deletePanel, closeDeletePanelDialog })=>({
|
|
217
221
|
deletePanelDialog,
|
|
218
222
|
deletePanel,
|
|
219
223
|
closeDeletePanelDialog
|
|
@@ -226,7 +230,11 @@ const selectDashboardDuration = (state)=>state.duration;
|
|
|
226
230
|
function useDashboardDuration() {
|
|
227
231
|
return (0, _DashboardProvider.useDashboardStore)(selectDashboardDuration);
|
|
228
232
|
}
|
|
229
|
-
const
|
|
233
|
+
const selectViewPanel = (state)=>state.getViewPanel();
|
|
234
|
+
function useViewPanel() {
|
|
235
|
+
return (0, _DashboardProvider.useDashboardStore)(selectViewPanel);
|
|
236
|
+
}
|
|
237
|
+
const selectSaveChangesConfirmationDialog = ({ saveChangesConfirmationDialog, openSaveChangesConfirmationDialog, closeSaveChangesConfirmationDialog })=>({
|
|
230
238
|
saveChangesConfirmationDialog,
|
|
231
239
|
openSaveChangesConfirmationDialog,
|
|
232
240
|
closeSaveChangesConfirmationDialog
|
|
@@ -234,7 +242,7 @@ const selectSaveChangesConfirmationDialog = ({ saveChangesConfirmationDialog , o
|
|
|
234
242
|
function useSaveChangesConfirmationDialog() {
|
|
235
243
|
return (0, _DashboardProvider.useDashboardStore)(selectSaveChangesConfirmationDialog);
|
|
236
244
|
}
|
|
237
|
-
const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDialog
|
|
245
|
+
const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDialog, openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog })=>({
|
|
238
246
|
discardChangesConfirmationDialog,
|
|
239
247
|
openDiscardChangesConfirmationDialog,
|
|
240
248
|
closeDiscardChangesConfirmationDialog
|
|
@@ -242,7 +250,7 @@ const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDial
|
|
|
242
250
|
function useDiscardChangesConfirmationDialog() {
|
|
243
251
|
return (0, _DashboardProvider.useDashboardStore)(selectDiscardChangesConfirmationDialog);
|
|
244
252
|
}
|
|
245
|
-
const selectEditJsonDialog = ({ editJsonDialog
|
|
253
|
+
const selectEditJsonDialog = ({ editJsonDialog, openEditJsonDialog, closeEditJsonDialog })=>({
|
|
246
254
|
editJsonDialog,
|
|
247
255
|
openEditJsonDialog,
|
|
248
256
|
closeEditJsonDialog
|
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "createDeletePanelGroupSlice", {
|
|
|
22
22
|
});
|
|
23
23
|
const createDeletePanelGroupSlice = (set, get)=>({
|
|
24
24
|
deletePanelGroup (panelGroupId) {
|
|
25
|
-
const { panelGroups
|
|
25
|
+
const { panelGroups, panelGroupOrder } = get();
|
|
26
26
|
const group = panelGroups[panelGroupId];
|
|
27
27
|
const idIndex = panelGroupOrder.findIndex((id)=>id === panelGroupId);
|
|
28
28
|
if (group === undefined || idIndex === -1) {
|
|
@@ -25,7 +25,7 @@ function createDeletePanelSlice() {
|
|
|
25
25
|
return (set, get)=>({
|
|
26
26
|
deletePanel (panelGroupItemId) {
|
|
27
27
|
set((draft)=>{
|
|
28
|
-
const { panelGroupId
|
|
28
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
29
29
|
const existingGroup = draft.panelGroups[panelGroupId];
|
|
30
30
|
if (existingGroup === undefined) {
|
|
31
31
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
@@ -45,8 +45,8 @@ function createDeletePanelSlice() {
|
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
47
|
openDeletePanelDialog (panelGroupItemId) {
|
|
48
|
-
const { panelGroupId
|
|
49
|
-
const { panels
|
|
48
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
49
|
+
const { panels, panelGroups } = get();
|
|
50
50
|
const panelGroup = panelGroups[panelGroupId];
|
|
51
51
|
if (panelGroup === undefined) {
|
|
52
52
|
throw new Error(`Panel group not found ${panelGroupId}`);
|
|
@@ -60,11 +60,10 @@ function createDeletePanelSlice() {
|
|
|
60
60
|
throw new Error(`Could not find panel ${panelKey}`);
|
|
61
61
|
}
|
|
62
62
|
set((state)=>{
|
|
63
|
-
var _panelGroup_title;
|
|
64
63
|
state.deletePanelDialog = {
|
|
65
64
|
panelGroupItemId: panelGroupItemId,
|
|
66
65
|
panelName: panel.spec.display.name,
|
|
67
|
-
panelGroupName:
|
|
66
|
+
panelGroupName: panelGroup.title ?? ''
|
|
68
67
|
};
|
|
69
68
|
});
|
|
70
69
|
},
|
|
@@ -28,7 +28,7 @@ function createDuplicatePanelSlice() {
|
|
|
28
28
|
set((state)=>{
|
|
29
29
|
const panels = state.panels;
|
|
30
30
|
// Figure out the panel key at that location
|
|
31
|
-
const { panelGroupId
|
|
31
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
32
32
|
const group = state.panelGroups[panelGroupId];
|
|
33
33
|
if (group === undefined) {
|
|
34
34
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
@@ -20,20 +20,18 @@ Object.defineProperty(exports, "createPanelEditorSlice", {
|
|
|
20
20
|
return createPanelEditorSlice;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
const
|
|
23
|
+
const _utils = require("../../utils");
|
|
24
24
|
const _common = require("./common");
|
|
25
25
|
const _panelgroupslice = require("./panel-group-slice");
|
|
26
26
|
function createPanelEditorSlice() {
|
|
27
27
|
// Return the state creator function for Zustand that uses the panels provided as intitial state
|
|
28
|
-
return (set, get)=>{
|
|
29
|
-
return {
|
|
28
|
+
return (set, get)=>({
|
|
30
29
|
panelEditor: undefined,
|
|
31
30
|
openEditPanel (panelGroupItemId) {
|
|
32
|
-
|
|
33
|
-
const { panels , panelGroups } = get();
|
|
31
|
+
const { panels, panelGroups } = get();
|
|
34
32
|
// Figure out the panel key at that location
|
|
35
|
-
const { panelGroupId
|
|
36
|
-
const panelKey =
|
|
33
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
34
|
+
const panelKey = panelGroups[panelGroupId]?.itemPanelKeys[panelGroupLayoutId];
|
|
37
35
|
if (panelKey === undefined) {
|
|
38
36
|
throw new Error(`Could not find Panel Group item ${panelGroupItemId}`);
|
|
39
37
|
}
|
|
@@ -77,7 +75,7 @@ function createPanelEditorSlice() {
|
|
|
77
75
|
newGroup.itemLayouts.push({
|
|
78
76
|
i: existingLayout.i,
|
|
79
77
|
x: 0,
|
|
80
|
-
y: (0,
|
|
78
|
+
y: (0, _utils.getYForNewRow)(newGroup),
|
|
81
79
|
w: existingLayout.w,
|
|
82
80
|
h: existingLayout.h
|
|
83
81
|
});
|
|
@@ -96,25 +94,23 @@ function createPanelEditorSlice() {
|
|
|
96
94
|
});
|
|
97
95
|
},
|
|
98
96
|
openAddPanel (panelGroupId) {
|
|
99
|
-
var _get_initialValues;
|
|
100
97
|
// If a panel group isn't supplied, add to the first group or create a group if there aren't any
|
|
101
98
|
let newGroup = undefined;
|
|
102
|
-
panelGroupId
|
|
99
|
+
panelGroupId ??= get().panelGroupOrder[0];
|
|
103
100
|
if (panelGroupId === undefined) {
|
|
104
101
|
newGroup = (0, _panelgroupslice.createEmptyPanelGroup)();
|
|
105
102
|
newGroup.title = 'Panel Group';
|
|
106
103
|
panelGroupId = newGroup.id;
|
|
107
104
|
}
|
|
108
|
-
var _get_initialValues_panelDefinition;
|
|
109
105
|
const editorState = {
|
|
110
106
|
mode: 'create',
|
|
111
107
|
initialValues: {
|
|
112
108
|
groupId: panelGroupId,
|
|
113
|
-
panelDefinition:
|
|
109
|
+
panelDefinition: get().initialValues?.panelDefinition ?? (0, _common.createPanelDefinition)()
|
|
114
110
|
},
|
|
115
111
|
applyChanges: (next)=>{
|
|
116
112
|
const name = next.panelDefinition.spec.display.name;
|
|
117
|
-
const panelKey = (0,
|
|
113
|
+
const panelKey = (0, _utils.getValidPanelKey)(name, get().panels);
|
|
118
114
|
set((state)=>{
|
|
119
115
|
// Add a panel
|
|
120
116
|
state.panels[panelKey] = next.panelDefinition;
|
|
@@ -126,7 +122,7 @@ function createPanelEditorSlice() {
|
|
|
126
122
|
const layout = {
|
|
127
123
|
i: (0, _common.generateId)().toString(),
|
|
128
124
|
x: 0,
|
|
129
|
-
y: (0,
|
|
125
|
+
y: (0, _utils.getYForNewRow)(group),
|
|
130
126
|
w: 12,
|
|
131
127
|
h: 6
|
|
132
128
|
};
|
|
@@ -149,6 +145,5 @@ function createPanelEditorSlice() {
|
|
|
149
145
|
state.panelEditor = editorState;
|
|
150
146
|
});
|
|
151
147
|
}
|
|
152
|
-
};
|
|
153
|
-
};
|
|
148
|
+
});
|
|
154
149
|
}
|
|
@@ -55,12 +55,11 @@ const createPanelGroupEditorSlice = (set, get)=>({
|
|
|
55
55
|
if (existingGroup === undefined) {
|
|
56
56
|
throw new Error(`Panel group with Id ${panelGroupId} does not exist`);
|
|
57
57
|
}
|
|
58
|
-
var _existingGroup_title;
|
|
59
58
|
// Create the editor state
|
|
60
59
|
const editor = {
|
|
61
60
|
mode: 'Edit',
|
|
62
61
|
initialValues: {
|
|
63
|
-
title:
|
|
62
|
+
title: existingGroup.title ?? '',
|
|
64
63
|
isCollapsed: existingGroup.isCollapsed
|
|
65
64
|
},
|
|
66
65
|
applyChanges (next) {
|
|
@@ -21,8 +21,8 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
addPanelGroup: function() {
|
|
25
|
+
return addPanelGroup;
|
|
26
26
|
},
|
|
27
27
|
convertLayoutsToPanelGroups: function() {
|
|
28
28
|
return convertLayoutsToPanelGroups;
|
|
@@ -30,14 +30,20 @@ _export(exports, {
|
|
|
30
30
|
createEmptyPanelGroup: function() {
|
|
31
31
|
return createEmptyPanelGroup;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
createPanelGroupSlice: function() {
|
|
34
|
+
return createPanelGroupSlice;
|
|
35
|
+
},
|
|
36
|
+
isPanelGroupItemIdEqual: function() {
|
|
37
|
+
return isPanelGroupItemIdEqual;
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
const _core = require("@perses-dev/core");
|
|
38
41
|
const _common = require("./common");
|
|
42
|
+
function isPanelGroupItemIdEqual(a, b) {
|
|
43
|
+
return a?.panelGroupId === b?.panelGroupId && a?.panelGroupItemLayoutId === b?.panelGroupItemLayoutId;
|
|
44
|
+
}
|
|
39
45
|
function createPanelGroupSlice(layouts) {
|
|
40
|
-
const { panelGroups
|
|
46
|
+
const { panelGroups, panelGroupOrder } = convertLayoutsToPanelGroups(layouts);
|
|
41
47
|
// Return the state creator function for Zustand
|
|
42
48
|
return (set)=>({
|
|
43
49
|
panelGroups,
|
|
@@ -75,7 +81,6 @@ function convertLayoutsToPanelGroups(layouts) {
|
|
|
75
81
|
const panelGroups = {};
|
|
76
82
|
const panelGroupIdOrder = [];
|
|
77
83
|
for (const layout of layouts){
|
|
78
|
-
var _layout_spec_display, _layout_spec_display_collapse, _layout_spec_display1;
|
|
79
84
|
const itemLayouts = [];
|
|
80
85
|
const itemPanelKeys = {};
|
|
81
86
|
// Split layout information from panel keys to make it easier to update just layouts on move/resize of panels
|
|
@@ -94,8 +99,8 @@ function convertLayoutsToPanelGroups(layouts) {
|
|
|
94
99
|
const panelGroupId = (0, _common.generateId)();
|
|
95
100
|
panelGroups[panelGroupId] = {
|
|
96
101
|
id: panelGroupId,
|
|
97
|
-
isCollapsed:
|
|
98
|
-
title:
|
|
102
|
+
isCollapsed: layout.spec.display?.collapse?.open === false,
|
|
103
|
+
title: layout.spec.display?.title,
|
|
99
104
|
itemLayouts,
|
|
100
105
|
itemPanelKeys
|
|
101
106
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
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, "createViewPanelSlice", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return createViewPanelSlice;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function createViewPanelSlice(viewPanelRef, setViewPanelRef) {
|
|
24
|
+
return (set, get)=>({
|
|
25
|
+
viewPanel: {
|
|
26
|
+
panelGroupItemId: undefined,
|
|
27
|
+
panelRef: viewPanelRef
|
|
28
|
+
},
|
|
29
|
+
getViewPanel () {
|
|
30
|
+
return getViewPanelGroupId(get().panelGroups, get().viewPanel.panelGroupItemId, get().viewPanel.panelRef);
|
|
31
|
+
},
|
|
32
|
+
setViewPanel (panelGroupItemId) {
|
|
33
|
+
set((state)=>{
|
|
34
|
+
state.viewPanel = {
|
|
35
|
+
panelRef: undefined,
|
|
36
|
+
panelGroupItemId: panelGroupItemId
|
|
37
|
+
};
|
|
38
|
+
const panelRef = findPanelRefOfPanelGroupItemId(get().panelGroups, panelGroupItemId);
|
|
39
|
+
if (setViewPanelRef) {
|
|
40
|
+
setViewPanelRef(panelRef);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function getViewPanelGroupId(panelGroups, panelGroupItemId, panelRef) {
|
|
47
|
+
if (panelGroupItemId) {
|
|
48
|
+
return panelGroupItemId;
|
|
49
|
+
}
|
|
50
|
+
if (panelRef) {
|
|
51
|
+
return findPanelGroupItemIdOfPanelRef(panelGroups, panelRef);
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
// Find the PanelGroupItemId of a Panel from a PanelRef
|
|
56
|
+
function findPanelGroupItemIdOfPanelRef(panelGroups, panelRef) {
|
|
57
|
+
for (const panelGroup of Object.values(panelGroups)){
|
|
58
|
+
const itemPanel = Object.entries(panelGroup.itemPanelKeys ?? []).find(([_, value])=>value === panelRef);
|
|
59
|
+
if (itemPanel) {
|
|
60
|
+
const [key] = itemPanel;
|
|
61
|
+
return {
|
|
62
|
+
panelGroupId: panelGroup.id,
|
|
63
|
+
panelGroupItemLayoutId: key
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
// Find the PanelRef from a PanelGroupItemId
|
|
70
|
+
function findPanelRefOfPanelGroupItemId(panelGroups, panelGroupItemId) {
|
|
71
|
+
if (!panelGroupItemId) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
const panelGroup = panelGroups[panelGroupItemId.panelGroupId];
|
|
75
|
+
if (panelGroup) {
|
|
76
|
+
return panelGroup.itemPanelKeys[panelGroupItemId.panelGroupItemLayoutId];
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
@@ -25,16 +25,15 @@ const _react = require("react");
|
|
|
25
25
|
const _core = require("@perses-dev/core");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
function DatasourceStoreProvider(props) {
|
|
28
|
-
const { projectName
|
|
28
|
+
const { projectName, datasourceApi, onCreate, children } = props;
|
|
29
29
|
const [dashboardResource, setDashboardResource] = (0, _react.useState)(props.dashboardResource);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const { getPlugin , listPluginMetadata } = (0, _pluginsystem.usePluginRegistry)();
|
|
30
|
+
const [savedDatasources, setSavedDatasources] = (0, _react.useState)(props.savedDatasources ?? {});
|
|
31
|
+
const project = projectName ?? dashboardResource?.metadata.project;
|
|
32
|
+
const { getPlugin, listPluginMetadata } = (0, _pluginsystem.usePluginRegistry)();
|
|
34
33
|
const findDatasource = (0, _core.useEvent)(async (selector)=>{
|
|
35
34
|
// Try to find it in dashboard spec
|
|
36
35
|
if (dashboardResource) {
|
|
37
|
-
const { datasources
|
|
36
|
+
const { datasources } = dashboardResource.spec;
|
|
38
37
|
const dashboardDatasource = findDashboardDatasource(datasources, selector);
|
|
39
38
|
if (dashboardDatasource !== undefined) {
|
|
40
39
|
return {
|
|
@@ -74,15 +73,15 @@ function DatasourceStoreProvider(props) {
|
|
|
74
73
|
});
|
|
75
74
|
// Gets a datasource spec for a given selector
|
|
76
75
|
const getDatasource = (0, _react.useCallback)(async (selector)=>{
|
|
77
|
-
const { spec
|
|
76
|
+
const { spec } = await findDatasource(selector);
|
|
78
77
|
return spec;
|
|
79
78
|
}, [
|
|
80
79
|
findDatasource
|
|
81
80
|
]);
|
|
82
81
|
// Given a Datasource selector, finds the spec for it and then uses its corresponding plugin the create a client
|
|
83
82
|
const getDatasourceClient = (0, _react.useCallback)(async function getClient(selector) {
|
|
84
|
-
const { kind
|
|
85
|
-
const [{ spec
|
|
83
|
+
const { kind } = selector;
|
|
84
|
+
const [{ spec, proxyUrl }, plugin] = await Promise.all([
|
|
86
85
|
findDatasource(selector),
|
|
87
86
|
getPlugin('Datasource', kind)
|
|
88
87
|
]);
|
|
@@ -99,24 +98,26 @@ function DatasourceStoreProvider(props) {
|
|
|
99
98
|
getPlugin,
|
|
100
99
|
onCreate
|
|
101
100
|
]);
|
|
102
|
-
const listDatasourceSelectItems = (0, _core.useEvent)(async (
|
|
101
|
+
const listDatasourceSelectItems = (0, _core.useEvent)(async (datasourcePluginName)=>{
|
|
103
102
|
const [pluginMetadata, datasources, globalDatasources] = await Promise.all([
|
|
104
|
-
listPluginMetadata(
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
listPluginMetadata([
|
|
104
|
+
'Datasource'
|
|
105
|
+
]),
|
|
106
|
+
project ? datasourceApi.listDatasources(project, datasourcePluginName) : [],
|
|
107
|
+
datasourceApi.listGlobalDatasources(datasourcePluginName)
|
|
107
108
|
]);
|
|
108
109
|
// Find the metadata for the plugin type they asked for, so we can use it for the name of the default datasource
|
|
109
|
-
const datasourcePluginMetadata = pluginMetadata.find((metadata)=>metadata.
|
|
110
|
+
const datasourcePluginMetadata = pluginMetadata.find((metadata)=>metadata.spec.name === datasourcePluginName);
|
|
110
111
|
if (datasourcePluginMetadata === undefined) {
|
|
111
|
-
throw new Error(`Could not find a Datasource plugin with kind '${
|
|
112
|
+
throw new Error(`Could not find a Datasource plugin with kind '${datasourcePluginName}'`);
|
|
112
113
|
}
|
|
113
114
|
// Get helper for computing results properly
|
|
114
|
-
const { results
|
|
115
|
+
const { results, addItem } = buildDatasourceSelectItemGroups(datasourcePluginMetadata.spec.display.name);
|
|
115
116
|
// Start with dashboard datasources with the highest precedence
|
|
116
|
-
if (dashboardResource
|
|
117
|
+
if (dashboardResource?.spec.datasources) {
|
|
117
118
|
for(const selectorName in dashboardResource.spec.datasources){
|
|
118
119
|
const spec = dashboardResource.spec.datasources[selectorName];
|
|
119
|
-
if (spec === undefined || spec.plugin.kind !==
|
|
120
|
+
if (spec === undefined || spec.plugin.kind !== datasourcePluginName) continue;
|
|
120
121
|
const saved = selectorName in savedDatasources;
|
|
121
122
|
addItem({
|
|
122
123
|
spec,
|
|
@@ -149,8 +150,7 @@ function DatasourceStoreProvider(props) {
|
|
|
149
150
|
return results;
|
|
150
151
|
});
|
|
151
152
|
const getLocalDatasources = (0, _react.useCallback)(()=>{
|
|
152
|
-
|
|
153
|
-
return (_dashboardResource_spec_datasources = dashboardResource === null || dashboardResource === void 0 ? void 0 : dashboardResource.spec.datasources) !== null && _dashboardResource_spec_datasources !== void 0 ? _dashboardResource_spec_datasources : {};
|
|
153
|
+
return dashboardResource?.spec.datasources ?? {};
|
|
154
154
|
}, [
|
|
155
155
|
dashboardResource
|
|
156
156
|
]);
|
|
@@ -161,7 +161,13 @@ function DatasourceStoreProvider(props) {
|
|
|
161
161
|
]);
|
|
162
162
|
const setLocalDatasources = (0, _react.useCallback)((datasources)=>{
|
|
163
163
|
if (dashboardResource) {
|
|
164
|
-
setDashboardResource({
|
|
164
|
+
setDashboardResource(dashboardResource.kind === 'Dashboard' ? {
|
|
165
|
+
...dashboardResource,
|
|
166
|
+
spec: {
|
|
167
|
+
...dashboardResource.spec,
|
|
168
|
+
datasources: datasources
|
|
169
|
+
}
|
|
170
|
+
} : {
|
|
165
171
|
...dashboardResource,
|
|
166
172
|
spec: {
|
|
167
173
|
...dashboardResource.spec,
|
|
@@ -229,9 +235,8 @@ function findDashboardDatasource(dashboardDatasources, selector) {
|
|
|
229
235
|
let explicitDefaultAdded = false;
|
|
230
236
|
const groupIndices = {};
|
|
231
237
|
let currentGroupIndex = 1; // 0 is the default group, always there as it contains at least the first item.
|
|
232
|
-
const addItem = ({ spec
|
|
233
|
-
|
|
234
|
-
group = group !== null && group !== void 0 ? group : '';
|
|
238
|
+
const addItem = ({ spec, selectorName, selectorGroup: group, editLink, saved })=>{
|
|
239
|
+
group = group ?? '';
|
|
235
240
|
// Ensure the default group is always present as soon as an item is added.
|
|
236
241
|
if (isFirst) {
|
|
237
242
|
results.push({
|
|
@@ -239,9 +244,8 @@ function findDashboardDatasource(dashboardDatasources, selector) {
|
|
|
239
244
|
items: []
|
|
240
245
|
});
|
|
241
246
|
}
|
|
242
|
-
var _groupIndices_group;
|
|
243
247
|
// Create the group if necessary
|
|
244
|
-
let selectItemGroup = results[
|
|
248
|
+
let selectItemGroup = results[groupIndices[group] ?? -1];
|
|
245
249
|
if (!selectItemGroup) {
|
|
246
250
|
groupIndices[group] = currentGroupIndex;
|
|
247
251
|
selectItemGroup = {
|
|
@@ -254,9 +258,8 @@ function findDashboardDatasource(dashboardDatasources, selector) {
|
|
|
254
258
|
}
|
|
255
259
|
// Add item to the group
|
|
256
260
|
const isOverridden = usedNames.has(selectorName);
|
|
257
|
-
var _spec_display_name;
|
|
258
261
|
selectItemGroup.items.push({
|
|
259
|
-
name:
|
|
262
|
+
name: spec.display?.name ?? selectorName,
|
|
260
263
|
overridden: isOverridden,
|
|
261
264
|
saved,
|
|
262
265
|
selector: {
|
|
@@ -285,9 +288,7 @@ function findDashboardDatasource(dashboardDatasources, selector) {
|
|
|
285
288
|
// At the end, we make sure the overriding item(s) is well flagged so
|
|
286
289
|
if (isOverridden) {
|
|
287
290
|
for(let i = explicitDefaultAdded ? 1 : 0; i < currentGroupIndex; i++){
|
|
288
|
-
|
|
289
|
-
var _results_i_items;
|
|
290
|
-
((_results_i_items = (_results_i = results[i]) === null || _results_i === void 0 ? void 0 : _results_i.items) !== null && _results_i_items !== void 0 ? _results_i_items : []).filter((item)=>item.selector.name === selectorName).forEach((item)=>{
|
|
291
|
+
(results[i]?.items ?? []).filter((item)=>item.selector.name === selectorName).forEach((item)=>{
|
|
291
292
|
item.overriding = true;
|
|
292
293
|
});
|
|
293
294
|
}
|