@perses-dev/plugin-system 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +7 -5
- package/dist/cjs/components/CalculationSelector/index.js +10 -8
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +350 -0
- package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
- package/dist/cjs/components/DatasourceSelect.js +137 -25
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +19 -17
- package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +25 -30
- package/dist/cjs/components/OptionsEditorRadios/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +7 -5
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +13 -11
- package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +60 -19
- package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
- package/dist/cjs/components/PluginEditor/PluginEditor.js +25 -32
- package/dist/cjs/components/PluginEditor/index.js +11 -9
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +8 -6
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +25 -14
- package/dist/cjs/components/PluginKindSelect/index.js +10 -8
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -9
- package/dist/cjs/components/PluginRegistry/index.js +10 -8
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +7 -3
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +9 -7
- package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
- package/dist/cjs/components/ProjectSelect.js +96 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +192 -0
- package/dist/cjs/components/TimeRangeControls/index.js +30 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +45 -49
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +23 -21
- package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +143 -0
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +96 -0
- package/dist/cjs/components/TraceQueryEditor/index.js +30 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +445 -230
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +38 -32
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +36 -37
- package/dist/cjs/components/Variables/index.js +11 -9
- package/dist/cjs/components/Variables/variable-model.js +24 -17
- package/dist/cjs/components/index.js +24 -19
- package/dist/cjs/constants/index.js +10 -8
- package/dist/cjs/constants/user-interface-text.js +7 -2
- package/dist/cjs/context/ProjectStoreProvider.js +78 -0
- package/dist/cjs/context/index.js +30 -0
- package/dist/cjs/context/query-params.js +49 -0
- package/dist/cjs/index.js +17 -13
- package/dist/cjs/model/index.js +18 -15
- package/dist/cjs/model/legend.js +32 -20
- package/dist/cjs/model/panels.js +2 -2
- package/dist/cjs/model/plugin-base.js +2 -2
- package/dist/cjs/model/plugin-loading.js +3 -1
- package/dist/cjs/model/trace-queries.js +16 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +67 -35
- package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +81 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +55 -27
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +43 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +12 -9
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +45 -59
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +30 -0
- package/dist/cjs/runtime/builtin-variables.js +81 -0
- package/dist/cjs/runtime/datasources.js +31 -12
- package/dist/cjs/runtime/index.js +17 -13
- package/dist/cjs/runtime/plugin-registry.js +44 -14
- package/dist/cjs/runtime/template-variables.js +51 -13
- package/dist/cjs/runtime/time-series-queries.js +43 -31
- package/dist/cjs/runtime/trace-queries.js +76 -0
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +21 -16
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +31 -13
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +9 -7
- package/dist/cjs/stories/shared-utils/decorators/index.js +15 -12
- package/dist/cjs/stories/shared-utils/index.js +10 -8
- package/dist/cjs/test/index.js +11 -8
- package/dist/cjs/test/mock-data.js +80 -0
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/test/test-plugins/bert/index.js +16 -12
- package/dist/cjs/test/test-plugins/ernie/index.js +15 -11
- package/dist/cjs/test/test-plugins/index.js +14 -10
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/mock-plugin-registry.js +9 -5
- package/dist/cjs/utils/action.js +43 -0
- package/dist/cjs/utils/index.js +11 -8
- package/dist/cjs/utils/variables.js +26 -8
- package/dist/cjs/validation/datasource.js +30 -0
- package/dist/cjs/validation/duration.js +25 -0
- package/dist/cjs/validation/index.js +34 -0
- package/dist/cjs/validation/resource.js +24 -0
- package/dist/cjs/validation/role.js +86 -0
- package/dist/cjs/validation/rolebinding.js +55 -0
- package/dist/cjs/validation/secret.js +176 -0
- package/dist/cjs/validation/user.js +46 -0
- package/dist/cjs/validation/variable.js +48 -0
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -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/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +14 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +342 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -0
- package/dist/components/DatasourceEditorForm/index.d.ts +2 -0
- package/dist/components/DatasourceEditorForm/index.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/index.js +15 -0
- package/dist/components/DatasourceEditorForm/index.js.map +1 -0
- package/dist/components/DatasourceSelect.d.ts +8 -3
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +120 -23
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +1 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +3 -3
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +5 -5
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +18 -25
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
- 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/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
- 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/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +2 -3
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +50 -11
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +1 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +17 -26
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +5 -5
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +23 -14
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.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 +3 -3
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +2 -2
- 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/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +14 -0
- package/dist/components/ProjectSelect.d.ts.map +1 -0
- package/dist/components/ProjectSelect.js +91 -0
- package/dist/components/ProjectSelect.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +13 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +168 -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/TimeRangeControls/index.js +15 -0
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +38 -44
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +8 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +130 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +12 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +83 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -0
- package/dist/components/TraceQueryEditor/index.d.ts +2 -0
- package/dist/components/TraceQueryEditor/index.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/index.js +15 -0
- package/dist/components/TraceQueryEditor/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -8
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -184
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +4 -4
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +8 -19
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +30 -35
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +9 -10
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/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 +16 -0
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -0
- package/dist/context/ProjectStoreProvider.js +56 -0
- package/dist/context/ProjectStoreProvider.js.map +1 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +15 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/query-params.d.ts +5 -0
- package/dist/context/query-params.d.ts.map +1 -0
- package/dist/context/query-params.js +41 -0
- package/dist/context/query-params.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.d.ts +2 -1
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +1 -0
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.d.ts +3 -3
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +14 -14
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +3 -2
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.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 +6 -4
- 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 +2 -2
- 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 +19 -0
- package/dist/model/trace-queries.d.ts.map +1 -0
- package/dist/model/trace-queries.js +15 -0
- package/dist/model/trace-queries.js.map +1 -0
- 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/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +6 -6
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +52 -28
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +18 -13
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +67 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +9 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -20
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +9 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +30 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.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 +1 -0
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +5 -5
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +13 -45
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +7 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +25 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -0
- package/dist/runtime/builtin-variables.d.ts +11 -0
- package/dist/runtime/builtin-variables.d.ts.map +1 -0
- package/dist/runtime/builtin-variables.js +59 -0
- package/dist/runtime/builtin-variables.js.map +1 -0
- package/dist/runtime/datasources.d.ts +42 -7
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +15 -7
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +5 -3
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +22 -5
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/template-variables.d.ts +6 -5
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +36 -9
- package/dist/runtime/template-variables.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +3 -3
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +21 -19
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +14 -0
- package/dist/runtime/trace-queries.d.ts.map +1 -0
- package/dist/runtime/trace-queries.js +61 -0
- package/dist/runtime/trace-queries.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +1 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +12 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +39 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +24 -8
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +4 -5
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +2 -2
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +1 -0
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/index.js +1 -0
- package/dist/stories/shared-utils/decorators/index.js.map +1 -1
- package/dist/stories/shared-utils/index.js.map +1 -1
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -0
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.d.ts +4 -0
- package/dist/test/mock-data.d.ts.map +1 -0
- package/dist/test/mock-data.js +64 -0
- package/dist/test/mock-data.js.map +1 -0
- package/dist/test/render.d.ts +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -2
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.js +2 -2
- 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/test-plugins/index.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +3 -3
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/action.d.ts +4 -0
- package/dist/utils/action.d.ts.map +1 -0
- package/dist/utils/action.js +27 -0
- package/dist/utils/action.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +17 -5
- package/dist/utils/variables.js.map +1 -1
- package/dist/validation/datasource.d.ts +19 -0
- package/dist/validation/datasource.d.ts.map +1 -0
- package/dist/validation/datasource.js +22 -0
- package/dist/validation/datasource.js.map +1 -0
- package/dist/validation/duration.d.ts +3 -0
- package/dist/validation/duration.d.ts.map +1 -0
- package/dist/validation/duration.js +17 -0
- package/dist/validation/duration.js.map +1 -0
- package/dist/validation/index.d.ts +6 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +19 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/resource.d.ts +3 -0
- package/dist/validation/resource.d.ts.map +1 -0
- package/dist/validation/resource.js +16 -0
- package/dist/validation/resource.js.map +1 -0
- package/dist/validation/role.d.ts +228 -0
- package/dist/validation/role.d.ts.map +1 -0
- package/dist/validation/role.js +67 -0
- package/dist/validation/role.js.map +1 -0
- package/dist/validation/rolebinding.d.ts +137 -0
- package/dist/validation/rolebinding.d.ts.map +1 -0
- package/dist/validation/rolebinding.js +47 -0
- package/dist/validation/rolebinding.js.map +1 -0
- package/dist/validation/secret.d.ts +964 -0
- package/dist/validation/secret.d.ts.map +1 -0
- package/dist/validation/secret.js +157 -0
- package/dist/validation/secret.js.map +1 -0
- package/dist/validation/user.d.ts +93 -0
- package/dist/validation/user.d.ts.map +1 -0
- package/dist/validation/user.js +38 -0
- package/dist/validation/user.js.map +1 -0
- package/dist/validation/variable.d.ts +96 -0
- package/dist/validation/variable.d.ts.map +1 -0
- package/dist/validation/variable.js +40 -0
- package/dist/validation/variable.js.map +1 -0
- package/package.json +9 -6
|
@@ -12,42 +12,29 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
15
|
-
import { Box, Typography, Switch, TextField, Grid,
|
|
16
|
-
import { useImmer } from 'use-immer';
|
|
15
|
+
import { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Button, Stack, ClickAwayListener, Divider } from '@mui/material';
|
|
17
16
|
import { DiscardChangesConfirmationDialog, ErrorBoundary } from '@perses-dev/components';
|
|
17
|
+
import { Controller, FormProvider, useForm } from 'react-hook-form';
|
|
18
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
19
|
+
import { useImmer } from 'use-immer';
|
|
20
|
+
import { getSubmitText, getTitleAction } from '../../../utils';
|
|
18
21
|
import { VARIABLE_TYPES } from '../variable-model';
|
|
19
22
|
import { PluginEditor } from '../../PluginEditor';
|
|
23
|
+
import { variableEditorValidationSchema } from '../../../validation';
|
|
20
24
|
import { VariableListPreview, VariablePreview } from './VariablePreview';
|
|
21
25
|
import { getVariableDefinitionFromState, getInitialState } from './variable-editor-form-model';
|
|
22
|
-
// TODO: Replace with proper validation library
|
|
23
|
-
function getValidation(state) {
|
|
24
|
-
/** Name validation */ let name = null;
|
|
25
|
-
if (!state.name) {
|
|
26
|
-
name = 'Name is required';
|
|
27
|
-
}
|
|
28
|
-
// name can only contain alphanumeric characters and underscores and no spaces
|
|
29
|
-
if (state.name && !/^[a-zA-Z0-9_-]+$/.test(state.name)) {
|
|
30
|
-
name = 'Name can only contain alphanumeric characters, underscores, and dashes';
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
name,
|
|
34
|
-
isValid: !name
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
26
|
function FallbackPreview() {
|
|
38
27
|
return /*#__PURE__*/ _jsx("div", {
|
|
39
28
|
children: "Error previewing values"
|
|
40
29
|
});
|
|
41
30
|
}
|
|
42
|
-
export function
|
|
43
|
-
const { initialVariableDefinition ,
|
|
31
|
+
export function VariableEditorForm(props) {
|
|
32
|
+
const { initialVariableDefinition, initialAction, isDraft, isReadonly, onSave, onClose, onDelete } = props;
|
|
44
33
|
const initialState = getInitialState(initialVariableDefinition);
|
|
45
34
|
const [state, setState] = useImmer(initialState);
|
|
46
|
-
const
|
|
47
|
-
state
|
|
48
|
-
]);
|
|
49
|
-
const [isDiscardDialogStateOpened, setDiscardDialogStateOpened] = useState(false);
|
|
35
|
+
const [isDiscardDialogOpened, setDiscardDialogOpened] = useState(false);
|
|
50
36
|
const [previewKey, setPreviewKey] = useState(0);
|
|
37
|
+
const [action, setAction] = useState(initialAction);
|
|
51
38
|
const refreshPreview = ()=>{
|
|
52
39
|
setPreviewKey((prev)=>prev + 1);
|
|
53
40
|
};
|
|
@@ -60,32 +47,38 @@ export function VariableEditForm(props) {
|
|
|
60
47
|
}, [
|
|
61
48
|
previewKey
|
|
62
49
|
]);
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
const titleAction = getTitleAction(action, isDraft);
|
|
51
|
+
const submitText = getSubmitText(action, isDraft);
|
|
52
|
+
const form = useForm({
|
|
53
|
+
resolver: zodResolver(variableEditorValidationSchema),
|
|
54
|
+
mode: 'onBlur',
|
|
55
|
+
defaultValues: initialState
|
|
56
|
+
});
|
|
57
|
+
const processForm = ()=>{
|
|
58
|
+
// reset display attributes to undefined when empty, because we don't want to save empty strings
|
|
59
|
+
onSave(getVariableDefinitionFromState({
|
|
60
|
+
...state,
|
|
61
|
+
title: state.title === '' ? undefined : state.title,
|
|
62
|
+
description: state.description === '' ? undefined : state.description
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
71
65
|
// When user click on cancel, several possibilities:
|
|
72
66
|
// - create action: ask for discard approval
|
|
73
67
|
// - update action: ask for discard approval if changed
|
|
74
68
|
// - read action: don´t ask for discard approval
|
|
75
69
|
const handleCancel = useCallback(()=>{
|
|
76
|
-
if (
|
|
77
|
-
|
|
70
|
+
if (JSON.stringify(initialState) !== JSON.stringify(state)) {
|
|
71
|
+
setDiscardDialogOpened(true);
|
|
78
72
|
} else {
|
|
79
|
-
|
|
73
|
+
onClose();
|
|
80
74
|
}
|
|
81
75
|
}, [
|
|
82
|
-
state,
|
|
83
76
|
initialState,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
onCancel
|
|
77
|
+
state,
|
|
78
|
+
onClose
|
|
87
79
|
]);
|
|
88
|
-
return /*#__PURE__*/ _jsxs(
|
|
80
|
+
return /*#__PURE__*/ _jsxs(FormProvider, {
|
|
81
|
+
...form,
|
|
89
82
|
children: [
|
|
90
83
|
/*#__PURE__*/ _jsxs(Box, {
|
|
91
84
|
sx: {
|
|
@@ -95,32 +88,69 @@ export function VariableEditForm(props) {
|
|
|
95
88
|
borderBottom: (theme)=>`1px solid ${theme.palette.divider}`
|
|
96
89
|
},
|
|
97
90
|
children: [
|
|
98
|
-
/*#__PURE__*/
|
|
91
|
+
/*#__PURE__*/ _jsxs(Typography, {
|
|
99
92
|
variant: "h2",
|
|
100
|
-
children:
|
|
93
|
+
children: [
|
|
94
|
+
titleAction,
|
|
95
|
+
" Variable"
|
|
96
|
+
]
|
|
101
97
|
}),
|
|
102
|
-
/*#__PURE__*/
|
|
98
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
103
99
|
direction: "row",
|
|
104
100
|
spacing: 1,
|
|
105
101
|
sx: {
|
|
106
102
|
marginLeft: 'auto'
|
|
107
103
|
},
|
|
108
|
-
children:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
104
|
+
children: action === 'read' ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
105
|
+
children: [
|
|
106
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
107
|
+
disabled: isReadonly,
|
|
108
|
+
variant: "contained",
|
|
109
|
+
onClick: ()=>setAction('update'),
|
|
110
|
+
children: "Edit"
|
|
111
|
+
}),
|
|
112
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
113
|
+
color: "error",
|
|
114
|
+
disabled: isReadonly,
|
|
115
|
+
variant: "outlined",
|
|
116
|
+
onClick: onDelete,
|
|
117
|
+
children: "Delete"
|
|
118
|
+
}),
|
|
119
|
+
/*#__PURE__*/ _jsx(Divider, {
|
|
120
|
+
orientation: "vertical",
|
|
121
|
+
flexItem: true,
|
|
122
|
+
sx: (theme)=>({
|
|
123
|
+
borderColor: theme.palette.grey['500'],
|
|
124
|
+
'&.MuiDivider-root': {
|
|
125
|
+
marginLeft: 2,
|
|
126
|
+
marginRight: 1
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
131
|
+
color: "secondary",
|
|
132
|
+
variant: "outlined",
|
|
133
|
+
onClick: onClose,
|
|
134
|
+
children: "Close"
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
138
|
+
children: [
|
|
139
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
140
|
+
type: "submit",
|
|
141
|
+
variant: "contained",
|
|
142
|
+
disabled: !form.formState.isValid,
|
|
143
|
+
onClick: form.handleSubmit(processForm),
|
|
144
|
+
children: submitText
|
|
145
|
+
}),
|
|
146
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
147
|
+
color: "secondary",
|
|
148
|
+
variant: "outlined",
|
|
149
|
+
onClick: handleCancel,
|
|
150
|
+
children: "Cancel"
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
})
|
|
124
154
|
})
|
|
125
155
|
]
|
|
126
156
|
}),
|
|
@@ -138,19 +168,31 @@ export function VariableEditForm(props) {
|
|
|
138
168
|
/*#__PURE__*/ _jsx(Grid, {
|
|
139
169
|
item: true,
|
|
140
170
|
xs: 8,
|
|
141
|
-
children: /*#__PURE__*/ _jsx(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
171
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
172
|
+
name: "name",
|
|
173
|
+
render: ({ field, fieldState })=>{
|
|
174
|
+
var _fieldState_error;
|
|
175
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
176
|
+
...field,
|
|
177
|
+
required: true,
|
|
178
|
+
fullWidth: true,
|
|
179
|
+
label: "Name",
|
|
180
|
+
InputLabelProps: {
|
|
181
|
+
shrink: action === 'read' ? true : undefined
|
|
182
|
+
},
|
|
183
|
+
InputProps: {
|
|
184
|
+
disabled: action === 'update' && !isDraft,
|
|
185
|
+
readOnly: action === 'read'
|
|
186
|
+
},
|
|
187
|
+
error: !!fieldState.error,
|
|
188
|
+
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
189
|
+
value: state.name,
|
|
190
|
+
onChange: (event)=>{
|
|
191
|
+
field.onChange(event);
|
|
192
|
+
setState((draft)=>{
|
|
193
|
+
draft.name = event.target.value;
|
|
194
|
+
});
|
|
195
|
+
}
|
|
154
196
|
});
|
|
155
197
|
}
|
|
156
198
|
})
|
|
@@ -158,16 +200,30 @@ export function VariableEditForm(props) {
|
|
|
158
200
|
/*#__PURE__*/ _jsx(Grid, {
|
|
159
201
|
item: true,
|
|
160
202
|
xs: 4,
|
|
161
|
-
children: /*#__PURE__*/ _jsx(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
203
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
204
|
+
name: "title",
|
|
205
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
206
|
+
var _fieldState_error;
|
|
207
|
+
var _state_title;
|
|
208
|
+
return _jsx(TextField, {
|
|
209
|
+
...field,
|
|
210
|
+
fullWidth: true,
|
|
211
|
+
label: "Display Label",
|
|
212
|
+
InputLabelProps: {
|
|
213
|
+
shrink: action === 'read' ? true : undefined
|
|
214
|
+
},
|
|
215
|
+
InputProps: {
|
|
216
|
+
readOnly: action === 'read'
|
|
217
|
+
},
|
|
218
|
+
error: !!fieldState.error,
|
|
219
|
+
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
220
|
+
value: (_state_title = state.title) !== null && _state_title !== void 0 ? _state_title : '',
|
|
221
|
+
onChange: (event)=>{
|
|
222
|
+
field.onChange(event);
|
|
223
|
+
setState((draft)=>{
|
|
224
|
+
draft.title = event.target.value;
|
|
225
|
+
});
|
|
226
|
+
}
|
|
171
227
|
});
|
|
172
228
|
}
|
|
173
229
|
})
|
|
@@ -175,16 +231,30 @@ export function VariableEditForm(props) {
|
|
|
175
231
|
/*#__PURE__*/ _jsx(Grid, {
|
|
176
232
|
item: true,
|
|
177
233
|
xs: 8,
|
|
178
|
-
children: /*#__PURE__*/ _jsx(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
234
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
235
|
+
name: "description",
|
|
236
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
237
|
+
var _fieldState_error;
|
|
238
|
+
var _state_description;
|
|
239
|
+
return _jsx(TextField, {
|
|
240
|
+
...field,
|
|
241
|
+
fullWidth: true,
|
|
242
|
+
label: "Description",
|
|
243
|
+
InputLabelProps: {
|
|
244
|
+
shrink: action === 'read' ? true : undefined
|
|
245
|
+
},
|
|
246
|
+
InputProps: {
|
|
247
|
+
readOnly: action === 'read'
|
|
248
|
+
},
|
|
249
|
+
error: !!fieldState.error,
|
|
250
|
+
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
251
|
+
value: (_state_description = state.description) !== null && _state_description !== void 0 ? _state_description : '',
|
|
252
|
+
onChange: (event)=>{
|
|
253
|
+
field.onChange(event);
|
|
254
|
+
setState((draft)=>{
|
|
255
|
+
draft.description = event.target.value;
|
|
256
|
+
});
|
|
257
|
+
}
|
|
188
258
|
});
|
|
189
259
|
}
|
|
190
260
|
})
|
|
@@ -192,30 +262,36 @@ export function VariableEditForm(props) {
|
|
|
192
262
|
/*#__PURE__*/ _jsx(Grid, {
|
|
193
263
|
item: true,
|
|
194
264
|
xs: 4,
|
|
195
|
-
children: /*#__PURE__*/
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
labelId: "variable-type-select-label",
|
|
204
|
-
id: "variable-type-select",
|
|
265
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
266
|
+
name: "kind",
|
|
267
|
+
render: ({ field, fieldState })=>{
|
|
268
|
+
var _fieldState_error;
|
|
269
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
270
|
+
select: true,
|
|
271
|
+
...field,
|
|
272
|
+
fullWidth: true,
|
|
205
273
|
label: "Type",
|
|
274
|
+
InputLabelProps: {
|
|
275
|
+
shrink: action === 'read' ? true : undefined
|
|
276
|
+
},
|
|
277
|
+
InputProps: {
|
|
278
|
+
readOnly: action === 'read'
|
|
279
|
+
},
|
|
280
|
+
error: !!fieldState.error,
|
|
281
|
+
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
206
282
|
value: state.kind,
|
|
207
|
-
|
|
208
|
-
|
|
283
|
+
onChange: (event)=>{
|
|
284
|
+
field.onChange(event);
|
|
209
285
|
setState((draft)=>{
|
|
210
|
-
draft.kind =
|
|
286
|
+
draft.kind = event.target.value;
|
|
211
287
|
});
|
|
212
288
|
},
|
|
213
289
|
children: VARIABLE_TYPES.map((v)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
214
290
|
value: v.kind,
|
|
215
291
|
children: v.label
|
|
216
292
|
}, v.kind))
|
|
217
|
-
})
|
|
218
|
-
|
|
293
|
+
});
|
|
294
|
+
}
|
|
219
295
|
})
|
|
220
296
|
})
|
|
221
297
|
]
|
|
@@ -238,17 +314,49 @@ export function VariableEditForm(props) {
|
|
|
238
314
|
]
|
|
239
315
|
})
|
|
240
316
|
}),
|
|
241
|
-
/*#__PURE__*/ _jsx(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
317
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
318
|
+
name: "textVariableFields.value",
|
|
319
|
+
render: ({ field, fieldState })=>{
|
|
320
|
+
var _fieldState_error;
|
|
321
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
322
|
+
...field,
|
|
323
|
+
label: "Value",
|
|
324
|
+
InputLabelProps: {
|
|
325
|
+
shrink: action === 'read' ? true : undefined
|
|
326
|
+
},
|
|
327
|
+
InputProps: {
|
|
328
|
+
readOnly: action === 'read'
|
|
329
|
+
},
|
|
330
|
+
error: !!fieldState.error,
|
|
331
|
+
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
332
|
+
value: state.textVariableFields.value,
|
|
333
|
+
onChange: (event)=>{
|
|
334
|
+
field.onChange(event);
|
|
335
|
+
setState((draft)=>{
|
|
336
|
+
draft.textVariableFields.value = event.target.value;
|
|
337
|
+
});
|
|
338
|
+
}
|
|
250
339
|
});
|
|
251
340
|
}
|
|
341
|
+
}),
|
|
342
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
343
|
+
name: "textVariableFields.constant",
|
|
344
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
345
|
+
label: "Constant",
|
|
346
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
347
|
+
...field,
|
|
348
|
+
checked: !!field.value,
|
|
349
|
+
readOnly: action === 'read',
|
|
350
|
+
value: state.textVariableFields.constant,
|
|
351
|
+
onChange: (event)=>{
|
|
352
|
+
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
353
|
+
field.onChange(event);
|
|
354
|
+
setState((draft)=>{
|
|
355
|
+
draft.textVariableFields.constant = event.target.checked;
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
})
|
|
359
|
+
})
|
|
252
360
|
})
|
|
253
361
|
]
|
|
254
362
|
})
|
|
@@ -285,38 +393,115 @@ export function VariableEditForm(props) {
|
|
|
285
393
|
onClickAway: ()=>refreshPreview(),
|
|
286
394
|
children: /*#__PURE__*/ _jsx(Box, {})
|
|
287
395
|
}),
|
|
288
|
-
/*#__PURE__*/ _jsx(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
396
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
397
|
+
name: "listVariableFields.plugin",
|
|
398
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(PluginEditor, {
|
|
399
|
+
width: "100%",
|
|
400
|
+
pluginType: "Variable",
|
|
401
|
+
pluginKindLabel: "Source",
|
|
402
|
+
isReadonly: action === 'read',
|
|
403
|
+
value: state.listVariableFields.plugin,
|
|
404
|
+
onChange: (val)=>{
|
|
405
|
+
field.onChange(val);
|
|
406
|
+
setState((draft)=>{
|
|
407
|
+
draft.listVariableFields.plugin = val;
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
})
|
|
299
411
|
})
|
|
300
412
|
]
|
|
301
413
|
}),
|
|
302
414
|
/*#__PURE__*/ _jsx(Stack, {
|
|
303
|
-
children: /*#__PURE__*/ _jsx(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
415
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
416
|
+
name: "listVariableFields.capturingRegexp",
|
|
417
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
418
|
+
var _fieldState_error;
|
|
419
|
+
var _state_listVariableFields_capturingRegexp;
|
|
420
|
+
return _jsx(TextField, {
|
|
421
|
+
...field,
|
|
422
|
+
label: "Capturing Regexp Filter",
|
|
423
|
+
InputLabelProps: {
|
|
424
|
+
shrink: action === 'read' ? true : undefined
|
|
425
|
+
},
|
|
426
|
+
InputProps: {
|
|
427
|
+
readOnly: action === 'read'
|
|
428
|
+
},
|
|
429
|
+
error: !!fieldState.error,
|
|
430
|
+
value: (_state_listVariableFields_capturingRegexp = state.listVariableFields.capturingRegexp) !== null && _state_listVariableFields_capturingRegexp !== void 0 ? _state_listVariableFields_capturingRegexp : '',
|
|
431
|
+
onChange: (event)=>{
|
|
432
|
+
field.onChange(event);
|
|
433
|
+
setState((draft)=>{
|
|
434
|
+
if (event.target.value) {
|
|
435
|
+
// TODO: do a better fix, if empty string => it should skip the filter
|
|
436
|
+
draft.listVariableFields.capturingRegexp = event.target.value;
|
|
437
|
+
} else {
|
|
438
|
+
draft.listVariableFields.capturingRegexp = undefined;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
},
|
|
442
|
+
helperText: ((_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message) ? fieldState.error.message : 'Optional, if you want to filter on captured result.'
|
|
317
443
|
});
|
|
318
|
-
}
|
|
319
|
-
|
|
444
|
+
}
|
|
445
|
+
})
|
|
446
|
+
}),
|
|
447
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
448
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
449
|
+
name: "listVariableFields.sort",
|
|
450
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
451
|
+
var _fieldState_error;
|
|
452
|
+
var _state_listVariableFields_sort;
|
|
453
|
+
return _jsxs(TextField, {
|
|
454
|
+
select: true,
|
|
455
|
+
...field,
|
|
456
|
+
fullWidth: true,
|
|
457
|
+
label: "Sort",
|
|
458
|
+
InputLabelProps: {
|
|
459
|
+
shrink: action === 'read' ? true : undefined
|
|
460
|
+
},
|
|
461
|
+
InputProps: {
|
|
462
|
+
readOnly: action === 'read'
|
|
463
|
+
},
|
|
464
|
+
error: !!fieldState.error,
|
|
465
|
+
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
466
|
+
value: (_state_listVariableFields_sort = state.listVariableFields.sort) !== null && _state_listVariableFields_sort !== void 0 ? _state_listVariableFields_sort : 'none',
|
|
467
|
+
onChange: (event)=>{
|
|
468
|
+
field.onChange(event);
|
|
469
|
+
setState((draft)=>{
|
|
470
|
+
draft.listVariableFields.sort = event.target.value;
|
|
471
|
+
});
|
|
472
|
+
},
|
|
473
|
+
children: [
|
|
474
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
475
|
+
value: "none",
|
|
476
|
+
children: "None"
|
|
477
|
+
}),
|
|
478
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
479
|
+
value: "alphabetical-asc",
|
|
480
|
+
children: "Alphabetical, asc"
|
|
481
|
+
}),
|
|
482
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
483
|
+
value: "alphabetical-desc",
|
|
484
|
+
children: "Alphabetical, desc"
|
|
485
|
+
}),
|
|
486
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
487
|
+
value: "numerical-asc",
|
|
488
|
+
children: "Numerical, asc"
|
|
489
|
+
}),
|
|
490
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
491
|
+
value: "numerical-desc",
|
|
492
|
+
children: "Numerical, desc"
|
|
493
|
+
}),
|
|
494
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
495
|
+
value: "alphabetical-ci-asc",
|
|
496
|
+
children: "Alphabetical, case-insensitive, asc"
|
|
497
|
+
}),
|
|
498
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
499
|
+
value: "alphabetical-ci-desc",
|
|
500
|
+
children: "Alphabetical, case-insensitive, desc"
|
|
501
|
+
})
|
|
502
|
+
]
|
|
503
|
+
});
|
|
504
|
+
}
|
|
320
505
|
})
|
|
321
506
|
})
|
|
322
507
|
]
|
|
@@ -332,18 +517,24 @@ export function VariableEditForm(props) {
|
|
|
332
517
|
children: [
|
|
333
518
|
/*#__PURE__*/ _jsxs(Stack, {
|
|
334
519
|
children: [
|
|
335
|
-
/*#__PURE__*/ _jsx(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
520
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
521
|
+
name: "listVariableFields.allowMultiple",
|
|
522
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
523
|
+
label: "Allow Multiple Values",
|
|
524
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
525
|
+
...field,
|
|
526
|
+
checked: !!field.value,
|
|
527
|
+
readOnly: action === 'read',
|
|
528
|
+
value: state.listVariableFields.allowMultiple,
|
|
529
|
+
onChange: (event)=>{
|
|
530
|
+
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
531
|
+
field.onChange(event);
|
|
532
|
+
setState((draft)=>{
|
|
533
|
+
draft.listVariableFields.allowMultiple = event.target.checked;
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
})
|
|
537
|
+
})
|
|
347
538
|
}),
|
|
348
539
|
/*#__PURE__*/ _jsx(Typography, {
|
|
349
540
|
variant: "caption",
|
|
@@ -353,40 +544,60 @@ export function VariableEditForm(props) {
|
|
|
353
544
|
}),
|
|
354
545
|
/*#__PURE__*/ _jsxs(Stack, {
|
|
355
546
|
children: [
|
|
356
|
-
/*#__PURE__*/ _jsx(
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
547
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
548
|
+
name: "listVariableFields.allowAllValue",
|
|
549
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
550
|
+
label: "Allow All option",
|
|
551
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
552
|
+
...field,
|
|
553
|
+
checked: !!field.value,
|
|
554
|
+
readOnly: action === 'read',
|
|
555
|
+
value: state.listVariableFields.allowAllValue,
|
|
556
|
+
onChange: (event)=>{
|
|
557
|
+
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
558
|
+
field.onChange(event);
|
|
559
|
+
setState((draft)=>{
|
|
560
|
+
draft.listVariableFields.allowAllValue = event.target.checked;
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
})
|
|
564
|
+
})
|
|
368
565
|
}),
|
|
369
566
|
/*#__PURE__*/ _jsx(Typography, {
|
|
370
567
|
mb: 1,
|
|
371
568
|
variant: "caption",
|
|
372
569
|
children: "Enables an option to include all variable values"
|
|
373
570
|
}),
|
|
374
|
-
state.listVariableFields.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
571
|
+
state.listVariableFields.allowAllValue && /*#__PURE__*/ _jsx(Controller, {
|
|
572
|
+
name: "listVariableFields.customAllValue",
|
|
573
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
574
|
+
var _fieldState_error;
|
|
575
|
+
var _state_listVariableFields_customAllValue;
|
|
576
|
+
return _jsx(TextField, {
|
|
577
|
+
...field,
|
|
578
|
+
fullWidth: true,
|
|
579
|
+
label: "Custom All Value",
|
|
580
|
+
InputLabelProps: {
|
|
581
|
+
shrink: action === 'read' ? true : undefined
|
|
582
|
+
},
|
|
583
|
+
InputProps: {
|
|
584
|
+
readOnly: action === 'read'
|
|
585
|
+
},
|
|
586
|
+
error: !!fieldState.error,
|
|
587
|
+
helperText: ((_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message) ? fieldState.error.message : 'When All is selected, this value will be used',
|
|
588
|
+
value: (_state_listVariableFields_customAllValue = state.listVariableFields.customAllValue) !== null && _state_listVariableFields_customAllValue !== void 0 ? _state_listVariableFields_customAllValue : '',
|
|
589
|
+
onChange: (event)=>{
|
|
590
|
+
field.onChange(event);
|
|
591
|
+
setState((draft)=>{
|
|
592
|
+
if (event.target.value) {
|
|
593
|
+
draft.listVariableFields.customAllValue = event.target.value;
|
|
594
|
+
} else {
|
|
595
|
+
draft.listVariableFields.customAllValue = undefined;
|
|
596
|
+
}
|
|
597
|
+
});
|
|
386
598
|
}
|
|
387
599
|
});
|
|
388
|
-
}
|
|
389
|
-
helperText: "When All is selected, this value will be used"
|
|
600
|
+
}
|
|
390
601
|
})
|
|
391
602
|
]
|
|
392
603
|
})
|
|
@@ -398,13 +609,13 @@ export function VariableEditForm(props) {
|
|
|
398
609
|
}),
|
|
399
610
|
/*#__PURE__*/ _jsx(DiscardChangesConfirmationDialog, {
|
|
400
611
|
description: "Are you sure you want to discard these changes? Changes cannot be recovered.",
|
|
401
|
-
isOpen:
|
|
612
|
+
isOpen: isDiscardDialogOpened,
|
|
402
613
|
onCancel: ()=>{
|
|
403
|
-
|
|
614
|
+
setDiscardDialogOpened(false);
|
|
404
615
|
},
|
|
405
616
|
onDiscardChanges: ()=>{
|
|
406
|
-
|
|
407
|
-
|
|
617
|
+
setDiscardDialogOpened(false);
|
|
618
|
+
onClose();
|
|
408
619
|
}
|
|
409
620
|
})
|
|
410
621
|
]
|