diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ed7e41d6..b3063f7d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ 1. [#2919](https://github.com/influxdata/chronograf/pull/2919): Automatically add graph type 'line' to any graph missing a type 1. [#2970](https://github.com/influxdata/chronograf/pull/2970): Fix hanging browser on docker host dashboard 1. [#3006](https://github.com/influxdata/chronograf/pull/3006): Fix Kapacitor Rules task enabled checkboxes to only toggle exactly as clicked +1. [#3048](https://github.com/influxdata/chronograf/pull/3048): Prevent Multi-Select Dropdown in InfluxDB Admin Users and Roles tabs from losing selection state ## v1.4.2.3 [2018-03-08] diff --git a/ui/src/admin/components/RoleRow.js b/ui/src/admin/components/RoleRow.js index 94afb37db..c5abf73ea 100644 --- a/ui/src/admin/components/RoleRow.js +++ b/ui/src/admin/components/RoleRow.js @@ -77,6 +77,7 @@ const RoleRow = ({ customClass={classnames(`dropdown-${ROLES_TABLE.colPermissions}`, { 'admin-table--multi-select-empty': !permissions.length, })} + resetStateOnReceiveProps={false} /> ) : null} @@ -92,6 +93,7 @@ const RoleRow = ({ customClass={classnames(`dropdown-${ROLES_TABLE.colUsers}`, { 'admin-table--multi-select-empty': !users.length, })} + resetStateOnReceiveProps={false} /> ) : null} diff --git a/ui/src/admin/components/UserRow.js b/ui/src/admin/components/UserRow.js index d35b69280..88cf2254d 100644 --- a/ui/src/admin/components/UserRow.js +++ b/ui/src/admin/components/UserRow.js @@ -96,6 +96,7 @@ const UserRow = ({ customClass={classnames(`dropdown-${USERS_TABLE.colRoles}`, { 'admin-table--multi-select-empty': !roles.length, })} + resetStateOnReceiveProps={false} /> ) : null} @@ -113,6 +114,7 @@ const UserRow = ({ customClass={classnames(`dropdown-${USERS_TABLE.colPermissions}`, { 'admin-table--multi-select-empty': !permissions.length, })} + resetStateOnReceiveProps={false} /> ) : null} diff --git a/ui/src/shared/components/MultiSelectDropdown.js b/ui/src/shared/components/MultiSelectDropdown.js index c54a404e5..77b954329 100644 --- a/ui/src/shared/components/MultiSelectDropdown.js +++ b/ui/src/shared/components/MultiSelectDropdown.js @@ -40,7 +40,10 @@ class MultiSelectDropdown extends Component { } componentWillReceiveProps(nextProps) { - if (!_.isEqual(this.props.selectedItems, nextProps.selectedItems)) { + if ( + !this.props.resetStateOnReceiveProps || + !_.isEqual(this.props.selectedItems, nextProps.selectedItems) + ) { return } @@ -106,17 +109,16 @@ class MultiSelectDropdown extends Component { renderMenu() { const {items, isApplyShown} = this.props - const applyButton = isApplyShown ? ( -
  • - -
  • - ) : null return (