Skip to content

Commit

Permalink
Merge pull request #1276 from alliance-genome/release/v0.25.0
Browse files Browse the repository at this point in the history
Release/v0.25.0
  • Loading branch information
markquintontulloch authored Oct 2, 2023
2 parents 3d3caba + 1d90bc9 commit 9722334
Show file tree
Hide file tree
Showing 54 changed files with 22,913 additions and 514 deletions.
12 changes: 12 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

https://agr-jira.atlassian.net/wiki/spaces/ATEAM/overview

## v0.25.0
* New features
* Display and editing of allele synonyms on allele detail page (SCRUM-3126)
* Keep the ontology browser term information panel in view while browsing the (SCRUM-3250)
* Display uniqueId error message in row edit mode of Disease Annotations table (SCRUM-3248)
* Display validation errors of hidden fields in row edit mode (SCRUM-3255)
* Enable access to curation API using admin tokens without Okta user (SCRUM-3078)
* Enable sorting of references by primary xref (SCRUM-2725)
* Fixes and maintenance
* Update curation system to align with LinkML v1.8.0 (SCRUM-3156)
* Fix short citation display, sorting, and filtering in Literature References table (SCRUM-3247)

## v0.24.0
* New features
* Load and display Allele 'allele_nomenclature_events' attribute (SCRUM-2340)
Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.0.1</version>
<configuration>
<doclint>all,-html,-syntax,-accessibility,-missing</doclint>
<failOnError>false</failOnError>
<quiet>true</quiet>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
21,428 changes: 21,428 additions & 0 deletions src/main/cliapp/package-lock.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/main/cliapp/src/components/Actions/DeletionAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Button } from "primereact/button";

