From 9c75c475cba7e028d1f716baebab64b99ddf680f Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 5 Feb 2019 09:52:42 -0600 Subject: [PATCH 1/4] misc form row fixes --- .../__snapshots__/described_form_group.test.js.snap | 4 ++-- .../form/described_form_group/described_form_group.js | 2 +- src/components/form/form_row/form_row.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap b/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap index c82f7c23d8c..a6b364a116a 100644 --- a/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap +++ b/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap @@ -419,7 +419,7 @@ exports[`EuiDescribedFormGroup ties together parts for accessibility 1`] = `
( - + {error} )); From f4759eda9a7ff8d7cef3ce1b6f8ca34b542e5954 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 5 Feb 2019 10:17:37 -0600 Subject: [PATCH 2/4] #1522 changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2b528e3206..789d1635533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fixed React key usage in `EuiPagination` ([#1514](https://github.com/elastic/eui/pull/1514)) - Fixed bug which prevented `EuiSwitch` with generated ID from having its label announced by VoiceOver ([#1519](https://github.com/elastic/eui/pull/1519)) - Fixed `EuiFilterButton` handling `numFilters` when `0` was specified ([#1510](https://github.com/elastic/eui/pull/1510)) +- Fixed `EuiFormRow` errors from the possibility of having duplicate `key` values ([#1522](https://github.com/elastic/eui/pull/1522)) ## [`6.8.0`](https://github.com/elastic/eui/tree/v6.8.0) From a7ef19f8ce84a31bf3ed9797215884d5ee8acc41 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 5 Feb 2019 11:03:15 -0600 Subject: [PATCH 3/4] use error as key; changelog update --- CHANGELOG.md | 2 +- .../__snapshots__/described_form_group.test.js.snap | 4 ++-- src/components/form/form_row/form_row.js | 13 ++++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 789d1635533..319b74606fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Fixed React key usage in `EuiPagination` ([#1514](https://github.com/elastic/eui/pull/1514)) - Fixed bug which prevented `EuiSwitch` with generated ID from having its label announced by VoiceOver ([#1519](https://github.com/elastic/eui/pull/1519)) - Fixed `EuiFilterButton` handling `numFilters` when `0` was specified ([#1510](https://github.com/elastic/eui/pull/1510)) -- Fixed `EuiFormRow` errors from the possibility of having duplicate `key` values ([#1522](https://github.com/elastic/eui/pull/1522)) +- Fixed `EuiFormRow` errors from the possibility of having duplicate `key` values. Allow `EuiDescribedFormGroup` to exist as a description-only row. ([#1522](https://github.com/elastic/eui/pull/1522)) ## [`6.8.0`](https://github.com/elastic/eui/tree/v6.8.0) diff --git a/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap b/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap index a6b364a116a..c82f7c23d8c 100644 --- a/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap +++ b/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap @@ -419,7 +419,7 @@ exports[`EuiDescribedFormGroup ties together parts for accessibility 1`] = `
( - - {error} - - )); + optionalErrors = errorTexts.map((error, i) =>{ + const key = typeof error === 'string' ? error : i; + return ( + + {error} + + );} + ); } let optionalLabel; From 88733a133e7b1f9b22554c6123ef5e39e42f9dd3 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Wed, 27 Feb 2019 12:51:26 -0600 Subject: [PATCH 4/4] update changelog entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6064033b4e..6360c674459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added `numActiveFilters` prop to `EuiFilterButton` ([#1589](https://github.com/elastic/eui/pull/1589)) - Updated style of `EuiFilterButton` to match `EuiFacetButton` ([#1589](https://github.com/elastic/eui/pull/1589)) - Added `size` and `color` props to `EuiNotificationBadge` ([#1589](https://github.com/elastic/eui/pull/1589)) +- Allow `EuiDescribedFormGroup` to exist as a description-only row ([#1522](https://github.com/elastic/eui/pull/1522)) **Bug fixes** @@ -13,6 +14,7 @@ - Adds missing `hasActiveFilters` prop for `EuiFilterButton` type and fixes `onChange` signature for `EuiButtonGroup` ([#1603](https://github.com/elastic/eui/pull/1603)) - Included `react-datepicker` TS types in EUI itself to avoid outside dependency ([#1618](https://github.com/elastic/eui/pull/1618)) - Prevent `EuiGlobalToastList` from attempting calculations on `null` DOM elements ([#1606](https://github.com/elastic/eui/pull/1606)) +- Fixed `EuiFormRow` errors from the possibility of having duplicate `key` values ([#1522](https://github.com/elastic/eui/pull/1522)) **Breaking changes** @@ -129,7 +131,6 @@ - Fixed React key usage in `EuiPagination` ([#1514](https://github.com/elastic/eui/pull/1514)) - Fixed bug which prevented `EuiSwitch` with generated ID from having its label announced by VoiceOver ([#1519](https://github.com/elastic/eui/pull/1519)) - Fixed `EuiFilterButton` handling `numFilters` when `0` was specified ([#1510](https://github.com/elastic/eui/pull/1510)) -- Fixed `EuiFormRow` errors from the possibility of having duplicate `key` values. Allow `EuiDescribedFormGroup` to exist as a description-only row. ([#1522](https://github.com/elastic/eui/pull/1522)) ## [`6.8.0`](https://github.com/elastic/eui/tree/v6.8.0)