-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from openimis/feature/OM-79
OM-79: eslint fix, new navbar contribs init, draft pages
- Loading branch information
Showing
11 changed files
with
133 additions
and
28 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
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 |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import babel from '@rollup/plugin-babel' | ||
import json from '@rollup/plugin-json' | ||
import pkg from './package.json' | ||
import babel from '@rollup/plugin-babel'; | ||
import json from '@rollup/plugin-json'; | ||
import pkg from './package.json'; | ||
|
||
export default { | ||
input: 'src/index.js', | ||
output: [ | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
sourcemap: true | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: 'dist/index.js', | ||
format: 'cjs', | ||
sourcemap: true | ||
} | ||
sourcemap: true, | ||
}, | ||
], | ||
external: [ | ||
/^@babel.*/, | ||
/^@date-io\/.*/, | ||
/^@material-ui\/.*/, | ||
/^@openimis.*/, | ||
"classnames", | ||
"clsx", | ||
"history", | ||
'classnames', | ||
'clsx', | ||
'history', | ||
/^lodash.*/, | ||
"moment", | ||
"prop-types", | ||
'moment', | ||
'prop-types', | ||
/^react.*/, | ||
/^redux.*/ | ||
/^redux.*/, | ||
], | ||
plugins: [ | ||
json(), | ||
babel({ | ||
exclude: 'node_modules/**', | ||
babelHelpers: 'runtime' | ||
babelHelpers: 'runtime', | ||
}), | ||
] | ||
} | ||
], | ||
}; |
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,5 @@ | ||
sonar.projectKey=openimis_openimis-fe-worker_voucher_js | ||
sonar.organization=openimis-1 | ||
sonar.projectName=openimis-fe-worker_voucher_js | ||
sonar.sources=src | ||
sonar.sourceEncoding=UTF-8 |
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,2 @@ | ||
// TODO: Adjust rights to the proper ones after BE implementation | ||
export const VOUCHER_RIGHT_SEARCH = 101101; |
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 |
---|---|---|
@@ -1,9 +1,54 @@ | ||
import messages_en from "./translations/en.json"; | ||
/* eslint-disable react/react-in-jsx-scope */ | ||
/* eslint-disable import/prefer-default-export */ | ||
/* eslint-disable camelcase */ | ||
|
||
import React from 'react'; | ||
|
||
import ListAltIcon from '@material-ui/icons/ListAlt'; | ||
import LocalAtmIcon from '@material-ui/icons/LocalAtm'; | ||
import GroupAddIcon from '@material-ui/icons/GroupAdd'; | ||
|
||
import { FormattedMessage } from '@openimis/fe-core'; | ||
import { VOUCHER_RIGHT_SEARCH } from './constants'; | ||
import VoucherAcquirementPage from './pages/VoucherAcquirementPage'; | ||
import VoucherAssignmentPage from './pages/VoucherAssignmentPage'; | ||
import VoucherDetailsPage from './pages/VoucherDetailsPage'; | ||
import VouchersPage from './pages/VouchersPage'; | ||
import messages_en from './translations/en.json'; | ||
|
||
const ROUTE_WORKER_VOUCHERS_LIST = 'voucher/vouchers'; | ||
const ROUTE_WORKER_VOUCHER = 'voucher/vouchers/voucher'; | ||
const ROUTE_WORKER_VOUCHER_ACQUIREMENT = 'voucher/acquirement'; | ||
const ROUTE_WORKER_VOUCHER_ASSIGNMENT = 'voucher/assignment'; | ||
|
||
const DEFAULT_CONFIG = { | ||
"translations": [{ key: "en", messages: messages_en }], | ||
translations: [{ key: 'en', messages: messages_en }], | ||
'worker.MainMenu': [ | ||
{ | ||
text: <FormattedMessage module="workerVoucher" id="menu.voucherList" />, | ||
icon: <ListAltIcon />, | ||
route: `/${ROUTE_WORKER_VOUCHERS_LIST}`, | ||
filter: (rights) => [VOUCHER_RIGHT_SEARCH].some((right) => rights.includes(right)), | ||
}, | ||
{ | ||
text: <FormattedMessage module="workerVoucher" id="menu.voucherAcquirement" />, | ||
icon: <LocalAtmIcon />, | ||
route: `/${ROUTE_WORKER_VOUCHER_ACQUIREMENT}`, | ||
filter: (rights) => [VOUCHER_RIGHT_SEARCH].some((right) => rights.includes(right)), | ||
}, | ||
{ | ||
text: <FormattedMessage module="workerVoucher" id="menu.voucherAssignment" />, | ||
icon: <GroupAddIcon />, | ||
route: `/${ROUTE_WORKER_VOUCHER_ASSIGNMENT}`, | ||
filter: (rights) => [VOUCHER_RIGHT_SEARCH].some((right) => rights.includes(right)), | ||
}, | ||
], | ||
'core.Router': [ | ||
{ path: ROUTE_WORKER_VOUCHERS_LIST, component: VouchersPage }, | ||
{ path: `${ROUTE_WORKER_VOUCHER}/:voucher_uuid?`, component: VoucherDetailsPage }, | ||
{ path: ROUTE_WORKER_VOUCHER_ACQUIREMENT, component: VoucherAcquirementPage }, | ||
{ path: ROUTE_WORKER_VOUCHER_ASSIGNMENT, component: VoucherAssignmentPage }, | ||
], | ||
}; | ||
|
||
export const WorkerVoucherModule = (cfg) => { | ||
return { ...DEFAULT_CONFIG, ...cfg }; | ||
}; | ||
export const WorkerVoucherModule = (cfg) => ({ ...DEFAULT_CONFIG, ...cfg }); |
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,11 @@ | ||
import React from 'react'; | ||
|
||
function VoucherAcquirementPage() { | ||
return ( | ||
<div> | ||
VoucherAcquirementPage | ||
</div> | ||
); | ||
} | ||
|
||
export default VoucherAcquirementPage; |
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,11 @@ | ||
import React from 'react'; | ||
|
||
function VoucherAssignmentPage() { | ||
return ( | ||
<div> | ||
VoucherAssignmentPage | ||
</div> | ||
); | ||
} | ||
|
||
export default VoucherAssignmentPage; |
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,11 @@ | ||
import React from 'react'; | ||
|
||
function VoucherDetailsPage() { | ||
return ( | ||
<div> | ||
VoucherDetailsPage | ||
</div> | ||
); | ||
} | ||
|
||
export default VoucherDetailsPage; |
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,11 @@ | ||
import React from 'react'; | ||
|
||
function VouchersPage() { | ||
return ( | ||
<div> | ||
VouchersPage | ||
</div> | ||
); | ||
} | ||
|
||
export default VouchersPage; |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
{ | ||
} | ||
"workerVoucher.menu.voucherList": "Voucher List", | ||
"workerVoucher.menu.voucherAcquirement": "Voucher Acquirement", | ||
"workerVoucher.menu.voucherAssignment": "Voucher Assignment" | ||
} |