Skip to content

Commit

Permalink
Merge branch 'master' into UIU-3301
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandberger authored Jan 14, 2025
2 parents 9d05d50 + 49a1a0c commit 203d05a
Show file tree
Hide file tree
Showing 24 changed files with 179 additions and 233 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@
## [11.1.0] In progress
* `useUserTenantRoles` supplies `tenantId` in all its queries. Refs UIU-3279.
* Leverage API supported sorting of columns on pre-registrations records list. Refs UIU-3249.
* Add permission to access users-keycloak delete method. Refs UIU-3282.
* Fix issue with `Proxy borrower` field value. Refs UIU-3290.
* Remove duplicates from the keyboard shortcut modal. Refs UIU-3026.
* React v19: refactor away from default props for functional components. Refs. UIU-3141.
* Hide Create block button for user without permission. Refs UIU-3300.
* Add HTML page title to add/edit patron block page. Refs UIU-3302.
* Update fee/fine actions column UX for accessibility. Refs UIU-3027.
* Rename permission after BE changes. Refs UIU-3309.

## [11.0.10](https://github.com/folio-org/ui-users/tree/v11.0.10) (2025-01-10)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.9...v11.0.10)

* Add sub permission `manual-block-templates.collection.get` to permission `Users: Can create, edit and remove patron blocks`. Refs UIU-3305.

## [11.0.9](https://github.com/folio-org/ui-users/tree/v11.0.9) (2024-12-13)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.8...v11.0.9)

* Add permission to access users-keycloak delete method. Refs UIU-3282.
* Check if userId is present in withUserRoles HOC. Refs UIU-3273.
* Add missed permissions for endpoints used in withUserRoles HOC. UIU-3294.
* Add view/manage roles permissions. Refs UIU-3301.
Expand All @@ -20,6 +35,13 @@
* Update permissions for mod-patron. Ref UIU-3259.
* Update permission after BE permission changes. Refs UIU-3288.

## [11.0.6](https://github.com/folio-org/ui-users/tree/v11.0.6) (2024-11-28)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.5...v11.0.6)

* `useUserTenantRoles` supplies `tenantId` in all its queries. Refs UIU-3279.
* Leverage API supported sorting of columns on pre-registrations records list. Refs UIU-3249.
* Show all patron notice print jobs (not just ten random ones), in correct order. Fixes UIU-3269.

## [11.0.5](https://github.com/folio-org/ui-users/tree/v11.0.5) (2024-11-20)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.3...v11.0.5)

Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/users",
"version": "11.0.5",
"version": "11.0.9",
"description": "User management",
"repository": "folio-org/ui-users",
"publishConfig": {
Expand Down Expand Up @@ -571,10 +571,10 @@
"comments.item.get",
"payments.collection.get",
"payments.item.get",
"feesfines.accounts.check-pay.item.post",
"feesfines.accounts-bulk.check-pay.item.post",
"feesfines.accounts.pay.item.post",
"feesfines.accounts-bulk.pay.item.post"
"feesfines.accounts.check-pay.post",
"feesfines.accounts-bulk.check-pay.post",
"feesfines.accounts.pay.post",
"feesfines.accounts-bulk.pay.post"
],
"visible": true
},
Expand All @@ -589,10 +589,10 @@
"comments.item.get",
"waives.collection.get",
"waives.item.get",
"feesfines.accounts.check-waive.item.post",
"feesfines.accounts-bulk.check-waive.item.post",
"feesfines.accounts.waive.item.post",
"feesfines.accounts-bulk.waive.item.post"
"feesfines.accounts.check-waive.post",
"feesfines.accounts-bulk.check-waive.post",
"feesfines.accounts.waive.post",
"feesfines.accounts-bulk.waive.post"
],
"visible": true
},
Expand All @@ -615,6 +615,7 @@
"replaces": ["ui-users.patron_blocks"],
"subPermissions": [
"manualblocks.collection.get",
"manual-block-templates.collection.get",
"manualblocks.item.delete",
"manualblocks.item.get",
"manualblocks.item.post",
Expand Down Expand Up @@ -722,12 +723,12 @@
"ui-users.manual-waive.execute",
"feesfines.accounts.check-transfer.post",
"feesfines.accounts.check-refund.post",
"feesfines.accounts.transfer.item.post",
"feesfines.accounts-bulk.transfer.item.post",
"feesfines.accounts.cancel.item.post",
"feesfines.accounts-bulk.cancel.item.post",
"feesfines.accounts.refund.item.post",
"feesfines.accounts-bulk.refund.item.post",
"feesfines.accounts.transfer.post",
"feesfines.accounts-bulk.transfer.post",
"feesfines.accounts.cancel.post",
"feesfines.accounts-bulk.cancel.post",
"feesfines.accounts.refund.post",
"feesfines.accounts-bulk.refund.post",
"circulation-storage.loans.item.get",
"inventory.items.item.get"
],
Expand Down Expand Up @@ -1008,8 +1009,8 @@
"displayName": "Users: Create and download Cash drawer reconciliation report",
"replaces": ["ui-users.cashDrawerReport"],
"subPermissions": [
"feesfines.feefine-reports.cash-drawer-reconciliation.item.post",
"feesfines.feefine-reports.cash-drawer-reconciliation-source.item.post"
"feesfines.feefine-reports.cash-drawer-reconciliation.post",
"feesfines.feefine-reports.cash-drawer-reconciliation-source.post"
],
"visible": true
},
Expand Down
4 changes: 4 additions & 0 deletions src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const commands = [
name: 'openShortcutModal',
label: (<FormattedMessage id="ui-users.shortcut.openShortcutModal" />),
shortcut: 'mod+alt+k',
},
{
label: (<FormattedMessage id="ui-users.shortcut.expandCollapse" />),
shortcut: 'spacebar'
}
];

