@perses-dev/plugin-system 0.53.0-rc.1 → 0.53.0-rc.3
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/CalculationSelector/index.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/index.js +1 -1
- package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +1 -1
- package/dist/cjs/components/DatasourceSelect/index.js +1 -1
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +1 -1
- package/dist/cjs/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +1175 -0
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +30 -0
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
- package/dist/cjs/components/LegendOptionsEditor/index.js +1 -1
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +1 -1
- package/dist/cjs/components/MetricLabelInput/index.js +1 -1
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +1 -1
- package/dist/cjs/components/MultiQueryEditor/index.js +1 -1
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +1 -1
- package/dist/cjs/components/OptionsEditorRadios/index.js +1 -1
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/index.js +1 -1
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +1 -1
- package/dist/cjs/components/PanelSpecEditor/index.js +1 -1
- package/dist/cjs/components/PluginEditor/PluginEditor.js +1 -1
- package/dist/cjs/components/PluginEditor/index.js +1 -1
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +1 -1
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +1 -1
- package/dist/cjs/components/PluginKindSelect/index.js +1 -1
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/cjs/components/PluginRegistry/index.js +1 -1
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/cjs/components/PluginSpecEditor/index.js +1 -1
- package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +43 -0
- package/dist/cjs/components/SelectionOptionsEditor/index.js +30 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +11 -3
- package/dist/cjs/components/TimeRangeControls/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/cjs/components/Variables/index.js +1 -1
- package/dist/cjs/components/Variables/variable-model.js +1 -1
- package/dist/cjs/components/index.js +2 -1
- package/dist/cjs/constants/index.js +1 -1
- package/dist/cjs/constants/user-interface-text.js +1 -1
- package/dist/cjs/context/ValidationProvider.js +1 -1
- package/dist/cjs/context/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/model/datasource.js +1 -1
- package/dist/cjs/model/explore.js +1 -1
- package/dist/cjs/model/index.js +1 -1
- package/dist/cjs/model/legend.js +1 -1
- package/dist/cjs/model/log-queries.js +1 -1
- package/dist/cjs/model/panels.js +1 -1
- package/dist/cjs/model/plugin-base.js +1 -1
- package/dist/cjs/model/plugin-loading.js +1 -1
- package/dist/cjs/model/plugins.js +1 -1
- package/dist/cjs/model/profile-queries.js +1 -1
- package/dist/cjs/model/time-series-queries.js +1 -1
- package/dist/cjs/model/trace-queries.js +1 -1
- package/dist/cjs/model/variables.js +1 -1
- package/dist/cjs/remote/PersesPlugin.types.js +1 -1
- package/dist/cjs/remote/PluginLoaderComponent.js +13 -1
- package/dist/cjs/remote/PluginRuntime.js +13 -1
- package/dist/cjs/remote/index.js +1 -1
- package/dist/cjs/remote/remotePluginLoader.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/index.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/model.js +1 -1
- package/dist/cjs/runtime/QueryCountProvider.js +1 -1
- package/dist/cjs/runtime/RouterProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +7 -2
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/index.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +28 -1
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +1 -1
- package/dist/cjs/runtime/UsageMetricsProvider.js +1 -1
- package/dist/cjs/runtime/builtin-variables.js +1 -1
- package/dist/cjs/runtime/datasources.js +1 -1
- package/dist/cjs/runtime/index.js +2 -1
- package/dist/cjs/runtime/item-actions.js +303 -0
- package/dist/cjs/runtime/log-queries.js +1 -1
- package/dist/cjs/runtime/plugin-registry.js +1 -1
- package/dist/cjs/runtime/profile-queries.js +1 -1
- package/dist/cjs/runtime/time-series-queries.js +1 -1
- package/dist/cjs/runtime/trace-queries.js +1 -1
- package/dist/cjs/runtime/utils.js +1 -1
- package/dist/cjs/runtime/variables.js +6 -6
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/mock-data.js +1 -1
- package/dist/cjs/test/render-hook.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test/test-plugins/bert/index.js +1 -1
- package/dist/cjs/test/test-plugins/ernie/index.js +1 -1
- package/dist/cjs/test/test-plugins/index.js +1 -1
- package/dist/cjs/test/utils.js +1 -1
- package/dist/cjs/test-utils/index.js +1 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +1 -1
- package/dist/cjs/utils/action.js +1 -1
- package/dist/cjs/utils/event.js +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/variables.js +9 -146
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/index.js +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceEditorForm/index.js +1 -1
- package/dist/components/DatasourceEditorForm/index.js.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
- package/dist/components/DatasourceSelect/index.js +1 -1
- package/dist/components/DatasourceSelect/index.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +49 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +1154 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.d.ts +2 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.d.ts.map +1 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js +15 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
- package/dist/components/MetricLabelInput/index.js +1 -1
- package/dist/components/MetricLabelInput/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/MultiQueryEditor/index.js +1 -1
- package/dist/components/MultiQueryEditor/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js +1 -1
- package/dist/components/OptionsEditorRadios/index.js.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 +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +1 -1
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js +1 -1
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js +1 -1
- package/dist/components/PluginKindSelect/index.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/index.js +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.js +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +10 -0
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -0
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +35 -0
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -0
- package/dist/components/SelectionOptionsEditor/index.d.ts +2 -0
- package/dist/components/SelectionOptionsEditor/index.d.ts.map +1 -0
- package/dist/components/SelectionOptionsEditor/index.js +15 -0
- package/dist/components/SelectionOptionsEditor/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +4 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -4
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js +1 -1
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.js +1 -1
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/user-interface-text.js +1 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/ValidationProvider.js +1 -1
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.js +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.js +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.js +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.js +1 -1
- package/dist/model/log-queries.js.map +1 -1
- package/dist/model/panels.js +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.js +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.js +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/profile-queries.js +1 -1
- package/dist/model/profile-queries.js.map +1 -1
- package/dist/model/time-series-queries.js +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.js +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +4 -7
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PersesPlugin.types.js +1 -1
- package/dist/remote/PersesPlugin.types.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
- package/dist/remote/PluginLoaderComponent.js +13 -1
- package/dist/remote/PluginLoaderComponent.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +13 -1
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/index.js +1 -1
- package/dist/remote/index.js.map +1 -1
- package/dist/remote/remotePluginLoader.js +1 -1
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js +1 -1
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +1 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/QueryCountProvider.js +1 -1
- package/dist/runtime/QueryCountProvider.js.map +1 -1
- package/dist/runtime/RouterProvider.js +1 -1
- package/dist/runtime/RouterProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +8 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +1 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +11 -0
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +26 -2
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.js +1 -1
- package/dist/runtime/UsageMetricsProvider.js.map +1 -1
- package/dist/runtime/builtin-variables.js +1 -1
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.js +1 -1
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/item-actions.d.ts +35 -0
- package/dist/runtime/item-actions.d.ts.map +1 -0
- package/dist/runtime/item-actions.js +300 -0
- package/dist/runtime/item-actions.js.map +1 -0
- package/dist/runtime/log-queries.js +1 -1
- package/dist/runtime/log-queries.js.map +1 -1
- package/dist/runtime/plugin-registry.js +1 -1
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/profile-queries.js +1 -1
- package/dist/runtime/profile-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.js +1 -1
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.js +1 -1
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/utils.js +1 -1
- package/dist/runtime/utils.js.map +1 -1
- package/dist/runtime/variables.d.ts +2 -18
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js +3 -3
- package/dist/runtime/variables.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.js +1 -1
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render-hook.js +1 -1
- package/dist/test/render-hook.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.js +1 -1
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +1 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/test-plugins/index.js +1 -1
- package/dist/test/test-plugins/index.js.map +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/utils.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +1 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/action.js +1 -1
- package/dist/utils/action.js.map +1 -1
- package/dist/utils/event.js +1 -1
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.d.ts +2 -30
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +3 -144
- package/dist/utils/variables.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js
ADDED
|
@@ -0,0 +1,1175 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get ACTION_ICONS () {
|
|
25
|
+
return ACTION_ICONS;
|
|
26
|
+
},
|
|
27
|
+
get ItemSelectionActionsEditor () {
|
|
28
|
+
return ItemSelectionActionsEditor;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
32
|
+
const _material = require("@mui/material");
|
|
33
|
+
const _components = require("@perses-dev/components");
|
|
34
|
+
const _Alert = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Alert"));
|
|
35
|
+
const _Check = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Check"));
|
|
36
|
+
const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
|
|
37
|
+
const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
|
|
38
|
+
const _Close = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Close"));
|
|
39
|
+
const _Cog = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Cog"));
|
|
40
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
41
|
+
const _Download = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Download"));
|
|
42
|
+
const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
|
|
43
|
+
const _Link = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Link"));
|
|
44
|
+
const _MagnifyScan = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/MagnifyScan"));
|
|
45
|
+
const _Pause = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Pause"));
|
|
46
|
+
const _Play = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Play"));
|
|
47
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
48
|
+
const _Refresh = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Refresh"));
|
|
49
|
+
const _RobotOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/RobotOutline"));
|
|
50
|
+
const _Send = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Send"));
|
|
51
|
+
const _Stop = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Stop"));
|
|
52
|
+
const _Sync = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Sync"));
|
|
53
|
+
const _Upload = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Upload"));
|
|
54
|
+
const _react = require("react");
|
|
55
|
+
function _interop_require_default(obj) {
|
|
56
|
+
return obj && obj.__esModule ? obj : {
|
|
57
|
+
default: obj
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const HTTP_METHODS = [
|
|
61
|
+
'GET',
|
|
62
|
+
'POST',
|
|
63
|
+
'PUT',
|
|
64
|
+
'PATCH',
|
|
65
|
+
'DELETE'
|
|
66
|
+
];
|
|
67
|
+
const BATCH_MODES = [
|
|
68
|
+
{
|
|
69
|
+
value: 'individual',
|
|
70
|
+
label: 'Individual (one request per selection)'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: 'batch',
|
|
74
|
+
label: 'Batch (single request with all selections)'
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
const CONTENT_TYPES = [
|
|
78
|
+
{
|
|
79
|
+
value: 'none',
|
|
80
|
+
label: 'None'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: 'json',
|
|
84
|
+
label: 'JSON'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: 'text',
|
|
88
|
+
label: 'Text'
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
const BODY_METHODS = [
|
|
92
|
+
'POST',
|
|
93
|
+
'PUT',
|
|
94
|
+
'PATCH'
|
|
95
|
+
];
|
|
96
|
+
const BODY_CLEAR_CONFIRM_MESSAGE = 'Changing this option will remove the current body template. Continue?';
|
|
97
|
+
const ACTION_ICONS = [
|
|
98
|
+
{
|
|
99
|
+
value: 'play',
|
|
100
|
+
label: 'Play',
|
|
101
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Play.default, {
|
|
102
|
+
fontSize: "inherit"
|
|
103
|
+
})
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
value: 'pause',
|
|
107
|
+
label: 'Pause',
|
|
108
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Pause.default, {
|
|
109
|
+
fontSize: "inherit"
|
|
110
|
+
})
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
value: 'stop',
|
|
114
|
+
label: 'Stop',
|
|
115
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Stop.default, {
|
|
116
|
+
fontSize: "inherit"
|
|
117
|
+
})
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
value: 'delete',
|
|
121
|
+
label: 'Delete',
|
|
122
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
|
|
123
|
+
fontSize: "inherit"
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
value: 'refresh',
|
|
128
|
+
label: 'Refresh',
|
|
129
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Refresh.default, {
|
|
130
|
+
fontSize: "inherit"
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: 'send',
|
|
135
|
+
label: 'Send',
|
|
136
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Send.default, {
|
|
137
|
+
fontSize: "inherit"
|
|
138
|
+
})
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
value: 'download',
|
|
142
|
+
label: 'Download',
|
|
143
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Download.default, {
|
|
144
|
+
fontSize: "inherit"
|
|
145
|
+
})
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
value: 'upload',
|
|
149
|
+
label: 'Upload',
|
|
150
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Upload.default, {
|
|
151
|
+
fontSize: "inherit"
|
|
152
|
+
})
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
value: 'check',
|
|
156
|
+
label: 'Check',
|
|
157
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Check.default, {
|
|
158
|
+
fontSize: "inherit"
|
|
159
|
+
})
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
value: 'close',
|
|
163
|
+
label: 'Close',
|
|
164
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Close.default, {
|
|
165
|
+
fontSize: "inherit"
|
|
166
|
+
})
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
value: 'alert',
|
|
170
|
+
label: 'Alert',
|
|
171
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Alert.default, {
|
|
172
|
+
fontSize: "inherit"
|
|
173
|
+
})
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
value: 'info',
|
|
177
|
+
label: 'Info',
|
|
178
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
|
|
179
|
+
fontSize: "inherit"
|
|
180
|
+
})
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
value: 'settings',
|
|
184
|
+
label: 'Settings',
|
|
185
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Cog.default, {
|
|
186
|
+
fontSize: "inherit"
|
|
187
|
+
})
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
value: 'link',
|
|
191
|
+
label: 'Link',
|
|
192
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Link.default, {
|
|
193
|
+
fontSize: "inherit"
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
value: 'sync',
|
|
198
|
+
label: 'Sync',
|
|
199
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Sync.default, {
|
|
200
|
+
fontSize: "inherit"
|
|
201
|
+
})
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
value: 'troubleshoot',
|
|
205
|
+
label: 'Troubleshoot',
|
|
206
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_MagnifyScan.default, {
|
|
207
|
+
fontSize: "inherit"
|
|
208
|
+
})
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
value: 'ask-ai',
|
|
212
|
+
label: 'Ask AI',
|
|
213
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_RobotOutline.default, {
|
|
214
|
+
fontSize: "inherit"
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
];
|
|
218
|
+
const URL_HELPER_TEXT = 'Supports interpolation: ${__data.fields["fieldName"]}, ${__data.index}, ${__data.count}';
|
|
219
|
+
function createDefaultEventAction() {
|
|
220
|
+
return {
|
|
221
|
+
type: 'event',
|
|
222
|
+
name: 'New Event Action',
|
|
223
|
+
eventName: 'selection-action',
|
|
224
|
+
batchMode: 'individual',
|
|
225
|
+
enabled: true
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function createDefaultWebhookAction() {
|
|
229
|
+
return {
|
|
230
|
+
type: 'webhook',
|
|
231
|
+
name: 'New Webhook Action',
|
|
232
|
+
url: '',
|
|
233
|
+
method: 'POST',
|
|
234
|
+
contentType: 'none',
|
|
235
|
+
batchMode: 'individual',
|
|
236
|
+
enabled: true
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function InterpolationHelper({ batchMode }) {
|
|
240
|
+
let content = /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
241
|
+
children: [
|
|
242
|
+
"Individual mode patterns: ",
|
|
243
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
244
|
+
children: '${__data.fields["field"]}'
|
|
245
|
+
}),
|
|
246
|
+
", ",
|
|
247
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
248
|
+
children: '${__data.index}'
|
|
249
|
+
}),
|
|
250
|
+
",",
|
|
251
|
+
' ',
|
|
252
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
253
|
+
children: '${__data.count}'
|
|
254
|
+
})
|
|
255
|
+
]
|
|
256
|
+
});
|
|
257
|
+
if (batchMode === 'batch') {
|
|
258
|
+
content = /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
259
|
+
children: [
|
|
260
|
+
"Batch mode patterns: ",
|
|
261
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
262
|
+
children: '${__data}'
|
|
263
|
+
}),
|
|
264
|
+
", ",
|
|
265
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
266
|
+
children: "${__data[0].fields['field']}"
|
|
267
|
+
}),
|
|
268
|
+
",",
|
|
269
|
+
' ',
|
|
270
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
271
|
+
children: "${__data.fields['field']:csv}"
|
|
272
|
+
}),
|
|
273
|
+
", ",
|
|
274
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("code", {
|
|
275
|
+
children: '${__data.count}'
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
281
|
+
variant: "caption",
|
|
282
|
+
color: "text.secondary",
|
|
283
|
+
sx: {
|
|
284
|
+
mb: 1,
|
|
285
|
+
display: 'block'
|
|
286
|
+
},
|
|
287
|
+
children: content
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function EventActionEditor({ action, index, onChange, onRemove, onMoveDown, onMoveUp }) {
|
|
291
|
+
const eventAction = action;
|
|
292
|
+
const [isCollapsed, setIsCollapsed] = (0, _react.useState)(true);
|
|
293
|
+
const hasBodyTemplate = (eventAction.bodyTemplate ?? '').trim().length > 0;
|
|
294
|
+
const handleIncludesTemplateChange = (0, _react.useCallback)((event)=>{
|
|
295
|
+
const nextContentType = event.target.value;
|
|
296
|
+
const bodyTemplate = nextContentType === 'custom' ? JSON.stringify({}) : undefined;
|
|
297
|
+
onChange(index, {
|
|
298
|
+
...eventAction,
|
|
299
|
+
bodyTemplate: bodyTemplate
|
|
300
|
+
});
|
|
301
|
+
}, [
|
|
302
|
+
index,
|
|
303
|
+
onChange,
|
|
304
|
+
eventAction
|
|
305
|
+
]);
|
|
306
|
+
const handleBodyTemplateChange = (0, _react.useCallback)((template)=>{
|
|
307
|
+
onChange(index, {
|
|
308
|
+
...eventAction,
|
|
309
|
+
bodyTemplate: template || undefined
|
|
310
|
+
});
|
|
311
|
+
}, [
|
|
312
|
+
index,
|
|
313
|
+
onChange,
|
|
314
|
+
eventAction
|
|
315
|
+
]);
|
|
316
|
+
const jsonDataTemplate = (0, _react.useMemo)(()=>{
|
|
317
|
+
if (eventAction.bodyTemplate) {
|
|
318
|
+
try {
|
|
319
|
+
return JSON.parse(eventAction.bodyTemplate);
|
|
320
|
+
} catch {
|
|
321
|
+
return {};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}, [
|
|
325
|
+
eventAction.bodyTemplate
|
|
326
|
+
]);
|
|
327
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.DragAndDropElement, {
|
|
328
|
+
data: eventAction,
|
|
329
|
+
children: [
|
|
330
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
331
|
+
direction: "row",
|
|
332
|
+
alignItems: "center",
|
|
333
|
+
justifyContent: "space-between",
|
|
334
|
+
gap: 4,
|
|
335
|
+
children: [
|
|
336
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
337
|
+
direction: "row",
|
|
338
|
+
gap: 1,
|
|
339
|
+
children: [
|
|
340
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
341
|
+
"data-testid": `event-action-toggle#${eventAction.name}`,
|
|
342
|
+
size: "small",
|
|
343
|
+
onClick: ()=>setIsCollapsed(!isCollapsed),
|
|
344
|
+
children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
|
|
345
|
+
}),
|
|
346
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
347
|
+
variant: "overline",
|
|
348
|
+
component: "h4",
|
|
349
|
+
sx: {
|
|
350
|
+
textTransform: 'none'
|
|
351
|
+
},
|
|
352
|
+
children: [
|
|
353
|
+
"EVENT ACTION:",
|
|
354
|
+
' ',
|
|
355
|
+
eventAction.name ? /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
356
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
357
|
+
children: eventAction.name
|
|
358
|
+
})
|
|
359
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
360
|
+
children: eventAction.name
|
|
361
|
+
})
|
|
362
|
+
]
|
|
363
|
+
})
|
|
364
|
+
]
|
|
365
|
+
}),
|
|
366
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
367
|
+
direction: "row",
|
|
368
|
+
gap: 1,
|
|
369
|
+
children: [
|
|
370
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
371
|
+
description: "Remove action settings",
|
|
372
|
+
placement: "top",
|
|
373
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
374
|
+
size: "small",
|
|
375
|
+
sx: {
|
|
376
|
+
marginLeft: 'auto'
|
|
377
|
+
},
|
|
378
|
+
onClick: ()=>onRemove(index),
|
|
379
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
380
|
+
}, "delete-action-button")
|
|
381
|
+
}),
|
|
382
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
383
|
+
description: "Reorder action settings",
|
|
384
|
+
placement: "top",
|
|
385
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.DragButton, {
|
|
386
|
+
onMoveUp: onMoveUp,
|
|
387
|
+
onMoveDown: onMoveDown,
|
|
388
|
+
menuSx: {
|
|
389
|
+
'.MuiPaper-root': {
|
|
390
|
+
backgroundColor: (theme)=>theme.palette.background.lighter
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}, "reorder-action-button")
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
})
|
|
397
|
+
]
|
|
398
|
+
}),
|
|
399
|
+
!isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
400
|
+
spacing: 2,
|
|
401
|
+
children: [
|
|
402
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
403
|
+
label: "Enabled",
|
|
404
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
405
|
+
checked: eventAction?.enabled ?? false,
|
|
406
|
+
onChange: (e)=>onChange(index, {
|
|
407
|
+
...eventAction,
|
|
408
|
+
enabled: e.target.checked
|
|
409
|
+
})
|
|
410
|
+
})
|
|
411
|
+
}),
|
|
412
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
413
|
+
direction: "row",
|
|
414
|
+
spacing: 2,
|
|
415
|
+
children: [
|
|
416
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
417
|
+
label: "Action Name",
|
|
418
|
+
size: "small",
|
|
419
|
+
value: eventAction.name,
|
|
420
|
+
onChange: (e)=>onChange(index, {
|
|
421
|
+
...eventAction,
|
|
422
|
+
name: e.target.value
|
|
423
|
+
}),
|
|
424
|
+
sx: {
|
|
425
|
+
flexGrow: 1
|
|
426
|
+
}
|
|
427
|
+
}),
|
|
428
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
429
|
+
size: "small",
|
|
430
|
+
sx: {
|
|
431
|
+
minWidth: 120
|
|
432
|
+
},
|
|
433
|
+
children: [
|
|
434
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
435
|
+
children: "Icon"
|
|
436
|
+
}),
|
|
437
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Select, {
|
|
438
|
+
value: eventAction.icon || '',
|
|
439
|
+
label: "Icon",
|
|
440
|
+
onChange: (e)=>onChange(index, {
|
|
441
|
+
...eventAction,
|
|
442
|
+
icon: e.target.value || undefined
|
|
443
|
+
}),
|
|
444
|
+
children: [
|
|
445
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
446
|
+
value: "",
|
|
447
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("em", {
|
|
448
|
+
children: "None"
|
|
449
|
+
})
|
|
450
|
+
}),
|
|
451
|
+
ACTION_ICONS.map((iconOption)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
452
|
+
value: iconOption.value,
|
|
453
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
454
|
+
direction: "row",
|
|
455
|
+
alignItems: "center",
|
|
456
|
+
spacing: 1,
|
|
457
|
+
children: [
|
|
458
|
+
iconOption.icon,
|
|
459
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
460
|
+
children: iconOption.label
|
|
461
|
+
})
|
|
462
|
+
]
|
|
463
|
+
})
|
|
464
|
+
}, iconOption.value))
|
|
465
|
+
]
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
})
|
|
469
|
+
]
|
|
470
|
+
}),
|
|
471
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
472
|
+
direction: "row",
|
|
473
|
+
spacing: 2,
|
|
474
|
+
children: [
|
|
475
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
476
|
+
label: "Event Name",
|
|
477
|
+
size: "small",
|
|
478
|
+
value: eventAction.eventName,
|
|
479
|
+
onChange: (e)=>onChange(index, {
|
|
480
|
+
...eventAction,
|
|
481
|
+
eventName: e.target.value
|
|
482
|
+
}),
|
|
483
|
+
helperText: "Name of the CustomEvent to dispatch (e.g., 'selection-action')",
|
|
484
|
+
fullWidth: true
|
|
485
|
+
}),
|
|
486
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
487
|
+
size: "small",
|
|
488
|
+
sx: {
|
|
489
|
+
flexGrow: 1,
|
|
490
|
+
minWidth: 280
|
|
491
|
+
},
|
|
492
|
+
children: [
|
|
493
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
494
|
+
children: "Batch Mode"
|
|
495
|
+
}),
|
|
496
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Select, {
|
|
497
|
+
value: eventAction.batchMode ?? 'individual',
|
|
498
|
+
label: "Batch Mode",
|
|
499
|
+
onChange: (e)=>onChange(index, {
|
|
500
|
+
...eventAction,
|
|
501
|
+
batchMode: e.target.value
|
|
502
|
+
}),
|
|
503
|
+
children: BATCH_MODES.map((mode)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
504
|
+
value: mode.value,
|
|
505
|
+
children: mode.label
|
|
506
|
+
}, mode.value))
|
|
507
|
+
})
|
|
508
|
+
]
|
|
509
|
+
})
|
|
510
|
+
]
|
|
511
|
+
}),
|
|
512
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
513
|
+
component: "fieldset",
|
|
514
|
+
size: "small",
|
|
515
|
+
children: [
|
|
516
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormLabel, {
|
|
517
|
+
component: "legend",
|
|
518
|
+
children: "Template"
|
|
519
|
+
}),
|
|
520
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.RadioGroup, {
|
|
521
|
+
row: true,
|
|
522
|
+
value: hasBodyTemplate ? 'custom' : 'none',
|
|
523
|
+
onChange: handleIncludesTemplateChange,
|
|
524
|
+
children: [
|
|
525
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
526
|
+
value: "none",
|
|
527
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Radio, {
|
|
528
|
+
size: "small"
|
|
529
|
+
}),
|
|
530
|
+
label: "None"
|
|
531
|
+
}),
|
|
532
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
533
|
+
value: "custom",
|
|
534
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Radio, {
|
|
535
|
+
size: "small"
|
|
536
|
+
}),
|
|
537
|
+
label: "JSON template"
|
|
538
|
+
})
|
|
539
|
+
]
|
|
540
|
+
})
|
|
541
|
+
]
|
|
542
|
+
}),
|
|
543
|
+
hasBodyTemplate && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
544
|
+
children: [
|
|
545
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(InterpolationHelper, {
|
|
546
|
+
batchMode: eventAction.batchMode
|
|
547
|
+
}),
|
|
548
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.JSONEditor, {
|
|
549
|
+
value: jsonDataTemplate || '',
|
|
550
|
+
onChange: handleBodyTemplateChange,
|
|
551
|
+
minHeight: "100px",
|
|
552
|
+
maxHeight: "200px"
|
|
553
|
+
})
|
|
554
|
+
]
|
|
555
|
+
}),
|
|
556
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
557
|
+
label: "Confirmation Message (optional)",
|
|
558
|
+
size: "small",
|
|
559
|
+
value: eventAction.confirmMessage || '',
|
|
560
|
+
onChange: (e)=>onChange(index, {
|
|
561
|
+
...eventAction,
|
|
562
|
+
confirmMessage: e.target.value || undefined
|
|
563
|
+
}),
|
|
564
|
+
helperText: "If set, shows a confirmation dialog before executing the action",
|
|
565
|
+
fullWidth: true,
|
|
566
|
+
multiline: true,
|
|
567
|
+
rows: 2
|
|
568
|
+
})
|
|
569
|
+
]
|
|
570
|
+
})
|
|
571
|
+
]
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
function WebhookActionEditor({ action, index, onChange, onRemove, onMoveUp, onMoveDown }) {
|
|
575
|
+
const webhookAction = action;
|
|
576
|
+
const [pendingChange, setPendingChange] = (0, _react.useState)(null);
|
|
577
|
+
const contentTypeValue = webhookAction.contentType ?? 'none';
|
|
578
|
+
const hasBodyTemplate = (webhookAction.bodyTemplate ?? '').trim().length > 0;
|
|
579
|
+
const supportsBody = BODY_METHODS.includes(webhookAction.method);
|
|
580
|
+
const [isCollapsed, setIsCollapsed] = (0, _react.useState)(true);
|
|
581
|
+
const handleBodyTemplateChange = (0, _react.useCallback)((template)=>{
|
|
582
|
+
onChange(index, {
|
|
583
|
+
...webhookAction,
|
|
584
|
+
bodyTemplate: template || undefined
|
|
585
|
+
});
|
|
586
|
+
}, [
|
|
587
|
+
index,
|
|
588
|
+
onChange,
|
|
589
|
+
webhookAction
|
|
590
|
+
]);
|
|
591
|
+
const handleTextTemplateChange = (0, _react.useCallback)((event)=>{
|
|
592
|
+
onChange(index, {
|
|
593
|
+
...webhookAction,
|
|
594
|
+
bodyTemplate: event.target.value || undefined
|
|
595
|
+
});
|
|
596
|
+
}, [
|
|
597
|
+
index,
|
|
598
|
+
onChange,
|
|
599
|
+
webhookAction
|
|
600
|
+
]);
|
|
601
|
+
const handleContentTypeChange = (0, _react.useCallback)((event)=>{
|
|
602
|
+
const nextContentType = event.target.value;
|
|
603
|
+
if (nextContentType === contentTypeValue) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (hasBodyTemplate) {
|
|
607
|
+
setPendingChange({
|
|
608
|
+
kind: 'contentType',
|
|
609
|
+
value: nextContentType
|
|
610
|
+
});
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
onChange(index, {
|
|
614
|
+
...webhookAction,
|
|
615
|
+
contentType: nextContentType
|
|
616
|
+
});
|
|
617
|
+
}, [
|
|
618
|
+
contentTypeValue,
|
|
619
|
+
hasBodyTemplate,
|
|
620
|
+
index,
|
|
621
|
+
onChange,
|
|
622
|
+
webhookAction
|
|
623
|
+
]);
|
|
624
|
+
const handleMethodChange = (0, _react.useCallback)((event)=>{
|
|
625
|
+
const nextMethod = event.target.value;
|
|
626
|
+
if (nextMethod === webhookAction.method) {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
const nextSupportsBody = BODY_METHODS.includes(nextMethod);
|
|
630
|
+
if (!nextSupportsBody && hasBodyTemplate) {
|
|
631
|
+
setPendingChange({
|
|
632
|
+
kind: 'method',
|
|
633
|
+
value: nextMethod
|
|
634
|
+
});
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
onChange(index, {
|
|
638
|
+
...webhookAction,
|
|
639
|
+
method: nextMethod
|
|
640
|
+
});
|
|
641
|
+
}, [
|
|
642
|
+
hasBodyTemplate,
|
|
643
|
+
index,
|
|
644
|
+
onChange,
|
|
645
|
+
webhookAction
|
|
646
|
+
]);
|
|
647
|
+
const handleConfirmClose = (0, _react.useCallback)(()=>{
|
|
648
|
+
setPendingChange(null);
|
|
649
|
+
}, []);
|
|
650
|
+
const handleConfirmApply = (0, _react.useCallback)(()=>{
|
|
651
|
+
if (!pendingChange) {
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
if (pendingChange.kind === 'contentType') {
|
|
655
|
+
onChange(index, {
|
|
656
|
+
...webhookAction,
|
|
657
|
+
contentType: pendingChange.value,
|
|
658
|
+
bodyTemplate: undefined
|
|
659
|
+
});
|
|
660
|
+
} else {
|
|
661
|
+
onChange(index, {
|
|
662
|
+
...webhookAction,
|
|
663
|
+
method: pendingChange.value,
|
|
664
|
+
bodyTemplate: undefined
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
setPendingChange(null);
|
|
668
|
+
}, [
|
|
669
|
+
index,
|
|
670
|
+
onChange,
|
|
671
|
+
pendingChange,
|
|
672
|
+
webhookAction
|
|
673
|
+
]);
|
|
674
|
+
const jsonBodyTemplate = (0, _react.useMemo)(()=>{
|
|
675
|
+
if (webhookAction.contentType === 'json' && webhookAction.bodyTemplate) {
|
|
676
|
+
try {
|
|
677
|
+
return JSON.parse(webhookAction.bodyTemplate);
|
|
678
|
+
} catch {
|
|
679
|
+
return {};
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}, [
|
|
683
|
+
webhookAction.bodyTemplate,
|
|
684
|
+
webhookAction.contentType
|
|
685
|
+
]);
|
|
686
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.DragAndDropElement, {
|
|
687
|
+
data: webhookAction,
|
|
688
|
+
children: [
|
|
689
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
690
|
+
direction: "row",
|
|
691
|
+
alignItems: "center",
|
|
692
|
+
justifyContent: "space-between",
|
|
693
|
+
gap: 4,
|
|
694
|
+
children: [
|
|
695
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
696
|
+
direction: "row",
|
|
697
|
+
gap: 1,
|
|
698
|
+
children: [
|
|
699
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
700
|
+
"data-testid": `column-toggle#${webhookAction.name}`,
|
|
701
|
+
size: "small",
|
|
702
|
+
onClick: ()=>setIsCollapsed(!isCollapsed),
|
|
703
|
+
children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
|
|
704
|
+
}),
|
|
705
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
706
|
+
variant: "overline",
|
|
707
|
+
component: "h4",
|
|
708
|
+
sx: {
|
|
709
|
+
textTransform: 'none'
|
|
710
|
+
},
|
|
711
|
+
children: [
|
|
712
|
+
"WEBHOOK ACTION: ",
|
|
713
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
714
|
+
children: webhookAction.name
|
|
715
|
+
})
|
|
716
|
+
]
|
|
717
|
+
})
|
|
718
|
+
]
|
|
719
|
+
}),
|
|
720
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
721
|
+
direction: "row",
|
|
722
|
+
gap: 1,
|
|
723
|
+
children: [
|
|
724
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
725
|
+
description: "Remove action settings",
|
|
726
|
+
placement: "top",
|
|
727
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
728
|
+
size: "small",
|
|
729
|
+
sx: {
|
|
730
|
+
marginLeft: 'auto'
|
|
731
|
+
},
|
|
732
|
+
onClick: ()=>onRemove(index),
|
|
733
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
734
|
+
}, "delete-action-button")
|
|
735
|
+
}),
|
|
736
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
737
|
+
description: "Reorder action settings",
|
|
738
|
+
placement: "top",
|
|
739
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.DragButton, {
|
|
740
|
+
onMoveUp: onMoveUp,
|
|
741
|
+
onMoveDown: onMoveDown,
|
|
742
|
+
menuSx: {
|
|
743
|
+
'.MuiPaper-root': {
|
|
744
|
+
backgroundColor: (theme)=>theme.palette.background.lighter
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}, "reorder-action-button")
|
|
748
|
+
})
|
|
749
|
+
]
|
|
750
|
+
})
|
|
751
|
+
]
|
|
752
|
+
}),
|
|
753
|
+
!isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
754
|
+
spacing: 2,
|
|
755
|
+
children: [
|
|
756
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
757
|
+
label: "Enabled",
|
|
758
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
759
|
+
checked: action?.enabled ?? false,
|
|
760
|
+
onChange: (e)=>onChange(index, {
|
|
761
|
+
...webhookAction,
|
|
762
|
+
enabled: e.target.checked
|
|
763
|
+
})
|
|
764
|
+
})
|
|
765
|
+
}),
|
|
766
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
767
|
+
direction: "row",
|
|
768
|
+
spacing: 2,
|
|
769
|
+
children: [
|
|
770
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
771
|
+
label: "Action Name",
|
|
772
|
+
size: "small",
|
|
773
|
+
value: webhookAction.name,
|
|
774
|
+
onChange: (e)=>onChange(index, {
|
|
775
|
+
...webhookAction,
|
|
776
|
+
name: e.target.value
|
|
777
|
+
}),
|
|
778
|
+
sx: {
|
|
779
|
+
flexGrow: 1
|
|
780
|
+
}
|
|
781
|
+
}),
|
|
782
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
783
|
+
size: "small",
|
|
784
|
+
sx: {
|
|
785
|
+
minWidth: 120
|
|
786
|
+
},
|
|
787
|
+
children: [
|
|
788
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
789
|
+
children: "Icon"
|
|
790
|
+
}),
|
|
791
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Select, {
|
|
792
|
+
value: webhookAction.icon || '',
|
|
793
|
+
label: "Icon",
|
|
794
|
+
onChange: (e)=>onChange(index, {
|
|
795
|
+
...webhookAction,
|
|
796
|
+
icon: e.target.value || undefined
|
|
797
|
+
}),
|
|
798
|
+
children: [
|
|
799
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
800
|
+
value: "",
|
|
801
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("em", {
|
|
802
|
+
children: "None"
|
|
803
|
+
})
|
|
804
|
+
}),
|
|
805
|
+
ACTION_ICONS.map((iconOption)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
806
|
+
value: iconOption.value,
|
|
807
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
808
|
+
direction: "row",
|
|
809
|
+
alignItems: "center",
|
|
810
|
+
spacing: 1,
|
|
811
|
+
children: [
|
|
812
|
+
iconOption.icon,
|
|
813
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
814
|
+
children: iconOption.label
|
|
815
|
+
})
|
|
816
|
+
]
|
|
817
|
+
})
|
|
818
|
+
}, iconOption.value))
|
|
819
|
+
]
|
|
820
|
+
})
|
|
821
|
+
]
|
|
822
|
+
})
|
|
823
|
+
]
|
|
824
|
+
}),
|
|
825
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
826
|
+
label: "URL",
|
|
827
|
+
size: "small",
|
|
828
|
+
value: webhookAction.url,
|
|
829
|
+
onChange: (e)=>onChange(index, {
|
|
830
|
+
...webhookAction,
|
|
831
|
+
url: e.target.value
|
|
832
|
+
}),
|
|
833
|
+
helperText: URL_HELPER_TEXT,
|
|
834
|
+
fullWidth: true
|
|
835
|
+
}),
|
|
836
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
837
|
+
direction: "row",
|
|
838
|
+
spacing: 2,
|
|
839
|
+
children: [
|
|
840
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
841
|
+
size: "small",
|
|
842
|
+
sx: {
|
|
843
|
+
minWidth: 120
|
|
844
|
+
},
|
|
845
|
+
children: [
|
|
846
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
847
|
+
children: "Method"
|
|
848
|
+
}),
|
|
849
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Select, {
|
|
850
|
+
value: webhookAction.method,
|
|
851
|
+
label: "Method",
|
|
852
|
+
onChange: handleMethodChange,
|
|
853
|
+
children: HTTP_METHODS.map((method)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
854
|
+
value: method,
|
|
855
|
+
children: method
|
|
856
|
+
}, method))
|
|
857
|
+
})
|
|
858
|
+
]
|
|
859
|
+
}),
|
|
860
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
861
|
+
size: "small",
|
|
862
|
+
sx: {
|
|
863
|
+
flexGrow: 1
|
|
864
|
+
},
|
|
865
|
+
children: [
|
|
866
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
867
|
+
children: "Batch Mode"
|
|
868
|
+
}),
|
|
869
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Select, {
|
|
870
|
+
value: webhookAction.batchMode,
|
|
871
|
+
label: "Batch Mode",
|
|
872
|
+
onChange: (e)=>onChange(index, {
|
|
873
|
+
...webhookAction,
|
|
874
|
+
batchMode: e.target.value
|
|
875
|
+
}),
|
|
876
|
+
children: BATCH_MODES.map((mode)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
877
|
+
value: mode.value,
|
|
878
|
+
children: mode.label
|
|
879
|
+
}, mode.value))
|
|
880
|
+
})
|
|
881
|
+
]
|
|
882
|
+
})
|
|
883
|
+
]
|
|
884
|
+
}),
|
|
885
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
886
|
+
component: "fieldset",
|
|
887
|
+
size: "small",
|
|
888
|
+
children: [
|
|
889
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormLabel, {
|
|
890
|
+
component: "legend",
|
|
891
|
+
children: "Content Type"
|
|
892
|
+
}),
|
|
893
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.RadioGroup, {
|
|
894
|
+
row: true,
|
|
895
|
+
value: contentTypeValue,
|
|
896
|
+
onChange: handleContentTypeChange,
|
|
897
|
+
children: CONTENT_TYPES.map((option)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
898
|
+
value: option.value,
|
|
899
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Radio, {
|
|
900
|
+
size: "small"
|
|
901
|
+
}),
|
|
902
|
+
label: option.label
|
|
903
|
+
}, option.value))
|
|
904
|
+
})
|
|
905
|
+
]
|
|
906
|
+
}),
|
|
907
|
+
supportsBody && contentTypeValue !== 'none' && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
908
|
+
children: [
|
|
909
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
910
|
+
variant: "body2",
|
|
911
|
+
color: "text.secondary",
|
|
912
|
+
sx: {
|
|
913
|
+
mb: 1
|
|
914
|
+
},
|
|
915
|
+
children: contentTypeValue === 'json' ? 'Body Template (JSON)' : 'Body Template (Text)'
|
|
916
|
+
}),
|
|
917
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(InterpolationHelper, {
|
|
918
|
+
batchMode: webhookAction.batchMode
|
|
919
|
+
}),
|
|
920
|
+
contentTypeValue === 'json' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.JSONEditor, {
|
|
921
|
+
value: jsonBodyTemplate || '',
|
|
922
|
+
onChange: handleBodyTemplateChange,
|
|
923
|
+
minHeight: "100px",
|
|
924
|
+
maxHeight: "200px"
|
|
925
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
926
|
+
value: webhookAction.bodyTemplate || '',
|
|
927
|
+
onChange: handleTextTemplateChange,
|
|
928
|
+
fullWidth: true,
|
|
929
|
+
multiline: true,
|
|
930
|
+
rows: 5
|
|
931
|
+
})
|
|
932
|
+
]
|
|
933
|
+
}),
|
|
934
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
935
|
+
label: "Confirmation Message (optional)",
|
|
936
|
+
size: "small",
|
|
937
|
+
value: webhookAction.confirmMessage || '',
|
|
938
|
+
onChange: (e)=>onChange(index, {
|
|
939
|
+
...webhookAction,
|
|
940
|
+
confirmMessage: e.target.value || undefined
|
|
941
|
+
}),
|
|
942
|
+
helperText: "If set, shows a confirmation dialog before executing the action",
|
|
943
|
+
fullWidth: true,
|
|
944
|
+
multiline: true,
|
|
945
|
+
rows: 2
|
|
946
|
+
})
|
|
947
|
+
]
|
|
948
|
+
}),
|
|
949
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Dialog, {
|
|
950
|
+
open: Boolean(pendingChange),
|
|
951
|
+
onClose: handleConfirmClose,
|
|
952
|
+
"aria-labelledby": "selection-body-clear-title",
|
|
953
|
+
children: [
|
|
954
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogTitle, {
|
|
955
|
+
id: "selection-body-clear-title",
|
|
956
|
+
children: "Remove Body Template?"
|
|
957
|
+
}),
|
|
958
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogContent, {
|
|
959
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogContentText, {
|
|
960
|
+
children: BODY_CLEAR_CONFIRM_MESSAGE
|
|
961
|
+
})
|
|
962
|
+
}),
|
|
963
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.DialogActions, {
|
|
964
|
+
children: [
|
|
965
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
966
|
+
onClick: handleConfirmClose,
|
|
967
|
+
children: "Cancel"
|
|
968
|
+
}),
|
|
969
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
970
|
+
onClick: handleConfirmApply,
|
|
971
|
+
variant: "contained",
|
|
972
|
+
color: "primary",
|
|
973
|
+
children: "Continue"
|
|
974
|
+
})
|
|
975
|
+
]
|
|
976
|
+
})
|
|
977
|
+
]
|
|
978
|
+
})
|
|
979
|
+
]
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
function ItemSelectionActionsEditor({ actionOptions, selectionOptions, onChangeActions, onChangeSelection }) {
|
|
983
|
+
const actions = (0, _react.useMemo)(()=>actionOptions || {
|
|
984
|
+
enabled: true,
|
|
985
|
+
displayInHeader: true,
|
|
986
|
+
displayWithItem: false
|
|
987
|
+
}, [
|
|
988
|
+
actionOptions
|
|
989
|
+
]);
|
|
990
|
+
const handleEnableActionsChange = (_, checked)=>{
|
|
991
|
+
onChangeActions({
|
|
992
|
+
...actions,
|
|
993
|
+
enabled: checked ? true : undefined
|
|
994
|
+
});
|
|
995
|
+
};
|
|
996
|
+
const handleEnableSelectionChange = (_, checked)=>{
|
|
997
|
+
onChangeSelection({
|
|
998
|
+
...selectionOptions,
|
|
999
|
+
enabled: checked ? true : undefined
|
|
1000
|
+
});
|
|
1001
|
+
};
|
|
1002
|
+
const handleDisplayInHeaderChange = (_, checked)=>{
|
|
1003
|
+
onChangeActions({
|
|
1004
|
+
...actions,
|
|
1005
|
+
displayInHeader: checked ? true : undefined
|
|
1006
|
+
});
|
|
1007
|
+
};
|
|
1008
|
+
const handleDisplayWithItemChange = (_, checked)=>{
|
|
1009
|
+
onChangeActions({
|
|
1010
|
+
...actions,
|
|
1011
|
+
displayWithItem: checked ? true : undefined
|
|
1012
|
+
});
|
|
1013
|
+
};
|
|
1014
|
+
const handleAddEventAction = (0, _react.useCallback)(()=>{
|
|
1015
|
+
onChangeActions({
|
|
1016
|
+
...actions,
|
|
1017
|
+
actionsList: [
|
|
1018
|
+
...actions.actionsList ?? [],
|
|
1019
|
+
createDefaultEventAction()
|
|
1020
|
+
]
|
|
1021
|
+
});
|
|
1022
|
+
}, [
|
|
1023
|
+
actions,
|
|
1024
|
+
onChangeActions
|
|
1025
|
+
]);
|
|
1026
|
+
const handleAddWebhookAction = (0, _react.useCallback)(()=>{
|
|
1027
|
+
onChangeActions({
|
|
1028
|
+
...actions,
|
|
1029
|
+
actionsList: [
|
|
1030
|
+
...actions.actionsList ?? [],
|
|
1031
|
+
createDefaultWebhookAction()
|
|
1032
|
+
]
|
|
1033
|
+
});
|
|
1034
|
+
}, [
|
|
1035
|
+
actions,
|
|
1036
|
+
onChangeActions
|
|
1037
|
+
]);
|
|
1038
|
+
const handleActionChange = (0, _react.useCallback)((index, updatedAction)=>{
|
|
1039
|
+
const newActions = actions.actionsList ? [
|
|
1040
|
+
...actions.actionsList
|
|
1041
|
+
] : [];
|
|
1042
|
+
newActions[index] = updatedAction;
|
|
1043
|
+
onChangeActions({
|
|
1044
|
+
...actions,
|
|
1045
|
+
actionsList: newActions
|
|
1046
|
+
});
|
|
1047
|
+
}, [
|
|
1048
|
+
actions,
|
|
1049
|
+
onChangeActions
|
|
1050
|
+
]);
|
|
1051
|
+
const handleRemoveAction = (0, _react.useCallback)((index)=>{
|
|
1052
|
+
const newActions = actions.actionsList ? actions.actionsList.filter((_, i)=>i !== index) : [];
|
|
1053
|
+
onChangeActions(newActions.length > 0 ? {
|
|
1054
|
+
...actions,
|
|
1055
|
+
actionsList: newActions
|
|
1056
|
+
} : undefined);
|
|
1057
|
+
}, [
|
|
1058
|
+
actions,
|
|
1059
|
+
onChangeActions
|
|
1060
|
+
]);
|
|
1061
|
+
(0, _components.useDragAndDropMonitor)({
|
|
1062
|
+
elements: actions.actionsList,
|
|
1063
|
+
accessKey: 'name',
|
|
1064
|
+
onChange: (newElements)=>{
|
|
1065
|
+
onChangeActions({
|
|
1066
|
+
...actions,
|
|
1067
|
+
actionsList: newElements
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
1072
|
+
spacing: 1,
|
|
1073
|
+
children: [
|
|
1074
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
1075
|
+
label: "Enable Item Selection",
|
|
1076
|
+
description: "Allow selecting items",
|
|
1077
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
1078
|
+
checked: selectionOptions?.enabled ?? false,
|
|
1079
|
+
onChange: handleEnableSelectionChange
|
|
1080
|
+
})
|
|
1081
|
+
}),
|
|
1082
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
1083
|
+
label: "Enable Item Actions",
|
|
1084
|
+
description: "Allow executing actions on selected items",
|
|
1085
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
1086
|
+
checked: actionOptions?.enabled ?? false,
|
|
1087
|
+
onChange: handleEnableActionsChange
|
|
1088
|
+
})
|
|
1089
|
+
}),
|
|
1090
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
1091
|
+
label: "Display Actions in Panel Header",
|
|
1092
|
+
description: "Show action buttons in the panel header when items are selected",
|
|
1093
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
1094
|
+
checked: actionOptions?.displayInHeader ?? false,
|
|
1095
|
+
onChange: handleDisplayInHeaderChange
|
|
1096
|
+
})
|
|
1097
|
+
}),
|
|
1098
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
1099
|
+
label: "Display Actions with Each Item",
|
|
1100
|
+
description: "Show action buttons alongside each item when selected",
|
|
1101
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
1102
|
+
checked: actionOptions?.displayWithItem ?? false,
|
|
1103
|
+
onChange: handleDisplayWithItemChange
|
|
1104
|
+
})
|
|
1105
|
+
}),
|
|
1106
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorGroup, {
|
|
1107
|
+
title: "Actions",
|
|
1108
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
1109
|
+
spacing: 3,
|
|
1110
|
+
children: [
|
|
1111
|
+
!actions.actionsList || actions.actionsList.length === 0 ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
1112
|
+
variant: "body2",
|
|
1113
|
+
color: "text.secondary",
|
|
1114
|
+
fontStyle: "italic",
|
|
1115
|
+
children: "No actions defined. Add an action to enable triggering events or webhooks on selected data."
|
|
1116
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
1117
|
+
spacing: 1,
|
|
1118
|
+
border: "none",
|
|
1119
|
+
children: actions.actionsList && actions.actionsList.map((action, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
1120
|
+
borderBottom: 1,
|
|
1121
|
+
borderColor: (theme)=>theme.palette.divider,
|
|
1122
|
+
pb: 1,
|
|
1123
|
+
children: action.type === 'event' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(EventActionEditor, {
|
|
1124
|
+
action: action,
|
|
1125
|
+
index: index,
|
|
1126
|
+
onChange: handleActionChange,
|
|
1127
|
+
onRemove: handleRemoveAction,
|
|
1128
|
+
onMoveDown: ()=>onChangeActions({
|
|
1129
|
+
...actions,
|
|
1130
|
+
actionsList: (0, _components.handleMoveDown)(action, actions.actionsList)
|
|
1131
|
+
}),
|
|
1132
|
+
onMoveUp: ()=>onChangeActions({
|
|
1133
|
+
...actions,
|
|
1134
|
+
actionsList: (0, _components.handleMoveUp)(action, actions.actionsList)
|
|
1135
|
+
})
|
|
1136
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(WebhookActionEditor, {
|
|
1137
|
+
action: action,
|
|
1138
|
+
index: index,
|
|
1139
|
+
onChange: handleActionChange,
|
|
1140
|
+
onRemove: handleRemoveAction,
|
|
1141
|
+
onMoveDown: ()=>onChangeActions({
|
|
1142
|
+
...actions,
|
|
1143
|
+
actionsList: (0, _components.handleMoveDown)(action, actions.actionsList)
|
|
1144
|
+
}),
|
|
1145
|
+
onMoveUp: ()=>onChangeActions({
|
|
1146
|
+
...actions,
|
|
1147
|
+
actionsList: (0, _components.handleMoveUp)(action, actions.actionsList)
|
|
1148
|
+
})
|
|
1149
|
+
})
|
|
1150
|
+
}, index))
|
|
1151
|
+
}),
|
|
1152
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
1153
|
+
direction: "row",
|
|
1154
|
+
spacing: 1,
|
|
1155
|
+
children: [
|
|
1156
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
1157
|
+
variant: "contained",
|
|
1158
|
+
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
|
|
1159
|
+
onClick: handleAddEventAction,
|
|
1160
|
+
children: "Add Event Action"
|
|
1161
|
+
}),
|
|
1162
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
1163
|
+
variant: "contained",
|
|
1164
|
+
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
|
|
1165
|
+
onClick: handleAddWebhookAction,
|
|
1166
|
+
children: "Add Webhook Action"
|
|
1167
|
+
})
|
|
1168
|
+
]
|
|
1169
|
+
})
|
|
1170
|
+
]
|
|
1171
|
+
})
|
|
1172
|
+
})
|
|
1173
|
+
]
|
|
1174
|
+
});
|
|
1175
|
+
}
|