diff --git a/docs/management/connectors/action-types/index.asciidoc b/docs/management/connectors/action-types/index.asciidoc index d674ba868686ec..87c7494df23ea6 100644 --- a/docs/management/connectors/action-types/index.asciidoc +++ b/docs/management/connectors/action-types/index.asciidoc @@ -26,8 +26,7 @@ image::management/connectors/images/index-connector.png[Index connector] [[index-connector-configuration]] ==== Connector configuration -Index connectors must have a name and an {es} index. You can optionally set the -{ref}/docs-refresh.html[refresh] policy and the time field, which contains the +Index connectors must have a name and an {es} index. You can optionally set the time field, which contains the details about when each alert condition was detected. [float] @@ -46,10 +45,8 @@ xpack.actions.preconfigured: actionTypeId: .index config: index: .kibana - refresh: true <1> executionTimeField: my-field -- -<1> By default, the {ref}/docs-refresh.html[refresh] policy is `false`. For more information, go to <>. diff --git a/docs/management/connectors/images/index-connector.png b/docs/management/connectors/images/index-connector.png index 438aac772c409b..4ef698b8609461 100644 Binary files a/docs/management/connectors/images/index-connector.png and b/docs/management/connectors/images/index-connector.png differ diff --git a/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.test.tsx index 4fc8752fac2bda..fa3ff05ccb03be 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.test.tsx @@ -99,7 +99,6 @@ describe('IndexActionConnectorFields', () => { const wrapper = await setup(connector); expect(wrapper.find('[data-test-subj="connectorIndexesComboBox"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="indexRefreshCheckbox"]').exists()).toBeTruthy(); // time field switch shouldn't show up initially expect(wrapper.find('[data-test-subj="hasTimeFieldCheckbox"]').exists()).toBeFalsy(); @@ -177,7 +176,6 @@ describe('IndexActionConnectorFields', () => { const wrapper = await setup(props); expect(wrapper.find('[data-test-subj="connectorIndexesComboBox"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="indexRefreshCheckbox"]').exists()).toBeTruthy(); // time related fields shouldn't show up expect(wrapper.find('[data-test-subj="hasTimeFieldCheckbox"]').exists()).toBeFalsy(); @@ -187,9 +185,6 @@ describe('IndexActionConnectorFields', () => { .find(EuiComboBox) .filter('[data-test-subj="connectorIndexesComboBox"]'); expect(indexComboBox.prop('selectedOptions')).toEqual([{ label: indexName, value: indexName }]); - - const refreshSwitch = wrapper.find(EuiSwitch).filter('[data-test-subj="indexRefreshCheckbox"]'); - expect(refreshSwitch.prop('checked')).toEqual(false); }); test('renders correctly when editing connector - refresh set to true', async () => { @@ -208,7 +203,6 @@ describe('IndexActionConnectorFields', () => { const wrapper = await setup(props); expect(wrapper.find('[data-test-subj="connectorIndexesComboBox"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="indexRefreshCheckbox"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="hasTimeFieldCheckbox"]').exists()).toBeFalsy(); expect(wrapper.find('[data-test-subj="executionTimeFieldSelect"]').exists()).toBeFalsy(); @@ -216,9 +210,6 @@ describe('IndexActionConnectorFields', () => { .find(EuiComboBox) .filter('[data-test-subj="connectorIndexesComboBox"]'); expect(indexComboBox.prop('selectedOptions')).toEqual([{ label: indexName, value: indexName }]); - - const refreshSwitch = wrapper.find(EuiSwitch).filter('[data-test-subj="indexRefreshCheckbox"]'); - expect(refreshSwitch.prop('checked')).toEqual(true); }); test('renders correctly when editing connector - with date type field mapping but no time field selected', async () => { @@ -238,7 +229,6 @@ describe('IndexActionConnectorFields', () => { await waitFor(() => { expect(wrapper.find('[data-test-subj="connectorIndexesComboBox"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="indexRefreshCheckbox"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="hasTimeFieldCheckbox"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="executionTimeFieldSelect"]').exists()).toBeFalsy(); }); @@ -248,9 +238,6 @@ describe('IndexActionConnectorFields', () => { .filter('[data-test-subj="connectorIndexesComboBox"]'); expect(indexComboBox.prop('selectedOptions')).toEqual([{ label: indexName, value: indexName }]); - const refreshSwitch = wrapper.find(EuiSwitch).filter('[data-test-subj="indexRefreshCheckbox"]'); - expect(refreshSwitch.prop('checked')).toEqual(false); - const timeFieldSwitch = wrapper .find(EuiSwitch) .filter('[data-test-subj="hasTimeFieldCheckbox"]'); @@ -275,7 +262,6 @@ describe('IndexActionConnectorFields', () => { await waitFor(() => { wrapper.update(); expect(wrapper.find('[data-test-subj="connectorIndexesComboBox"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="indexRefreshCheckbox"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="hasTimeFieldCheckbox"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="executionTimeFieldSelect"]').exists()).toBeTruthy(); }); @@ -285,9 +271,6 @@ describe('IndexActionConnectorFields', () => { .filter('[data-test-subj="connectorIndexesComboBox"]'); expect(indexComboBox.prop('selectedOptions')).toEqual([{ label: indexName, value: indexName }]); - const refreshSwitch = wrapper.find(EuiSwitch).filter('[data-test-subj="indexRefreshCheckbox"]'); - expect(refreshSwitch.prop('checked')).toEqual(false); - const timeFieldSwitch = wrapper .find(EuiSwitch) .filter('[data-test-subj="hasTimeFieldCheckbox"]'); @@ -380,8 +363,8 @@ describe('IndexActionConnectorFields', () => { actionTypeId: '.index', config: { index: 'test_es_index', - refresh: false, executionTimeField: '1', + refresh: false, }, id: 'test', isDeprecated: false, @@ -425,7 +408,6 @@ describe('IndexActionConnectorFields', () => { actionTypeId: '.index', config: { index: 'test_es_index', - refresh: false, }, id: 'test', isDeprecated: false, diff --git a/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.tsx b/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.tsx index ec090c3c004d10..54912f7bd94921 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/es_index/es_index_connector.tsx @@ -29,7 +29,10 @@ import { ToggleField, SelectField } from '@kbn/es-ui-shared-plugin/static/forms/ import { DocLinksStart } from '@kbn/core/public'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import type { ActionConnectorFieldsProps } from '@kbn/triggers-actions-ui-plugin/public'; +import { + type ActionConnectorFieldsProps, + HiddenField, +} from '@kbn/triggers-actions-ui-plugin/public'; import { firstFieldOption, getFields, @@ -131,6 +134,7 @@ const IndexActionConnectorFields: React.FunctionComponent + {(field) => { @@ -214,33 +218,6 @@ const IndexActionConnectorFields: React.FunctionComponent - - {' '} - - - ), - disabled: readOnly, - 'data-test-subj': 'indexRefreshCheckbox', - }, - }} - /> - {showTimeFieldCheckbox ? (