Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug with no possibility to edit the index name after adding
Browse files Browse the repository at this point in the history
YulNaumenko committed Apr 21, 2020
1 parent f76669b commit 02e680f
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -151,7 +151,7 @@ const IndexActionConnectorFields: React.FunctionComponent<ActionConnectorFieldsP
: []
}
onChange={async (selected: EuiComboBoxOptionOption[]) => {
editActionConfig('index', selected[0].value);
editActionConfig('index', selected.length > 0 ? selected[0].value : '');
const indices = selected.map(s => s.value as string);

// reset time field and expression fields if indices are deleted
Original file line number Diff line number Diff line change
@@ -209,5 +209,23 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
expect(await testSubjects.exists('preconfiguredBadge')).to.be(true);
expect(await testSubjects.exists('saveEditedActionButton')).to.be(false);
});

it('should not be able to clear selected index on index connector form', async () => {
await pageObjects.triggersActionsUI.clickCreateConnectorButton();

await testSubjects.click('.index-card');

const indexComboBox = await testSubjects.find('connectorIndexesComboBox');
await indexComboBox.click();
await indexComboBox.type('k');
const filterSelectItem = await find.byCssSelector(`.euiFilterSelectItem`);
await filterSelectItem.click();

expect(await indexComboBox.getVisibleText()).to.be('.kibana');

await testSubjects.click('comboBoxClearButton');

expect(await indexComboBox.getVisibleText()).to.be('');
});
});
};

0 comments on commit 02e680f

Please sign in to comment.