Commit 486ef617 authored by Maksym Tishchenko's avatar Maksym Tishchenko
Browse files

Requests. Items list frame/section

parent d518d465
......@@ -78,6 +78,8 @@
"InventoryViabilityAction_plural": "Inventory viability actions",
"OrderRequest": "Request",
"OrderRequest_plural": "Requests",
"OrderRequestItem": "Request item",
"OrderRequestItem_plural": "Request items",
"OAuthClient": "OAuth client",
"OAuthClient_plural": "OAuth clients",
"Site": "Site",
......
......@@ -64,6 +64,8 @@
"InventoryViabilityAction_plural": "Inventory viability actions",
"OrderRequest": "Request",
"OrderRequest_plural": "Requests",
"OrderRequestItem": "Request item",
"OrderRequestItem_plural": "Request items",
"OAuthClient": "OAuth client",
"OAuthClient_plural": "OAuth clients",
"Site": "Site",
......
......@@ -129,7 +129,7 @@ class RequestService {
* @param id OrderRequest ID
* @param xhrConfig additional xhr config
*/
public removeOrderItems = (data: number[], id: number, xhrConfig?: AxiosRequestConfig): Promise<OrderRequest> => {
public removeOrderItems = (data: number[], id: number, xhrConfig?: AxiosRequestConfig): Promise<{ content: OrderRequestItem[], requestId: number }> => {
const apiUrl = URL_REMOVE_ORDER_ITEMS.expand({ id });
// console.log(`Fetching from ${apiUrl}`);
......@@ -140,7 +140,7 @@ class RequestService {
url: apiUrl,
method: 'POST',
...content,
}).then(({ data }) => data as OrderRequest);
}).then(({ data }) => ({ content: data, requestId: id } as { content: OrderRequestItem[], requestId: number }));
}
/**
......
......@@ -885,14 +885,16 @@
"item": "Item",
"byAccession": "By accession",
"byInventory": "By inventory",
"sourceInventory": "Source inventory",
"changeInventory": "Change inventory",
"updateStatus": "Update status",
"actions": "Actions",
"verifyItemList": "Verify item list",
"sameAsRequestor": "The same as Requestor",
"sameAsFinalRecipient": "The same as final recipient"
},
"edit": {
"title": "New Request"
"title": "New Request",
"itemTitle": "Edit order request item number {{number}}"
},
"retrievalList": {
"title": "Retrieval list",
......
......@@ -7,8 +7,9 @@ import {
SAGA_RECEIVE_REQUEST, SAGA_EDIT_REQUEST, RECEIVE_REQUEST,
SAGA_RECEIVE_REQUEST_ITEMS, RECEIVE_REQUEST_ITEMS,
SAGA_CREATE_REQUEST, RECEIVE_NEW_REQUEST, CLEAR_REQUEST,
SAGA_RECEIVE_REQUEST_ACTIONS, RECEIVE_REQUEST_ACTIONS,
RECEIVE_REQUEST_ITEMS_CONTENT, REMOVE_REQUEST, SAGA_REMOVE_REQUEST
SAGA_RECEIVE_REQUEST_ACTIONS, RECEIVE_REQUEST_ACTIONS, RECEIVE_REQUEST_ITEMS_CONTENT,
SAGA_EDIT_REQUEST_ITEM, RECEIVE_REQUEST_ITEM, SAGA_REMOVE_REQUEST_ITEMS,
REMOVE_REQUEST_ITEMS, REMOVE_REQUEST, SAGA_REMOVE_REQUEST
} from 'request/constants';
// Model
import {
......@@ -28,10 +29,12 @@ export const requestPublicSagas = [
takeEvery(SAGA_RECEIVE_REQUEST, getOrderRequestSaga),
takeEvery(SAGA_CREATE_REQUEST, createOrderRequestSaga),
takeEvery(SAGA_EDIT_REQUEST, editOrderRequestSaga),
takeEvery(SAGA_EDIT_REQUEST_ITEM, editOrderRequestItemSaga),
takeEvery(RECEIVE_NEW_REQUEST, redirectToNewRequestSaga),
takeEvery(SAGA_RECEIVE_REQUEST_ITEMS, listOrderRequestItemsSaga),
takeEvery(SAGA_RECEIVE_REQUEST_ACTIONS, listOrderRequestActionsSaga),
takeEvery(SAGA_REMOVE_REQUEST, removeOrderRequestSaga),
takeEvery(SAGA_REMOVE_REQUEST_ITEMS, removeOrderRequestItemsSaga),
];
function* getOrderRequestSaga(action) {
......@@ -169,6 +172,21 @@ export const removeOrderRequestAction = (id: number) => ({
payload: { id },
});
export const editOrderRequestItemAction = (orderRequestItem: OrderRequestItem) => {
return {
type: SAGA_EDIT_REQUEST_ITEM,
payload: {
orderRequestItem,
},
};
}
export const removeOrderRequestItemsAction = (orderRequestItems: number[], requestId: number) => ({
type: SAGA_REMOVE_REQUEST_ITEMS,
payload: { orderRequestItems, requestId },
});
function * createOrderRequestSaga(action) {
yield put({
type: 'API',
......@@ -202,6 +220,15 @@ function* removeOrderRequestSaga(action) {
});
}
function * editOrderRequestItemSaga(action) {
yield put({
type: 'API',
target: RECEIVE_REQUEST_ITEM,
method: RequestService.updateItem,
params: [ action.payload.orderRequestItem ],
});
}
function * redirectToNewRequestSaga(action) {
// console.log('Redirect?', action.payload);
if (action.payload && action.payload.apiCall && action.payload.apiCall.data) {
......@@ -217,3 +244,12 @@ function * redirectToNewRequestSaga(action) {
yield call(sagaNavigate, `/dist/request/${action.payload.apiCall.data.id}`);
}
}
function* removeOrderRequestItemsSaga(action) {
yield put({
type: 'API',
target: REMOVE_REQUEST_ITEMS,
method: RequestService.removeOrderItems,
params: [ action.payload.orderRequestItems, action.payload.requestId ],
});
}
......@@ -3,14 +3,18 @@ export const SAGA_LIST_REQUESTS = 'saga/request/public/LIST';
export const SAGA_RECEIVE_REQUEST_ITEMS = 'saga/request/public/RECEIVE_ITEMS';
export const SAGA_CREATE_REQUEST = 'saga/request/public/CREATE';
export const SAGA_EDIT_REQUEST = 'saga/request/public/EDIT';
export const SAGA_EDIT_REQUEST_ITEM = 'saga/request/public/EDIT_ITEM';
export const RECEIVE_NEW_REQUEST = 'saga/request/public/RECEIVE_NEW';
export const SAGA_RECEIVE_REQUEST_ACTIONS = 'saga/request/public/RECEIVE_ACTIONS';
export const SAGA_REMOVE_REQUEST = 'saga/request/public/REMOVE_REQUEST';
export const SAGA_REMOVE_REQUEST_ITEMS = 'saga/request/public/REMOVE_ITEMS';
export const CLEAR_REQUEST = 'success/request/public/CLEAR_REQUEST';
export const RECEIVE_REQUEST = 'success/request/public/RECEIVE_REQUEST';
export const RECEIVE_REQUEST_ITEM = 'success/request/public/RECEIVE_REQUEST_ITEM';
export const RECEIVE_REQUESTS_LIST = 'success/request/public/LIST';
export const RECEIVE_REQUEST_ITEMS = 'success/request/public/RECEIVE_ITEMS';
export const RECEIVE_REQUEST_ITEMS_CONTENT = 'success/request/public/RECEIVE_ITEMS_CONTENT';
export const RECEIVE_REQUEST_ACTIONS = 'success/request/public/RECEIVE_ACTIONS';
export const REMOVE_REQUEST = 'success/request/public/REMOVE_REQUEST';
export const REMOVE_REQUEST_ITEMS = 'success/request/public/REMOVE_REQUEST_ITEMS';
import update from 'immutability-helper';
// Constants
import { RECEIVE_REQUESTS_LIST, RECEIVE_REQUEST, CLEAR_REQUEST, RECEIVE_REQUEST_ITEMS, RECEIVE_REQUEST_ITEMS_CONTENT, RECEIVE_REQUEST_ACTIONS, REMOVE_REQUEST } from 'request/constants';
import { RECEIVE_REQUESTS_LIST, RECEIVE_REQUEST, CLEAR_REQUEST, RECEIVE_REQUEST_ITEMS, RECEIVE_REQUEST_ITEMS_CONTENT, RECEIVE_REQUEST_ACTIONS, REMOVE_REQUEST_ITEMS, RECEIVE_REQUEST_ITEM, REMOVE_REQUEST } from 'request/constants';
// Model
import {
OrderRequest, OrderRequestFilteredPage,
InventoryFilteredPage, OrderRequestActionFilteredPage,
OrderRequestActionFilteredPage, OrderRequestItemFilteredPage,
} from '@gringlobal-ce/client/model/gringlobal';
import { FilteredPage } from '@gringlobal-ce/client/model/page';
import { ApiCall } from '@gringlobal-ce/client/model/common';
......@@ -12,7 +12,7 @@ import { ApiCall } from '@gringlobal-ce/client/model/common';
const initialState: {
requestList: ApiCall<OrderRequestFilteredPage>,
request: ApiCall<OrderRequest>,
requestItems: ApiCall<InventoryFilteredPage>,
requestItems: ApiCall<OrderRequestItemFilteredPage>,
requestActions: ApiCall<OrderRequestActionFilteredPage>,
} = {
requestList: null,
......@@ -68,6 +68,37 @@ const publicReducer = (state = initialState, action) => {
request: { $set: apiCall },
});
}
case RECEIVE_REQUEST_ITEM: {
const { apiCall } = action.payload;
if (apiCall.data && state.requestItems) {
const { data: requestItems } = state.requestItems;
const requestItem = apiCall.data;
const updatedIndex = requestItems && requestItems.content && requestItems.content.findIndex((stateItem) => +stateItem.id === +requestItem.id);
if (updatedIndex !== undefined && updatedIndex !== -1) {
return update(state, {
requestItems: {
data: {
content: {
[updatedIndex]: { $set: requestItem },
},
},
},
});
} else {
return update(state, {
requestItems: {
data: {
content: {
$set: [ ...requestItems.content, requestItem ],
},
},
},
});
}
}
}
case RECEIVE_REQUESTS_LIST: {
const { apiCall: { loading, error, timestamp, data } } = action.payload;
return update(state, {
......@@ -148,6 +179,51 @@ const publicReducer = (state = initialState, action) => {
}
return state;
}
case REMOVE_REQUEST_ITEMS: {
const { apiCall: { data } } = action.payload;
if (data) {
console.log(data);
if (state.requestItems && state.requestItems.data && state.requestItems.data.content) {
const updatedItems = state.requestItems.data.content.filter((item) => data.content.findIndex((deleted) => +deleted.id === +item.id) === -1);
const updatedIndex = state.requestList?.data?.content.findIndex((request) => +request.id === +data.requestId);
if (updatedIndex !== undefined && updatedIndex !== -1) {
return update(state, {
requestList: {
data: {
content: {
[updatedIndex]: { numberOfItems: { $apply: (number) => number - data.content.length } },
},
},
},
requestItems: {
data: {
content: {
$set: updatedItems,
},
totalElements: {
$apply: (total) => total - data.content.length,
},
},
},
});
} else {
return update(state, {
requestItems: {
data: {
content: {
$set: updatedItems,
},
totalElements: {
$apply: (total) => total - data.content.length,
},
},
},
});
}
}
}
return state;
}
default:
return state;
}
......
......@@ -18,14 +18,16 @@
"item": "Item",
"byAccession": "By accession",
"byInventory": "By inventory",
"sourceInventory": "Source inventory",
"changeInventory": "Change inventory",
"updateStatus": "Update status",
"actions": "Actions",
"verifyItemList": "Verify item list",
"sameAsRequestor": "The same as Requestor",
"sameAsFinalRecipient": "The same as final recipient"
},
"edit": {
"title": "New Request"
"title": "New Request",
"itemTitle": "Edit order request item number {{number}}"
},
"retrievalList": {
"title": "Retrieval list",
......
......@@ -299,8 +299,12 @@ class CheckList extends React.Component<IProps> {
private scanBarcode = (barcode: string) => {
console.log('Scanned barcode', barcode);
let extractedId = null;
if (barcode.match(/^OR:[0-9]+$/)) {// format OR:{ request.id }
extractedId = +barcode.split(':')[1]
}
RequestService.get(+barcode).then((request) => {
RequestService.get(+extractedId || +barcode).then((request) => {
console.log(`Received request order for id=${barcode}`, request);
this.props.navigateTo(`/dist/request/checklist/${request.id}`);
}).catch((err) => {
......
......@@ -13,7 +13,8 @@ import {
import { OrderRequestItemStatus } from '@gringlobal-ce/client/model/gringlobal/OrderRequestItem';
// Action
import navigateTo from '@gringlobal-ce/client/action/navigation';
import { getOrderRequestAction, listOrderRequestItemsAction, receiveOrderRequestItemsSuccessAction, listOrderRequestActionsAction, editOrderRequestAction, removeOrderRequestAction } from 'request/action/public';
import { getOrderRequestAction, listOrderRequestItemsAction, receiveOrderRequestItemsSuccessAction,
listOrderRequestActionsAction, editOrderRequestAction, removeOrderRequestItemsAction, editOrderRequestItemAction, removeOrderRequestAction } from 'request/action/public';
import { showSnackbar } from '@gringlobal-ce/client/action/snackbar';
// Service
import { RequestService } from '@gringlobal-ce/client/service';
......@@ -33,6 +34,7 @@ import TabPanel from '@gringlobal-ce/client/ui/common/tabs/TabPanel';
import SlotLayout from '@gringlobal-ce/client/ui/common/layout/SlotLayout';
import AuditDataDisplay from 'common/AuditDataDisplay';
import withTabs, { IWithTabs } from 'ui/common/withTabs';
import { withStyles, WithStyles } from '@material-ui/core/styles';
import { AccessionLink, CooperatorLink, InventoryLink } from 'ui/common/Links';
import InventorySelector from 'inventory/ui/c/InventorySelector';
import AccessionInventorySelector from 'accession/ui/c/AccessionInventorySelector';
......@@ -44,12 +46,23 @@ import PrintIcon from '@material-ui/icons/Print';
import SourceInventorySelector from 'request/ui/c/SourceInventorySelector';
import confirm from '@gringlobal-ce/client/utilities/confirmAlert';
import { IPageRequest, Page } from '@gringlobal-ce/client/model/page';
import ButtonSnackbar from '@gringlobal-ce/client/ui/common/button/ButtonSnackbar';
import OrderRequestItemForm from 'request/ui/c/OrderRequestItemForm';
import Number from '@gringlobal-ce/client/ui/common/Number';
import MenuItem from '@material-ui/core/MenuItem';
import Menu from '@material-ui/core/Menu';
const styles = (theme) => ({
tableWrapper: {
position: "relative" as const,
},
});
export const OrderRequestItemTableConfig = new TableConfiguration({
defaultColumns: [
'sequenceNumber', 'statusCode',
'accession', 'improvementStatusCode', 'taxonomySpecies',
'inventory', 'name',
'inventory', 'name', 'quantityOnHand', 'quantityShipped', 'quantityShippedUnitCode'
],
ignoredColumns: [
'id', '_class', 'createdBy', 'modifiedBy', 'ownedBy', 'ownedDate',
......@@ -61,6 +74,7 @@ export const OrderRequestItemTableConfig = new TableConfiguration({
accession: { label: 'client:model.Accession.accessionNumber', sort: 'inventory.accession.accessionNumber' },
improvementStatusCode: { label: 'client:model.Accession.improvementStatusCode' },
taxonomySpecies: { label: 'client:model.Accession.taxonomySpecies', sort: 'inventory.accession.taxonomySpecies.name' },
quantityOnHand: { label: 'client:model.Inventory.quantityOnHand', sort: 'inventory.quantityOnHand' }
},
columnRenderers: {
statusCode: ({ value }: { value: string }) => <CodeValueDisplay codeGroup={ OrderRequestItem.CodeValue.statusCode } value={ value } />,
......@@ -68,6 +82,7 @@ export const OrderRequestItemTableConfig = new TableConfiguration({
accession: ({ row }: { row: OrderRequestItem }) => row?.inventory?.accession && <AccessionLink accession={ row.inventory.accession } />,
taxonomySpecies: ({ row }: { row: OrderRequestItem }): JSX.Element => <PrintSpecies taxonomySpecies={ row?.inventory?.accession?.taxonomySpecies } />,
improvementStatusCode: ({ row }: { row: OrderRequestItem }) => <CodeValueDisplay codeGroup={ Accession.CodeGroup.improvementStatusCode } value={ row?.inventory?.accession?.improvementStatusCode } />,
quantityOnHand: ({ row }: { row: OrderRequestItem }) => <Number value={ row?.inventory?.quantityOnHand } />,
},
});
......@@ -91,7 +106,7 @@ enum RequestTabs {
ACTIONS = 'actions',
}
interface IDetailsPageProps extends React.ClassAttributes<any>, WithTranslation, IWithTabs {
interface IDetailsPageProps extends React.ClassAttributes<any>, WithTranslation, WithStyles, IWithTabs {
id: number;
getOrderRequestAction: (id: string | number) => void;
listOrderRequestActionsAction: (id: string | number) => void;
......@@ -102,6 +117,8 @@ interface IDetailsPageProps extends React.ClassAttributes<any>, WithTranslation,
requestActionsCall: ApiCall<OrderRequestActionFilteredPage>;
navigateTo: (path: string, query?: any) => void;
editOrderRequestAction: (orderRequest: OrderRequest) => void;
removeOrderRequestItemsAction: (orderRequestItems: number[], requestId: number) => void;
editOrderRequestItemAction: (orderRequestItem: OrderRequestItem) => void;
removeOrderRequestAction: (id: number) => void;
showSnackbar: (error: string) => void;
}
......@@ -121,6 +138,8 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
itemsInventoryDialogIsOpen: false,
itemsAccessionDialogIsOpen: false,
orderRequestDialogIsOpen: false,
orderRequestItemDialogIsOpen: false,
anchorEl: null
}
public constructor(props) {
......@@ -190,7 +209,21 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
// });
// }
private removeItems = () => {
const { t, removeOrderRequestItemsAction, requestItemsCall: { data: { content: items } }, id } = this.props;
const { selectedItems } = this.state;
confirm(t('common:label.deleteListConfirm', { count: selectedItems.length, what: t('client:model.name.OrderRequestItem', { count: selectedItems.length }) }), {
confirmLabel: t('common:label.yes'),
abortLabel: t('common:label.no'),
}).then(() => {
removeOrderRequestItemsAction(items.filter((item, index) => selectedItems.includes(index)).map((i) => i.id), +id)
this.setState({ selectedItems: [] })
});
};
private updateItemStatus = (newStatus: OrderRequestItemStatus) => () => {
console.log('status', newStatus)
const { id, listOrderRequestItemsAction, requestCall: { data: request }, requestItemsCall: { data: { content: items } } } = this.props;
const selectedItems = this.state.selectedItems.map((i) => items[i]);
......@@ -218,6 +251,38 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
this.closeOrderRequestDialog();
};
private handleEditItem = (formData: OrderRequestItem) => {
formData.inventory = { id: formData.inventory.id } as Inventory
const { editOrderRequestItemAction } = this.props;
editOrderRequestItemAction(formData);
this.closeOrderRequestItemDialog();
};
private closeMenu = () => {
this.setState({ anchorEl: null });
};
private handleMenuItemClick = (event, itemStatus) => {
window.removeEventListener('scroll', this.closeMenu);
window.removeEventListener('resize', this.closeMenu);
this.updateItemStatus(itemStatus as OrderRequestItemStatus)()
this.setState({ anchorEl: null });
};
private handleCloseStatusMenu = () => {
window.removeEventListener('scroll', this.closeMenu);
window.removeEventListener('resize', this.closeMenu);
this.setState({ anchorEl: null });
};
private handleOpenStatusMenu = (event) => {
window.addEventListener('scroll', this.closeMenu);
window.addEventListener('resize', this.closeMenu);
this.setState({ anchorEl: event.currentTarget, hidden: false });
};
// source inventory
private openSourceInventoryDialog = () => this.setState({ sourceInventoryDialogIsOpen: true });
......@@ -238,6 +303,11 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
private closeOrderRequestDialog = () => this.setState({ orderRequestDialogIsOpen: false });
// edit request item
private openOrderRequestItemDialog = () => this.setState({ orderRequestItemDialogIsOpen: true });
private closeOrderRequestItemDialog = () => this.setState({ orderRequestItemDialogIsOpen: false });
private onInventoriesSelect = (selected, byAccession: boolean) => {
const { id, showSnackbar, listOrderRequestItemsAction } = this.props;
RequestService.addInventories(id, selected).then(() => {
......@@ -259,14 +329,18 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
};
public render(): React.ReactNode {
const { requestCall, requestItemsCall, requestActionsCall, t, currentTab, onTabChange } = this.props;
const { selectedItems, sourceInventoryDialogIsOpen, itemsInventoryDialogIsOpen, itemsAccessionDialogIsOpen, orderRequestDialogIsOpen } = this.state;
const { requestCall, requestItemsCall, requestActionsCall, t, currentTab, onTabChange, classes } = this.props;
const {
selectedItems, sourceInventoryDialogIsOpen, itemsInventoryDialogIsOpen, itemsAccessionDialogIsOpen,
orderRequestDialogIsOpen, orderRequestItemDialogIsOpen, anchorEl
} = this.state;
const columns = OrderRequestItemTableConfig.getColumns(requestItemsCall && requestItemsCall.data && requestItemsCall.data.content ? requestItemsCall.data.content[0] : null);
if (!requestCall) {
return null;
}
const { loading, data: request } = requestCall;
const selectedItem = requestItemsCall?.data?.content?.[selectedItems[0]];
return (
<>
......@@ -351,42 +425,66 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
>
<Card>
<CardHeader title={ t('request.public.p.details.items') } />
{ requestItemsCall && requestItemsCall.data && requestItemsCall.data.totalElements > 0 &&
<CardActions>
<ButtonBar>
<div className={ classes.tableWrapper }>
{ requestItemsCall && requestItemsCall.data && requestItemsCall.data.totalElements > 0 &&
<ButtonSnackbar isRelative open={ selectedItems.length > 0 }>
<Button onClick={ this.removeItems } variant="contained">
{ t('common:action.remove') }
</Button>
<Button
disabled={ selectedItems.length !== 1 }
onClick={ this.openOrderRequestItemDialog }
variant="contained"
color="secondary"
>
{ t('common:action.edit') }
</Button>
<Button
variant="contained"
disabled={ selectedItems.length === 0 }
color="secondary"
onClick={ this.openSourceInventoryDialog }
>
{ t('request.public.p.details.sourceInventory') }
{ t('request.public.p.details.changeInventory') }
</Button>
<Button
variant="contained"
color="secondary"
onClick={ this.handleOpenStatusMenu }
>
{ t('request.public.p.details.updateStatus') }
</Button>
<Menu
id="update-status-menu"
anchorEl={ anchorEl }
open={ Boolean(anchorEl) }
keepMounted
onClose={ this.handleCloseStatusMenu }
>
{ Object.keys(OrderRequestItemStatus).map((itemStatus) => (
<Button
key={ itemStatus } variant="contained" color="secondary"
disabled={ selectedItems.length === 0 }
onClick={ this.updateItemStatus(itemStatus as OrderRequestItemStatus) }
<MenuItem
key={ itemStatus } selected={ null }
onClick={ (event) => this.handleMenuItemClick(event, itemStatus) }
>
<CodeValueDisplay value={ itemStatus } codeGroup={ OrderRequestItem.CodeValue.statusCode } />
</Button>
</MenuItem>
)) }
</ButtonBar>
</CardActions>
}
<Table
noWrap
tableKey="request-items-list"
type={ 'OrderRequestItem' }
columns={ columns }
data={ requestItemsCall && requestItemsCall.data && requestItemsCall.data.content }
tableConfig={ OrderRequestItemTableConfig }
total={ requestItemsCall && requestItemsCall.data && requestItemsCall.data.content && requestItemsCall.data.totalElements }
// sort={ requestItemsCall && requestItemsCall.data && requestItemsCall.data.sort }
// onSortChange={ onSortChange }
onRowsToggled={ this.rowsToggled }
loadMore={ this.loadMoreItems }
/>
</Menu>
</ButtonSnackbar>
}
<Table
noWrap
tableKey="request-items-list"
type={ 'OrderRequestItem' }
columns={ columns }
data={ requestItemsCall && requestItemsCall.data && requestItemsCall.data.content }
tableConfig={ OrderRequestItemTableConfig }
total={ requestItemsCall && requestItemsCall.data && requestItemsCall.data.content && requestItemsCall.data.totalElements }
// sort={ requestItemsCall && requestItemsCall.data && requestItemsCall.data.sort }
// onSortChange={ onSortChange }
onRowsToggled={ this.rowsToggled }
loadMore={ this.loadMoreItems }
/>
</div>
<SourceInventorySelector items={ selectedItems.map((index) => requestItemsCall?.data?.content?.[index]) } onSubmit={ this.handleUpdateItems } isOpen={ sourceInventoryDialogIsOpen } onClose={ this.closeSourceInventoryDialog }/>
<AccessionInventorySelector onInventoriesSelect={ this.onInventoriesSelect } isOpen={ itemsAccessionDialogIsOpen } onClose={ this.closeItemsAccessionDialog }/>
<InventorySelector onInventoriesSelect={ this.onInventoriesSelect } isOpen={ itemsInventoryDialogIsOpen } onClose={ this.closeItemsInventoryDialog }/>
......@@ -403,6 +501,15 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
size='lg'
initialValues={ request }
/>
<OrderRequestItemForm
isOpen={ orderRequestItemDialogIsOpen }
onClose={ this.closeOrderRequestItemDialog }
onSubmit={ this.handleEditItem }
formId='order-request-item-form'
title={ selectedItem?.name || t('request.public.p.edit.itemTitle', { number: selectedItem?.sequenceNumber }) }