Skip to content

Commit

Permalink
UIREQ-1032 - update const name to camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Nov 7, 2023
1 parent 08fdbe4 commit b327f3f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/ItemDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

import {
isValidRequest,
isvirtualItem,
isVirtualItem,
openRequestStatusFilters,
} from './utils';
import { itemStatusesTranslations } from './constants';
Expand Down Expand Up @@ -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)
? <Link to={`/inventory/view/${instanceId}/${holdingsRecordId}/${itemId}`}>{item.barcode || itemId}</Link>
: (item.barcode || itemId);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ViewRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import {
getTlrSettings,
generateUserName,
isValidRequest,
isvirtualItem,
isVirtualItem,
isVirtualPatron,
} from './utils';
import urls from './routes/urls';
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/components/TitleInformation/TitleInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../../constants';
import {
isValidRequest,
isvirtualItem,
isVirtualItem,
openRequestStatusFilters,
} from '../../utils';

Expand Down Expand Up @@ -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 (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) => {
Expand Down
12 changes: 6 additions & 6 deletions src/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
isFormEditing,
resetFieldState,
getRequestTypeOptions,
isvirtualItem,
isVirtualItem,
} from './utils';

import {
Expand Down Expand Up @@ -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);
});
});

Expand Down

0 comments on commit b327f3f

Please sign in to comment.