-
Notifications
You must be signed in to change notification settings - Fork 89
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 #1639 from monocle/demo-fix
Fix routing to demo bug. Closes #1472
- Loading branch information
Showing
7 changed files
with
138 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
import { connect } from "react-redux"; | ||
import { RecordData } from "../RecordSearch/Record/types"; | ||
import store, { AppState } from "../../redux/store"; | ||
import { startDemo } from "../../redux/search/actions"; | ||
import DemoInfo from "./DemoInfo"; | ||
import SearchPanel from "../RecordSearch/SearchPanel"; | ||
import Status from "../RecordSearch/Status"; | ||
import Record from "../RecordSearch/Record"; | ||
import Assumptions from "../RecordSearch/Assumptions"; | ||
|
||
interface Props { | ||
record?: RecordData; | ||
startDemo: Function; | ||
} | ||
|
||
class Demo extends React.Component<Props> { | ||
componentDidMount() { | ||
document.title = "Demo - RecordSponge"; | ||
store.dispatch(this.props.startDemo()); | ||
} | ||
|
||
render() { | ||
return ( | ||
<main className="mw8 center f6 f5-l ph2"> | ||
<DemoInfo /> | ||
<SearchPanel /> | ||
<Status record={this.props.record} /> | ||
<Record record={this.props.record} /> | ||
<Assumptions /> | ||
</main> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (state: AppState) => { | ||
return { | ||
record: state.search.record, | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps, { startDemo })(Demo); |
32 changes: 32 additions & 0 deletions
32
src/frontend/src/components/RecordSearch/Assumptions/index.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,32 @@ | ||
import React from "react"; | ||
import { HashLink as Link } from "react-router-hash-link"; | ||
|
||
export default function Assumptions() { | ||
return ( | ||
<div className="bg-white shadow mb6 pa4 br3"> | ||
<h2 className="fw6 mb3">Assumptions</h2> | ||
<p className="mb3"> | ||
We are only able to access your public Oregon records. | ||
</p> | ||
<p className="mb2"> | ||
Your analysis may be different if you have had cases which were: | ||
</p> | ||
<ul className="lh-copy pl4 mw6 mb3"> | ||
<li className="mb2">Previously expunged</li> | ||
<li className="mb2"> | ||
From States besides Oregon within the last ten years | ||
</li> | ||
<li className="mb2">From Federal Court within the last ten years</li> | ||
<li className="mb2"> | ||
From local District Courts, e.g. Medford Municipal Court (not Jackson | ||
County Circuit Court) from within the last ten years | ||
</li> | ||
</ul> | ||
<p> | ||
<Link className="link hover-blue underline" to="/manual#assumption1"> | ||
Learn more in the Manual | ||
</Link> | ||
</p> | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,42 @@ | ||
import React, { Component } from "react"; | ||
import React from "react"; | ||
import { connect } from "react-redux"; | ||
import { AppState } from "../../redux/store"; | ||
import { RecordData } from "./Record/types"; | ||
import store, { AppState } from "../../redux/store"; | ||
import { stopDemo } from "../../redux/search/actions"; | ||
import { checkOeciRedirect } from "../../service/cookie-service"; | ||
import SearchPanel from "./SearchPanel"; | ||
import Record from "./Record"; | ||
import Status from "./Status"; | ||
import DemoInfo from "./Demo/DemoInfo"; | ||
import { checkOeciRedirect } from "../../service/cookie-service"; | ||
import { HashLink as Link } from "react-router-hash-link"; | ||
import Assumptions from "./Assumptions"; | ||
|
||
interface Props { | ||
demo: boolean; | ||
record?: RecordData; | ||
stopDemo: Function; | ||
} | ||
|
||
class RecordSearch extends Component<Props> { | ||
|
||
class RecordSearch extends React.Component<Props> { | ||
componentDidMount() { | ||
this.props.demo || checkOeciRedirect(); | ||
checkOeciRedirect(); | ||
document.title = "Search Records - RecordSponge"; | ||
store.dispatch(this.props.stopDemo()); | ||
} | ||
|
||
render() { | ||
return ( | ||
<> | ||
<main className="mw8 center f6 f5-l ph2"> | ||
{this.props.demo && <DemoInfo />} | ||
<SearchPanel /> | ||
<Status record={this.props.record} /> | ||
<Record record={this.props.record} /> | ||
<div className="bg-white shadow mb6 pa4 br3"> | ||
<h2 className="fw6 mb3">Assumptions</h2> | ||
<p className="mb3"> | ||
We are only able to access your public Oregon records. | ||
</p> | ||
<p className="mb2"> | ||
Your analysis may be different if you have had cases which were: | ||
</p> | ||
<ul className="lh-copy pl4 mw6 mb3"> | ||
<li className="mb2">Previously expunged</li> | ||
<li className="mb2"> | ||
From States besides Oregon within the last ten years | ||
</li> | ||
<li className="mb2"> | ||
From Federal Court within the last ten years | ||
</li> | ||
<li className="mb2"> | ||
From local District Courts, e.g. Medford Municipal Court (not | ||
Jackson County Circuit Court) from within the last ten years | ||
</li> | ||
</ul> | ||
<p> | ||
<Link | ||
className="link hover-blue underline" | ||
to="/manual#assumption1" | ||
> | ||
Learn more in the Manual | ||
</Link> | ||
</p> | ||
</div> | ||
</main> | ||
</> | ||
<main className="mw8 center f6 f5-l ph2"> | ||
<SearchPanel /> | ||
<Status record={this.props.record} /> | ||
<Record record={this.props.record} /> | ||
<Assumptions /> | ||
</main> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (state: AppState) => { | ||
return { | ||
record: state.search.record, | ||
demo: state.search.demo, | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps, {})(RecordSearch); | ||
export default connect(mapStateToProps, { stopDemo })(RecordSearch); |
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