Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Added global permissions for get read-access to values such as tenant’s locale, timezone, and currency. Refs UICHKOUT-983.
* Added focus improvement for modal. Refs UICHKOUT-982.
* Add 'subscribesTo' field for servicepoints in package.json. Refs UICHKOUT-882.
* *BREAKING* Replace `users/configurations/entry` endpoint with `users/settings/entries` for user settings. Refs UICHKOUT-987.

## [12.0.2] (https://github.com/folio-org/ui-checkout/tree/v12.0.2) (2025-10-29)
[Full Changelog](https://github.com/folio-org/ui-checkout/compare/v12.0.1...v12.0.2)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"loan-storage": "7.4",
"loan-policy-storage": "1.0 2.0",
"users": "16.4",
"users.settings": "1.0",
"inventory": "10.0 11.0 12.0 13.0 14.0",
"automated-patron-blocks": "0.1",
"notes": "4.0"
Expand Down Expand Up @@ -71,7 +72,7 @@
"circulation.end-patron-action-session.post",
"configuration.entries.collection.get",
"note.links.collection.get",
"users.configurations.item.get"
"users.settings.collection.get"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/CheckOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CheckOut extends React.Component {
},
settings: {
type: 'okapi',
path: 'users/configurations/entry',
path: 'users/settings/entries',
},
loans: {
type: 'okapi',
Expand Down Expand Up @@ -156,7 +156,7 @@ class CheckOut extends React.Component {
}),
settings: PropTypes.shape({
records: PropTypes.arrayOf(PropTypes.shape({
enabled: PropTypes.bool,
settings: PropTypes.arrayOf(PropTypes.object),
})),
}),
checkoutSettings: PropTypes.shape({
Expand Down Expand Up @@ -653,7 +653,7 @@ class CheckOut extends React.Component {
const itemInitialValue = this.shouldSubmitAutomatically ? { item: { barcode: location.state.itemBarcode } } : {};
const checkoutSettings = get(resources, ['checkoutSettings', 'records'], []);
const patrons = get(resources, ['patrons', 'records'], []);
const settings = get(resources, ['settings', 'records'], []);
const settings = resources.settings?.records?.[0]?.settings || [];
const {
manualPatronBlocks,
automatedPatronBlocks,
Expand Down
7 changes: 3 additions & 4 deletions src/components/UserDetail/UserDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Loans from './Loans';

import {
MAX_RECORDS,
PROFILE_PICTURE_CONFIG_KEY,
} from '../../constants';

import css from './UserDetail.css';
Expand Down Expand Up @@ -60,9 +61,7 @@ class UserDetail extends React.Component {
}),
id: PropTypes.string.isRequired,
label: PropTypes.node,
settings: PropTypes.arrayOf(PropTypes.shape({
enabled: PropTypes.bool,
})).isRequired,
settings: PropTypes.arrayOf(PropTypes.object).isRequired,
ariaLabel: PropTypes.node,
resources: PropTypes.shape({
patronGroups: PropTypes.shape({
Expand Down Expand Up @@ -139,7 +138,7 @@ class UserDetail extends React.Component {
const patronGroup = patronGroups[0] || {};
const statusVal = (get(user, ['active'], '') ? 'ui-checkout.active' : 'ui-checkout.inactive');
const profilePictureLink = user?.personal?.profilePictureLink;
const profilePicturesEnabled = Boolean(settings.length) && settings[0].enabled;
const profilePicturesEnabled = settings.find(setting => setting.key === PROFILE_PICTURE_CONFIG_KEY)?.value?.enabled;
const hasViewProfilePicturePerm = stripes.hasPerm('ui-users.profile-pictures.view');
const displayProfilePicture = profilePicturesEnabled && hasViewProfilePicturePerm;

Expand Down
6 changes: 4 additions & 2 deletions src/components/UserDetail/UserDetail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ const basicProps = {
id: 'id',
label: 'label',
settings: [{
value: 'true',
enabled: true,
value: {
enabled: true,
},
key: 'PROFILE_PICTURE_CONFIG',
}],
resources: {
patronGroups: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/ViewPatron/ViewPatron.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ class ViewPatron extends React.Component {
formatMessage: PropTypes.func.isRequired,
}).isRequired,
patronBlocks: PropTypes.arrayOf(PropTypes.object),
settings: PropTypes.arrayOf(PropTypes.shape({
enabled: PropTypes.bool,
})),
settings: PropTypes.arrayOf(PropTypes.object),
};

constructor(props) {
Expand Down
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ export const OPEN_REQUEST_STATUSES = {
export const DCB_INSTANCE_ID = '9d1b77e4-f02e-4b7f-b296-3f2042ddac54';
export const DCB_HOLDINGS_RECORD_ID = '10cd3a5a-d36f-4c7a-bc4f-e1ae3cf820c9';

export const PROFILE_PICTURE_CONFIG_KEY = 'PROFILE_PICTURE_CONFIG';

export default '';