Commit 3bb00509 authored by Oleksii Savran's avatar Oleksii Savran
Browse files

WIP: Rename request to distribution

parent 037062e3
......@@ -14,7 +14,7 @@
"inventoryPolicy": "Inventory maintenance policy",
"taxonomyGenus": "Genera",
"taxonomySpecies": "Species",
"request": "Requests",
"distribution": "Requests",
"webuser": "Web Users"
},
"welcome": {
......@@ -246,6 +246,47 @@
}
}
},
"distribution": {
"public": {
"p": {
"request": {
"list": "Requests for material"
},
"details": {
"title": "Request",
"items": "Items",
"actions": "Actions"
}
},
"c": {
"filters": {
"text": "Full-text search"
}
}
},
"checklist": {
"title": "Check request items",
"items": "Request items",
"checked": "Checked",
"remaining": "Remaining",
"total": "Total",
"incorrect": "Incorrect",
"incorrectBarcodes": "Incorrect barcodes",
"tabs": {
"scan": "Scan",
"request": "Request",
"faults": "Faults"
}
},
"addmaterial": {
"names": {
"label": "Search for accession names and numbers",
"placeholder": "Or copy-paste a list of names",
"resultsFor": "Results for: {{name}}"
},
"items": "Request items"
}
},
"inventory": {
"public": {
"p": {
......@@ -578,47 +619,6 @@
"folder": "folder"
}
},
"request": {
"public": {
"p": {
"request": {
"list": "Requests for material"
},
"details": {
"title": "Request",
"items": "Items",
"actions": "Actions"
}
},
"c": {
"filters": {
"text": "Full-text search"
}
}
},
"checklist": {
"title": "Check request items",
"items": "Request items",
"checked": "Checked",
"remaining": "Remaining",
"total": "Total",
"incorrect": "Incorrect",
"incorrectBarcodes": "Incorrect barcodes",
"tabs": {
"scan": "Scan",
"request": "Request",
"faults": "Faults"
}
},
"addmaterial": {
"names": {
"label": "Search for accession names and numbers",
"placeholder": "Or copy-paste a list of names",
"resultsFor": "Results for: {{name}}"
},
"items": "Request items"
}
},
"site": {
"admin": {
"p": {
......
......@@ -11,7 +11,7 @@ import { taxonomyPublicSagas } from 'taxonomy/action/public';
import { accessionPublicSagas } from 'accession/action/public';
import { inventoryPublicSagas } from 'inventory/action/public';
import { inventoryGroupPublicSagas } from 'inventorygroup/action/public';
import { requestPublicSagas } from 'request/action/public';
import { distributionPublicSagas } from 'distribution/action/public';
import { kpiAdminSagas } from 'kpi/action/admin';
import { siteAdminSagas } from 'site/action/admin';
import { repositoryAdminSagas } from 'repository/action/admin';
......@@ -33,7 +33,7 @@ export default function*() {
...accessionPublicSagas,
...inventoryPublicSagas,
...inventoryGroupPublicSagas,
...requestPublicSagas,
...distributionPublicSagas,
...cropPublicSagas,
...siteAdminSagas,
......
......@@ -11,7 +11,7 @@ import accession from 'accession/reducer';
import user from 'user/reducer';
import inventory from 'inventory/reducer';
import inventorygroup from 'inventorygroup/reducer';
import request from 'request/reducer';
import distribution from 'distribution/reducer';
import site from 'site/reducer';
import kpi from 'kpi/reducer';
import repository from 'repository/reducer';
......@@ -33,7 +33,7 @@ const rootReducer = (history?) => (combineReducers({
inventory,
inventorygroup,
inventoryPolicy,
request,
distribution,
user,
site,
kpi,
......
......@@ -8,7 +8,7 @@ import {
SAGA_RECEIVE_REQUEST_ITEMS, RECEIVE_REQUEST_ITEMS,
SAGA_CREATE_REQUEST, RECEIVE_NEW_REQUEST, CLEAR_REQUEST,
SAGA_RECEIVE_REQUEST_ACTIONS, RECEIVE_REQUEST_ACTIONS,
} from 'request/constants';
} from 'distribution/constants';
// Model
import OrderRequest from '@gringlobal/client/model/gringlobal/OrderRequest';
import OrderRequestItem from '@gringlobal/client/model/gringlobal/OrderRequestItem';
......@@ -22,7 +22,7 @@ import OrderRequestAction from '@gringlobal/client/model/gringlobal/OrderRequest
// import OrderRequestItem from '@gringlobal/client/model/gringlobal/OrderRequestItem';
export const requestPublicSagas = [
export const distributionPublicSagas = [
takeEvery(SAGA_LIST_REQUESTS, listOrderRequestsSaga),
takeEvery(SAGA_RECEIVE_REQUEST, getOrderRequestSaga),
takeEvery(SAGA_CREATE_REQUEST, createOrderRequestSaga),
......
export const SAGA_RECEIVE_REQUEST = 'saga/distribution/public/RECEIVE_REQUEST';
export const SAGA_LIST_REQUESTS = 'saga/distribution/public/LIST';
export const SAGA_RECEIVE_REQUEST_ITEMS = 'saga/distribution/public/RECEIVE_ITEMS';
export const SAGA_CREATE_REQUEST = 'saga/distribution/public/CREATE';
export const RECEIVE_NEW_REQUEST = 'saga/distribution/public/RECEIVE_NEW';
export const SAGA_RECEIVE_REQUEST_ACTIONS = 'saga/distribution/public/RECEIVE_ACTIONS';
export const CLEAR_REQUEST = 'success/distribution/public/CLEAR_REQUEST';
export const RECEIVE_REQUEST = 'success/distribution/public/RECEIVE_REQUEST';
export const RECEIVE_REQUESTS_LIST = 'success/distribution/public/LIST';
export const RECEIVE_REQUEST_ITEMS = 'success/distribution/public/RECEIVE_ITEMS';
export const RECEIVE_REQUEST_ACTIONS = 'success/distribution/public/RECEIVE_ACTIONS';
import update from 'immutability-helper';
// Constants
import { RECEIVE_REQUESTS_LIST, RECEIVE_REQUEST, CLEAR_REQUEST, RECEIVE_REQUEST_ITEMS, RECEIVE_REQUEST_ACTIONS } from 'request/constants';
import { RECEIVE_REQUESTS_LIST, RECEIVE_REQUEST, CLEAR_REQUEST, RECEIVE_REQUEST_ITEMS, RECEIVE_REQUEST_ACTIONS } from 'distribution/constants';
// Model
import OrderRequest from '@gringlobal/client/model/gringlobal/OrderRequest';
import { FilteredPage } from '@gringlobal/client/model/page';
......
......@@ -8,39 +8,39 @@ const publicRoutes: IRoute[] = [
{
exact: true,
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "request" */ 'request/ui/RequestBrowsePage'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "distribution" */ 'distribution/ui/DistributionBrowsePage'),
}),
path: '/request',
path: '/distribution',
},
{
exact: true,
auth: [ UserRole.USER ],
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "request" */ 'request/ui/RequestAddPage'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "distribution" */ 'distribution/ui/DistributionAddPage'),
}),
path: '/request/new',
path: '/distribution/new',
},
{
exact: true,
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "request" */'request/ui/CheckList'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "distribution" */'distribution/ui/CheckList'),
}),
path: '/request/checklist/:requestId(\\d+)?',
path: '/distribution/checklist/:distributionId(\\d+)?',
},
{
exact: true,
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "request" */'request/ui/RequestDetailsPage'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "distribution" */'distribution/ui/DistributionDetailsPage'),
}),
path: '/request/:id(\\d+)',
path: '/distribution/:id(\\d+)',
},
{
exact: true,
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "request" */'request/ui/AddMaterialPage'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "distribution" */'distribution/ui/AddMaterialPage'),
}),
path: '/request/:requestId(\\d+)/add',
path: '/distribution/:distributionId(\\d+)/add',
},
];
export { publicRoutes as requestPublicRoutes };
export { publicRoutes as distributionPublicRoutes };
......@@ -8,7 +8,7 @@ import memoize from 'memoize-one';
// Actions
import navigateTo from '@gringlobal/client/action/navigation';
import { clearOrderRequestState } from 'request/action/public';
import { clearOrderRequestState } from 'distribution/action/public';
// Layout
import ContentHeader from '@gringlobal/client/ui/common/heading/ContentHeader';
import Table, { TextAlign } from '@gringlobal/client/ui/common/table/Table';
......@@ -240,11 +240,11 @@ class AddMaterialPage extends React.Component<IProps & WithTranslation & WithSty
return (
<>
<PageTitle title={ t('request.addmaterial.title') }/>
<PageTitle title={ t('distribution.addmaterial.title') }/>
<ContentHeader title={ request ?
<>
{ request.localNumber ? request.localNumber : request.id }
</> : t('request.addmaterial.title')
</> : t('distribution.addmaterial.title')
} />
<Card>
......@@ -252,13 +252,13 @@ class AddMaterialPage extends React.Component<IProps & WithTranslation & WithSty
<Form onSubmit={ this.updateNames } render={ ({ handleSubmit }) => (
<form onSubmit={ handleSubmit }>
<Field
placeholder={ t('request.addmaterial.names.placeholder') }
placeholder={ t('distribution.addmaterial.names.placeholder') }
name="names"
type="text"
component={ TextField }
autoFocus
onPaste={ this.pasteNames }
label={ t('request.addmaterial.names.label') }
label={ t('distribution.addmaterial.names.label') }
/>
</form>
) } />
......@@ -268,7 +268,7 @@ class AddMaterialPage extends React.Component<IProps & WithTranslation & WithSty
{ names && names.map((name) => (
<Card key={ name }>
<CardHeader title={ t('request.addmaterial.names.resultsFor', { name }) } />
<CardHeader title={ t('distribution.addmaterial.names.resultsFor', { name }) } />
<CardContent>
<AccessionSelector
requestedName={ name }
......@@ -280,7 +280,7 @@ class AddMaterialPage extends React.Component<IProps & WithTranslation & WithSty
) ) }
{ requestItems && <Card>
<CardHeader title={ t('request.addmaterial.items') } />
<CardHeader title={ t('distribution.addmaterial.items') } />
<Table
noWrap
tableKey="inventory-adjust-list"
......
......@@ -177,7 +177,7 @@ class CheckList extends React.Component<IProps> {
defaultColumnSettings: {
sequenceNumber: { readonly: true, align: TextAlign.right },
statusCode: { align: TextAlign.center },
_itemCheckbox: { align: TextAlign.center, label: 'request.checklist.checked' },
_itemCheckbox: { align: TextAlign.center, label: 'distribution.checklist.checked' },
_inventoryId: { align: TextAlign.center, label: 'client:model.Inventory.inventoryId' }, // todo: remove in production
quantityShipped: { align: TextAlign.right },
},
......@@ -378,7 +378,7 @@ class CheckList extends React.Component<IProps> {
return (
<>
<PageTitle title={ t('request.checklist.title') }/>
<PageTitle title={ t('distribution.checklist.title') }/>
<HeaderTabs
value={ currentTab }
textColor="primary"
......@@ -387,9 +387,9 @@ class CheckList extends React.Component<IProps> {
scrollButtons="auto"
aria-label="Inventory tabs"
>
<Tab value={ CheckListTabs.SCAN } label={ t('request.checklist.tabs.scan') } />
<Tab value={ CheckListTabs.REQUEST } label={ t('request.checklist.tabs.request') } />
<Tab value={ CheckListTabs.FAULTS } label={ t('request.checklist.tabs.faults') } disabled={ !incorrectList.length }/>
<Tab value={ CheckListTabs.SCAN } label={ t('distribution.checklist.tabs.scan') } />
<Tab value={ CheckListTabs.REQUEST } label={ t('distribution.checklist.tabs.request') } />
<Tab value={ CheckListTabs.FAULTS } label={ t('distribution.checklist.tabs.faults') } disabled={ !incorrectList.length }/>
</HeaderTabs>
<TabPanel value={ currentTab } index={ CheckListTabs.SCAN }>
<SlotLayout
......@@ -406,19 +406,19 @@ class CheckList extends React.Component<IProps> {
<Grid container justify="space-between" className={ classes.categories }>
<Grid item xs={ 6 } sm={ 3 } className={ classes.barcodeCategory } direction="column">
<div>{ checked }</div>
<div>{ t('request.checklist.checked') }</div>
<div>{ t('distribution.checklist.checked') }</div>
</Grid>
<Grid item xs={ 6 } sm={ 3 } className={ classes.barcodeCategory } direction="column">
<div>{ requestItems ? requestItems.length - checked : '-' }</div>
<div>{ t('request.checklist.remaining') }</div>
<div>{ t('distribution.checklist.remaining') }</div>
</Grid>
<Grid item xs={ 6 } sm={ 3 } className={ classes.barcodeCategory } direction="column">
<div>{ requestItems ? requestItems.length : '-' }</div>
<div>{ t('request.checklist.total') }</div>
<div>{ t('distribution.checklist.total') }</div>
</Grid>
<Grid item xs={ 6 } sm={ 3 } className={ classes.barcodeCategory } direction="column">
<div>{ incorrectList.length }</div>
<div>{ t('request.checklist.incorrect') }</div>
<div>{ t('distribution.checklist.incorrect') }</div>
</Grid>
</Grid>
</>
......@@ -438,7 +438,7 @@ class CheckList extends React.Component<IProps> {
<TabPanel value={ currentTab } index={ CheckListTabs.REQUEST }>
{ request &&
<Card>
<CardHeader title={ t('request.public.p.details.title') } />
<CardHeader title={ t('distribution.public.p.details.title') } />
<CardContent>
<Properties>
<PropertiesItem title={ t('client:model.OrderRequest.orderTypeCode') }>
......@@ -464,7 +464,7 @@ class CheckList extends React.Component<IProps> {
<TabPanel value={ currentTab } index={ CheckListTabs.FAULTS }>
{ !!incorrectList.length && (
<Card>
<CardHeader title={ t('request.checklist.incorrectBarcodes') } />
<CardHeader title={ t('distribution.checklist.incorrectBarcodes') } />
<CardContent className={ classes.incorrectBarcodes }>
{ incorrectList.map((barcode, i) => (
<span key={ `${barcode}-${i}` }>{ barcode }</span>
......
......@@ -5,18 +5,18 @@ import { WithTranslation, withTranslation } from 'react-i18next';
// Model
import OrderRequest from '@gringlobal/client/model/gringlobal/OrderRequest';
// Action
import { createOrderRequestAction } from 'request/action/public';
import { createOrderRequestAction } from 'distribution/action/public';
// UI
import ContentHeader from '@gringlobal/client/ui/common/heading/ContentHeader';
import { Card, CardContent } from '@material-ui/core';
import OrderRequestForm from 'request/ui/c/OrderRequestForm';
import OrderRequestForm from 'distribution/ui/c/OrderRequestForm';
import PageTitle from '@gringlobal/client/ui/common/PageTitle';
interface IRequestAddPage extends React.ClassAttributes<any> {
createOrderRequestAction: (orderRequest: OrderRequest) => any;
}
class RequestAddPage extends React.Component<IRequestAddPage & WithTranslation> {
class DistributionAddPage extends React.Component<IRequestAddPage & WithTranslation> {
protected static needs = [];
......@@ -62,4 +62,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
export default compose(
connect(mapStateToProps, mapDispatchToProps),
withTranslation(),
)(RequestAddPage);
)(DistributionAddPage);
......@@ -5,7 +5,7 @@ import { WithTranslation, withTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
// Action
import { listOrderRequestsAction, loadMoreOrderRequestsAction } from 'request/action/public';
import { listOrderRequestsAction, loadMoreOrderRequestsAction } from 'distribution/action/public';
// Model
import OrderRequest from '@gringlobal/client/model/gringlobal/OrderRequest';
import Cooperator from '@gringlobal/client/model/gringlobal/Cooperator';
......@@ -17,7 +17,7 @@ import Table, { TextAlign, Renderers } from '@gringlobal/client/ui/common/table/
import AddNewButton from '@gringlobal/client/ui/common/button/AddNewButton';
import { CooperatorOwnedTableConfiguration as TableConfiguration } from '@gringlobal/client/ui/common/table/TableConfiguration';
import { PrintSpecies } from 'common/Taxonomy';
import Filters from 'request/ui/c/Filters';
import Filters from 'distribution/ui/c/Filters';
import OrderRequestFilter from '@gringlobal/client/model/gringlobal/OrderRequestFilter';
import TaxonomySpecies from '@gringlobal/client/model/gringlobal/TaxonomySpecies';
import withBrowsePageBase, { WithBrowsePageBase } from 'ui/common/withBrowsePageBase';
......@@ -55,7 +55,7 @@ export const OrderRequestTableDefaultConfig = {
id: { readonly: true, align: TextAlign.right },
},
columnsRenderers: {
localNumber: (localNumber: string, request: OrderRequest): JSX.Element => <Link to={ `/request/${request.id}` }>
localNumber: (localNumber: string, request: OrderRequest): JSX.Element => <Link to={ `/distribution/${request.id}` }>
{ localNumber || request.id }
</Link>,
orderTypeCode: (codeValue) => <CodeValueDisplay codeGroup={ OrderRequest.CodeGroup.orderTypeCode } value={ codeValue } />,
......@@ -102,8 +102,8 @@ class BrowsePage extends React.Component<IBrowsePageProps> {
return (
<>
<PageTitle title={ t('request.public.p.request.list') }/>
<ContentHeader title={ t('request.public.p.request.list') }>
<PageTitle title={ t('distribution.public.p.distribution.list') }/>
<ContentHeader title={ t('distribution.public.p.distribution.list') }>
<Filters
onSubmit={ applyFilter }
filter={ data && data.filter }
......@@ -124,7 +124,7 @@ class BrowsePage extends React.Component<IBrowsePageProps> {
/>
<AddNewButton
title="OrderRequest"
path="request/new"
path="distribution/new"
/>
</>
);
......@@ -134,7 +134,7 @@ class BrowsePage extends React.Component<IBrowsePageProps> {
const mapStateToProps = (state) => ({
loadableData: state.request.public.requestList,
loadableData: state.distribution.public.requestList,
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
......
......@@ -6,7 +6,7 @@ import { WithTranslation, withTranslation } from 'react-i18next';
// Action
import { ApiCall } from '@gringlobal/client/model/common';
import { getOrderRequestAction, listOrderRequestItemsAction, listOrderRequestActionsAction } from 'request/action/public';
import { getOrderRequestAction, listOrderRequestItemsAction, listOrderRequestActionsAction } from 'distribution/action/public';
import { RequestService } from '@gringlobal/client/service';
import OrderRequest from '@gringlobal/client/model/gringlobal/OrderRequest';
import Loading from '@gringlobal/client/ui/common/Loading';
......@@ -24,7 +24,7 @@ import { InventoryName } from 'common/Inventory';
import ButtonBar from '@gringlobal/client/ui/common/button/ButtonBar';
import PageTitle from '@gringlobal/client/ui/common/PageTitle';
import OrderRequestAction from '@gringlobal/client/model/gringlobal/OrderRequestAction';
import { BasicRequestActionsTable as RequestActionsTable } from 'request/ui/c/RequestActionsTable';
import { BasicRequestActionsTable as RequestActionsTable } from 'distribution/ui/c/RequestActionsTable';
import Tab from '@material-ui/core/Tab';
import HeaderTabs from '@gringlobal/client/ui/common/tabs/HeaderTabs';
import TabPanel from '@gringlobal/client/ui/common/tabs/TabPanel';
......@@ -158,7 +158,7 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
return (
<>
<PageTitle title={ request ? request.localNumber ? request.localNumber : `${t('request.public.p.details.title')} ${request.id}` : t('request.public.p.details.title') }/>
<PageTitle title={ request ? request.localNumber ? request.localNumber : `${t('distribution.public.p.details.title')} ${request.id}` : t('distribution.public.p.details.title') }/>
<HeaderTabs
value={ currentTab }
textColor="primary"
......@@ -167,8 +167,8 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
scrollButtons="auto"
aria-label="Request tabs"
>
<Tab value={ RequestTabs.REQUEST } label={ t('request.public.p.details.title') } />
<Tab value={ RequestTabs.ACTIONS } label={ t('request.public.p.details.actions') } />
<Tab value={ RequestTabs.REQUEST } label={ t('distribution.public.p.details.title') } />
<Tab value={ RequestTabs.ACTIONS } label={ t('distribution.public.p.details.actions') } />
</HeaderTabs>
<TabPanel value={ currentTab } index={ RequestTabs.REQUEST }>
{ loading && <Loading/> }
......@@ -180,7 +180,7 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
<CardHeader title={
request
? <>{ request.localNumber ? request.localNumber : request.id }</>
: t('request.public.p.details.title')
: t('distribution.public.p.details.title')
}/>
<CardContent>
<Properties>
......@@ -200,7 +200,7 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
</CardContent>
<CardActions>
<ButtonBar>
<Link to={ `/request/${request.id}/add` }><Button variant="contained" color="primary">{ t('Add material...') }</Button></Link>
<Link to={ `/distribution/${request.id}/add` }><Button variant="contained" color="primary">{ t('Add material...') }</Button></Link>
<Button variant="contained" color="primary" onClick={ this.verifyItemList }>{ t('Verify item list') }</Button>
<Button variant="contained" color="secondary">Edit</Button>
<Button variant="outlined" color="secondary">Remove</Button>
......@@ -212,7 +212,7 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
}
>
<Card>
<CardHeader title={ t('request.public.p.details.items') } />
<CardHeader title={ t('distribution.public.p.details.items') } />
{ requestItemsCall && requestItemsCall.data && requestItemsCall.data.totalElements > 0 &&
<CardActions>
<ButtonBar>
......@@ -257,9 +257,9 @@ class OrderRequestDetailsPage extends React.Component<IDetailsPageProps> {
const mapStateToProps = (state, ownProps) => ({
id: ownProps.match.params.id,
requestCall: state.request.public.request,
requestItemsCall: state.request.public.requestItems,
requestActionsCall: state.request.public.requestActions,
requestCall: state.distribution.public.request,
requestItemsCall: state.distribution.public.requestItems,
requestActionsCall: state.distribution.public.requestActions,
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
......
......@@ -32,7 +32,7 @@ function accessionFiltersInternal(props: FormRenderProps & WithStyles) {
return (
<form onSubmit={ handleSubmit }>
<Field
placeholder={ t('accession.public.c.filters.text') }
placeholder={ t('distribution.public.c.filters.text') }
name="_text"
type="text"
component={ TextField }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment