diff --git a/src/ItemDetail.js b/src/ItemDetail.js index f72687d0..86656a44 100644 --- a/src/ItemDetail.js +++ b/src/ItemDetail.js @@ -17,7 +17,7 @@ import { import { isValidRequest, - isvirtualItem, + isVirtualItem, openRequestStatusFilters, } from './utils'; import { itemStatusesTranslations } from './constants'; @@ -59,7 +59,7 @@ const ItemDetail = ({ const isRequestValid = isValidRequest({ instanceId, holdingsRecordId }); const recordLink = () => { if (itemId) { - return isRequestValid && !isvirtualItem(instanceId, holdingsRecordId) + return isRequestValid && !isVirtualItem(instanceId, holdingsRecordId) ? {item.barcode || itemId} : (item.barcode || itemId); } diff --git a/src/ViewRequest.js b/src/ViewRequest.js index 4d7cd80a..be811d50 100644 --- a/src/ViewRequest.js +++ b/src/ViewRequest.js @@ -63,7 +63,7 @@ import { getTlrSettings, generateUserName, isValidRequest, - isvirtualItem, + isVirtualItem, isVirtualPatron, } from './utils'; import urls from './routes/urls'; @@ -485,7 +485,7 @@ class ViewRequest extends React.Component { const isRequestOpen = requestStatus.startsWith('Open'); const cancellationReasonMap = keyBy(cancellationReasons, 'id'); const isRequestValid = isValidRequest(request); - const isDCBTransaction = isVirtualPatron(requester?.personal?.lastName) || isvirtualItem(request?.instanceId, request?.holdingsRecordId); + const isDCBTransaction = isVirtualPatron(requester?.personal?.lastName) || isVirtualItem(request?.instanceId, request?.holdingsRecordId); let deliveryAddressDetail; let selectedDelivery = false; diff --git a/src/components/TitleInformation/TitleInformation.js b/src/components/TitleInformation/TitleInformation.js index 2cc03f84..fba65c0f 100644 --- a/src/components/TitleInformation/TitleInformation.js +++ b/src/components/TitleInformation/TitleInformation.js @@ -17,7 +17,7 @@ import { } from '../../constants'; import { isValidRequest, - isvirtualItem, + isVirtualItem, openRequestStatusFilters, } from '../../utils'; @@ -47,7 +47,7 @@ const TitleInformation = (props) => { }, } = props; const titleLevelRequestsCountValue = titleLevelRequestsLink ? getURL(instanceId, titleLevelRequestsCount) : titleLevelRequestsCount; - const titleValue = isValidRequest({ instanceId }) && !isvirtualItem(instanceId, holdingsRecordId) ? getTitleURL(instanceId, title) : title; + const titleValue = isValidRequest({ instanceId }) && !isVirtualItem(instanceId, holdingsRecordId) ? getTitleURL(instanceId, title) : title; return ( <> diff --git a/src/utils.js b/src/utils.js index 11562952..14e32236 100644 --- a/src/utils.js +++ b/src/utils.js @@ -338,7 +338,7 @@ export const isValidRequest = ({ DCB Transactions (where FOLIO plays a) borrowing role work with virtual items, whose instance and holding record id are hard coded */ -export const isvirtualItem = ( +export const isVirtualItem = ( instanceId, holdingsRecordId, ) => { diff --git a/src/utils.test.js b/src/utils.test.js index 04db7a67..981469de 100644 --- a/src/utils.test.js +++ b/src/utils.test.js @@ -28,7 +28,7 @@ import { isFormEditing, resetFieldState, getRequestTypeOptions, - isvirtualItem, + isVirtualItem, } from './utils'; import { @@ -293,21 +293,21 @@ describe('isValidRequest', () => { }); }); -describe('isvirtualItem', () => { +describe('isVirtualItem', () => { it('should return true if item is virtual', () => { - expect(isvirtualItem(DCB_INSTANCE_ID, DCB_HOLDINGS_RECORD_ID)).toBe(true); + expect(isVirtualItem(DCB_INSTANCE_ID, DCB_HOLDINGS_RECORD_ID)).toBe(true); }); it('should return false if "holdingsRecordId" in request have hardcoded invalid value', () => { - expect(isvirtualItem(DCB_INSTANCE_ID, 'testHoldingRecordId')).toBe(false); + expect(isVirtualItem(DCB_INSTANCE_ID, 'testHoldingRecordId')).toBe(false); }); it('should return false if "instanceId" in request have hardcoded invalid value', () => { - expect(isvirtualItem('testInstanceId', DCB_HOLDINGS_RECORD_ID)).toBe(false); + expect(isVirtualItem('testInstanceId', DCB_HOLDINGS_RECORD_ID)).toBe(false); }); it('should return false if "instanceId" and "holdingsRecordId" in request have hardcoded invalid value', () => { - expect(isvirtualItem('testInstanceId', 'testHoldingRecordId')).toBe(false); + expect(isVirtualItem('testInstanceId', 'testHoldingRecordId')).toBe(false); }); });