-
Notifications
You must be signed in to change notification settings - Fork 1
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 #760 from alliance-genome/release/v0.12.0-rc2
Release/v0.12.0-rc2
- Loading branch information
Showing
330 changed files
with
7,882 additions
and
1,783 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
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
48 changes: 48 additions & 0 deletions
48
src/main/cliapp/src/components/ConditionRelationHandleFormSelector.js
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,48 @@ | ||
import React, { useState } from 'react'; | ||
import { Dropdown } from "primereact/dropdown" | ||
import { SearchService } from '../service/SearchService'; | ||
|
||
export function ConditionRelationHandleFormDropdown({ editorChange, referenceCurie, value, name, showClear, placeholderText, isEnabled, customRef }) { | ||
const [selectedValue, setSelectedValue] = useState(value); | ||
const searchService = new SearchService(); | ||
const [handles, setHandles] = useState(null); | ||
|
||
const onShow = () => { | ||
searchService.find( | ||
"condition-relation", | ||
15, | ||
0, | ||
{"singleReference.curie": referenceCurie} | ||
).then((data) => { | ||
if (data.results?.length > 0) { | ||
setHandles(data.results); | ||
} else { | ||
setHandles(null); | ||
} | ||
}) | ||
} | ||
|
||
const onChange = (e) => { | ||
setSelectedValue(e.value); | ||
editorChange(e); | ||
} | ||
|
||
return ( | ||
<> | ||
<Dropdown | ||
ref={customRef} | ||
name={name} | ||
value={selectedValue} | ||
disabled={!isEnabled} | ||
options={handles} | ||
onShow={onShow} | ||
onChange={(e) => onChange(e)} | ||
optionLabel="handle" | ||
showClear={showClear} | ||
placeholder={placeholderText} | ||
style={{ width: '100%' }} | ||
/> | ||
</> | ||
) | ||
} | ||
|
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
Oops, something went wrong.