Skip to content

Commit

Permalink
Merge branch 'master' into UIREQ-1190
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Dec 20, 2024
2 parents 61fd169 + a6d0fe2 commit 8da07ff
Show file tree
Hide file tree
Showing 44 changed files with 96 additions and 89 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
* Increase code coverage for src/ChooseRequestTypeDialog.js by Jest/RTL tests. Refs UIREQ-1044.
* Cleanup retrieval service point implementation from deprecated folder. Refs UIREQ-1211.
* Increase code coverage for src/ViewRequest.js by Jest/RTL tests. Refs UIREQ-1046.
* React v19: refactor away from default props for functional components. Refs UIREQ-1101.
* Add "Retrieval service point" filter. Refs UIREQ-1190.
* Include `Retrieval service point` column in csv exports. Refs UIREQ-1191.

## [11.0.2] (https://github.com/folio-org/ui-requests/tree/v11.0.2) (2024-12-10)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v11.0.1...v11.0.2)
Expand Down
6 changes: 1 addition & 5 deletions src/ItemsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const ItemsDialog = ({
onRowClick = noop,
mutator,
skippedItemId,
title,
title = '',
instanceId,
}) => {
const [areItemsBeingLoaded, setAreItemsBeingLoaded] = useState(false);
Expand Down Expand Up @@ -233,10 +233,6 @@ ItemsDialog.manifest = {
},
};

ItemsDialog.defaultProps = {
title: '',
};

