@perses-dev/plugin-system 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/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +83 -163
- package/dist/cjs/components/DatasourceSelect.js +12 -15
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +528 -0
- package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
- package/dist/cjs/{validation/resource.js → components/MetricLabelInput/index.js} +15 -9
- package/dist/cjs/components/{TraceQueryEditor/TraceQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +39 -40
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +23 -11
- package/dist/cjs/components/MultiQueryEditor/index.js +30 -0
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +54 -62
- package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +44 -33
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +9 -10
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +20 -17
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/cjs/components/ProjectSelect.js +7 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +131 -0
- package/dist/cjs/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +394 -439
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +17 -15
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
- package/dist/cjs/components/Variables/variable-model.js +35 -37
- package/dist/cjs/components/index.js +4 -1
- package/dist/cjs/constants/user-interface-text.js +4 -1
- package/dist/cjs/context/ProjectStoreProvider.js +12 -9
- package/dist/cjs/context/ValidationProvider.js +69 -0
- package/dist/cjs/context/index.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
- package/dist/cjs/model/legend.js +5 -5
- package/dist/cjs/remote/PersesPlugin.types.js +16 -0
- package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
- package/dist/cjs/remote/PluginRuntime.js +267 -0
- package/dist/cjs/{validation → remote}/index.js +2 -4
- package/dist/cjs/remote/remotePluginLoader.js +61 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +23 -14
- package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/cjs/runtime/QueryCountProvider.js +83 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -13
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +20 -23
- package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
- package/dist/cjs/runtime/builtin-variables.js +7 -7
- package/dist/cjs/runtime/datasources.js +30 -21
- package/dist/cjs/runtime/index.js +4 -2
- package/dist/cjs/runtime/plugin-registry.js +48 -36
- package/dist/cjs/runtime/time-series-queries.js +35 -40
- package/dist/cjs/runtime/trace-queries.js +9 -6
- package/dist/cjs/runtime/{template-variables.js → variables.js} +38 -48
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +1 -65
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
- package/dist/cjs/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +9 -9
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/index.js +2 -2
- package/dist/cjs/test/mock-data.js +25 -4
- package/dist/cjs/test/render.js +2 -11
- package/dist/cjs/test/test-plugins/bert/index.js +21 -20
- package/dist/cjs/test/test-plugins/ernie/index.js +2 -2
- package/dist/cjs/test/test-plugins/index.js +3 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +13 -13
- package/dist/cjs/utils/action.js +3 -3
- package/dist/cjs/utils/variables.js +24 -24
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +7 -7
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +86 -166
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect.d.ts +4 -4
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +9 -12
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +474 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.js +15 -0
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
- package/dist/components/MetricLabelInput/index.d.ts +2 -0
- package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/index.js +15 -0
- package/dist/components/MetricLabelInput/index.js.map +1 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +42 -39
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +33 -10
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
- package/dist/components/MultiQueryEditor/index.d.ts +2 -0
- package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
- package/dist/components/MultiQueryEditor/index.js +15 -0
- package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +4 -4
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +5 -5
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -3
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +56 -64
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +16 -10
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +44 -33
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +11 -5
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +4 -4
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +9 -10
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -5
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +3 -3
- package/dist/components/ProjectSelect.d.ts.map +1 -1
- package/dist/components/ProjectSelect.js +7 -7
- package/dist/components/ProjectSelect.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +14 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +110 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -442
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +11 -11
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +2 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +29 -31
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -1
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +2 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +4 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/ProjectStoreProvider.d.ts +4 -4
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
- package/dist/context/ProjectStoreProvider.js +9 -6
- package/dist/context/ProjectStoreProvider.js.map +1 -1
- package/dist/context/ValidationProvider.d.ts +19 -0
- package/dist/context/ValidationProvider.d.ts.map +1 -0
- package/dist/context/ValidationProvider.js +52 -0
- package/dist/context/ValidationProvider.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/index.js.map +1 -1
- package/dist/context/query-params.d.ts.map +1 -1
- package/dist/context/query-params.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +13 -0
- package/dist/model/explore.d.ts.map +1 -0
- package/dist/{validation/resource.js → model/explore.js} +4 -3
- package/dist/model/explore.js.map +1 -0
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +17 -5
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +0 -1
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +35 -21
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +4 -3
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +1 -1
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +2 -2
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +3 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PersesPlugin.types.d.ts +7 -0
- package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
- package/dist/remote/PersesPlugin.types.js +15 -0
- package/dist/remote/PersesPlugin.types.js.map +1 -0
- package/dist/remote/PluginLoaderComponent.d.ts +10 -0
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
- package/dist/remote/PluginLoaderComponent.js +67 -0
- package/dist/remote/PluginLoaderComponent.js.map +1 -0
- package/dist/remote/PluginRuntime.d.ts +11 -0
- package/dist/remote/PluginRuntime.d.ts.map +1 -0
- package/dist/remote/PluginRuntime.js +202 -0
- package/dist/remote/PluginRuntime.js.map +1 -0
- package/dist/remote/index.d.ts +3 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/{validation → remote}/index.js +2 -4
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/remotePluginLoader.d.ts +3 -0
- package/dist/remote/remotePluginLoader.d.ts.map +1 -0
- package/dist/remote/remotePluginLoader.js +53 -0
- package/dist/remote/remotePluginLoader.js.map +1 -0
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -10
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +6 -7
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/QueryCountProvider.d.ts +9 -0
- package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
- package/dist/{validation/datasource.js → runtime/QueryCountProvider.js} +14 -10
- package/dist/runtime/QueryCountProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +6 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +30 -9
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +8 -11
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
- package/dist/runtime/UsageMetricsProvider.js +77 -0
- package/dist/runtime/UsageMetricsProvider.js.map +1 -0
- package/dist/runtime/builtin-variables.d.ts +2 -2
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +4 -4
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +5 -4
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +24 -15
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +4 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +11 -11
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +40 -28
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +5 -4
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +28 -33
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +5 -4
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +10 -7
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/{template-variables.d.ts → variables.d.ts} +7 -7
- package/dist/runtime/variables.d.ts.map +1 -0
- package/dist/runtime/{template-variables.js → variables.js} +35 -44
- package/dist/runtime/variables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +2 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -22
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts +13 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +10 -10
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/index.js +2 -2
- package/dist/stories/shared-utils/decorators/index.js.map +1 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +25 -4
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render.d.ts +4 -4
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -11
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js +21 -20
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +2 -2
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +6 -4
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +10 -10
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/variables.d.ts +4 -4
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +19 -19
- package/dist/utils/variables.js.map +1 -1
- package/package.json +7 -6
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +0 -146
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
- package/dist/cjs/validation/datasource.js +0 -30
- package/dist/cjs/validation/role.js +0 -85
- package/dist/cjs/validation/rolebinding.js +0 -55
- package/dist/cjs/validation/secret.js +0 -176
- package/dist/cjs/validation/variable.js +0 -48
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -8
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -13
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
- package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -9
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -13
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +0 -83
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
- package/dist/components/TraceQueryEditor/index.d.ts +0 -2
- package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
- package/dist/runtime/template-variables.d.ts.map +0 -1
- package/dist/runtime/template-variables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -13
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
- package/dist/validation/datasource.d.ts +0 -19
- package/dist/validation/datasource.d.ts.map +0 -1
- package/dist/validation/datasource.js.map +0 -1
- package/dist/validation/index.d.ts +0 -5
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/resource.d.ts +0 -3
- package/dist/validation/resource.d.ts.map +0 -1
- package/dist/validation/resource.js.map +0 -1
- package/dist/validation/role.d.ts +0 -228
- package/dist/validation/role.d.ts.map +0 -1
- package/dist/validation/role.js +0 -66
- package/dist/validation/role.js.map +0 -1
- package/dist/validation/rolebinding.d.ts +0 -137
- package/dist/validation/rolebinding.d.ts.map +0 -1
- package/dist/validation/rolebinding.js +0 -47
- package/dist/validation/rolebinding.js.map +0 -1
- package/dist/validation/secret.d.ts +0 -964
- package/dist/validation/secret.d.ts.map +0 -1
- package/dist/validation/secret.js +0 -157
- package/dist/validation/secret.js.map +0 -1
- package/dist/validation/variable.d.ts +0 -96
- package/dist/validation/variable.d.ts.map +0 -1
- package/dist/validation/variable.js +0 -40
- package/dist/validation/variable.js.map +0 -1
|
@@ -29,7 +29,7 @@ const CALC_OPTIONS = Object.entries(_core.CALCULATIONS_CONFIG).map(([id, config]
|
|
|
29
29
|
...config
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
|
-
function CalculationSelector({ value
|
|
32
|
+
function CalculationSelector({ value, onChange }) {
|
|
33
33
|
const handleCalculationChange = (_, newValue)=>{
|
|
34
34
|
onChange(newValue.id);
|
|
35
35
|
};
|
|
@@ -21,79 +21,50 @@ Object.defineProperty(exports, "DatasourceEditorForm", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const
|
|
24
|
+
const _zod = require("@hookform/resolvers/zod");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
|
-
const _react = require("react");
|
|
27
26
|
const _components = require("@perses-dev/components");
|
|
27
|
+
const _react = require("react");
|
|
28
28
|
const _reacthookform = require("react-hook-form");
|
|
29
|
-
const
|
|
30
|
-
const _PluginEditor = require("../PluginEditor");
|
|
29
|
+
const _context = require("../../context");
|
|
31
30
|
const _utils = require("../../utils");
|
|
32
|
-
const
|
|
33
|
-
/**
|
|
34
|
-
* This preprocessing ensures that we always have a defined object for the `display` property
|
|
35
|
-
* @param datasource
|
|
36
|
-
*/ function getInitialState(name, spec) {
|
|
37
|
-
var _spec_display, _spec_display1;
|
|
38
|
-
var _spec_display_name, _spec_display_description;
|
|
39
|
-
const patchedDisplay = {
|
|
40
|
-
name: (_spec_display_name = (_spec_display = spec.display) === null || _spec_display === void 0 ? void 0 : _spec_display.name) !== null && _spec_display_name !== void 0 ? _spec_display_name : '',
|
|
41
|
-
description: (_spec_display_description = (_spec_display1 = spec.display) === null || _spec_display1 === void 0 ? void 0 : _spec_display1.description) !== null && _spec_display_description !== void 0 ? _spec_display_description : ''
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
name: name,
|
|
45
|
-
spec: {
|
|
46
|
-
...spec,
|
|
47
|
-
display: patchedDisplay
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
31
|
+
const _PluginEditor = require("../PluginEditor");
|
|
51
32
|
function DatasourceEditorForm(props) {
|
|
52
|
-
|
|
53
|
-
const { initialName , initialSpec , initialAction , isDraft , isReadonly , onSave , onClose , onDelete } = props;
|
|
54
|
-
const initialState = getInitialState(initialName, initialSpec);
|
|
55
|
-
const [state, setState] = (0, _useimmer.useImmer)(initialState);
|
|
33
|
+
const { initialDatasourceDefinition, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete } = props;
|
|
56
34
|
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
57
|
-
const [action, setAction] = (0, _react.useState)(initialAction);
|
|
58
35
|
const titleAction = (0, _utils.getTitleAction)(action, isDraft);
|
|
59
36
|
const submitText = (0, _utils.getSubmitText)(action, isDraft);
|
|
37
|
+
const { datasourceEditorSchema } = (0, _context.useValidationSchemas)();
|
|
60
38
|
const form = (0, _reacthookform.useForm)({
|
|
61
|
-
resolver: (0, _zod.zodResolver)(
|
|
39
|
+
resolver: (0, _zod.zodResolver)(datasourceEditorSchema),
|
|
62
40
|
mode: 'onBlur',
|
|
63
|
-
defaultValues:
|
|
64
|
-
name: state.name,
|
|
65
|
-
title: (_state_spec_display = state.spec.display) === null || _state_spec_display === void 0 ? void 0 : _state_spec_display.name,
|
|
66
|
-
description: (_state_spec_display1 = state.spec.display) === null || _state_spec_display1 === void 0 ? void 0 : _state_spec_display1.description,
|
|
67
|
-
default: state.spec.default
|
|
68
|
-
}
|
|
41
|
+
defaultValues: initialDatasourceDefinition
|
|
69
42
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
43
|
+
/*
|
|
44
|
+
* Remove empty fields that are optional
|
|
45
|
+
*/ function clearFormData(data) {
|
|
46
|
+
const result = {
|
|
47
|
+
...data
|
|
48
|
+
};
|
|
49
|
+
if (result.spec.display?.name === undefined && result.spec.display?.description === undefined) {
|
|
50
|
+
delete result.spec.display;
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
const processForm = (data)=>{
|
|
55
|
+
onSave(clearFormData(data));
|
|
80
56
|
};
|
|
81
57
|
// When user click on cancel, several possibilities:
|
|
82
58
|
// - create action: ask for discard approval
|
|
83
59
|
// - update action: ask for discard approval if changed
|
|
84
60
|
// - read action: don´t ask for discard approval
|
|
85
|
-
|
|
86
|
-
if (JSON.stringify(
|
|
61
|
+
function handleCancel() {
|
|
62
|
+
if (JSON.stringify(initialDatasourceDefinition) !== JSON.stringify(clearFormData(form.getValues()))) {
|
|
87
63
|
setDiscardDialogOpened(true);
|
|
88
64
|
} else {
|
|
89
65
|
onClose();
|
|
90
66
|
}
|
|
91
|
-
}
|
|
92
|
-
state,
|
|
93
|
-
initialState,
|
|
94
|
-
setDiscardDialogOpened,
|
|
95
|
-
onClose
|
|
96
|
-
]);
|
|
67
|
+
}
|
|
97
68
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacthookform.FormProvider, {
|
|
98
69
|
...form,
|
|
99
70
|
children: [
|
|
@@ -112,61 +83,15 @@ function DatasourceEditorForm(props) {
|
|
|
112
83
|
" Datasource"
|
|
113
84
|
]
|
|
114
85
|
}),
|
|
115
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
disabled: isReadonly,
|
|
125
|
-
variant: "contained",
|
|
126
|
-
onClick: ()=>setAction('update'),
|
|
127
|
-
children: "Edit"
|
|
128
|
-
}),
|
|
129
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
130
|
-
color: "error",
|
|
131
|
-
disabled: isReadonly,
|
|
132
|
-
variant: "outlined",
|
|
133
|
-
onClick: onDelete,
|
|
134
|
-
children: "Delete"
|
|
135
|
-
}),
|
|
136
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {
|
|
137
|
-
orientation: "vertical",
|
|
138
|
-
flexItem: true,
|
|
139
|
-
sx: (theme)=>({
|
|
140
|
-
borderColor: theme.palette.grey['500'],
|
|
141
|
-
'&.MuiDivider-root': {
|
|
142
|
-
marginLeft: 2,
|
|
143
|
-
marginRight: 1
|
|
144
|
-
}
|
|
145
|
-
})
|
|
146
|
-
}),
|
|
147
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
148
|
-
color: "secondary",
|
|
149
|
-
variant: "outlined",
|
|
150
|
-
onClick: onClose,
|
|
151
|
-
children: "Close"
|
|
152
|
-
})
|
|
153
|
-
]
|
|
154
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
155
|
-
children: [
|
|
156
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
157
|
-
variant: "contained",
|
|
158
|
-
disabled: !form.formState.isValid,
|
|
159
|
-
onClick: form.handleSubmit(processForm),
|
|
160
|
-
children: submitText
|
|
161
|
-
}),
|
|
162
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
163
|
-
color: "secondary",
|
|
164
|
-
variant: "outlined",
|
|
165
|
-
onClick: handleCancel,
|
|
166
|
-
children: "Cancel"
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
})
|
|
86
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.FormActions, {
|
|
87
|
+
action: action,
|
|
88
|
+
submitText: submitText,
|
|
89
|
+
isReadonly: isReadonly,
|
|
90
|
+
isValid: form.formState.isValid,
|
|
91
|
+
onActionChange: onActionChange,
|
|
92
|
+
onSubmit: form.handleSubmit(processForm),
|
|
93
|
+
onDelete: onDelete,
|
|
94
|
+
onCancel: handleCancel
|
|
170
95
|
})
|
|
171
96
|
]
|
|
172
97
|
}),
|
|
@@ -185,10 +110,9 @@ function DatasourceEditorForm(props) {
|
|
|
185
110
|
item: true,
|
|
186
111
|
xs: 4,
|
|
187
112
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
113
|
+
control: form.control,
|
|
188
114
|
name: "name",
|
|
189
|
-
render: ({ field
|
|
190
|
-
var _fieldState_error;
|
|
191
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
115
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
192
116
|
...field,
|
|
193
117
|
required: true,
|
|
194
118
|
fullWidth: true,
|
|
@@ -202,25 +126,21 @@ function DatasourceEditorForm(props) {
|
|
|
202
126
|
readOnly: action === 'read'
|
|
203
127
|
},
|
|
204
128
|
error: !!fieldState.error,
|
|
205
|
-
helperText:
|
|
129
|
+
helperText: fieldState.error?.message,
|
|
130
|
+
value: field.value ?? '',
|
|
206
131
|
onChange: (event)=>{
|
|
207
132
|
field.onChange(event);
|
|
208
|
-
setState((draft)=>{
|
|
209
|
-
draft.name = event.target.value;
|
|
210
|
-
});
|
|
211
133
|
}
|
|
212
|
-
})
|
|
213
|
-
}
|
|
134
|
+
})
|
|
214
135
|
})
|
|
215
136
|
}),
|
|
216
137
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
217
138
|
item: true,
|
|
218
139
|
xs: 8,
|
|
219
140
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
141
|
+
control: form.control,
|
|
142
|
+
name: "spec.display.name",
|
|
143
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
224
144
|
...field,
|
|
225
145
|
fullWidth: true,
|
|
226
146
|
name: "title",
|
|
@@ -232,27 +152,21 @@ function DatasourceEditorForm(props) {
|
|
|
232
152
|
readOnly: action === 'read'
|
|
233
153
|
},
|
|
234
154
|
error: !!fieldState.error,
|
|
235
|
-
helperText:
|
|
155
|
+
helperText: fieldState.error?.message,
|
|
156
|
+
value: field.value ?? '',
|
|
236
157
|
onChange: (event)=>{
|
|
237
|
-
|
|
238
|
-
field.onChange(event);
|
|
239
|
-
if (draft.spec.display) {
|
|
240
|
-
draft.spec.display.name = event.target.value;
|
|
241
|
-
}
|
|
242
|
-
});
|
|
158
|
+
field.onChange(event);
|
|
243
159
|
}
|
|
244
|
-
})
|
|
245
|
-
}
|
|
160
|
+
})
|
|
246
161
|
})
|
|
247
162
|
}),
|
|
248
163
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
249
164
|
item: true,
|
|
250
165
|
xs: 12,
|
|
251
166
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
167
|
+
control: form.control,
|
|
168
|
+
name: "spec.display.description",
|
|
169
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
256
170
|
...field,
|
|
257
171
|
fullWidth: true,
|
|
258
172
|
name: "description",
|
|
@@ -264,17 +178,12 @@ function DatasourceEditorForm(props) {
|
|
|
264
178
|
readOnly: action === 'read'
|
|
265
179
|
},
|
|
266
180
|
error: !!fieldState.error,
|
|
267
|
-
helperText:
|
|
181
|
+
helperText: fieldState.error?.message,
|
|
182
|
+
value: field.value ?? '',
|
|
268
183
|
onChange: (event)=>{
|
|
269
184
|
field.onChange(event);
|
|
270
|
-
setState((draft)=>{
|
|
271
|
-
if (draft.spec.display) {
|
|
272
|
-
draft.spec.display.description = event.target.value;
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
185
|
}
|
|
276
|
-
})
|
|
277
|
-
}
|
|
186
|
+
})
|
|
278
187
|
})
|
|
279
188
|
}),
|
|
280
189
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
@@ -286,28 +195,26 @@ function DatasourceEditorForm(props) {
|
|
|
286
195
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
287
196
|
children: [
|
|
288
197
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
198
|
+
control: form.control,
|
|
199
|
+
name: "spec.default",
|
|
200
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
201
|
+
label: "Set as default",
|
|
292
202
|
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
293
|
-
|
|
203
|
+
...field,
|
|
204
|
+
checked: !!field.value,
|
|
294
205
|
readOnly: action === 'read',
|
|
295
206
|
onChange: (event)=>{
|
|
296
207
|
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
297
208
|
field.onChange(event);
|
|
298
|
-
setState((draft)=>{
|
|
299
|
-
draft.spec.default = event.target.checked;
|
|
300
|
-
});
|
|
301
209
|
}
|
|
302
|
-
})
|
|
303
|
-
label: "Set as default"
|
|
210
|
+
})
|
|
304
211
|
})
|
|
305
212
|
}),
|
|
306
213
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
307
214
|
variant: "caption",
|
|
308
215
|
children: [
|
|
309
216
|
"Whether this datasource should be the default ",
|
|
310
|
-
|
|
217
|
+
form.getValues().spec.plugin.kind,
|
|
311
218
|
" to be used"
|
|
312
219
|
]
|
|
313
220
|
})
|
|
@@ -322,17 +229,30 @@ function DatasourceEditorForm(props) {
|
|
|
322
229
|
variant: "h3",
|
|
323
230
|
children: "Plugin Options"
|
|
324
231
|
}),
|
|
325
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
232
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
233
|
+
control: form.control,
|
|
234
|
+
name: "spec.plugin",
|
|
235
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
|
|
236
|
+
width: "100%",
|
|
237
|
+
pluginTypes: [
|
|
238
|
+
'Datasource'
|
|
239
|
+
],
|
|
240
|
+
pluginKindLabel: "Source",
|
|
241
|
+
value: {
|
|
242
|
+
selection: {
|
|
243
|
+
type: 'Datasource',
|
|
244
|
+
kind: field.value.kind
|
|
245
|
+
},
|
|
246
|
+
spec: field.value.spec
|
|
247
|
+
},
|
|
248
|
+
isReadonly: action === 'read',
|
|
249
|
+
onChange: (v)=>{
|
|
250
|
+
field.onChange({
|
|
251
|
+
kind: v.selection.kind,
|
|
252
|
+
spec: v.spec
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
})
|
|
336
256
|
})
|
|
337
257
|
]
|
|
338
258
|
}),
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DatasourceSelect: function() {
|
|
25
|
-
return DatasourceSelect;
|
|
26
|
-
},
|
|
27
24
|
DatasourceName: function() {
|
|
28
25
|
return DatasourceName;
|
|
26
|
+
},
|
|
27
|
+
DatasourceSelect: function() {
|
|
28
|
+
return DatasourceSelect;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -39,14 +39,13 @@ function _interop_require_default(obj) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function DatasourceSelect(props) {
|
|
42
|
-
const { datasourcePluginKind
|
|
43
|
-
const { data
|
|
42
|
+
const { datasourcePluginKind, value, project, onChange, ...others } = props;
|
|
43
|
+
const { data, isLoading } = (0, _runtime.useListDatasourceSelectItems)(datasourcePluginKind, project);
|
|
44
44
|
// Rebuild the group of the value if not provided
|
|
45
45
|
const defaultValue = (0, _react.useMemo)(()=>{
|
|
46
|
-
|
|
47
|
-
const group = (_flatMap_find = (data !== null && data !== void 0 ? data : []).flatMap((itemGroup)=>itemGroup.items).find((item)=>{
|
|
46
|
+
const group = (data ?? []).flatMap((itemGroup)=>itemGroup.items).find((item)=>{
|
|
48
47
|
return value.kind === item.selector.kind && value.name === item.selector.name && !item.overridden;
|
|
49
|
-
})
|
|
48
|
+
})?.selector.group;
|
|
50
49
|
return {
|
|
51
50
|
...value,
|
|
52
51
|
group
|
|
@@ -57,15 +56,14 @@ function DatasourceSelect(props) {
|
|
|
57
56
|
]);
|
|
58
57
|
// Convert the datasource list into menu items with name/group?/value strings that the Select input can work with
|
|
59
58
|
const menuItems = (0, _react.useMemo)(()=>{
|
|
60
|
-
|
|
61
|
-
return (data !== null && data !== void 0 ? data : []).map((itemGroup)=>({
|
|
59
|
+
return (data ?? []).map((itemGroup)=>({
|
|
62
60
|
group: itemGroup.group,
|
|
63
61
|
editLink: itemGroup.editLink,
|
|
64
62
|
items: itemGroup.items.map((item)=>({
|
|
65
63
|
name: item.name,
|
|
66
64
|
overriding: item.overriding,
|
|
67
65
|
overridden: item.overridden,
|
|
68
|
-
saved:
|
|
66
|
+
saved: item.saved ?? true,
|
|
69
67
|
group: item.selector.group,
|
|
70
68
|
value: selectorToOptionValue(item.selector)
|
|
71
69
|
}))
|
|
@@ -140,7 +138,7 @@ function DatasourceSelect(props) {
|
|
|
140
138
|
});
|
|
141
139
|
}
|
|
142
140
|
function DatasourceName(props) {
|
|
143
|
-
const { name
|
|
141
|
+
const { name, overridden, overriding } = props;
|
|
144
142
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
145
143
|
children: [
|
|
146
144
|
`${name} `,
|
|
@@ -161,11 +159,10 @@ const OPTION_VALUE_DELIMITER = '_____';
|
|
|
161
159
|
* returns a string value like `{kind}_____{group}_____{name}` that can be used as a Select input value.
|
|
162
160
|
* @param selector
|
|
163
161
|
*/ function selectorToOptionValue(selector) {
|
|
164
|
-
var _selector_group, _selector_name;
|
|
165
162
|
return [
|
|
166
163
|
selector.kind,
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
selector.group ?? '',
|
|
165
|
+
selector.name ?? ''
|
|
169
166
|
].join(OPTION_VALUE_DELIMITER);
|
|
170
167
|
}
|
|
171
168
|
/**
|