-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCDA Validator v3 functionality part 2 (#68)
* Functionality for CCDA-V3 Validator * Add .env * Validator results continuation * Minor adjustments for Validator results * Styling enhancements (#66) * ui: reformat result total cards * ui: replace avatar with chips in dialog menu * ui: make uploaded file a chip and deletable * ui: move helpertext within validation indicator * fix: duplicate content --------- Co-authored-by: Matthew Stankiewicz <[email protected]> * CCDA Validator error handling and menu * Remove unused imports * Rearrange and rename some validator components * ui: add theme over error display and reformat error pop-up * fix: overlap in xpath & ccda. Plus alter colors & format for summary * Some more changes for Validator * Validator totals display * ui: reformat total row to include grid. Add padding on subheaders * fix: take out overflow * fix: z-index for close button on error display * Validator minor changes * ui: add helpertext for save results * ui: replace static helpertext with tooltip for save button * Add Details component and handle error scenario * ui: add breakpoints * ui: add scroll breakpoint on dialogTemplate * ui: add padding on loading results title * fix: reduce chip size * fix: reduce accordion min height * fix: take out scrollToTop and use anchor link method * ui: add padding bottom to c-cda content * ui: speed up indicator * Clean up for ValidatorV3 * ui: add styles for back to top button, hover and visted puesdo classes * fix: take out unused code --------- Co-authored-by: mattystank <[email protected]> Co-authored-by: Matthew Stankiewicz <[email protected]>
- Loading branch information
1 parent
9eefbac
commit 5ad77d6
Showing
22 changed files
with
969 additions
and
494 deletions.
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 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
125 changes: 0 additions & 125 deletions
125
src/components/c-cda/validation/ValidatorLoadingCard.tsx
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
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,71 @@ | ||
import React from 'react' | ||
import { Box, Dialog, DialogTitle, IconButton, DialogContent, Typography } from '@mui/material' | ||
import CloseIcon from '@mui/icons-material/Close' | ||
import { ErrorOutline } from '@mui/icons-material' | ||
import palette from '@/styles/palette' | ||
import ONCLogo from '@public/shared/ONCLogo-backgroundImage.png' | ||
import Image from 'next/image' | ||
|
||
interface ErrorDisplayCardProps { | ||
open: boolean | ||
handleClose: () => void | ||
response: { error?: string | null; errorStatus?: number } | ||
} | ||
const ErrorDisplayCard = ({ open, handleClose, response }: ErrorDisplayCardProps) => { | ||
return ( | ||
<> | ||
{response ? ( | ||
<Dialog open={open} maxWidth="sm" onClose={handleClose}> | ||
<IconButton | ||
aria-label="Close Dialog" | ||
sx={{ zIndex: '1000', position: 'absolute', right: 8, top: 8 }} | ||
onClick={handleClose} | ||
> | ||
<CloseIcon htmlColor={palette.white} /> | ||
</IconButton> | ||
<Box px={4} py={3} alignItems={'flex-start'} display={'flex'} flexDirection={'row'} bgcolor={palette.warning}> | ||
<Image | ||
style={{ | ||
backgroundSize: 'contain', | ||
backgroundRepeat: 'no-repeat', | ||
top: -80, | ||
left: -1, | ||
position: 'absolute', | ||
overflow: 'clip', | ||
width: '100%', | ||
height: '100%', | ||
objectFit: 'none', | ||
}} | ||
src={ONCLogo} | ||
alt="ONC Logo" | ||
/> | ||
<ErrorOutline sx={{ mb: -1 }} fontSize={'large'} htmlColor={palette.white} /> | ||
<Box> | ||
<DialogTitle | ||
textAlign={'left'} | ||
color={palette.white} | ||
sx={{ fontWeight: '600', px: 2, py: 1 }} | ||
id="validating-dialog-title" | ||
variant="h3" | ||
> | ||
Oh no! | ||
<br /> | ||
Looks like there was an error. | ||
</DialogTitle> | ||
{response.errorStatus ? ( | ||
<Typography sx={{ px: 2 }} textAlign={'left'} color={palette.white}> | ||
Error Type: {response.errorStatus!} | ||
</Typography> | ||
) : null} | ||
</Box> | ||
</Box> | ||
<DialogContent sx={{ padding: '32px' }}> | ||
<Typography>{response.error}</Typography> | ||
</DialogContent> | ||
</Dialog> | ||
) : null} | ||
</> | ||
) | ||
} | ||
|
||
export default ErrorDisplayCard |
30 changes: 25 additions & 5 deletions
30
src/components/c-cda/validation/results/OriginalCCDAResult.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 |
---|---|---|
@@ -1,13 +1,33 @@ | ||
import { Box } from '@mui/material' | ||
import palette from '@/styles/palette' | ||
import { Accordion, AccordionDetails, AccordionSummary, Box, Typography } from '@mui/material' | ||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore' | ||
interface OriginalCCDAResultProps { | ||
xmlData: string | ||
xmlData: { ccdaFileContents: string } | ||
} | ||
|
||
const OriginalCCDAResult = ({ xmlData }: OriginalCCDAResultProps) => { | ||
return ( | ||
<Box> | ||
<pre>{xmlData}</pre> | ||
</Box> | ||
<Accordion | ||
sx={{ | ||
py: 0, | ||
'&:before': { | ||
display: 'none', | ||
}, | ||
borderLeft: `4px solid ${palette.greyDark}`, | ||
}} | ||
disableGutters | ||
elevation={1} | ||
> | ||
<AccordionSummary sx={{ borderBottom: `1px solid ${palette.divider}` }} expandIcon={<ExpandMoreIcon />}> | ||
<Typography sx={{ fontWeight: 'bold', border: `` }}>C-CDA</Typography> | ||
</AccordionSummary> | ||
|
||
<AccordionDetails sx={{ p: 2 }}> | ||
<Box sx={{ marginBottom: 1, width: '100%', overflow: 'auto' }} p={2}> | ||
<pre style={{ whiteSpace: 'pre-line', wordWrap: 'break-word' }}>{xmlData.ccdaFileContents}</pre> | ||
</Box> | ||
</AccordionDetails> | ||
</Accordion> | ||
) | ||
} | ||
export default OriginalCCDAResult |
Oops, something went wrong.