This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- create facilities tab for displaying a text list of facilities - add free text search field to search on name, and country name fields - add functionality to download a CSV of facilities filtered by free text search - update Redux actions to handle toggling & displaying the facilities tab and storing the free text search value - adjust application HTML element hierarchy & style sheet in order to - prevent the enter app from scrolling vertically - enable select components to scroll vertically when necessary
- Loading branch information
Kelly Innes
committed
Mar 4, 2019
1 parent
dae70dc
commit 12ed908
Showing
27 changed files
with
844 additions
and
241 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* eslint-env jest */ | ||
import isEqual from 'lodash/isEqual'; | ||
|
||
import { | ||
csvHeaders, | ||
createFacilityRowFromFeature, | ||
formatDataForCSV, | ||
} from '../util/util.facilitiesCSV'; | ||
|
||
it('creates a new facility row array from a feature', () => { | ||
const feature = { | ||
properties: { | ||
name: 'name', | ||
address: 'address', | ||
country_code: 'country_code', | ||
country_name: 'country_name', | ||
oar_id: 'oar_id', | ||
}, | ||
geometry: { | ||
coordinates: [ | ||
'lng', | ||
'lat', | ||
], | ||
}, | ||
}; | ||
|
||
const expectedRowArray = [ | ||
'oar_id', | ||
'name', | ||
'address', | ||
'country_code', | ||
'country_name', | ||
'lat', | ||
'lng', | ||
]; | ||
|
||
expect(isEqual( | ||
createFacilityRowFromFeature(feature), | ||
expectedRowArray, | ||
)).toBe(true); | ||
}); | ||
|
||
it('creates a 2-d array including headers for exporting as a CSV', () => { | ||
const facilities = [ | ||
{ | ||
properties: { | ||
name: 'name', | ||
address: 'address', | ||
country_code: 'country_code', | ||
country_name: 'country_name', | ||
oar_id: 'oar_id', | ||
}, | ||
geometry: { | ||
coordinates: [ | ||
'lng', | ||
'lat', | ||
], | ||
}, | ||
}, | ||
]; | ||
|
||
const expected2DArray = [ | ||
csvHeaders, | ||
[ | ||
'oar_id', | ||
'name', | ||
'address', | ||
'country_code', | ||
'country_name', | ||
'lat', | ||
'lng', | ||
], | ||
]; | ||
|
||
expect(isEqual( | ||
formatDataForCSV(facilities), | ||
expected2DArray, | ||
)).toBe(true); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { node } from 'prop-types'; | ||
|
||
export default function AppOverflow({ | ||
children, | ||
}) { | ||
return ( | ||
<div style={{ height: '100%', overflow: 'auto' }}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
AppOverflow.propTypes = { | ||
children: node.isRequired, | ||
}; |
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.