export const DeleteAction = ({ disabled, deletionHandler, index}) => {
return (
<Button icon="pi pi-trash" className="p-button-text" disabled={disabled}
onClick={(e) => deletionHandler(e, index)} />
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { DialogErrorMessageComponent } from "../Error/DialogErrorMessageComponent";
import { useControlledVocabularyService } from "../../service/useControlledVocabularyService";
import { ControlledVocabularyDropdown } from '../ControlledVocabularySelector';

export const ControlledVocabularyEditor = ({
props,
onChangeHandler,
errorMessages,
rowIndex,
vocabType,
field,
showClear,
optionLabel="name"
}) => {
const vocabTerms = useControlledVocabularyService(vocabType);

return (
<>
<ControlledVocabularyDropdown
field={field}
options={vocabTerms}
editorChange={onChangeHandler}
props={props}
showClear={showClear}
optionLabel={optionLabel}
dataKey='id'
/>
<DialogErrorMessageComponent errorMessages={errorMessages[rowIndex]} errorField={field} />
</>
);
};
36 changes: 36 additions & 0 deletions src/main/cliapp/src/components/Editors/EvidenceEditor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { AutocompleteMultiEditor } from "../Autocomplete/AutocompleteMultiEditor";
import { SearchService } from '../../service/SearchService';
import { autocompleteSearch, buildAutocompleteFilter } from '../../utils/utils';
import { LiteratureAutocompleteTemplate } from '../Autocomplete/LiteratureAutocompleteTemplate';
import { DialogErrorMessageComponent } from "../Error/DialogErrorMessageComponent";

const evidenceSearch = (event, setFiltered, setInputValue) => {
const searchService = new SearchService();
const autocompleteFields = ["curie", "cross_references.curie"];
const endpoint = "literature-reference";
const filterName = "evidenceFilter";
const filter = buildAutocompleteFilter(event, autocompleteFields);

setInputValue(event.query);
autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered);
}
export const EvidenceEditor = ({ props, errorMessages, onChange }) => {
return (
<>
<AutocompleteMultiEditor
search={evidenceSearch}
initialValue={props?.rowData?.evidence}
rowProps={props}
fieldName='evidence'
subField='curie'
valueDisplay={(item, setAutocompleteHoverItem, op, query) =>
<LiteratureAutocompleteTemplate item={item} setAutocompleteHoverItem={setAutocompleteHoverItem} op={op} query={query}/>}
onValueChangeHandler={onChange}
/>
<DialogErrorMessageComponent
errorMessages={errorMessages[props?.rowIndex]}
errorField={"evidence"}
/>
</>
);
};
20 changes: 20 additions & 0 deletions src/main/cliapp/src/components/Editors/InternalEditor.js
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 InternalEditor = ({ props, internalOnChangeHandler, errorMessages, rowIndex }) => {
const booleanTerms = useControlledVocabularyService("generic_boolean_terms");

return (
<>
<TrueFalseDropdown
props={props}
field="internal"
options={booleanTerms}
editorChange={internalOnChangeHandler}
showClear={false}
/>
<DialogErrorMessageComponent errorMessages={errorMessages[rowIndex]} errorField={"internal"} />
</>
);
};
24 changes: 24 additions & 0 deletions src/main/cliapp/src/components/Editors/TableInputTextEditor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { InputText } from "primereact/inputtext";
import { DialogErrorMessageComponent } from "../Error/DialogErrorMessageComponent";
import { useState } from "react";

export const TableInputTextEditor = ({ value, errorMessages, textOnChangeHandler, rowIndex, field }) => {
const [localValue, setLocalValue] = useState(value);

const onChange = (e) => {
setLocalValue(e.target.value);
textOnChangeHandler(rowIndex, e, field)
}

return (
<>
<InputText
id={field}
value={localValue}
onChange={onChange}
fieldName={field}
/>
<DialogErrorMessageComponent errorMessages={errorMessages[rowIndex]} errorField={field} />
</>
);
};
21 changes: 21 additions & 0 deletions src/main/cliapp/src/components/FormTableWrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const FormTableWrapper = ({
labelColumnSize,
table,
tableName,
showTable,
button,
}) => {
return (
<div className="grid">
<div className="col-12">
<div className="mb-3">
<label>{tableName}</label>
</div>
{showTable && table}
<div className={`${showTable ? "pt-3" : ""} p-field p-col col-4`}>
{button}
</div>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { Checkbox } from 'primereact/checkbox';

import { FilterComponent } from '../Filters/FilterComponent'
import { DataTableHeaderFooterTemplate } from "../DataTableHeaderFooterTemplate";
import { DuplicationAction } from "../DuplicationAction";
import { EntityDetailsAction } from "../EntityDetailsAction";
import { DuplicationAction } from "../Actions/DuplicationAction";
import { EntityDetailsAction } from "../Actions/EntityDetailsAction";


import { filterColumns, orderColumns } from '../../utils/utils';
Expand Down Expand Up @@ -65,6 +65,7 @@ export const GenericDataTable = (props) => {
exceptionMessage,
} = useGenericDataTable(props);

const toast_topleft = useRef(null);
const toast_topright = useRef(null);
const [deleteDialog, setDeleteDialog] = useState(false);
const [deprecateDialog, setDeprecateDialog] = useState(false);
Expand Down Expand Up @@ -251,6 +252,7 @@ export const GenericDataTable = (props) => {

return (
<div className="card">
<Toast ref={toast_topleft} position="top-left" />
<Toast ref={toast_topright} position="top-right" />
<DataTable dataKey={dataKey} value={entities} header={header} ref={dataTable}
filterDisplay="row" scrollHeight="62vh" scrollable= {true} tableClassName='p-datatable-md'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ export const useGenericDataTable = ({
toast_topright.current.show([
{ life: 7000, severity: 'error', summary: 'Update error: ', detail: errorMessage, sticky: false }
]);
if (error.response.data.errorMessages && Object.keys(error.response.data.errorMessages).length > 0) {
let messages = [];
for (let errorField in error.response.data.errorMessages) {
messages.push(errorField + ": " + error.response.data.errorMessages[errorField]);
}
let messageSummary = messages.join(" / ");
toast_topleft.current.show([
{ life: 7000, severity: 'error', summary: 'Errors found: ', detail: messageSummary, sticky: false }
]);
}
}
else if(error.response.data !== undefined) {
setExceptionMessage(error.response.data);
Expand Down
2 changes: 1 addition & 1 deletion src/main/cliapp/src/components/GenericDataTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const GenericDataTree = (props) => {
</div>
<div className="col-6">
<div className="card">
<div><pre style={{whiteSpace: "pre-wrap"}}>{JSON.stringify(selectedTerm, null, 2) }</pre></div>
<div className="fixed"><pre style={{whiteSpace: "pre-wrap"}}>{JSON.stringify(selectedTerm, null, 2) }</pre></div>
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/main/cliapp/src/constants/FilterFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export const FIELD_SETS = Object.freeze({
filterName: "citationFilter",
fields: ["citation"],
},
shortCitationFieldSet: {
filterName: "shortCitationFilter",
fields: ["shortCitation"],
literatureShortCitationFieldSet: {
filterName: "literatureShortCitationFilter",
fields: ["short_citation"],
},
conditionAnatomyFieldSet: {
filterName: "conditionAnatomyFilter",
Expand Down Expand Up @@ -430,7 +430,7 @@ export const FILTER_CONFIGS = Object.freeze({
assertedAlleleFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.assertedAlleleFieldSet] },
assertedGenesFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.assertedGenesFieldSet] },
citationFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.citationFieldSet]},
shortCitationFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.shortCitationFieldSet]},
literatureShortCitationFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.literatureShortCitationFieldSet]},
conditionAnatomyFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.conditionAnatomyFieldSet] },
conditionChemicalFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.conditionChemicalFieldSet] },
conditionClassFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.conditionClassFieldSet] },
Expand Down
5 changes: 3 additions & 2 deletions src/main/cliapp/src/constants/SortFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const SORT_FIELDS = Object.freeze([
"diseaseRelation.name",
"negated",
"object.name",
"singleReference.curie",
"singleReference.primaryCrossReferenceCurie",
"evidenceCodes.abbreviation",
"with.geneSymbol.displayText",
"relatedNotes.freeText",
Expand Down Expand Up @@ -44,7 +44,7 @@ export const SORT_FIELDS = Object.freeze([
"alleleDatabaseStatus.databaseStatus.name",
"alleleInheritanceModes.inheritanceMode.name",
"alleleNomenclatureEvents.nomenclatureEvent.name",
"references.curie",
"references.primaryCrossReferenceCurie",
"inCollection.name",
"isExtinct",
"handle",
Expand Down Expand Up @@ -77,6 +77,7 @@ export const SORT_FIELDS = Object.freeze([
"title",
"abstract",
"citation",
"short_citation",
"prefix",
"idPattern",
"idExample",
Expand Down
27 changes: 23 additions & 4 deletions src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { CurieFormTemplate } from '../../components/Templates/CurieFormTemplate'
import { DataProviderFormTemplate } from '../../components/Templates/DataProviderFormTemplate';
import { DateFormTemplate } from '../../components/Templates/DateFormTemplate';
import { UserFormTemplate } from '../../components/Templates/UserFormTemplate';
import { SynonymsForm } from './SynonymsForm';
import { validateTable } from '../../utils/utils';

export default function AlleleDetailPage(){
const { curie } = useParams();
Expand Down Expand Up @@ -46,15 +48,24 @@ const { isLoading } = useQuery([curie],
return alleleService.saveAllele(allele);
});

const handleSubmit = (event) => {

const handleSubmit = async (event) => {
event.preventDefault();
alleleDispatch({
type: "SUBMIT"
})
event.preventDefault();

const isSynonymsErrors = await validateTable(
"allelesynonymslotannotation",
"synonymsErrorMessages",
alleleState.allele.alleleSynonyms,
alleleDispatch,
);

mutation.mutate(alleleState.allele, {
onSuccess: (data) => {
onSuccess: () => {
if(isSynonymsErrors) return;
toastSuccess.current.show({severity: 'success', summary: 'Successful', detail: 'Allele Saved'});
console.log(alleleState.errorMessages);
},
onError: (error) => {
let message;
Expand Down Expand Up @@ -175,6 +186,14 @@ const { isLoading } = useQuery([curie],

<Divider />

<SynonymsForm
state={alleleState}
dispatch={alleleDispatch}
labelColumnSize={labelColumnSize}
/>

<Divider />

<TaxonFormEditor
taxon={alleleState.allele?.taxon}
onTaxonValueChange={onTaxonValueChange}
Expand Down
2 changes: 1 addition & 1 deletion src/main/cliapp/src/containers/allelesPage/AllelesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ export const AllelesTable = () => {
filterConfig: FILTER_CONFIGS.alleleDatabaseStatusFilterConfig,
},
{
field: "references.curie",
field: "references.primaryCrossReferenceCurie",
header: "References",
body: referencesTemplate,
sortable: isEnabled,
Expand Down
Loading

0 comments on commit 9722334

Please sign in to comment.