-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPDX-8479 HI Report Page & key #1228
Open
dr-bizz
wants to merge
24
commits into
health-indicator
Choose a base branch
from
8479-hi-report-page
base: health-indicator
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3d157e1
Add config file for GraphQL language server
canac 3c6d694
Extract typeguard into lib
canac d6ddc19
Refactor monthYearFormat to accept DateTime instances
canac ddc65d5
Create reusable LegendReferenceLine component
canac 7d356c9
Create reusable BarChartSkeleton component
canac d179617
Unconditionally mock window.ResizeObserver
canac d1efb9f
Create HealthIndicatorGraph component
canac 597e418
Remove Hi suffix from field names
canac 165f36c
fixup! Create reusable BarChartSkeleton component
canac 2e01206
Add graph colors to theme
canac e3940ad
fixup! Create reusable LegendReferenceLine component
canac 94bc197
Fixing error: Required unplugged package missing from disk
dr-bizz f942c79
Create bare bones of the MPD Health Indicator report page
dr-bizz abf0f90
Adding Monthly goal and HI graphs to report page
dr-bizz a10fc85
Health Formula
dr-bizz e9b3578
Adding tooltip and data to HI formula
dr-bizz a8e572b
Show no data message if no HI data
dr-bizz 7efc41d
Merge branch 'health-indicator' into 8479-hi-report-page
dr-bizz 40f0514
fixup! Create bare bones of the MPD Health Indicator report page
dr-bizz 938cc10
force codescene to review
dr-bizz 260ab26
Adding codceScene rules json to see if it changes how codeScene revie…
dr-bizz bef08f2
Cleaning up PR and simplifying code
dr-bizz 8ed6e96
fixup! Cleaning up PR and simplifying code
dr-bizz a45a032
fixup! Cleaning up PR and simplifying code
dr-bizz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,4 @@ | ||
{ | ||
"schema": "src/graphql/schema.graphql", | ||
"documents": "**/*.graphql" | ||
} |
42 changes: 42 additions & 0 deletions
42
pages/accountLists/[accountListId]/reports/healthIndicator/index.page.test.tsx
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,42 @@ | ||
import React from 'react'; | ||
import { ThemeProvider } from '@mui/material/styles'; | ||
import { LocalizationProvider } from '@mui/x-date-pickers'; | ||
import { AdapterLuxon } from '@mui/x-date-pickers/AdapterLuxon'; | ||
import { render } from '@testing-library/react'; | ||
import { SnackbarProvider } from 'notistack'; | ||
import { I18nextProvider } from 'react-i18next'; | ||
import TestRouter from '__tests__/util/TestRouter'; | ||
import { GqlMockedProvider } from '__tests__/util/graphqlMocking'; | ||
import i18n from 'src/lib/i18n'; | ||
import theme from 'src/theme'; | ||
import HealthIndicatorPage from './index.page'; | ||
|
||
const accountListId = 'account-list-1'; | ||
const router = { | ||
query: { accountListId }, | ||
isReady: true, | ||
}; | ||
|
||
const Components = () => ( | ||
<I18nextProvider i18n={i18n}> | ||
<LocalizationProvider dateAdapter={AdapterLuxon}> | ||
<SnackbarProvider> | ||
<ThemeProvider theme={theme}> | ||
<TestRouter router={router}> | ||
<GqlMockedProvider> | ||
<HealthIndicatorPage /> | ||
</GqlMockedProvider> | ||
</TestRouter> | ||
</ThemeProvider> | ||
</SnackbarProvider> | ||
</LocalizationProvider> | ||
</I18nextProvider> | ||
); | ||
|
||
describe('MPD Health Indicator Page', () => { | ||
it('should show initial financial accounts page', async () => { | ||
const { findByText } = render(<Components />); | ||
|
||
expect(await findByText('content')).toBeInTheDocument(); | ||
}); | ||
}); |
66 changes: 66 additions & 0 deletions
66
pages/accountLists/[accountListId]/reports/healthIndicator/index.page.tsx
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,66 @@ | ||
import Head from 'next/head'; | ||
import React, { useState } from 'react'; | ||
import { Box } from '@mui/material'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { loadSession } from 'pages/api/utils/pagePropsHelpers'; | ||
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; | ||
import Loading from 'src/components/Loading'; | ||
import { HealthIndicatorReport } from 'src/components/Reports/HealthIndicatorReport/HealthIndicatorReport'; | ||
import { headerHeight } from 'src/components/Shared/Header/ListHeader'; | ||
import { | ||
MultiPageMenu, | ||
NavTypeEnum, | ||
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu'; | ||
import { useAccountListId } from 'src/hooks/useAccountListId'; | ||
import useGetAppSettings from 'src/hooks/useGetAppSettings'; | ||
|
||
const HealthIndicatorPage: React.FC = () => { | ||
const { t } = useTranslation(); | ||
const accountListId = useAccountListId(); | ||
const { appName } = useGetAppSettings(); | ||
const [navListOpen, setNavListOpen] = useState(false); | ||
|
||
const handleNavListToggle = () => { | ||
setNavListOpen(!navListOpen); | ||
}; | ||
return ( | ||
<> | ||
<Head> | ||
<title>{`${appName} | ${t('Reports - MPD Health')}`}</title> | ||
</Head> | ||
|
||
{accountListId ? ( | ||
<Box sx={{ background: 'common.white' }}> | ||
<SidePanelsLayout | ||
headerHeight={headerHeight} | ||
isScrollBox={false} | ||
leftOpen={navListOpen} | ||
leftWidth="290px" | ||
mainContent={ | ||
<HealthIndicatorReport | ||
accountListId={accountListId} | ||
isNavListOpen={navListOpen} | ||
onNavListToggle={handleNavListToggle} | ||
title={t('Overall Staff MPD Health')} | ||
/> | ||
} | ||
leftPanel={ | ||
<MultiPageMenu | ||
isOpen={navListOpen} | ||
selectedId="healthIndicator" | ||
onClose={handleNavListToggle} | ||
navType={NavTypeEnum.Reports} | ||
/> | ||
} | ||
/> | ||
</Box> | ||
) : ( | ||
<Loading loading /> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export const getServerSideProps = loadSession; | ||
|
||
export default HealthIndicatorPage; |
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
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ No longer an issue: Code Duplication
The module no longer contains too many functions with similar structure