Skip to content

Commit

Permalink
backoffice: ILL: BorrowingRequest: Make Due date field name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamarora1 committed Jan 23, 2024
1 parent 5af68ff commit 6083722
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/lib/config/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ export const RECORDS_CONFIG = {
loanMaxDuration: 180,
statuses: ILL_BORROWING_REQUESTS_STATUSES,
defaultType: 'PHYSICAL_COPY',
fieldOverrides: {
due_date: 'Due Date',
},
search: {
filters: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Loan extends React.Component {
value: this.dateOrDefault(brwReqMetadata.received_date),
},
{
name: 'Due date',
name: invenioConfig.ILL_BORROWING_REQUESTS.fieldOverrides.due_date,
value: this.dateOrDefault(brwReqMetadata.due_date),
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getDisplayVal } from '@config';
import { getDisplayVal, invenioConfig } from '@config';
import PropTypes from 'prop-types';
import React from 'react';
import { Statistic } from 'semantic-ui-react';
Expand Down Expand Up @@ -50,9 +50,10 @@ export class BorrowingRequestStatistics extends React.Component {
const {
brwReq: { due_date: dueDate },
} = this.props;
const title = invenioConfig.ILL_BORROWING_REQUESTS.fieldOverrides.due_date;
return (
<Statistic>
<Statistic.Label>Due date</Statistic.Label>
<Statistic.Label>{title}</Statistic.Label>
<Statistic.Value>{dueDate ? dueDate : '-'}</Statistic.Value>
</Statistic>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const schema = () => {
},
due_date: {
format: 'date',
title: 'Due date',
title: invenioConfig.ILL_BORROWING_REQUESTS.fieldOverrides.due_date,
type: 'string',
},
expected_delivery_date: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getDisplayVal } from '@config';
import { getDisplayVal, invenioConfig } from '@config';
import { ILLBorrowingRequestIcon } from '@components/backoffice/icons';
import { BackOfficeRoutes, ILLRoutes, ProviderRoutes } from '@routes/urls';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -27,7 +27,9 @@ export default class BorrowingRequestListEntry extends Component {
</Link>
</Item.Description>
<Item.Description>
<label>due date </label>
<label>
{invenioConfig.ILL_BORROWING_REQUESTS.fieldOverrides.due_date}{' '}
</label>
{dueDate ? dueDate : '-'}
</Item.Description>
</>
Expand Down

0 comments on commit 6083722

Please sign in to comment.