Skip to content

Commit

Permalink
UIREC-285 Include Accession number field in receive all view (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
alb3rtino authored Oct 24, 2023
1 parent 77a5d65 commit fc50cdd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change history for ui-receiving

## 4.1.0 (IN PROGRESS)
* Include Accession number field in receive all view. Refs UIREC-285.

## [4.0.0](https://github.com/folio-org/ui-receiving/tree/v4.0.0) (2023-10-12)
[Full Changelog](https://github.com/folio-org/ui-receiving/compare/v3.0.0...v4.0.0)
Expand Down
12 changes: 12 additions & 0 deletions src/TitleReceive/TitleReceiveList.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const visibleColumns = [
'caption',
'enumeration',
'copyNumber',
'accessionNumber',
'barcode',
'format',
'hasRequest',
Expand Down Expand Up @@ -84,6 +85,16 @@ export const TitleReceiveList = ({
aria-label={intl.formatMessage({ id: 'ui-receiving.piece.enumeration' })}
/>
),
accessionNumber: record => (
<Field
name={`${field}[${record.rowIndex}].accessionNumber`}
component={TextField}
disabled={!record.itemId && !record.isCreateItem}
marginBottom0
fullWidth
aria-label={intl.formatMessage({ id: 'ui-receiving.piece.accessionNumber' })}
/>
),
barcode: record => (
<Field
name={`${field}[${record.rowIndex}].barcode`}
Expand Down Expand Up @@ -181,6 +192,7 @@ export const TitleReceiveList = ({
caption: <FormattedMessage id="ui-receiving.piece.caption" />,
copyNumber: <FormattedMessage id="ui-receiving.piece.copyNumber" />,
enumeration: <FormattedMessage id="ui-receiving.piece.enumeration" />,
accessionNumber: <FormattedMessage id="ui-receiving.piece.accessionNumber" />,
barcode: <FormattedMessage id="ui-receiving.piece.barcode" />,
format: <FormattedMessage id="ui-receiving.piece.format" />,
hasRequest: <FormattedMessage id="ui-receiving.piece.request" />,
Expand Down
1 change: 1 addition & 0 deletions src/common/hooks/useReceive.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const useReceive = (options = {}) => {
.map(piece => ({
id: piece.id,
barcode: piece.barcode,
accessionNumber: piece.accessionNumber,
callNumber: piece.callNumber,
comment: piece.comment,
caption: piece.caption,
Expand Down
15 changes: 11 additions & 4 deletions src/common/utils/getDehydratedPiece.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { omit } from 'lodash';

export const getDehydratedPiece = (piece) => omit(
piece,
['barcode', 'callNumber', 'checked', 'request', 'itemStatus', 'rowIndex', 'isCreateItem', 'holdingsRecordId'],
);
export const getDehydratedPiece = (piece) => omit(piece, [
'barcode',
'accessionNumber',
'callNumber',
'checked',
'request',
'itemStatus',
'rowIndex',
'isCreateItem',
'holdingsRecordId',
]);
1 change: 1 addition & 0 deletions src/common/utils/getHydratedPieces.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function getHydratedPieces(pieces, mutatorRequests, mutatorItems) {
...piece,
itemId: itemsMap[piece.itemId] ? piece.itemId : undefined,
barcode: itemsMap[piece.itemId]?.barcode,
accessionNumber: itemsMap[piece.itemId]?.accessionNumber,
callNumber: itemsMap[piece.itemId]?.itemLevelCallNumber,
itemStatus: getPieceStatusFromItem(itemsMap[piece.itemId]),
request: requestsMap[piece.itemId],
Expand Down
1 change: 1 addition & 0 deletions translations/ui-receiving/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"title.requester": "Requester",
"title.rush": "Rush",

"piece.accessionNumber": "Accession number",
"piece.actions.addItem":"Add item",
"piece.actions.savePiece.error": "The piece was <b>not saved</b>",
"piece.actions.savePiece.success": "The piece was successfully <b>saved</b>",
Expand Down

0 comments on commit fc50cdd

Please sign in to comment.