Skip to content

Commit

Permalink
Merge branch 'master' of github.com:folio-org/ui-users into feat/numb…
Browse files Browse the repository at this point in the history
…er_generator
  • Loading branch information
EthanFreestone committed Dec 8, 2023
2 parents 611495a + 1d65b2c commit 2232744
Show file tree
Hide file tree
Showing 35 changed files with 1,168 additions and 419 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@
## [10.1.0] IN PROGRESS

* Also support `feesfines` interface version `19.0`. Refs UIU-2960.
* Disable validation for shadow user. Refs UIU-3000.
* Disable open loan actions for virtual patron. Refs UIU-2964.
* Fix problem with Date field in User app reports does not populate when a first entry was cleared. Refs UIU-2991.
* Hide all actionalble buttons on user details pane for DCB Virtual user. Refs UIU-2987.
* Open loan page modifications for a virtual patron. Refs UIU-2988.
* Display item title and barcode as text when the item is dcb virtual item. Refs UIU-2966.
* Fix wrong date in Cash-Drawer-Reconciliation-Report.pdf. Refs UIU-3010.
* Conditionally hide actions on closed loan records for DCB Circulation. Refs UIU-2989.

## [10.0.4](https://github.com/folio-org/ui-users/tree/v10.0.4) (2023-11-10)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v10.0.3...v10.0.4)

* Correctly handle optional `X-Okapi-token` request header. Refs UIU-2977.
* Fix bug with Edit form Expand/collapse all shortcuts not working. Refs UIU-2959.
* Update patron groups retrieval in user search to hold `maxUnpagedResourceCount`. Refs UIU-2973.
* Update resourceData and queryParams in `UserSearchContainer.js` to escape special characters in tags filter. Refs. UIU-2995.
* Lost item fees not suspended when item is claimed returned from the ellipses in action menu. Refs UIU-2993.

