-
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 #1307 from alliance-genome/release/v0.27.0-rc1
Release/v0.27.0-rc1
- Loading branch information
Showing
266 changed files
with
11,628 additions
and
1,488 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { DialogErrorMessageComponent } from "../Error/DialogErrorMessageComponent"; | ||
import { useControlledVocabularyService } from "../../service/useControlledVocabularyService"; | ||
import { TrueFalseDropdown } from "../TrueFalseDropDownSelector"; | ||
|
||
export const ObsoleteEditor = ({ props, obsoleteOnChangeHandler, errorMessages, rowIndex }) => { | ||
const booleanTerms = useControlledVocabularyService("generic_boolean_terms"); | ||
|
||
return ( | ||
<> | ||
<TrueFalseDropdown | ||
props={props} | ||
field="obsolete" | ||
options={booleanTerms} | ||
editorChange={obsoleteOnChangeHandler} | ||
showClear={false} | ||
/> | ||
<DialogErrorMessageComponent errorMessages={errorMessages[rowIndex]} errorField={"obsolete"} /> | ||
</> | ||
); | ||
}; |
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
27 changes: 27 additions & 0 deletions
27
src/main/cliapp/src/components/Editors/references/SingleReferenceFormEditor.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,27 @@ | ||
import React from "react"; | ||
import { LiteratureAutocompleteTemplate } from "../../Autocomplete/LiteratureAutocompleteTemplate"; | ||
import { FormErrorMessageComponent } from "../../Error/FormErrorMessageComponent"; | ||
import { referenceSearch } from "./utils"; | ||
import { AutocompleteFormEditor } from "../../Autocomplete/AutocompleteFormEditor"; | ||
|
||
export const SingleReferenceFormEditor = ({ | ||
reference, | ||
onReferenceValueChange, | ||
errorMessages | ||
}) => { | ||
return ( | ||
<> | ||
<AutocompleteFormEditor | ||
inputClassNames="w-20rem" | ||
search={referenceSearch} | ||
name="singleReference" | ||
fieldName='singleReference' | ||
initialValue={reference} | ||
onValueChangeHandler={onReferenceValueChange} | ||
valueDisplay={(item, setAutocompleteHoverItem, op, query) => | ||
<LiteratureAutocompleteTemplate item={item} setAutocompleteHoverItem={setAutocompleteHoverItem} op={op} query={query} />} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"references"} /> | ||
</> | ||
); | ||
}; |
25 changes: 25 additions & 0 deletions
25
src/main/cliapp/src/components/Editors/references/SingleReferenceTableEditor.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,25 @@ | ||
import React from "react"; | ||
import { AutocompleteEditor } from "../../Autocomplete/AutocompleteEditor"; | ||
import { LiteratureAutocompleteTemplate } from "../../Autocomplete/LiteratureAutocompleteTemplate"; | ||
import { referenceSearch } from "./utils"; | ||
import { DialogErrorMessageComponent } from "../../Error/DialogErrorMessageComponent"; | ||
|
||
export const SingleReferenceTableEditor = ({ props, errorMessages, onChange }) => { | ||
return ( | ||
<> | ||
<AutocompleteEditor | ||
search={referenceSearch} | ||
initialValue={props.rowData?.curie} | ||
rowProps={props} | ||
fieldName='references' | ||
valueDisplay={(item, setAutocompleteHoverItem, op, query) => | ||
<LiteratureAutocompleteTemplate item={item} setAutocompleteHoverItem={setAutocompleteHoverItem} op={op} query={query}/>} | ||
onValueChangeHandler={onChange} | ||
/> | ||
<DialogErrorMessageComponent | ||
errorMessages={errorMessages[props?.rowIndex]} | ||
errorField={"select"} | ||
/> | ||
</> | ||
); | ||
}; |
28 changes: 28 additions & 0 deletions
28
...pp/src/components/Editors/sourceGeneralConsequence/SourceGeneralConsequenceTableEditor.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,28 @@ | ||
import React from "react"; | ||
import { AutocompleteEditor } from "../../Autocomplete/AutocompleteEditor"; | ||
import { ErrorMessageComponent } from "../../Error/ErrorMessageComponent"; | ||
import { sourceGeneralConsequenceSearch } from "./utils"; | ||
import { defaultAutocompleteOnChange } from "../../../utils/utils"; | ||
|
||
export const SourceGeneralConsequenceTableEditor = ({ rowProps, errorMessagesRef}) => { | ||
|
||
const onSourceGeneralConsequenceValueChange = (event, setFieldValue, props) => { | ||
defaultAutocompleteOnChange(props, event, "sourceGeneralConsequence", setFieldValue); | ||
}; | ||
|
||
return ( | ||
<> | ||
<AutocompleteEditor | ||
search={sourceGeneralConsequenceSearch} | ||
initialValue={rowProps.rowData.sourceGeneralConsequence?.curie} | ||
rowProps={rowProps} | ||
fieldName='sourceGeneralConsequence' | ||
onValueChangeHandler={onSourceGeneralConsequenceValueChange} | ||
/> | ||
<ErrorMessageComponent | ||
errorMessages={errorMessagesRef.current[rowProps.rowIndex]} | ||
errorField='sourceGeneralConsequence' | ||
/> | ||
</> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
src/main/cliapp/src/components/Editors/sourceGeneralConsequence/utils.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,13 @@ | ||
import { buildAutocompleteFilter, autocompleteSearch } from "../../../utils/utils"; | ||
import { SearchService } from "../../../service/SearchService"; | ||
|
||
|
||
export const sourceGeneralConsequenceSearch = (event, setFiltered, setQuery) => { | ||
const searchService = new SearchService(); | ||
const autocompleteFields = ["curie", "name", "secondaryIdentifiers", "synonyms.name"]; | ||
const endpoint = "soterm"; | ||
const filterName = "sourceGeneralConsequenceFilter"; | ||
setQuery(event.query); | ||
const filter = buildAutocompleteFilter(event, autocompleteFields); | ||
autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/cliapp/src/components/Editors/variantType/VariantTypeTableEditor.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,28 @@ | ||
import React from "react"; | ||
import { AutocompleteEditor } from "../../Autocomplete/AutocompleteEditor"; | ||
import { ErrorMessageComponent } from "../../Error/ErrorMessageComponent"; | ||
import { variantTypeSearch } from "./utils"; | ||
import { defaultAutocompleteOnChange } from "../../../utils/utils"; | ||
|
||
export const VariantTypeTableEditor = ({ rowProps, errorMessagesRef}) => { | ||
|
||
const onVariantTypeValueChange = (event, setFieldValue, props) => { | ||
defaultAutocompleteOnChange(props, event, "variantType", setFieldValue); | ||
}; | ||
|
||
return ( | ||
<> | ||
<AutocompleteEditor | ||
search={variantTypeSearch} | ||
initialValue={rowProps.rowData.variantType?.curie} | ||
rowProps={rowProps} | ||
fieldName='variantType' | ||
onValueChangeHandler={onVariantTypeValueChange} | ||
/> | ||
<ErrorMessageComponent | ||
errorMessages={errorMessagesRef.current[rowProps.rowIndex]} | ||
errorField='variantType' | ||
/> | ||
</> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
src/main/cliapp/src/components/Editors/variantType/utils.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,13 @@ | ||
import { buildAutocompleteFilter, autocompleteSearch } from "../../../utils/utils"; | ||
import { SearchService } from "../../../service/SearchService"; | ||
|
||
|
||
export const variantTypeSearch = (event, setFiltered, setQuery) => { | ||
const searchService = new SearchService(); | ||
const autocompleteFields = ["curie", "name", "secondaryIdentifiers", "synonyms.name"]; | ||
const endpoint = "soterm"; | ||
const filterName = "sourceGeneralConsequenceFilter"; | ||
setQuery(event.query); | ||
const filter = buildAutocompleteFilter(event, autocompleteFields); | ||
autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); | ||
} |
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
25 changes: 4 additions & 21 deletions
25
src/main/cliapp/src/components/Templates/CrossReferenceTemplate.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 |
---|---|---|
@@ -1,41 +1,24 @@ | ||
import { EllipsisTableCell } from '../../components/EllipsisTableCell'; | ||
import { differentiateCrossReferences } from '../../containers/allelesPage/utils'; | ||
|
||
export const CrossReferencesTemplate = ({ rowData }) => { | ||
if (!rowData) return null; | ||
|
||
const { crossReferences, curieField } = differentiateCrossReferences(rowData); | ||
|
||
const sortedCrossReferences = crossReferences.sort((a, b) => (a[curieField] > b[curieField]) ? 1 : -1); | ||
const sortedCrossReferences = crossReferences?.sort((a, b) => (a[curieField] > b[curieField]) ? 1 : -1); | ||
|
||
return ( | ||
<div> | ||
<ul type={{ listType: 'none' }}> | ||
{sortedCrossReferences.map((a, index) => | ||
{sortedCrossReferences?.map((reference, index) => | ||
<li key={index}> | ||
<EllipsisTableCell> | ||
{a[curieField]} | ||
{reference[curieField]} | ||
</EllipsisTableCell> | ||
</li> | ||
)} | ||
</ul> | ||
</div> | ||
); | ||
}; | ||
|
||
const differentiateCrossReferences = (reference) => { | ||
let crossReferences; | ||
let curieField; | ||
|
||
if (reference.cross_references) { | ||
crossReferences = global.structuredClone(reference.cross_references); | ||
curieField = "curie"; | ||
} else if (reference.crossReferences) { | ||
crossReferences = global.structuredClone(reference.crossReferences); | ||
curieField = "referencedCurie"; | ||
} else { | ||
return; | ||
} | ||
|
||
return {crossReferences, curieField}; | ||
|
||
}; |
Oops, something went wrong.