Skip to content

Commit

Permalink
Merge branch '2.x-dev' of https://github.com/EBISPOT/zooma into integ…
Browse files Browse the repository at this point in the history
…rationTests
  • Loading branch information
henrietteharmse committed May 14, 2021
2 parents ae73731 + b05f7df commit da45f1b
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 217 deletions.
4 changes: 0 additions & 4 deletions zooma-ui/src/main/frontend/public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ main {
background-color: #FFFDC4 !important;
}

.unmapped {
display: none;
}

.context-help-wrapper {
position: relative;
top: 20px;
Expand Down
28 changes: 27 additions & 1 deletion zooma-ui/src/main/frontend/src/components/ResultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface Props {
}

interface State {
hideUnmapped: boolean
}

export default class ResultsTable extends Component<Props, State> {
Expand All @@ -19,12 +20,22 @@ export default class ResultsTable extends Component<Props, State> {
super(props)

this.state = {
hideUnmapped: false
}
}

render() {

let { results } = this.props

console.dir(results)

return (
<Fragment>
<label>
<input type="checkbox" checked={this.state.hideUnmapped} onClick={this.toggleHideUnmapped}/>
Hide results that did not map
</label>
<table>
<thead>
<tr>
Expand All @@ -50,7 +61,9 @@ export default class ResultsTable extends Component<Props, State> {
</thead>
<tbody>
{
this.props.results.map(result =>
results
.filter(result => (!this.state.hideUnmapped) || result.mappingConfidence !== 'Did not map')
.map(result =>
<tr className={getResultClass(result)}>
<td>{result.propertyType}</td>
<td>{result.propertyValue}</td>
Expand All @@ -64,9 +77,22 @@ export default class ResultsTable extends Component<Props, State> {
)}
</tbody>
</table>
<p>
<b>Stats:</b> {results.length} properties &emsp;&emsp;
{results.filter(r => r.mappingConfidence === 'High').length} high &emsp;&emsp;
{results.filter(r => r.mappingConfidence === 'Good').length} good &emsp;&emsp;
{results.filter(r => r.mappingConfidence === 'Medium').length} medium &emsp;&emsp;
{results.filter(r => r.mappingConfidence === 'Low').length} low &emsp;&emsp;
{results.filter(r => r.mappingConfidence === 'Did not map').length} unmapped
</p>
</Fragment>
)
}

toggleHideUnmapped = () => {
this.setState({ hideUnmapped: !this.state.hideUnmapped })
}

}

function Datasource(props:any) {
Expand Down
6 changes: 4 additions & 2 deletions zooma-ui/src/main/frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ If you are new to ZOOMA, take a look at our getting started guide.</p>
</Row>
<br/>
<Row className="align-center">
<button className="button large" onClick={this.onClickAnnotate}>Annotate</button>
<button className="button large"
disabled={this.state.searching}
onClick={this.onClickAnnotate}>Annotate</button>
&nbsp;
<button className="button secondary large"
disabled={this.state.results.length === 0}
Expand Down Expand Up @@ -163,7 +165,7 @@ If you are new to ZOOMA, take a look at our getting started guide.</p>
properties, requiredSources, preferredSources, ontologySources, doNotSearchDatasources, doNotSearchOntologies
}

this.setState(prevState => ({ ...prevState, searching: true }))
await this.setState(prevState => ({ ...prevState, searching: true }))

let { results, tsv } = await ZoomaApi.search(searchParams, (progress:number) => {
this.setState(prevState => ({ ...prevState, progress }))
Expand Down
Loading

0 comments on commit da45f1b

Please sign in to comment.