ItemsDialog.propTypes = {
open: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
Expand Down
15 changes: 4 additions & 11 deletions src/components/FulfilmentPreference/FulfilmentPreference.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const {

const FulfilmentPreference = ({
isEditForm,
deliverySelected,
deliveryAddress,
deliverySelected = false,
deliveryAddress = '',
onChangeAddress,
deliveryLocations,
fulfillmentTypeOptions,
deliveryLocations = [],
fulfillmentTypeOptions = [],
defaultDeliveryAddressTypeId,
changeDeliveryAddress,
requestTypes,
Expand Down Expand Up @@ -167,11 +167,4 @@ FulfilmentPreference.propTypes = {
deliverySelected: PropTypes.bool,
};

FulfilmentPreference.defaultProps = {
deliveryAddress: '',
deliveryLocations: [],
fulfillmentTypeOptions: [],
deliverySelected: false,
};

export default FulfilmentPreference;
6 changes: 1 addition & 5 deletions src/components/PrintContent/PrintContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import css from './PrintContent.css';
const PrintContent = forwardRef(({
dataSource,
template,
id,
id = 'printContent',
}, ref) => {
const templateFn = useMemo(() => buildTemplate(template), [template]);

Expand Down Expand Up @@ -43,8 +43,4 @@ PrintContent.propTypes = {
template: PropTypes.string.isRequired,
};

PrintContent.defaultProps = {
id: 'printContent',
};

export default memo(PrintContent, isEqual);
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
} from '../../../constants';

const PickupServicePointFilter = ({
activeValues,
servicePoints,
activeValues = [],
servicePoints = [],
onChange,
onClear,
}) => {
Expand Down Expand Up @@ -67,9 +67,4 @@ PickupServicePointFilter.propTypes = {
onClear: PropTypes.func.isRequired,
};

PickupServicePointFilter.defaultProps = {
activeValues: [],
servicePoints: [],
};

export default PickupServicePointFilter;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../../../constants';

const RequestLevelFilter = ({
activeValues,
activeValues = [],
onChange,
onClear,
}) => {
Expand Down Expand Up @@ -63,8 +63,4 @@ RequestLevelFilter.propTypes = {
onClear: PropTypes.func.isRequired,
};

RequestLevelFilter.defaultProps = {
activeValues: [],
};

export default RequestLevelFilter;
12 changes: 3 additions & 9 deletions src/components/SortableList/SortableList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import draggableRowFormatter from './draggableRowFormatter';

export default function SortableList(props) {
const {
droppableId,
droppableId = uniqueId('droppable'),
onDragEnd,
rowFormatter,
isRowDraggable,
rowFormatter = draggableRowFormatter,
isRowDraggable = () => true,
rowProps,
visibleColumns: originalVisibleColumns,
columnWidths: originalColumnWidths,
Expand Down Expand Up @@ -73,12 +73,6 @@ export default function SortableList(props) {
);
}

SortableList.defaultProps = {
droppableId: uniqueId('droppable'),
rowFormatter: draggableRowFormatter,
isRowDraggable: () => true,
};

SortableList.propTypes = {
droppableId: PropTypes.string,
onDragEnd: PropTypes.func,
Expand Down
18 changes: 5 additions & 13 deletions src/components/TitleInformation/TitleInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export const getIdentifiers = (data, separator, limit) => data.slice(0, limit).m

const TitleInformation = (props) => {
const {
titleLevelRequestsLink,
titleLevelRequestsLink = true,
holdingsRecordId,
instanceId,
titleLevelRequestsCount,
title,
contributors,
publications,
editions,
identifiers,
contributors = [],
publications = [],
editions = [],
identifiers = [],
intl:{
formatMessage,
},
Expand Down Expand Up @@ -95,14 +95,6 @@ const TitleInformation = (props) => {
);
};

TitleInformation.defaultProps = {
contributors: [],
publications: [],
editions: [],
identifiers: [],
titleLevelRequestsLink: true,
};

TitleInformation.propTypes = {
titleLevelRequestsLink: PropTypes.bool,
titleLevelRequestsCount: PropTypes.number.isRequired,
Expand Down
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export const reportHeaders = [
'holdShelfExpirationDate',
'position',
'item.barcode',
'item.retrievalServicePointName',
'instance.title',
'instance.contributorNames',
'item.location.libraryName',
Expand Down Expand Up @@ -219,6 +220,7 @@ export const reportHeaders = [
export const expiredHoldsReportHeaders = [
'requester.name',
'requester.barcode',
'item.retrievalServicePointName',
'instance.title',
'item.barcode',
'item.callNumberComponents.prefix',
Expand Down
3 changes: 3 additions & 0 deletions src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,9 @@ class RequestsRoute extends React.Component {
const { addressLine1, city, region, postalCode, countryId } = record.deliveryAddress;
record.deliveryAddress = `${addressLine1 || ''} ${city || ''} ${region || ''} ${countryId || ''} ${postalCode || ''}`;
}
if (record.item.retrievalServicePointName) {
record.retrievalServicePointName = record.item.retrievalServicePointName;
}
record.instance.contributorNames = contributorNamesMap.join('; ');
if (record.tags) record.tags.tagList = tagListMap.join('; ');
});
Expand Down
8 changes: 7 additions & 1 deletion src/routes/RequestsRoute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ const mockedRequest = {
instanceId: 'instanceId',
item: {
barcode: 'itemBarcode',
retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f',
retrievalServicePointName: 'Circ Desk 1',
},
requester: {
barcode: 'requesterBarcode',
Expand Down Expand Up @@ -357,6 +359,10 @@ describe('RequestsRoute', () => {
}
],
},
item: {
retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f',
retrievalServicePointName: 'Circ Desk 1',
},
tags: {
tagList: ['tag1', 'tag2'],
},
Expand Down Expand Up @@ -628,7 +634,7 @@ describe('RequestsRoute', () => {
expect(printContent).toBeInTheDocument();
});

it('should trigger "exportCsv"', async () => {
it("should trigger 'exportCsv'", async () => {
await userEvent.click(screen.getByRole('button', { name: 'ui-requests.exportSearchResultsToCsv' }));

await waitFor(() => {
Expand Down
3 changes: 2 additions & 1 deletion translations/ui-requests/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/ber.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Kopie",
"permission.moveRequest.execute": "Požadavky: Přejít na novou jednotku, změnit pořadí fronty",
"permission.reorderQueue.execute": "Žádanky: Změna pořadí ve frontě",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Exemplare",
"permission.moveRequest.execute": "Bestandsanfragen: Verschieben zu neuem Exemplar, Warteliste neu anordnen",
"permission.reorderQueue.execute": "Bestandsanfragen: Warteliste neu anordnen",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
2 changes: 1 addition & 1 deletion translations/ui-requests/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"deliveryAddress": "Delivery address",
"requester.pickupLocation": "Pickup location",
"pickupServicePoint.name": "Pickup service point",
"retrievalServicePoint.name": "Retrieval service point",
"item.retrievalServicePointName": "Retrieval service point",
"requester.patronGroup.group": "Requester patron group",
"tags.tagList": "Tags",
"printDetails.printCount": "# Copies",
Expand Down
3 changes: 2 additions & 1 deletion translations/ui-requests/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/en_SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
3 changes: 2 additions & 1 deletion translations/ui-requests/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@
"printDetails.printCount": "# Copies",
"permission.moveRequest.execute": "Requests: Move to new item, reorder queue",
"permission.reorderQueue.execute": "Requests: Reorder queue",
"requests.retrievalServicePoint": "Retrieval service point"
"requests.retrievalServicePoint": "Retrieval service point",
"retrievalServicePoint.name": "Retrieval service point"
}
Loading

0 comments on commit 8da07ff

Please sign in to comment.