This file contains hidden or 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
import React, { useEffect } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { | |
compose, | |
unless, | |
prop, | |
isNil, | |
merge, | |
propOr, | |
tryCatch, |
This file contains hidden or 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
import { useEffect, useRef, useReducer } from 'react'; | |
import { merge, forEach, reject, append } from 'ramda'; | |
export const useIsMounted = () => { | |
const ref = useRef(null); | |
useEffect(() => { | |
ref.current = true; | |
return () => { | |
ref.current = false; | |
}; |
This file contains hidden or 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
import { pathEq, allPass, anyPass } from 'ramda'; | |
import { projectHasOverlayId } from 'data/project/docs/overlays'; | |
import { projectHasActivityId } from 'data/project/activities'; | |
import { projectHasCoastalInundationControl } from 'data/project/controls'; | |
export const reportData = [ | |
{ | |
section: 'Flooding', | |
reports: [ | |
{ |
This file contains hidden or 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
['Hobsonville Marina sub-precinct A', 'Central Park', 'Orakei Point sub-precinct F', 'Tamaki', 'Riverhead 3', | |
'Orewa 1 sub-precinct D', 'Avondale 2 sub-precinct A', | |
'Beachlands 2 sub-precinct B', 'Orakei Point sub-precinct C', | |
'Babich sub-precinct B', 'Hillsborough', | |
'Hillsborough sub-precinct B', 'Oratia Village', | |
'Waitemata Navigation Channel [rcp]', 'Grafton sub-precinct B', | |
'Rowing and Paddling [rcp]', 'Orakei Point sub-precinct A', | |
'Wairaka sub-precinct A', 'Mount Albert 2 sub-precinct B', | |
'Waiuku sub-precinct D', 'Albany 9 sub-precinct D', | |
'Beachlands 1 sub-precinct B', 'Britomart sub-precinct A', |
This file contains hidden or 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
const zoneNameDocumentIdMap = { | |
'Residential - Large Lot Zone': 'H1', | |
'Residential - Rural and Coastal Settlement Zone': 'H2', | |
'Residential - Single House Zone': 'H3', | |
'Residential - Mixed Housing Suburban Zone': 'H4', | |
'Residential - Mixed Housing Urban Zone': 'H5', | |
'Residential -Terrace Housing and Apartment Buildings Zone': 'H6', | |
'Open Space - Conservation Zone': 'H7', | |
'Open Space - Informal Recreation Zone': 'H7', | |
'Open Space - Sport and Active Recreation Zone': 'H7', |
This file contains hidden or 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
import React from 'react'; | |
import { map } from 'ramda'; | |
import { H1, Table, Row, Cell, TableColHeading } from './document/common-components'; | |
const defaultDate = () => new Date().toLocaleDateString('en-NZ'); | |
const getAppendices = () => { | |
return [ | |
{ id: 'A', name: 'Site Pre-Check', author: 'Rico', date: defaultDate() }, | |
{ id: 'B', name: 'Proposal Checklist', author: 'Rico', date: defaultDate() } |
This file contains hidden or 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
import { GISImageGenerator } from 'gis/images'; | |
import { DocumentGenerator } from './document/document'; | |
import { DocumentStyle } from './document/style'; | |
import { | |
generateFirstPageHeader, | |
generateFirstPageFooter, | |
generateFooter, | |
generateHeader | |
} from './header-footer'; | |
import { generateAppendices } from './appendices'; |
This file contains hidden or 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
import { Paragraph, PageBreak, TextRun } from 'docx'; | |
import { | |
curry, | |
compose, | |
reject, | |
assoc, | |
isNil, | |
merge, | |
map, | |
split, |
This file contains hidden or 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
<Document title="Test Doc"> | |
<Section> | |
<H1>Title</H1> | |
<Paragraph> | |
<Run bold={true}>Test Title </Run> | |
<Run italics={true}>Italics are cool</Run> | |
</Paragraph> | |
</Section> | |
</Document> |
This file contains hidden or 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
import React, { useContext } from 'react'; | |
import TestRenderer from 'react-test-renderer'; | |
import { AuthProvider, AuthContext } from './AuthContext'; | |
import { UserReadableError } from 'func-utils'; | |
const token = expiry => '.' + btoa(JSON.stringify({ exp: expiry / 1000 })); | |
describe('AuthProvider', () => { | |
let providerContext = null; | |
let mount = null; |