Expand Down
31 changes: 0 additions & 31 deletions src/commandsGeneral.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/components/Accounts/ViewFeesFines/ViewFeesFines.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class ViewFeesFines extends React.Component {
'callNumber': f => (f.callNumber ? f.callNumber : '-'),
'dueDate': f => (f.dueDate ? this.formatDateTime(f.dueDate) : '-'),
'returnedDate': f => (this.getLoan(f).returnDate ? this.formatDateTime(this.getLoan(f).returnDate) : '-'),
' ': f => this.renderActions(f, this.getLoan(f)),
'actions': f => this.renderActions(f, this.getLoan(f)),
};
}

Expand Down Expand Up @@ -478,6 +478,7 @@ class ViewFeesFines extends React.Component {
'callNumber': intl.formatMessage({ id: 'ui-users.accounts.history.columns.number' }),
'dueDate': intl.formatMessage({ id: 'ui-users.accounts.history.columns.due' }),
'returnedDate': intl.formatMessage({ id: 'ui-users.accounts.history.columns.returned' }),
'actions': intl.formatMessage({ id: 'ui-users.accounts.history.columns.actions' }),
};

return (
Expand All @@ -499,7 +500,7 @@ class ViewFeesFines extends React.Component {
'callNumber': 110,
'dueDate': 110,
'returnedDate': 110,
' ': 50
'actions': 70
}}
visibleColumns={this.props.visibleColumns}
fullWidth
Expand Down
14 changes: 2 additions & 12 deletions src/components/Accounts/ViewFeesFines/ViewFeesFines.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const defaultProps = {
match: { params: { id: 1 } },
history,
user: { id: '123' },
visibleColumns: [' ', 'metadata.createdDate', 'metadata.updatedDate', 'feeFineType', 'amount', 'remaining', 'paymentStatus.name', 'feeFineOwner', 'title', 'barcode', 'callNumber', 'dueDate', 'returnedDate', ' '],
visibleColumns: [' ', 'metadata.createdDate', 'metadata.updatedDate', 'feeFineType', 'amount', 'remaining', 'paymentStatus.name', 'feeFineOwner', 'title', 'barcode', 'callNumber', 'dueDate', 'returnedDate', 'actions'],
intl: {
formatMessage: ({ id }) => id
},
Expand Down Expand Up @@ -184,17 +184,7 @@ describe('ViewFeesFines', () => {
const checkBox = screen.getAllByRole('checkbox', { name: '' });
userEvent.click(checkBox[1]);
await userEvent.click(screen.queryByText(/ui-users.accounts.history.button.pay/i));
expect(mockOnChangeActions).toHaveBeenCalledWith({ pay: true }, accountsData);
await userEvent.click(screen.queryByText(/ui-users.accounts.history.button.waive/i));
expect(mockOnChangeActions).toHaveBeenCalledWith({ waiveModal: true }, accountsData);
await userEvent.click(screen.queryByText(/ui-users.accounts.history.button.refund/i));
expect(mockOnChangeActions).toHaveBeenCalledWith({ refundModal: true }, accountsData);
await userEvent.click(screen.queryByText(/ui-users.accounts.history.button.transfer/i));
expect(mockOnChangeActions).toHaveBeenCalledWith({ transferModal: true }, accountsData);
await userEvent.click(screen.queryByText(/ui-users.accounts.button.error/i));
expect(mockOnChangeActions).toHaveBeenCalledWith({ cancellation: true }, accountsData);
await userEvent.click(screen.queryByText(/ui-users.accounts.history.button.loanDetails/i));
expect(nav.onClickViewLoanActionsHistory).toBeCalled();
expect(mockOnChangeActions).toHaveBeenCalledWith({ 'refund': true, 'regularpayment': false, 'transfer': false, 'waive': false });
});
it('onClickViewLoanActionsHistory to be called when loanDetails clicked from DropDownMenu', async () => {
renderViewFeesFines(defaultProps);
Expand Down
12 changes: 3 additions & 9 deletions src/components/AffiliationsManager/AffiliationsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { AffiliationsManagerModal } from './AffiliationsManagerModal';
import AffiliationsManagerTrigger from './AffiliationsManagerTrigger';

const AffiliationsManager = ({
disabled,
disabled = false,
onUpdateAffiliations,
renderTrigger,
renderTrigger = AffiliationsManagerTrigger,
userId,
withTrigger,
withTrigger = true,
}) => {
const [isModalOpen, toggleModal] = useToggle(!withTrigger);

Expand All @@ -36,10 +36,4 @@ AffiliationsManager.propTypes = {
withTrigger: PropTypes.bool,
};

AffiliationsManager.defaultProps = {
disabled: false,
renderTrigger: AffiliationsManagerTrigger,
withTrigger: true,
};

export default AffiliationsManager;
6 changes: 1 addition & 5 deletions src/components/AffiliationsSelect/AffiliationsSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Selection } from '@folio/stripes/components';
import { affiliationsShape } from '../../shapes';

const AffiliationsSelect = ({
id,
id = 'user-assigned',
affiliations,
value,
onChange,
Expand Down Expand Up @@ -53,10 +53,6 @@ const AffiliationsSelect = ({
);
};

AffiliationsSelect.defaultProps = {
id: 'user-assigned',
};

AffiliationsSelect.propTypes = {
affiliations: affiliationsShape,
onChange: PropTypes.func.isRequired,
Expand Down
11 changes: 6 additions & 5 deletions src/components/AssignedUsers/AssignedUsersContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ import AssignUsers from './AssignUsers';
import AssignedUsersList from './AssignedUsersList';
import { getUpdatedUsersList } from './utils';

const AssignedUsersContainer = ({ permissionSetId, expanded, onToggle, tenantId }) => {
const AssignedUsersContainer = ({
permissionSetId,
expanded = true,
onToggle,
tenantId
}) => {
const callout = useCallout();
const intl = useIntl();

Expand Down Expand Up @@ -123,8 +128,4 @@ AssignedUsersContainer.propTypes = {
tenantId: PropTypes.string,
};

AssignedUsersContainer.defaultProps = {
expanded: true,
};

export default AssignedUsersContainer;
7 changes: 1 addition & 6 deletions src/components/AssignedUsers/AssignedUsersList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VISIBLE_COLUMNS,
} from './constants';

const AssignedUsersList = ({ users, isFetching }) => (
const AssignedUsersList = ({ users = [], isFetching = false }) => (
<Row
start="xs"
data-test-assigned-users
Expand All @@ -34,9 +34,4 @@ AssignedUsersList.propTypes = {
isFetching: PropTypes.bool,
};

AssignedUsersList.defaultProps = {
users: [],
isFetching: false,
};

export default AssignedUsersList;
7 changes: 1 addition & 6 deletions src/components/BulkRenewalDialog/BulkRenewedLoansList.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@ const propTypes = {
errorMessages: PropTypes.object.isRequired,
};

const defaultProps = {
height: 300,
};

const BulkRenewedLoansList = (props) => {
const {
failedRenewals,
successRenewals,
height,
height = 300,
errorMessages,
requestCounts,
loanPolicies,
Expand Down Expand Up @@ -126,7 +122,6 @@ const BulkRenewedLoansList = (props) => {
);
};

BulkRenewedLoansList.defaultProps = defaultProps;
BulkRenewedLoansList.propTypes = propTypes;

export default BulkRenewedLoansList;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

import { USER_TYPES } from '../../../../../constants';

const ChangeUserTypeModal = ({ onChange, initialUserType, open }) => {
const ChangeUserTypeModal = ({ onChange, initialUserType, open = false }) => {
const userTypeModalFooter = (
<ModalFooter>
<Button
Expand Down Expand Up @@ -47,8 +47,4 @@ ChangeUserTypeModal.propTypes = {
open: PropTypes.bool,
};

ChangeUserTypeModal.defaultProps = {
open: false,
};

export default ChangeUserTypeModal;
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import css from './CheckboxColumn.css';
const CheckboxColumn = memo(props => {
const {
value,
checked,
checked = false,
roleName,
onChange,
onChange = noop,
} = props;

return (
Expand Down Expand Up @@ -39,9 +39,4 @@ CheckboxColumn.propTypes = {
onChange: PropTypes.func,
};

CheckboxColumn.defaultProps = {
checked: false,
onChange: noop,
};

export default CheckboxColumn;
7 changes: 1 addition & 6 deletions src/components/Loans/components/ActionsBar/ActionsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ const propTypes = {
contentEnd: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
};

const defaultProps = {
show: true,
};

const ActionsBar = ({ show, contentStart, contentEnd }) => {
const ActionsBar = ({ show = true, contentStart, contentEnd }) => {
if (!show) {
return null;
}
Expand All @@ -30,6 +26,5 @@ const ActionsBar = ({ show, contentStart, contentEnd }) => {
};

ActionsBar.propTypes = propTypes;
ActionsBar.defaultProps = defaultProps;

export default ActionsBar;
Loading

0 comments on commit 203d05a

Please sign in to comment.