diff --git a/CHANGELOG.md b/CHANGELOG.md index b5d56d1..70f3983 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ [Full Changelog](https://github.com/folio-org/ui-plugin-find-user/compare/v7.1.0...v7.1.1) * Fix Select User Modal with User Assignment Status Filters pagination issue. Refs UIPFU-87. +* Add `Cancel` and `New` button to support Routing list feature and fix select all toggle button issue. Refs UIPFU-89. ## [7.1.0](https://github.com/folio-org/ui-plugin-find-user/tree/v7.1.0) (2024-03-20) [Full Changelog](https://github.com/folio-org/ui-plugin-find-user/compare/v7.0.0...v7.1.0) diff --git a/src/UserSearchModal.js b/src/UserSearchModal.js index 4a4f360..b0bd7d8 100644 --- a/src/UserSearchModal.js +++ b/src/UserSearchModal.js @@ -39,6 +39,7 @@ class UserSearchModal extends Component { }), }), tenantId: PropTypes.string, + showCreateUserButton: PropTypes.bool, } static defaultProps = { @@ -91,6 +92,7 @@ class UserSearchModal extends Component { initialSelectedUsers, tenantId, stripes, + showCreateUserButton = false, } = this.props; return ( @@ -116,8 +118,10 @@ class UserSearchModal extends Component { {...viewProps} onSaveMultiple={this.passUsersOut} onSelectRow={this.passUserOut} + onClose={this.closeModal} isMultiSelect={Boolean(selectUsers)} initialSelectedUsers={initialSelectedUsers} + showCreateUserButton={showCreateUserButton} />} diff --git a/src/UserSearchView.js b/src/UserSearchView.js index ae88afa..8b43eb6 100644 --- a/src/UserSearchView.js +++ b/src/UserSearchView.js @@ -24,6 +24,7 @@ import { SearchAndSortSearchButton as FilterPaneToggle, } from '@folio/stripes/smart-components'; +import { CREATE_USER_URL } from './constants'; import filterConfig, { filterConfigWithUserAssignedStatus } from './filterConfig'; import Filters from './Filters'; @@ -58,6 +59,7 @@ class UserSearchView extends React.Component { idPrefix: PropTypes.string, isMultiSelect: PropTypes.bool, onSelectRow: PropTypes.func, + onClose: PropTypes.func, onSaveMultiple: PropTypes.func, onComponentWillUnmount: PropTypes.func, queryGetter: PropTypes.func, @@ -67,6 +69,7 @@ class UserSearchView extends React.Component { data: PropTypes.object, onNeedMoreData: PropTypes.func, visibleColumns: PropTypes.arrayOf(PropTypes.string), + showCreateUserButton: PropTypes.bool, resultOffset: PropTypes.shape({ replace: PropTypes.func.isRequired, }), @@ -146,7 +149,7 @@ class UserSearchView extends React.Component { this.setState((state, props) => { const isAllChecked = !state.isAllChecked; const { data: { users } } = props; - const checkedMap = reduceUsersToMap(users, isAllChecked); + const checkedMap = reduceUsersToMap(users.records, isAllChecked); return { checkedMap, @@ -196,6 +199,8 @@ class UserSearchView extends React.Component { isMultiSelect, resultOffset, initialSelectedUsers, + onClose, + showCreateUserButton, } = this.props; const { checkedMap, isAllChecked } = this.state; @@ -258,6 +263,17 @@ class UserSearchView extends React.Component { email: user => get(user, ['personal', 'email']), }; + const createUserButton = ( + + ); + return ( <>