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

[Actions] Back Button on Add Connector Flyout #80160

Merged
merged 6 commits into from
Oct 16, 2020
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 @@ -75,6 +75,8 @@ describe('connector_add_flyout', () => {
);
expect(wrapper.find('ActionTypeMenu')).toHaveLength(1);
expect(wrapper.find(`[data-test-subj="${actionType.id}-card"]`).exists()).toBeTruthy();
expect(wrapper.find('[data-test-subj="cancelButton"]').exists()).toBeTruthy();
expect(wrapper.find('[data-test-subj="backButton"]').exists()).toBeFalsy();
});

it('renders banner with subscription links when gold features are disabled due to licensing ', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,31 @@ export const ConnectorAddFlyout = ({
<EuiFlyoutFooter>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiButtonEmpty onClick={closeFlyout}>
{i18n.translate(
'xpack.triggersActionsUI.sections.actionConnectorAdd.cancelButtonLabel',
{
defaultMessage: 'Cancel',
}
)}
</EuiButtonEmpty>
{!actionType ? (
<EuiButtonEmpty data-test-subj="cancelButton" onClick={closeFlyout}>
{i18n.translate(
'xpack.triggersActionsUI.sections.actionConnectorAdd.cancelButtonLabel',
{
defaultMessage: 'Cancel',
}
)}
</EuiButtonEmpty>
) : (
<EuiButtonEmpty
data-test-subj="backButton"
onClick={() => {
setActionType(undefined);
setConnector(initialConnector);
}}
>
{i18n.translate(
'xpack.triggersActionsUI.sections.actionConnectorAdd.backButtonLabel',
{
defaultMessage: 'Back',
}
)}
</EuiButtonEmpty>
)}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup justifyContent="spaceBetween">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await pageObjects.triggersActionsUI.clickCreateConnectorButton();

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

await find.clickByCssSelector('[data-test-subj="backButton"]');

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

await testSubjects.setValue('nameInput', connectorName);
Expand Down