From 48b0af10aef3098e988f6119839c8e26d61caaf5 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Wed, 11 Jul 2018 13:03:53 -0400 Subject: [PATCH 1/4] Give close button on flyout a data-test-subj --- src/components/flyout/flyout.js | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/components/flyout/flyout.js b/src/components/flyout/flyout.js index 7f518341fe9..b48864910c9 100644 --- a/src/components/flyout/flyout.js +++ b/src/components/flyout/flyout.js @@ -1,6 +1,4 @@ -import React, { - Component, -} from 'react'; +import React, { Component } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; import FocusTrap from 'focus-trap-react'; @@ -28,21 +26,9 @@ export class EuiFlyout extends Component { }; render() { - const { - className, - children, - hideCloseButton, - onClose, - ownFocus, - size, - ...rest - } = this.props; + const { className, children, hideCloseButton, onClose, ownFocus, size, ...rest } = this.props; - const classes = classnames( - 'euiFlyout', - sizeToClassNameMap[size], - className - ); + const classes = classnames('euiFlyout', sizeToClassNameMap[size], className); let closeButton; if (onClose && !hideCloseButton) { @@ -53,6 +39,7 @@ export class EuiFlyout extends Component { color="text" aria-label="Closes this dialog" onClick={onClose} + data-test-subj="euiFlyoutCloseButton" /> ); } @@ -60,7 +47,9 @@ export class EuiFlyout extends Component { const flyoutContent = (
{ this.flyout = node; }} + ref={node => { + this.flyout = node; + }} className={classes} tabIndex={0} onKeyDown={this.onKeyDown} @@ -75,9 +64,7 @@ export class EuiFlyout extends Component { // to click it to close it. let optionalOverlay; if (ownFocus) { - optionalOverlay = ( - - ); + optionalOverlay = ; } return ( From 389a934a407489de39415d0777f0bd63592b184f Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Wed, 11 Jul 2018 13:10:29 -0400 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01cdfb07e2f..6b6bb865999 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Gave Flyout close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000/files)) - Changed `EuiXYChart` components exports to `/experimental` subfolder ([#975](https://github.com/elastic/eui/pull/975)) - Added beta version of `EuiXYChart` and associated components ([#309](https://github.com/elastic/eui/pull/309)) From 0f63bb548f696c819a824bba14dae00a045526b1 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Wed, 11 Jul 2018 14:35:14 -0400 Subject: [PATCH 3/4] Update jest snapshots and improve changelod message --- CHANGELOG.md | 2 +- src/components/flyout/__snapshots__/flyout.test.js.snap | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd7c26c972c..e2d5fc6a01c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -- Gave Flyout close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000/files)) +- Gave`EuiFlyout` close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000/files)) ## [`1.2.1`](https://github.com/elastic/eui/tree/v1.2.1) diff --git a/src/components/flyout/__snapshots__/flyout.test.js.snap b/src/components/flyout/__snapshots__/flyout.test.js.snap index f922abf7d05..e1acc04f82e 100644 --- a/src/components/flyout/__snapshots__/flyout.test.js.snap +++ b/src/components/flyout/__snapshots__/flyout.test.js.snap @@ -13,6 +13,7 @@ exports[`EuiFlyout is rendered 1`] = `