Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alerting] Fixed bug with no possibility to edit the index name after adding #64033

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,27 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
expect(await testSubjects.exists('preconfiguredBadge')).to.be(true);
expect(await testSubjects.exists('saveEditedActionButton')).to.be(false);
});

it('should be able to clear selected index on index connector form', async () => {
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
await pageObjects.common.navigateToApp('triggersActions');
await testSubjects.click('connectorsTab');
await pageObjects.triggersActionsUI.clickCreateConnectorButton();

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

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

const indexValueBeforeClear = await find.byCssSelector('.euiComboBoxPill');
expect(await indexValueBeforeClear.getAttribute('value')).to.be('.kibana');

await testSubjects.click('comboBoxClearButton');

const indexValueAfterClear = await find.byCssSelector('.euiComboBoxPill');
expect(await indexValueAfterClear.getAttribute('value')).to.be('');
});
});
};