Skip to content

Commit

Permalink
UIOR-1147: add donors info to POL
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Nov 7, 2023
1 parent 6566e03 commit e7ac69d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Add missed permission to fetch org types in view only mode. Refs UIOR-1168.
* Preview contains blank page when trying to print an order. Refs UIOR-1173.
* Do not disable account numbers having only one account available. Refs UIOR-1174.
* Add donor info to POL. Refs UIOR-1147.

## [5.0.0](https://github.com/folio-org/ui-orders/tree/v5.0.0) (2023-10-12)
[Full Changelog](https://github.com/folio-org/ui-orders/compare/v4.0.3...v5.0.0)
Expand Down
11 changes: 11 additions & 0 deletions src/components/POLine/POLineForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import { ViewMetaData } from '@folio/stripes/smart-components';
import stripesForm from '@folio/stripes/final-form';
import {
DonorsList,
FundDistributionFieldsFinal,
handleKeyCommand,
} from '@folio/stripes-acq-components';
Expand Down Expand Up @@ -128,6 +129,7 @@ function POLineForm({
const initialInventoryData = isCreateFromInstance
? createPOLDataFromInstance(instance, identifierTypes)
: initialTemplateInventoryData;
const donorOrganizationIds = get(initialValues, 'donorOrganizationIds', []);

useEffect(() => {
setTimeout(() => {
Expand Down Expand Up @@ -438,6 +440,15 @@ function POLineForm({
integrationConfigs={integrationConfigs}
/>
</Accordion>
<Accordion
id={ACCORDION_ID.donorsInformation}
label={<FormattedMessage id="ui-orders.paneBlock.donorInformation" />}
>
<DonorsList
name="donorOrganizationIds"
donorOrganizationIds={donorOrganizationIds}
/>
</Accordion>
{isOngoing(order.orderType) && (
<Accordion
label={<FormattedMessage id="ui-orders.line.accordion.ongoingOrder" />}
Expand Down
7 changes: 6 additions & 1 deletion src/components/POLine/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const ACCORDION_ID = {
vendor: 'vendor',
linkedInstances: 'linkedInstances',
ongoingOrder: 'ongoingOrder',
donorsInformation: 'donorsInformation',
};

// Mapping between attribute (field) in form and id of accordion
Expand Down Expand Up @@ -59,8 +60,12 @@ export const POL_TEMPLATE_FIELDS_MAP = {
'tags.tagList': 'polTags.tagList',
};

const INITIALLY_CLOSED_ACCORDION_IDS = {
[ACCORDION_ID.donorsInformation]: true,
};

export const INITIAL_SECTIONS = Object.values(ACCORDION_ID).reduce(
(accum, id) => ({ ...accum, [id]: true }), {},
(accum, id) => ({ ...accum, [id]: !INITIALLY_CLOSED_ACCORDION_IDS[id] }), {},
);

export const ACCOUNT_STATUS = {
Expand Down
1 change: 1 addition & 0 deletions translations/ui-orders/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"paneBlock.openBtn": "Open",
"paneBlock.unopenBtn": "Unopen",
"paneBlock.POLines": "PO lines",
"paneBlock.donorInformation": "Donor information",
"paneBlock.POSummary": "PO summary",
"paneBlock.purchaseOrder": "Purchase order",
"paneBlock.receiveBtn": "Receive",
Expand Down

0 comments on commit e7ac69d

Please sign in to comment.