-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from OpenLMIS-Angola/OAM-226-add-missing-tran…
…slations OAM-226: Added missing translaitons to order create component
- Loading branch information
Showing
13 changed files
with
193 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"react.table.noItems": "Showing no items" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,14 @@ | |
* http://www.gnu.org/licenses. For additional information contact [email protected]. | ||
*/ | ||
|
||
import React, { useRef, useState, useLayoutEffect } from 'react'; | ||
import React, { useRef, useState, useLayoutEffect, useMemo } from 'react'; | ||
import { useTable, usePagination } from 'react-table'; | ||
|
||
import PrevPageButton from '../buttons/prev-page-button'; | ||
import NextPageButton from '../buttons/next-page-button'; | ||
import PageButton from '../buttons/page-button'; | ||
|
||
import getService from '../utils/angular-utils'; | ||
|
||
const Table = ({ | ||
columns, | ||
|
@@ -71,6 +72,8 @@ const Table = ({ | |
usePagination | ||
); | ||
|
||
const { formatMessage } = useMemo(() => getService('messageService'), []); | ||
|
||
const ref = useRef(null); | ||
// Get width of the table and pass it to the table-empty-message | ||
const [width, setWidth] = useState(0); | ||
|
@@ -157,7 +160,7 @@ const Table = ({ | |
</table> | ||
{!data.length ? ( | ||
<div className='table-empty-message' style={{ width: width }}> | ||
<span>{!noItemsMessage ? "Showing no items" : noItemsMessage}</span> | ||
<span>{!noItemsMessage ? formatMessage('react.table.noItems') : noItemsMessage}</span> | ||
</div> | ||
) : null} | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,23 +13,26 @@ | |
* http://www.gnu.org/licenses. For additional information contact [email protected]. | ||
*/ | ||
|
||
import React from 'react'; | ||
import React, { useMemo } from 'react'; | ||
import { HashRouter as Router, Route, Switch, useLocation } from 'react-router-dom'; | ||
import OrderCreateTable from './order-create-table'; | ||
import OrderCreateForm from './order-create-form'; | ||
import Breadcrumbs from '../react-components/breadcrumbs/breadcrumbs'; | ||
import getService from '../react-components/utils/angular-utils'; | ||
|
||
const OrderCreateRouting = () => { | ||
const location = useLocation(); | ||
const queryParams = new URLSearchParams(location.search); | ||
const isReadOnly = queryParams.get('isReadOnly') === 'true'; | ||
const { formatMessage } = useMemo(() => getService('messageService'), []); | ||
|
||
return ( | ||
<div className="page-responsive"> | ||
<Breadcrumbs | ||
routes={[ | ||
{ path: "/requisitions/orderCreate", breadcrumb: 'Create Order' }, | ||
{ path: "/requisitions/orderCreate/:orderIds", breadcrumb: isReadOnly ? 'View' : 'Edit' } | ||
{ path: "/requisitions/orderCreate", breadcrumb: formatMessage('requisition.orderCreate') }, | ||
{ path: "/requisitions/orderCreate/:orderIds", | ||
breadcrumb: isReadOnly ? formatMessage('requisition.orderCreate.view') : formatMessage('requisition.orderCreate.edit') } | ||
]} | ||
/> | ||
<Switch> | ||
|
15 changes: 9 additions & 6 deletions
15
src/requisition-order-create/order-create-requisition-info.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.