-
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 #1198 from alliance-genome/release/v0.23.0-rc1
Release/v0.23.0-rc1
- Loading branch information
Showing
104 changed files
with
1,455 additions
and
287 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
40 changes: 40 additions & 0 deletions
40
src/main/cliapp/src/components/Editors/inCollection/InCollectionFormEditor.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,40 @@ | ||
import React from 'react'; | ||
import { AutocompleteFormEditor } from '../../Autocomplete/AutocompleteFormEditor'; | ||
import { inCollectionSearch } from './utils'; | ||
import { FormErrorMessageComponent } from '../../Error/FormErrorMessageComponent'; | ||
import { InCollectionAdditionalFieldData } from '../../FieldData/InCollectionAdditionalFieldData'; | ||
import { VocabTermAutocompleteTemplate } from '../../Autocomplete/VocabTermAutocompleteTemplate'; | ||
|
||
export const InCollectionFormEditor = ({ | ||
inCollection, | ||
onInCollectionValueChange, | ||
widgetColumnSize, | ||
labelColumnSize, | ||
fieldDetailsColumnSize, | ||
errorMessages | ||
}) => { | ||
|
||
return ( | ||
<div className="grid"> | ||
<div className={labelColumnSize}> | ||
<label htmlFor="inCollection">In Collection</label> | ||
</div> | ||
<div className={widgetColumnSize}> | ||
<AutocompleteFormEditor | ||
name="inCollection-input" | ||
search={inCollectionSearch} | ||
initialValue={inCollection} | ||
fieldName='inCollection' | ||
subField='name' | ||
onValueChangeHandler={onInCollectionValueChange} | ||
valueDisplay={(item, setAutocompleteSelectedItem, op, query) => | ||
<VocabTermAutocompleteTemplate item={item} op={op} query={query} setAutocompleteSelectedItem={setAutocompleteSelectedItem}/>} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"inCollection"}/> | ||
</div> | ||
<div className={fieldDetailsColumnSize}> | ||
<InCollectionAdditionalFieldData name={inCollection?.name}/> | ||
</div> | ||
</div> | ||
) | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/cliapp/src/components/Editors/inCollection/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,19 @@ | ||
import { buildAutocompleteFilter, autocompleteSearch } from "../../../utils/utils"; | ||
import { SearchService } from "../../../service/SearchService"; | ||
|
||
export const inCollectionSearch = (event, setFiltered, setQuery) => { | ||
const searchService = new SearchService(); | ||
const autocompleteFields = ["name"]; | ||
const endpoint = "vocabularyterm"; | ||
const filterName = "taxonFilter"; | ||
const otherFilters = { | ||
vocabularyFilter: { | ||
"vocabulary.name": { | ||
queryString: "Allele collection vocabulary" | ||
} | ||
} | ||
} | ||
setQuery(event.query); | ||
const filter = buildAutocompleteFilter(event, autocompleteFields); | ||
autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered, otherFilters); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/cliapp/src/components/Editors/internal/InternalFormEditor.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,38 @@ | ||
import React from 'react'; | ||
import { FormErrorMessageComponent } from '../../Error/FormErrorMessageComponent'; | ||
import { Dropdown } from 'primereact/dropdown'; | ||
import { InternalAdditionalFieldData } from '../../FieldData/InternalAdditionalFieldData'; | ||
|
||
export const InternalFormEditor = ({ | ||
internal, | ||
onInternalValueChange, | ||
booleanTerms, | ||
widgetColumnSize, | ||
labelColumnSize, | ||
fieldDetailsColumnSize, | ||
errorMessages | ||
}) => { | ||
|
||
return ( | ||
<div className="grid"> | ||
<div className={labelColumnSize}> | ||
<label htmlFor="internal">Internal</label> | ||
</div> | ||
<div className={widgetColumnSize}> | ||
<Dropdown | ||
name="internal" | ||
value={internal} | ||
options={booleanTerms} | ||
optionLabel='text' | ||
optionValue='name' | ||
onChange={onInternalValueChange} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"internal"}/> | ||
</div> | ||
<div className={fieldDetailsColumnSize}> | ||
<InternalAdditionalFieldData internal={internal?.toString()}/> | ||
</div> | ||
</div> | ||
|
||
) | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/cliapp/src/components/Editors/isExtinct/IsExtinctFormEditor.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,37 @@ | ||
import React from 'react'; | ||
import { FormErrorMessageComponent } from '../../Error/FormErrorMessageComponent'; | ||
import { IsExtinctAdditionalFieldData } from '../../FieldData/IsExtinctAdditionalFieldData'; | ||
import { Dropdown } from 'primereact/dropdown'; | ||
|
||
export const IsExtinctFormEditor = ({ | ||
isExtinct, | ||
onIsExtinctValueChange, | ||
booleanTerms, | ||
widgetColumnSize, | ||
labelColumnSize, | ||
fieldDetailsColumnSize, | ||
errorMessages | ||
}) => { | ||
|
||
return ( | ||
<div className="grid"> | ||
<div className={labelColumnSize}> | ||
<label htmlFor="isExtinct">Is Extinct</label> | ||
</div> | ||
<div className={widgetColumnSize}> | ||
<Dropdown | ||
name="isExtinct" | ||
value={isExtinct} | ||
options={booleanTerms} | ||
optionLabel='text' | ||
optionValue='name' | ||
onChange={onIsExtinctValueChange} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"isExtinct"}/> | ||
</div> | ||
<div className={fieldDetailsColumnSize}> | ||
<IsExtinctAdditionalFieldData isExtinct={isExtinct?.toString()}/> | ||
</div> | ||
</div> | ||
) | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/cliapp/src/components/Editors/obsolete/ObsoleteFormEditor.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,38 @@ | ||
import React from 'react'; | ||
import { FormErrorMessageComponent } from '../../Error/FormErrorMessageComponent'; | ||
import { Dropdown } from 'primereact/dropdown'; | ||
import { ObsoleteAdditionalFieldData } from '../../FieldData/ObsoleteAdditionalFieldData'; | ||
|
||
export const ObsoleteFormEditor = ({ | ||
obsolete, | ||
onObsoleteValueChange, | ||
booleanTerms, | ||
widgetColumnSize, | ||
labelColumnSize, | ||
fieldDetailsColumnSize, | ||
errorMessages | ||
}) => { | ||
|
||
return ( | ||
<div className="grid"> | ||
<div className={labelColumnSize}> | ||
<label htmlFor="obsolete">Obsolete</label> | ||
</div> | ||
<div className={widgetColumnSize}> | ||
<Dropdown | ||
name="obsolete" | ||
value={obsolete} | ||
options={booleanTerms} | ||
optionLabel='text' | ||
optionValue='name' | ||
onChange={onObsoleteValueChange} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"obsolete"}/> | ||
</div> | ||
<div className={fieldDetailsColumnSize}> | ||
<ObsoleteAdditionalFieldData obsolete={obsolete?.toString()}/> | ||
</div> | ||
</div> | ||
|
||
) | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/cliapp/src/components/Editors/references/ReferencesFormEditor.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,39 @@ | ||
import React from "react" | ||
import { AutocompleteFormMultiEditor } from '../../Autocomplete/AutocompleteFormMultiEditor'; | ||
import { LiteratureAutocompleteTemplate } from "../../Autocomplete/LiteratureAutocompleteTemplate"; | ||
import { FormErrorMessageComponent } from "../../Error/FormErrorMessageComponent"; | ||
import { ReferencesAdditionalFieldData } from "../../FieldData/ReferencesAdditionalFieldData"; | ||
import { referenceSearch } from "./utils"; | ||
|
||
export const ReferencesFormEditor = ({ | ||
references, | ||
onReferencesValueChange, | ||
widgetColumnSize, | ||
labelColumnSize, | ||
fieldDetailsColumnSize, | ||
errorMessages | ||
}) => { | ||
|
||
return ( | ||
<div className="grid"> | ||
<div className={labelColumnSize}> | ||
<label htmlFor="referenes">References</label> | ||
</div> | ||
<div className={widgetColumnSize}> | ||
<AutocompleteFormMultiEditor | ||
search={referenceSearch} | ||
initialValue={references} | ||
fieldName='references' | ||
valueDisplay={(item, setAutocompleteHoverItem, op, query) => | ||
<LiteratureAutocompleteTemplate item={item} setAutocompleteHoverItem={setAutocompleteHoverItem} op={op} query={query}/>} | ||
onValueChangeHandler={onReferencesValueChange} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"references"}/> | ||
</div> | ||
<div className={fieldDetailsColumnSize}> | ||
<ReferencesAdditionalFieldData references={references}/> | ||
</div> | ||
</div> | ||
|
||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/cliapp/src/components/Editors/references/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 referenceSearch = (event, setFiltered, setInputValue) => { | ||
const searchService = new SearchService(); | ||
const autocompleteFields = ["curie", "cross_references.curie"]; | ||
const endpoint = "literature-reference"; | ||
const filterName = "curieFilter"; | ||
const filter = buildAutocompleteFilter(event, autocompleteFields); | ||
|
||
setInputValue(event.query); | ||
autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/cliapp/src/components/Editors/taxon/TaxonFormEditor.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,36 @@ | ||
import React from 'react'; | ||
import { AutocompleteFormEditor } from '../../Autocomplete/AutocompleteFormEditor'; | ||
import { taxonSearch } from './utils'; | ||
import { FormErrorMessageComponent } from '../../Error/FormErrorMessageComponent'; | ||
import { TaxonAdditionalFieldData } from '../../FieldData/TaxonAdditionalFieldData'; | ||
|
||
export const TaxonFormEditor = ({ | ||
taxon, | ||
onTaxonValueChange, | ||
widgetColumnSize, | ||
labelColumnSize, | ||
fieldDetailsColumnSize, | ||
errorMessages | ||
}) => { | ||
|
||
return ( | ||
<div className="grid"> | ||
<div className={labelColumnSize}> | ||
<label htmlFor="taxon">Taxon</label> | ||
</div> | ||
<div className={widgetColumnSize}> | ||
<AutocompleteFormEditor | ||
name="taxon-input" | ||
search={taxonSearch} | ||
initialValue={taxon} | ||
fieldName='taxon' | ||
onValueChangeHandler={onTaxonValueChange} | ||
/> | ||
<FormErrorMessageComponent errorMessages={errorMessages} errorField={"taxon"}/> | ||
</div> | ||
<div className={fieldDetailsColumnSize}> | ||
<TaxonAdditionalFieldData curie={taxon?.curie}/> | ||
</div> | ||
</div> | ||
) | ||
} |
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 taxonSearch = (event, setFiltered, setQuery) => { | ||
const searchService = new SearchService(); | ||
const autocompleteFields = ["curie", "name", "crossReferences.referencedCurie", "secondaryIdentifiers", "synonyms.name"]; | ||
const endpoint = "ncbitaxonterm"; | ||
const filterName = "taxonFilter"; | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Link } from 'react-router-dom/cjs/react-router-dom.min'; | ||
import { Tooltip } from 'primereact/tooltip'; | ||
|
||
export const EntityDetailsAction = ({ curie, disabled }) =>{ | ||
const disabledClasses = disabled ? "pointer-events-none opacity-50" : ""; | ||
|
||
if (!curie) return null; | ||
|
||
return ( | ||
<> | ||
<Link to={`allele/${curie}`} target="_blank" className={`${curie.replace(':', '')} ${disabledClasses}`}> | ||
<i className="pi pi-info"></i> | ||
</Link> | ||
<Tooltip target={`.${curie.replace(':', '')}`} content= {"Open Details"} /> | ||
</> | ||
); | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
src/main/cliapp/src/components/FieldData/InCollectionAdditionalFieldData.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,6 @@ | ||
import React from 'react'; | ||
|
||
export const InCollectionAdditionalFieldData = ({ name }) => { | ||
if(!name) return null; | ||
return <div className="p-info">{name}</div>; | ||
}; |
6 changes: 6 additions & 0 deletions
6
src/main/cliapp/src/components/FieldData/InternalAdditionalFieldData.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,6 @@ | ||
import React from 'react'; | ||
|
||
export const InternalAdditionalFieldData = ({ internal }) => { | ||
if(!internal) return null; | ||
return <div className="p-info">{internal}</div>; | ||
}; |
6 changes: 6 additions & 0 deletions
6
src/main/cliapp/src/components/FieldData/IsExtinctAdditionalFieldData.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,6 @@ | ||
import React from 'react'; | ||
|
||
export const IsExtinctAdditionalFieldData = ({ isExtinct }) => { | ||
if(!isExtinct) return null; | ||
return <div className="p-info">{isExtinct}</div>; | ||
}; |
6 changes: 6 additions & 0 deletions
6
src/main/cliapp/src/components/FieldData/ObsoleteAdditionalFieldData.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,6 @@ | ||
import React from 'react'; | ||
|
||
export const ObsoleteAdditionalFieldData = ({ obsolete }) => { | ||
if(!obsolete) return null; | ||
return <div className="p-info">{obsolete}</div>; | ||
}; |
15 changes: 15 additions & 0 deletions
15
src/main/cliapp/src/components/FieldData/ReferencesAdditionalFieldData.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,15 @@ | ||
import React from 'react'; | ||
import { SingleReferenceAdditionalFieldData } from "./SingleReferenceAdditionalFieldData"; | ||
|
||
export const ReferencesAdditionalFieldData = ({ references }) => { | ||
|
||
const referencesDivs = references?.map((reference) => { | ||
return ( | ||
<div key={reference.curie}> | ||
<SingleReferenceAdditionalFieldData key={reference.curie} fieldData={reference} /> | ||
</div> | ||
) | ||
}) | ||
|
||
return referencesDivs || null; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
src/main/cliapp/src/components/FieldData/TaxonAdditionalFieldData.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,6 @@ | ||
import React from "react"; | ||
|
||
export const TaxonAdditionalFieldData = ({ curie }) => { | ||
if(!curie) return null; | ||
return <div className="p-info">{curie}</div>; | ||
} |
File renamed without changes.
Oops, something went wrong.