## [10.0.3](https://github.com/folio-org/ui-users/tree/v10.0.3) (2023-10-23)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v10.0.1...v10.0.3)
Expand Down
3 changes: 1 addition & 2 deletions src/components/EditSections/EditUserInfo/EditUserInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ class EditUserInfo extends React.Component {
dataOptions={patronGroupOptions}
defaultValue={initialValues.patronGroup}
aria-required="true"
required
disabled={disabled}
required={!disabled}
/>
<OnChange name="patronGroup">
{(selectedPatronGroup) => {
Expand Down
154 changes: 88 additions & 66 deletions src/components/Loans/ClosedLoans/ClosedLoans.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import {
calculateSortParams,
getChargeFineToLoanPath,
nav,
isDcbUser,
isDCBItem,
} from '../../util';
import ActionsBar from '../components/ActionsBar';
import Label from '../../Label';
Expand Down Expand Up @@ -182,7 +184,7 @@ class ClosedLoans extends React.Component {
}

getLoansFormatter() {
const { intl: { formatMessage } } = this.props;
const { intl: { formatMessage }, user } = this.props;

return {
'title': loan => _.get(loan, ['item', 'title'], ''),
Expand Down Expand Up @@ -242,13 +244,20 @@ class ClosedLoans extends React.Component {
' ': loan => {
return <Dropdown
usePortal
renderTrigger={({ getTriggerProps }) => (
<IconButton
{...getTriggerProps()}
icon="ellipsis"
aria-label={formatMessage({ id: 'ui-users.action' })}
/>
)}
renderTrigger={({ getTriggerProps }) => {
const isVirtualUser = isDcbUser(user);
const isVirtualItem = loan.item && isDCBItem(loan.item);

if (isVirtualUser && isVirtualItem) { return null; }

return (
<IconButton
{...getTriggerProps()}
icon="ellipsis"
aria-label={formatMessage({ id: 'ui-users.action' })}
/>
);
}}
renderMenu={this.renderDropDownMenu(loan)}
/>;
}
Expand Down Expand Up @@ -348,16 +357,19 @@ class ClosedLoans extends React.Component {
const {
stripes,
match: { params },
user,
} = this.props;

const accounts = _.get(this.props.resources, ['loanAccount', 'records'], []);
const accountsLoan = accounts.filter(a => a.loanId === loan.id) || [];
const itemDetailsLink = loan.item && `/inventory/view/${loan.item.instanceId}/${loan.item.holdingsRecordId}/${loan.itemId}`;
const buttonDisabled = !stripes.hasPerm('ui-users.feesfines.actions.all');
const isVirtualUser = isDcbUser(user);
const isVirtualItem = loan.item && isDCBItem(loan.item);

return (
<DropdownMenu data-role="menu">
{itemDetailsLink &&
{itemDetailsLink && !isVirtualItem &&
<IfPermission perm="inventory.items.item.get">
<Button
buttonStyle="dropdownItem"
Expand All @@ -367,24 +379,30 @@ class ClosedLoans extends React.Component {
</Button>
</IfPermission>
}
<Button
data-testid="newFeeFineButton"
disabled={buttonDisabled}
buttonStyle="dropdownItem"
to={getChargeFineToLoanPath(params.id, loan.id)}
>
<FormattedMessage id="ui-users.loans.newFeeFine" />
</Button>
<Button
data-testid="feeFineDetailsButton"
disabled={_.isEmpty(accountsLoan)}
buttonStyle="dropdownItem"
onClick={() => {
this.handleOptionsChange({ loan, action: 'feefineDetails' });
}}
>
<FormattedMessage id="ui-users.loans.feeFineDetails" />
</Button>
{
!isVirtualUser && (
<>
<Button
data-testid="newFeeFineButton"
disabled={buttonDisabled}
buttonStyle="dropdownItem"
to={getChargeFineToLoanPath(params.id, loan.id)}
>
<FormattedMessage id="ui-users.loans.newFeeFine" />
</Button>
<Button
data-testid="feeFineDetailsButton"
disabled={_.isEmpty(accountsLoan)}
buttonStyle="dropdownItem"
onClick={() => {
this.handleOptionsChange({ loan, action: 'feefineDetails' });
}}
>
<FormattedMessage id="ui-users.loans.feeFineDetails" />
</Button>
</>
)
}
</DropdownMenu>
);
};
Expand All @@ -399,6 +417,7 @@ class ClosedLoans extends React.Component {
} = this.state;
const {
loans,
user,
} = this.props;

const visibleColumns = ['title', 'dueDate', 'barcode', 'feefineIncurred', 'callNumber', 'Contributors', 'renewals', 'loanDate', 'returnDate', 'checkinServicePoint', ' '];
Expand All @@ -407,6 +426,7 @@ class ClosedLoans extends React.Component {
[this.sortMap[sortOrder[0]], this.sortMap[sortOrder[1]]], sortDirection);
const clonedLoans = _.cloneDeep(loans);
const recordsToCSV = this.buildRecords(clonedLoans);
const isVirtualUser = isDcbUser(user);

const columnWidths = {
'title': { max: 200 },
Expand Down Expand Up @@ -439,45 +459,47 @@ class ClosedLoans extends React.Component {
</Label>
}
contentEnd={
<IntlConsumer>
{intl => (
<div>
<IfPermission perm="ui-users.loans.anonymize">
<Button
marginBottom0
id="anonymize-all"
onClick={this.toggleLoansAnonymizationConfirmModal}
>
{anonymizeString}
</Button>
</IfPermission>
<ExportCsv
data={recordsToCSV}
onlyFields={this.columnHeadersMap}
/>
<ErrorModal
id="anonymization-fees-fines-modal"
open={anonymizationErrorModalOpen}
label={intl.formatMessage({ id: 'ui-users.anonymization.error.header' })}
message={intl.formatMessage(
{ id: 'ui-users.anonymization.error.message' },
{ amount: failedAnonymizationLoansCount }
)}
onClose={this.closeLoansAnonymizationErrorModal}
/>
<ConfirmationModal
open={confirmAnonymizationModalOpen}
heading={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.header' })}
message={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.message' })}
onConfirm={this.anonymizeLoans}
onCancel={this.toggleLoansAnonymizationConfirmModal}
cancelLabel={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.cancel' })}
confirmLabel={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.confirm' })}
/>
</div>
)}
</IntlConsumer>
}
!isVirtualUser && (
<IntlConsumer>
{intl => (
<div>
<IfPermission perm="ui-users.loans.anonymize">
<Button
marginBottom0
id="anonymize-all"
onClick={this.toggleLoansAnonymizationConfirmModal}
>
{anonymizeString}
</Button>
</IfPermission>
<ExportCsv
data={recordsToCSV}
onlyFields={this.columnHeadersMap}
/>
<ErrorModal
id="anonymization-fees-fines-modal"
open={anonymizationErrorModalOpen}
label={intl.formatMessage({ id: 'ui-users.anonymization.error.header' })}
message={intl.formatMessage(
{ id: 'ui-users.anonymization.error.message' },
{ amount: failedAnonymizationLoansCount }
)}
onClose={this.closeLoansAnonymizationErrorModal}
/>
<ConfirmationModal
open={confirmAnonymizationModalOpen}
heading={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.header' })}
message={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.message' })}
onConfirm={this.anonymizeLoans}
onCancel={this.toggleLoansAnonymizationConfirmModal}
cancelLabel={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.cancel' })}
confirmLabel={intl.formatMessage({ id: 'ui-users.anonymization.confirmation.confirm' })}
/>
</div>
)}
</IntlConsumer>
)
}
/>
<MultiColumnList
id="list-loanshistory"
Expand Down
Loading

0 comments on commit 2232744

Please sign in to comment.