Skip to content

Commit

Permalink
UIREC-295 Add the 'Acquisition units' field to the receiving title form
Browse files Browse the repository at this point in the history
  • Loading branch information
usavkov-epam committed Dec 29, 2023
1 parent 0ddd1f0 commit aba38bd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Display claim actions for Piece. Refs UIREC-291.
* Set claiming workflow statuses for single Piece. Refs UIREC-292.
* Add unreceivable accordion to receiving title view. Refs UIREC-302.
* Add the "Acquisition units" field to the receiving title form. Refs UIREC-295.

## [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
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,24 @@
"ui-receiving.edit"
]
},
{
"permissionName": "ui-receiving.acq-units.assignment.assign",
"displayName": "Receiving: Assign acquisition units to new receiving title",
"description": "",
"visible": true,
"subPermissions": [
"titles.acquisitions-units-assignments.assign"
]
},
{
"permissionName": "ui-receiving.acq-units.assignment.manage",
"displayName": "Receiving: Manage acquisition units of existing receiving title",
"description": "",
"visible": true,
"subPermissions": [
"titles.acquisitions-units-assignments.manage"
]
},
{
"permissionName": "ui-receiving.exportCSV",
"displayName": "Receiving: Export search results",
Expand Down
16 changes: 16 additions & 0 deletions src/TitleForm/TitleForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import { Pluggable } from '@folio/stripes/core';
import { ViewMetaData } from '@folio/stripes/smart-components';
import {
AcqUnitsField,
FieldDatepickerFinal,
FolioFormattedDate,
FormFooter,
Expand All @@ -41,6 +42,8 @@ import ProductIdDetailsForm from './ProductIdDetailsForm';
import ContributorsForm from './ContributorsForm';

const ALLOWED_YEAR_LENGTH = 4;
const ASSIGN_ACQ_UNITS_PERM = 'titles.acquisitions-units-assignments.assign';
const MANAGE_ACQ_UNITS_PERM = 'titles.acquisitions-units-assignments.manage';

const TitleForm = ({
handleSubmit,
Expand Down Expand Up @@ -264,6 +267,19 @@ const TitleForm = ({
validateFields={[]}
/>
</Col>
<Col
xs={6}
md={3}
>
<AcqUnitsField
id="title-acq-units"
name="acqUnitIds"
perm={isEditMode ? MANAGE_ACQ_UNITS_PERM : ASSIGN_ACQ_UNITS_PERM}
isEdit={isEditMode}
preselectedUnits={values.acqUnitIds}
isFinal
/>
</Col>
</Row>

<Row>
Expand Down
2 changes: 2 additions & 0 deletions translations/ui-receiving/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,7 @@
"permission.edit": "Receiving: View, edit",
"permission.create": "Receiving: View, edit, create",
"permission.delete": "Receiving: View, edit, delete",
"permission.acq-units.assignment.assign": "Receiving: Assign acquisition units to new receiving title",
"permission.acq-units.assignment.manage": "Receiving: Manage acquisition units of existing receiving title",
"permission.exportCSV": "Receiving: Export search results"
}

0 comments on commit aba38bd

Please sign in to comment.