Skip to content

Commit

Permalink
OM-3329: dashboard init
Browse files Browse the repository at this point in the history
  • Loading branch information
olewandowski1 committed Oct 30, 2024
1 parent 943957e commit eb74a4a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import WorkerSearcherSelectActions from './components/WorkerSearcherSelectAction
import GroupsPage from './pages/GroupsPage';
import GroupDetailsPage from './pages/GroupDetailsPage';
import PublicVoucherDetailsPage from './pages/PublicVoucherDetailsPage';
import DashboardPage from './pages/DashboardPage';

const ROUTE_PUBLIC_WORKER_VOUCHER_PAGE = 'voucher/check';
const ROUTE_WORKER_VOUCHERS_LIST = 'voucher/vouchers';
Expand Down Expand Up @@ -183,6 +184,7 @@ const DEFAULT_CONFIG = {
],
'workerVoucher.VoucherHeadPanel': [BillVoucherHeadPanel],
'workerVoucher.WorkerSearcherAction.select': WorkerSearcherSelectActions,
'home.HomePage.customDashboard': DashboardPage,
};

export const WorkerVoucherModule = (cfg) => ({ ...DEFAULT_CONFIG, ...cfg });
38 changes: 38 additions & 0 deletions src/pages/DashboardPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';

import { Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/styles';

import { useTranslations } from '@openimis/fe-core';
import { MODULE_NAME } from '../constants';

export const useStyles = makeStyles((theme) => ({
page: theme.page,
pageTitle: {
fontWeight: 600,
},
}));

function DashboardPage() {
const classes = useStyles();
const { formatMessageWithValues } = useTranslations(MODULE_NAME);
const { economicUnit } = useSelector((state) => state.policyHolder);

useEffect(() => {
// eslint-disable-next-line no-console
console.log('Refetch data when EU changes');
}, [economicUnit]);

return (
<div className={classes.page}>
<Typography variant="h5" className={classes.pageTitle}>
{formatMessageWithValues('DashboardPage.title', {
employer: 'Employer',
})}
</Typography>
</div>
);
}

export default DashboardPage;
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,6 @@
"workerVoucher.PublicVoucherDetailsPage.noVoucherUuid": " Voucher UUID not provided.",
"workerVoucher.PublicVoucherDetailsPage.voucherNotFound": "Voucher not found.",
"workerVoucher.PublicVoucherDetailsPage.invalidVoucherFound": "Voucher is no longer valid. It was valid on the day {assignedDate} at the {employer} employer.",
"workerVoucher.PublicVoucherDetailsPage.voucherFound": "Voucher found. It is valid on the day {assignedDate} at the {employer} employer."
"workerVoucher.PublicVoucherDetailsPage.voucherFound": "Voucher found. It is valid on the day {assignedDate} at the {employer} employer.",
"workerVoucher.DashboardPage.title": "Welcome, {employer}!"
}

0 comments on commit eb74a4a

Please sign in to comment.