This repository has been archived by the owner on Jan 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from cfpb/alt-disclosure
Disclosure s3 server and select component
- Loading branch information
Showing
22 changed files
with
269 additions
and
305 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
Binary file not shown.
Binary file not shown.
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 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,21 +1,52 @@ | ||
.LoadingIconWrapper { | ||
.LoadingInline.LoadingIconWrapper { | ||
height: 22px; | ||
width: 22px; | ||
display: inline-block; | ||
position: relative; | ||
transform: rotateX(180deg); | ||
width: 40px; | ||
margin-left: 5px; | ||
margin-top: 0; | ||
padding-top: 3px; | ||
.LoadingIcon { | ||
height: 22px; | ||
width: 22px; | ||
} | ||
} | ||
|
||
.LoadingIcon { | ||
animation: loading-spin 2s infinite linear; | ||
position: absolute; | ||
top: -7px; | ||
.status .LoadingInline { | ||
height: 18px; | ||
width: 18px; | ||
} | ||
|
||
|
||
@keyframes loading-spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(-359deg); | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
.LoadingIconWrapper { | ||
position: relative; | ||
height: 30px; | ||
width: 30px; | ||
display: inline-block; | ||
margin-top: 2em; | ||
margin-left: 48%; | ||
} | ||
|
||
.LoadingIcon { | ||
position:absolute; | ||
margin: 0 auto; | ||
border: 4px solid $color-gray-lightest; | ||
border-left-color: $color-primary; | ||
border-radius: 50%; | ||
width: 30px; | ||
height: 30px; | ||
animation: loading-spin 1.2s linear infinite; | ||
} | ||
|
||
.usa-alert .LoadingIcon { | ||
border: 4px solid $color-gray-lighter; | ||
border-left-color: $color-primary; | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -1,119 +1,20 @@ | ||
import React from 'react' | ||
import Header from '../common/Header.jsx' | ||
|
||
const MSAMDS = [ | ||
{ id: '25420', name: 'Harrisburg-Carlisle, PA' }, | ||
{ id: '25180', name: 'Hagerstown-Martinsburg, MD-WV' }, | ||
{ id: '25060', name: 'Gulfport-Biloxi, MS' }, | ||
{ id: '25020', name: 'Guayama, PR' }, | ||
{ id: '24860', name: 'Greenville, SC' }, | ||
{ id: '24780', name: 'Greenville, NC' }, | ||
{ id: '25500', name: 'Harrisonburg, VA' }, | ||
{ id: '25540', name: 'Hartford-West Hartford-East Hartford, CT' }, | ||
{ id: '25620', name: 'Hattiesburg, MS' }, | ||
{ id: '25860', name: 'Hickory-Lenoir-Morganton, NC' }, | ||
{ id: '25980', name: 'Hinesville-Fort Stewart, GA' }, | ||
{ id: '26100', name: 'Holland-Grand Haven, MI' }, | ||
{ id: '26180', name: 'Honolulu, HI' }, | ||
{ id: '26300', name: 'Hot Springs, AR' }, | ||
{ id: '26380', name: 'Houma-Bayou Cane-Thibodaux, LA' } | ||
] | ||
|
||
class MsaMds extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
|
||
this.state = { | ||
error: null, | ||
isLoaded: false, | ||
msamds: [], | ||
selectValue: '' | ||
} | ||
|
||
this.handleChange = this.handleChange.bind(this) | ||
this.handleSubmit = this.handleSubmit.bind(this) | ||
} | ||
|
||
componentDidMount() { | ||
// TODO: load either MSA/MDs for an institution or for a state | ||
let fetchURL = '' | ||
if (this.props.match.params.institutionId) | ||
fetchURL = `https://ffiec-api.cfpb.gov/public/filers/${ | ||
this.props.match.params.institutionId | ||
}/msamds` | ||
if (this.props.match.params.stateId) | ||
fetchURL = `https://ffiec-api.cfpb.gov/public/msamds?state=${ | ||
this.props.match.params.stateId | ||
}` | ||
|
||
this.setState({ msamds: MSAMDS, isLoaded: true, selectValue: MSAMDS[0].id }) | ||
/* | ||
fetch(fetchURL) | ||
.then(res => res.json()) | ||
.then( | ||
result => { | ||
this.setState({ | ||
isLoaded: true, | ||
msamds: result.msamds | ||
}) | ||
}, | ||
error => { | ||
this.setState({ | ||
isLoaded: true, | ||
error | ||
}) | ||
} | ||
)*/ | ||
} | ||
|
||
handleChange(event) { | ||
this.setState({ selectValue: event.target.value }) | ||
} | ||
|
||
handleSubmit(event) { | ||
this.props.history.push({ | ||
pathname: `${this.props.match.url}/msa-md/${this.state.selectValue}` | ||
}) | ||
event.preventDefault() | ||
} | ||
|
||
render() { | ||
let msaMdsFor = '' | ||
if (this.props.match.params.institutionId) | ||
msaMdsFor = this.props.match.params.institutionId | ||
if (this.props.match.params.stateId) | ||
msaMdsFor = this.props.match.params.stateId | ||
|
||
return ( | ||
<div className="usa-grid msa-mds" id="main-content"> | ||
<Header | ||
type={1} | ||
headingText={`Choose an available MSA/MD for ${msaMdsFor}`} | ||
/> | ||
|
||
<form onSubmit={this.handleSubmit}> | ||
<label htmlFor="states">Select a MSA/MD</label> | ||
|
||
<select | ||
name="msamds" | ||
id="msamds" | ||
value={this.state.selectValue} | ||
onChange={this.handleChange} | ||
> | ||
{this.state.msamds.map((msamd, index) => { | ||
return ( | ||
<option key={index} value={msamd.id}> | ||
{msamd.id} - {msamd.name} | ||
</option> | ||
) | ||
})} | ||
</select> | ||
|
||
<input type="submit" value="Next - Find a Report" /> | ||
</form> | ||
</div> | ||
) | ||
} | ||
import Selector from './Selector.jsx' | ||
|
||
const MsaMds = props => { | ||
return ( | ||
<Selector | ||
target="msa-md" | ||
placeholder="Select MSA/MD..." | ||
paragraphText="Listed below are all the MSA/MDs for this institution" | ||
getHeader={function() { | ||
return `Choose an available MSA/MD for institution ${ | ||
this.props.match.params.institutionId | ||
}` | ||
}} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export default MsaMds |
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.