-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
207 additions
and
16 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
121 changes: 121 additions & 0 deletions
121
apps/smart-forms-app/src/features/notfound/NotFoundQuickLinks.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,121 @@ | ||
/* | ||
* Copyright 2023 Commonwealth Scientific and Industrial Research | ||
* Organisation (CSIRO) ABN 41 687 119 230. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import type { ReactNode } from 'react'; | ||
import { Box, Card, Grid, IconButton, Stack, Typography } from '@mui/material'; | ||
import GridViewIcon from '@mui/icons-material/GridView'; | ||
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; | ||
import LocalFireDepartmentIcon from '@mui/icons-material/LocalFireDepartment'; | ||
import StorageIcon from '@mui/icons-material/Storage'; | ||
import DataSaverOnIcon from '@mui/icons-material/DataSaverOn'; | ||
import GitHubIcon from '@mui/icons-material/GitHub'; | ||
import MenuBookIcon from '@mui/icons-material/MenuBook'; | ||
|
||
interface QuickLinkCardProps { | ||
title: string; | ||
description: string; | ||
link: string; | ||
icon: ReactNode; | ||
} | ||
|
||
const quickLinkCards: QuickLinkCardProps[] = [ | ||
{ | ||
title: 'App Dashboard', | ||
description: 'View, create and edit responses from FHIR questionnaires.', | ||
link: 'https://smartforms.csiro.au', | ||
icon: <GridViewIcon fontSize="large" color="primary" /> | ||
}, | ||
{ | ||
title: 'FHIR Implementation Guide', | ||
description: 'A FHIR Implementation Guide to support the use of Smart Forms.', | ||
link: 'https://smartforms.csiro.au/ig', | ||
icon: <LocalFireDepartmentIcon fontSize="large" color="primary" /> | ||
}, | ||
{ | ||
title: 'Forms Server FHIR API', | ||
description: 'A Questionnaire-hosting FHIR API which supports the $assemble operation.', | ||
link: 'https://smartforms.csiro.au/fhir', | ||
icon: <StorageIcon fontSize="large" color="primary" /> | ||
}, | ||
{ | ||
title: 'EHR Launch Simulator', | ||
description: 'A minimal EHR testbed (SMART Launcher fork) for launching SMART apps.', | ||
link: 'https://smartforms.csiro.au/ehr', | ||
icon: <DataSaverOnIcon fontSize="large" color="primary" /> | ||
}, | ||
{ | ||
title: 'GitHub', | ||
description: 'View the GitHub page for this open-source project.', | ||
link: 'https://github.com/aehrc/smart-forms', | ||
icon: <GitHubIcon fontSize="large" color="primary" /> | ||
} | ||
]; | ||
|
||
function NotFoundQuickLinks() { | ||
return ( | ||
<Grid container spacing={2}> | ||
{quickLinkCards.map((card) => ( | ||
<Grid key={card.link} item xs={12} sm={6} md={4}> | ||
<Card sx={{ p: 3, pb: 2.5, height: '100%' }}> | ||
<Stack justifyContent="space-between" height="inherit"> | ||
<Grid container spacing={1}> | ||
<Grid item xs={2}> | ||
{card.icon} | ||
</Grid> | ||
<Grid item xs={10}> | ||
<Typography variant="h5" mb={1}> | ||
{card.title} | ||
</Typography> | ||
<Typography>{card.description}</Typography> | ||
</Grid> | ||
</Grid> | ||
<Box display="flex" flexDirection="row-reverse"> | ||
<IconButton color="primary" href={card.link}> | ||
<ArrowForwardIcon /> | ||
</IconButton> | ||
</Box> | ||
</Stack> | ||
</Card> | ||
</Grid> | ||
))} | ||
<Grid item xs={12} sm={6} md={4}> | ||
<Card sx={{ p: 3, pb: 2.5, height: '100%' }}> | ||
<Stack justifyContent="space-between" height="inherit"> | ||
<Grid container spacing={1}> | ||
<Grid item xs={2}> | ||
<MenuBookIcon fontSize="large" color="primary" /> | ||
</Grid> | ||
<Grid item xs={10}> | ||
<Typography variant="h5" mb={1}> | ||
Developer Documentation | ||
</Typography> | ||
<Typography color="text.disabled">Coming soon!</Typography> | ||
</Grid> | ||
</Grid> | ||
<Box display="flex" flexDirection="row-reverse"> | ||
<IconButton color="primary" disabled> | ||
<ArrowForwardIcon /> | ||
</IconButton> | ||
</Box> | ||
</Stack> | ||
</Card> | ||
</Grid> | ||
</Grid> | ||
); | ||
} | ||
|
||
export default NotFoundQuickLinks; |
63 changes: 63 additions & 0 deletions
63
apps/smart-forms-app/src/features/notfound/NotFoundSelections.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,63 @@ | ||
/* | ||
* Copyright 2023 Commonwealth Scientific and Industrial Research | ||
* Organisation (CSIRO) ABN 41 687 119 230. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Box, Stack, Typography } from '@mui/material'; | ||
import ReauthenticateButton from '../../components/Button/ReauthenticateButton.tsx'; | ||
import NotFoundQuickLinks from './NotFoundQuickLinks.tsx'; | ||
|
||
interface NotFoundSelectionsProps { | ||
authSessionFound: boolean; | ||
} | ||
|
||
function NotFoundSelections(props: NotFoundSelectionsProps) { | ||
const { authSessionFound } = props; | ||
|
||
if (authSessionFound) { | ||
return ( | ||
<> | ||
<Stack rowGap={1.5}> | ||
<Typography fontSize={15}> | ||
{ | ||
"We couldn't find the page you were looking for, but we detected a recent authorisation session." | ||
} | ||
</Typography> | ||
<Typography fontSize={15}> | ||
You would need to be re-authenticated. Do you want to try re-authenticating? | ||
</Typography> | ||
</Stack> | ||
<Box mt={4} /> | ||
<ReauthenticateButton /> | ||
</> | ||
); | ||
} | ||
|
||
return ( | ||
<> | ||
<Stack rowGap={1.5} mb={5}> | ||
<Typography fontSize={14}>{"We couldn't find what you were looking for."}</Typography> | ||
|
||
<Typography fontSize={14}> | ||
Use the quick links below to navigate to the page you were looking for. | ||
</Typography> | ||
</Stack> | ||
|
||
<NotFoundQuickLinks /> | ||
</> | ||
); | ||
} | ||
|
||
export default NotFoundSelections; |