-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add default incident startdate, validate on blur * Hide tableview filters from mat chart in incident reports * Add meta tags to incident report * Don't throw an error when caption is invalid * Add publish/unpublish buttons * Switch datetime with date only input * Add more navigation buttons and error styling * remove double import * Improve preview modal * Handle missing email address * Improve handling of missing email modal * Fix SpinLoader warnings for styled props * Fix ASN submission * Display number of reports * Show report creation date * Change form validation mode * Change display of networks * Rename incidents to findings * Display creation date on index page * Improve MAT tag validation * Show all reports on the dashboard
- Loading branch information
Showing
28 changed files
with
1,577 additions
and
1,271 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
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
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,60 @@ | ||
import { Heading, Flex, Box, Text } from 'ooni-components' | ||
import { Badge } from 'components/Badge' | ||
import Flag from 'components/Flag' | ||
import Markdown from 'markdown-to-jsx' | ||
import { MATChartWrapper } from 'components/MATChart' | ||
import { getLocalisedRegionName } from 'utils/i18nCountries' | ||
import { useIntl } from 'react-intl' | ||
import { formatLongDate } from 'utils' | ||
import NLink from 'next/link' | ||
|
||
const FormattedMarkdown = ({ children }) => { | ||
return ( | ||
<Markdown | ||
options={{ | ||
overrides: { | ||
MAT: { | ||
component: MATChartWrapper, | ||
}, | ||
}, | ||
}} | ||
> | ||
{children} | ||
</Markdown> | ||
) | ||
} | ||
|
||
const FindingDisplay = ({ incident }) => { | ||
const intl = useIntl() | ||
|
||
return ( | ||
<> | ||
<Heading h={1} mt={4} mb={4} pb={3} sx={{borderBottom: '1px solid', borderColor: 'gray3'}}> | ||
{incident?.title} | ||
</Heading> | ||
{!!incident?.CCs?.length && ( | ||
<Flex alignItems="center"> | ||
<Flag countryCode={incident.CCs[0]} size={32} /> | ||
<Heading h={3} ml={2}> | ||
{getLocalisedRegionName(incident.CCs[0], intl.locale)} | ||
</Heading> | ||
</Flex> | ||
)} | ||
<Text color="gray6" mb={3}>{incident?.start_time && formatLongDate(incident?.start_time, intl.locale)} - {incident?.end_time ? formatLongDate(incident?.end_time, intl.locale) : 'ongoing'}</Text> | ||
{!!incident?.tags?.length && ( | ||
<Flex mb={3}> | ||
{incident.tags.map((tag) => ( | ||
<Box key={tag} mr={2}> | ||
<Badge>{tag}</Badge> | ||
</Box> | ||
))} | ||
</Flex> | ||
)} | ||
<Text color="gray6" mb={4}>created by {incident?.reported_by} on {incident?.create_time && formatLongDate(incident?.create_time, intl.locale)}</Text> | ||
{!!incident?.ASNs?.length && <Box mb={3} fontSize={18} lineHeight="1.5">Network: {incident.ASNs.map((as) => (<NLink key={as} href={`/as/AS${as}`}>{`AS${as}`}</NLink>)).reduce((prev, curr) => (prev ? [prev, ', ', curr] : curr), null)}</Box>} | ||
<Box fontSize={18} lineHeight="1.5">{incident?.text && <FormattedMarkdown>{incident.text}</FormattedMarkdown>}</Box> | ||
</> | ||
) | ||
} | ||
|
||
export default FindingDisplay |
Oops, something went wrong.
2d0c038
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.
Successfully deployed to the following URLs:
explorer – ./
explorer-ooni1.vercel.app
explorer-git-master-ooni1.vercel.app
explorer-one.vercel.app