From 9812143d2b9e95a2ad68cc121866e4df91fc4d8f Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 18 Jul 2023 17:07:41 +0100 Subject: [PATCH 01/48] Incorporate default value for negated into uniqueID --- .../diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index 9d06c4450..f1d6942ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -51,8 +51,11 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotatio UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); uniqueId.add(subjectCurie); uniqueId.add(annotationDTO.getDiseaseRelationName()); - if (annotationDTO.getNegated()) + if (annotationDTO.getNegated()) { uniqueId.add(annotationDTO.getNegated().toString()); + } else { + uniqueId.add("false"); + } uniqueId.add(annotationDTO.getDoTermCurie()); uniqueId.add(refCurie); uniqueId.addList(annotationDTO.getEvidenceCodeCuries()); From e80960013a16c0fcaf369ca302f8d439ef5d2aa9 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 18 Jul 2023 17:40:11 +0100 Subject: [PATCH 02/48] Fix integration tests --- .../bulkupload/DiseaseAnnotationBulkUploadITCase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java index ac2c1c9fe..28020c4e2 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java @@ -427,7 +427,7 @@ public void geneDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception body("entity.createdBy.uniqueId", is("DATEST:Person0002")). body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime().toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime().toString())). - body("entity.uniqueId", is("DATEST:Gene0002|is_marker_for|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). + body("entity.uniqueId", is("DATEST:Gene0002|is_marker_for|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). body("entity.subject.curie", is(gene2)). body("entity.object.curie", is(doTerm2)). body("entity.diseaseRelation.name", is(geneDiseaseRelation)). @@ -507,7 +507,7 @@ public void alleleDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exceptio body("entity.createdBy.uniqueId", is("DATEST:Person0002")). body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime().toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime().toString())). - body("entity.uniqueId", is("DATEST:Allele0002|is_implicated_in|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). + body("entity.uniqueId", is("DATEST:Allele0002|is_implicated_in|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). body("entity.subject.curie", is(allele2)). body("entity.object.curie", is(doTerm2)). body("entity.diseaseRelation.name", is(alleleAndGeneDiseaseRelation)). @@ -588,7 +588,7 @@ public void agmDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception { body("entity.createdBy.uniqueId", is("DATEST:Person0002")). body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime().toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime().toString())). - body("entity.uniqueId", is("DATEST:AGM0002|is_exacerbated_model_of|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). + body("entity.uniqueId", is("DATEST:AGM0002|is_exacerbated_model_of|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). body("entity.subject.curie", is(agm2)). body("entity.object.curie", is(doTerm2)). body("entity.diseaseRelation.name", is(agmDiseaseRelation2)). From 6f66e8004d4e66cf357a13775a062ace4584a5e6 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 7 Jul 2023 15:08:10 -0500 Subject: [PATCH 03/48] SCRUM-3009 add get to AlleleService --- src/main/cliapp/src/service/AlleleService.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/cliapp/src/service/AlleleService.js b/src/main/cliapp/src/service/AlleleService.js index f8c489ee0..229f48eb9 100644 --- a/src/main/cliapp/src/service/AlleleService.js +++ b/src/main/cliapp/src/service/AlleleService.js @@ -14,5 +14,9 @@ export class AlleleService extends BaseAuthService { const deletionService = new DeletionService(); return await deletionService.delete(`allele`, allele.id); } + + async getAllele(curie) { + return this.api.get(`/allele/${curie}`); + } } From 31a40d5f7235efc75f64638bec6119196606a651 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 7 Jul 2023 15:08:43 -0500 Subject: [PATCH 04/48] SCRUM-3009 add AllelesDetailPage --- .../AllelesDetailComponent.js | 26 +++++++++++++++++++ .../src/containers/allelesDetailPage/index.js | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js create mode 100644 src/main/cliapp/src/containers/allelesDetailPage/index.js diff --git a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js b/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js new file mode 100644 index 000000000..5e7d62b29 --- /dev/null +++ b/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js @@ -0,0 +1,26 @@ +import React, { useState } from 'react'; +import { useQuery } from 'react-query'; +import { AlleleService } from '../../service/AlleleService'; + +export const AllelesDetailComponent = ({ curie }) => { + const [allele, setAllele] = useState({}); + //call service + const alleleService = new AlleleService(); + //retrieve data + useQuery([curie], + () => alleleService.getAllele(curie), + { + onSuccess: (data) => { + setAllele(data.result); + }, + onError: (error) => { + console.warn(error); + }, + keepPreviousData: true, + refetchOnWindowFocus: false, + } + ); + //display output data + return(<>{allele}) + +}; diff --git a/src/main/cliapp/src/containers/allelesDetailPage/index.js b/src/main/cliapp/src/containers/allelesDetailPage/index.js new file mode 100644 index 000000000..e971a1da2 --- /dev/null +++ b/src/main/cliapp/src/containers/allelesDetailPage/index.js @@ -0,0 +1,3 @@ +import { AllelesDetailComponent as AllelesDetailPage } from "./AllelesDetailComponent"; + +export { AllelesDetailPage }; From 11f778252402ac1801603fde2f19fab1a4e09bf4 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 7 Jul 2023 16:26:38 -0500 Subject: [PATCH 05/48] SCRUM-3009 added allele detail route --- src/main/cliapp/src/routes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index 7bcc8c084..5e28af71d 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -14,6 +14,7 @@ import { ExperimentalConditionsPage } from './containers/experimentalConditionsP import { ConditionRelationPage } from './containers/conditionRelationPage'; import { AffectedGenomicModelPage } from './containers/affectedGenomicModelPage'; import { AllelesPage } from './containers/allelesPage'; +import { AllelesDetailPage } from './containers/allelesDetailPage'; import { GenesPage } from './containers/genesPage'; import { ProfilePage } from './containers/profilePage'; import { MoleculesPage } from './containers/moleculesPage'; @@ -44,6 +45,7 @@ export default ( } /> } /> } /> + } /> } /> } /> } /> From 4d6c40cce0e5f2b7071b3292deec19cf58f4348b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 7 Jul 2023 16:27:10 -0500 Subject: [PATCH 06/48] SCRUM-3009 display allele data on page --- .../AllelesDetailComponent.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js b/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js index 5e7d62b29..d213768c7 100644 --- a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js +++ b/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js @@ -1,17 +1,22 @@ import React, { useState } from 'react'; +import ReactJson from 'react-json-view' +import { useParams } from 'react-router-dom'; import { useQuery } from 'react-query'; import { AlleleService } from '../../service/AlleleService'; -export const AllelesDetailComponent = ({ curie }) => { - const [allele, setAllele] = useState({}); +export const AllelesDetailComponent = () => { + const [allele, setAllele] = useState(); + const { curie } = useParams(); + const { layoutColorMode } = localStorage.getItem("themeSettings"); //call service const alleleService = new AlleleService(); //retrieve data useQuery([curie], () => alleleService.getAllele(curie), { - onSuccess: (data) => { - setAllele(data.result); + onSuccess: (result) => { + // const alleleString = JSON.stringify(result.data.entity); + setAllele(result?.data?.entity); }, onError: (error) => { console.warn(error); @@ -21,6 +26,11 @@ export const AllelesDetailComponent = ({ curie }) => { } ); //display output data - return(<>{allele}) + return( + <> +

Allele Detail Page

+ + + ) }; From 921c78ea323add6ea5a272f06f8385bb6b4d6413 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 10 Jul 2023 11:19:09 -0500 Subject: [PATCH 07/48] SCRUM-3009 added EntityDetailsAction to alleles --- .../cliapp/src/components/EntityDetailsAction.js | 15 +++++++++++++++ .../GenericDataTable/GenericDataTable.js | 9 +++++++++ .../src/containers/allelesPage/AllelesTable.js | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 src/main/cliapp/src/components/EntityDetailsAction.js diff --git a/src/main/cliapp/src/components/EntityDetailsAction.js b/src/main/cliapp/src/components/EntityDetailsAction.js new file mode 100644 index 000000000..c13b3db8e --- /dev/null +++ b/src/main/cliapp/src/components/EntityDetailsAction.js @@ -0,0 +1,15 @@ +import { NavLink } from 'react-router-dom/cjs/react-router-dom.min'; +import { Tooltip } from 'primereact/tooltip'; + +export const EntityDetailsAction = ({ props, disabled }) => { + if (props?.curie) { + return ( + <> + !disabled} className={props.curie.replace(':', '')}> + + + + + ); + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js index 368b83cba..4135b4045 100644 --- a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js +++ b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js @@ -11,6 +11,7 @@ import { Checkbox } from 'primereact/checkbox'; import { FilterComponent } from '../Filters/FilterComponent' import { DataTableHeaderFooterTemplate } from "../DataTableHeaderFooterTemplate"; import { DuplicationAction } from "../DuplicationAction"; +import { EntityDetailsAction } from "../EntityDetailsAction"; import { filterColumns, orderColumns } from '../../utils/utils'; @@ -28,6 +29,7 @@ export const GenericDataTable = (props) => { deletionEnabled, handleDuplication, duplicationEnabled, + hasDetails=false, dataKey = 'id', deprecateOption = false, modReset = false, @@ -281,6 +283,13 @@ export const GenericDataTable = (props) => { showFilterMenu={false} style={{maxWidth: '4rem', minWidth: '4rem', display: props.isEditable ? 'visible' : 'none' }} headerStyle={{ width: '4rem', position: 'sticky' }} bodyStyle={{textAlign: 'center'}} frozen headerClassName='surface-0'/> } + {hasDetails && + } + body={(props) => } + showFilterMenu={false} style={{maxWidth: '4rem', minWidth: '4rem', display: props.isEditable ? 'visible' : 'none' }} headerStyle={{ width: '4rem', position: 'sticky' }} bodyStyle={{textAlign: 'center'}} + frozen headerClassName='surface-0'/> + } {columnList} diff --git a/src/main/cliapp/src/containers/allelesPage/AllelesTable.js b/src/main/cliapp/src/containers/allelesPage/AllelesTable.js index ef6b2d69e..d0896324d 100644 --- a/src/main/cliapp/src/containers/allelesPage/AllelesTable.js +++ b/src/main/cliapp/src/containers/allelesPage/AllelesTable.js @@ -126,6 +126,7 @@ export const AllelesTable = () => { return alleleService.saveAllele(updatedAllele); }); + const taxonTemplate = (rowData) => { if (rowData?.taxon) { return ( @@ -1345,6 +1346,7 @@ export const AllelesTable = () => { defaultColumnNames={defaultColumnNames} initialTableState={initialTableState} isEditable={true} + hasDetails={true} mutation={mutation} isEnabled={isEnabled} setIsEnabled={setIsEnabled} From f0b3410d46bc7174a1f3a2b0a393d316bfabed6c Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 10 Jul 2023 11:20:15 -0500 Subject: [PATCH 08/48] SCRUM-3009 removed comments from AllelesDetailComponent --- .../containers/allelesDetailPage/AllelesDetailComponent.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js b/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js index d213768c7..7ba6134c7 100644 --- a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js +++ b/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js @@ -8,14 +8,12 @@ export const AllelesDetailComponent = () => { const [allele, setAllele] = useState(); const { curie } = useParams(); const { layoutColorMode } = localStorage.getItem("themeSettings"); - //call service const alleleService = new AlleleService(); - //retrieve data + useQuery([curie], () => alleleService.getAllele(curie), { onSuccess: (result) => { - // const alleleString = JSON.stringify(result.data.entity); setAllele(result?.data?.entity); }, onError: (error) => { @@ -25,7 +23,7 @@ export const AllelesDetailComponent = () => { refetchOnWindowFocus: false, } ); - //display output data + return( <>

Allele Detail Page

From 36b114987e00563739947141c522f74cbefeb31b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 18 Jul 2023 14:54:07 -0500 Subject: [PATCH 09/48] SCRUM-3009 moved AlleleDetailPage under allelesPage --- src/main/cliapp/src/containers/allelesDetailPage/index.js | 3 --- .../AlleleDetailPage.js} | 2 +- src/main/cliapp/src/containers/allelesPage/index.js | 3 ++- src/main/cliapp/src/routes.js | 5 ++--- 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 src/main/cliapp/src/containers/allelesDetailPage/index.js rename src/main/cliapp/src/containers/{allelesDetailPage/AllelesDetailComponent.js => allelesPage/AlleleDetailPage.js} (94%) diff --git a/src/main/cliapp/src/containers/allelesDetailPage/index.js b/src/main/cliapp/src/containers/allelesDetailPage/index.js deleted file mode 100644 index e971a1da2..000000000 --- a/src/main/cliapp/src/containers/allelesDetailPage/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { AllelesDetailComponent as AllelesDetailPage } from "./AllelesDetailComponent"; - -export { AllelesDetailPage }; diff --git a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js b/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js similarity index 94% rename from src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js rename to src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js index 7ba6134c7..98f010865 100644 --- a/src/main/cliapp/src/containers/allelesDetailPage/AllelesDetailComponent.js +++ b/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js @@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom'; import { useQuery } from 'react-query'; import { AlleleService } from '../../service/AlleleService'; -export const AllelesDetailComponent = () => { +export default function AlleleDetailPage(){ const [allele, setAllele] = useState(); const { curie } = useParams(); const { layoutColorMode } = localStorage.getItem("themeSettings"); diff --git a/src/main/cliapp/src/containers/allelesPage/index.js b/src/main/cliapp/src/containers/allelesPage/index.js index 220ba2acb..2ae04e4e4 100644 --- a/src/main/cliapp/src/containers/allelesPage/index.js +++ b/src/main/cliapp/src/containers/allelesPage/index.js @@ -1,3 +1,4 @@ import AllelesPage from "./AllelesPage"; +import AlleleDetailPage from "./AlleleDetailPage"; -export { AllelesPage }; \ No newline at end of file +export { AllelesPage, AlleleDetailPage }; \ No newline at end of file diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index 5e28af71d..99e85e341 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -13,8 +13,7 @@ import { DiseaseAnnotationsPage } from './containers/diseaseAnnotationsPage'; import { ExperimentalConditionsPage } from './containers/experimentalConditionsPage'; import { ConditionRelationPage } from './containers/conditionRelationPage'; import { AffectedGenomicModelPage } from './containers/affectedGenomicModelPage'; -import { AllelesPage } from './containers/allelesPage'; -import { AllelesDetailPage } from './containers/allelesDetailPage'; +import { AllelesPage, AlleleDetailPage } from './containers/allelesPage'; import { GenesPage } from './containers/genesPage'; import { ProfilePage } from './containers/profilePage'; import { MoleculesPage } from './containers/moleculesPage'; @@ -45,7 +44,7 @@ export default ( } /> } /> } /> - } /> + } /> } /> } /> } /> From 452e925f3e3acc910e0d7cfc088dc71fb29d8a09 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 19 Jul 2023 08:54:17 -0500 Subject: [PATCH 10/48] SCRUM-3009 disable detail page link during row edit --- .../cliapp/src/components/EntityDetailsAction.js | 13 +++++++------ .../components/GenericDataTable/GenericDataTable.js | 4 ++-- src/main/cliapp/src/routes.js | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/cliapp/src/components/EntityDetailsAction.js b/src/main/cliapp/src/components/EntityDetailsAction.js index c13b3db8e..3fecbf4b5 100644 --- a/src/main/cliapp/src/components/EntityDetailsAction.js +++ b/src/main/cliapp/src/components/EntityDetailsAction.js @@ -1,14 +1,15 @@ -import { NavLink } from 'react-router-dom/cjs/react-router-dom.min'; +import { Link } from 'react-router-dom/cjs/react-router-dom.min'; import { Tooltip } from 'primereact/tooltip'; -export const EntityDetailsAction = ({ props, disabled }) => { - if (props?.curie) { +export const EntityDetailsAction = ({ entity, disabled }) =>{ + const disabledClasses = disabled ? "pointer-events-none opacity-50" : ""; + if (entity?.curie) { return ( <> - !disabled} className={props.curie.replace(':', '')}> + - - + + ); } diff --git a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js index 4135b4045..4e6bff57d 100644 --- a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js +++ b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js @@ -285,8 +285,8 @@ export const GenericDataTable = (props) => { } {hasDetails && } - body={(props) => } + editor={(props) => } + body={(props) => } showFilterMenu={false} style={{maxWidth: '4rem', minWidth: '4rem', display: props.isEditable ? 'visible' : 'none' }} headerStyle={{ width: '4rem', position: 'sticky' }} bodyStyle={{textAlign: 'center'}} frozen headerClassName='surface-0'/> } diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index 99e85e341..5180fbc8a 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -1,6 +1,5 @@ import React from 'react'; -//import { Route } from 'react-router-dom'; import { SecureRoute } from '@okta/okta-react'; From f502890af2d33ef2add5f37e12d3d4b264f2b1f2 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 19 Jul 2023 10:06:54 -0500 Subject: [PATCH 11/48] SCRUM-3009 refactored EntityDetailsAction --- .../src/components/EntityDetailsAction.js | 23 ++++++++++--------- .../GenericDataTable/GenericDataTable.js | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/cliapp/src/components/EntityDetailsAction.js b/src/main/cliapp/src/components/EntityDetailsAction.js index 3fecbf4b5..2aa0b5fc6 100644 --- a/src/main/cliapp/src/components/EntityDetailsAction.js +++ b/src/main/cliapp/src/components/EntityDetailsAction.js @@ -1,16 +1,17 @@ import { Link } from 'react-router-dom/cjs/react-router-dom.min'; import { Tooltip } from 'primereact/tooltip'; -export const EntityDetailsAction = ({ entity, disabled }) =>{ +export const EntityDetailsAction = ({ curie, disabled }) =>{ const disabledClasses = disabled ? "pointer-events-none opacity-50" : ""; - if (entity?.curie) { - return ( - <> - - - - - - ); - } + + if (!curie) return null; + + return ( + <> + + + + + + ); }; \ No newline at end of file diff --git a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js index 4e6bff57d..51e61a583 100644 --- a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js +++ b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js @@ -285,8 +285,8 @@ export const GenericDataTable = (props) => { } {hasDetails && } - body={(props) => } + editor={(props) => } + body={(props) => } showFilterMenu={false} style={{maxWidth: '4rem', minWidth: '4rem', display: props.isEditable ? 'visible' : 'none' }} headerStyle={{ width: '4rem', position: 'sticky' }} bodyStyle={{textAlign: 'center'}} frozen headerClassName='surface-0'/> } From 9047b282114e2f0930324e878b333a7d9d603c9d Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 19 Jul 2023 10:28:50 -0500 Subject: [PATCH 12/48] SCRUM-3009 add BrowserRouter to AllelesTable test --- .../containers/allelesPage/__tests__/AllelesTable.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/cliapp/src/containers/allelesPage/__tests__/AllelesTable.test.js b/src/main/cliapp/src/containers/allelesPage/__tests__/AllelesTable.test.js index 7b01853e9..58dea83e4 100644 --- a/src/main/cliapp/src/containers/allelesPage/__tests__/AllelesTable.test.js +++ b/src/main/cliapp/src/containers/allelesPage/__tests__/AllelesTable.test.js @@ -1,4 +1,5 @@ import React from "react"; +import { BrowserRouter } from "react-router-dom/cjs/react-router-dom"; import { waitFor } from "@testing-library/react"; import { renderWithClient } from '../../../tools/jest/utils'; import { AllelesTable } from "../AllelesTable"; @@ -16,7 +17,7 @@ describe("", () => { }); it("Renders without crashing", async () => { - let result = await renderWithClient(); + let result = await renderWithClient(); await waitFor(() => { expect(result); @@ -25,14 +26,14 @@ describe("", () => { }); it("Contains Correct Table Name", async () => { - let result = await renderWithClient(); + let result = await renderWithClient(); const tableTitle = await result.findByText(/Alleles Table/i); expect(tableTitle).toBeInTheDocument(); }); it("Contains Correct Table Data", async () => { - let result = await renderWithClient(); + let result = await renderWithClient(); const curieTd = await result.findByText(/FB:FBal0196303/i); const nameTd = await result.findByText(/Saccharomyces cerevisiae UAS construct a of Stefancsik/i); From 6e0081647ae7f01d1ab8187ac7d04baebac41f59 Mon Sep 17 00:00:00 2001 From: Manuel Luypaert Date: Tue, 25 Jul 2023 16:28:33 +0100 Subject: [PATCH 13/48] Reorganised other links. --- README.md | 2 +- .../src/containers/layout/SiteLayout.js | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5034b3735..c04b03519 100644 --- a/README.md +++ b/README.md @@ -461,7 +461,7 @@ the new version of the application can function in a consistent state upon and a ``` 3. Check the logs for errors after app-server restart, which could indicate a DB restore failure and troubleshoot accordingly if necessary to fix any errors. -3. Connect to the Environment's search domain and delete all indexes. A link to the Cerebro view into each environment's search indexes is available in the curation interface under `Other Links` > `Elastic Search UI` (VPN connection required). +3. Connect to the Environment's search domain and delete all indexes. A link to the Cerebro view into each environment's search indexes is available in the curation interface under `Developer Links` > `Search index UI (cerebro)` (VPN connection required). Alternatively, you can reach this UI manually by browsing to the [AGR Cerebro interface](http://cerebro.alliancegenome.org:9000) and entering the environment's domain endpoint manually. The domain endpoint URL can be found through the [Amazon OpenSearch console](https://us-east-1.console.aws.amazon.com/aos/home?region=us-east-1#opensearch/domains). 4. Tag and create the release in git and gitHub, as described in the [Release creation](#release-creation) section. 5. Check the logs for the environment that you're releasing to and ensure the application started successfully diff --git a/src/main/cliapp/src/containers/layout/SiteLayout.js b/src/main/cliapp/src/containers/layout/SiteLayout.js index 47690f104..247aca820 100644 --- a/src/main/cliapp/src/containers/layout/SiteLayout.js +++ b/src/main/cliapp/src/containers/layout/SiteLayout.js @@ -316,17 +316,22 @@ export const SiteLayout = (props) => { ] }, { - label: 'Other Links', icon: 'pi pi-fw pi-sitemap', + label: 'Data files and reports', icon: 'pi pi-fw pi-sitemap', items: [ { label: 'FMS Data Files', icon: 'pi pi-fw pi-home', to: '/fmspage' }, - { label: 'Site Metrics', icon: 'pi pi-fw pi-home', to: '/metricspage' }, { label: 'Data Loads', icon: 'pi pi-fw pi-home', to: '/dataloads' }, - { label: 'Reports', icon: 'pi pi-fw pi-home', to: '/reports' }, - { label: 'Swagger UI', icon: 'pi pi-fw pi-home', url: '/swagger-ui', target: "_blank" }, - { label: 'Elastic Search UI', icon: 'pi pi-fw pi-home', url: `http://cerebro.alliancegenome.org:9000/#!/overview?host=https://${siteContext?.apiVersion?.esHost}`, target: "_blank" }, - { label: 'Logs Server', icon: 'pi pi-fw pi-home', url: `http://logs.alliancegenome.org:5601/app/logtrail#/?q=*&h=agr.curation.${siteContext?.apiVersion?.env}.api.server&t=Now&i=logstash*&_g=()`, target: "_blank" }, + { label: 'Reports', icon: 'pi pi-fw pi-home', to: '/reports' } ] - } + }, + { + label: 'Developer links', icon: 'pi pi-fw pi-sitemap', + items: [ + { label: 'Site Metrics', icon: 'pi pi-fw pi-home', to: '/metricspage' }, + { label: 'API UI (Swagger)', icon: 'pi pi-fw pi-home', url: '/swagger-ui', target: "_blank" }, + { label: 'Search index UI (cerebro)', icon: 'pi pi-fw pi-home', url: `http://cerebro.alliancegenome.org:9000/#!/overview?host=https://${siteContext?.apiVersion?.esHost}`, target: "_blank" }, + { label: 'Logs Server UI', icon: 'pi pi-fw pi-home', url: `http://logs.alliancegenome.org:5601/app/logtrail#/?q=*&h=agr.curation.${siteContext?.apiVersion?.env}.api.server&t=Now&i=logstash*&_g=()`, target: "_blank" }, + ] + } ] } ]; From 172c8955a35a901fd3128d1db7a1fa81654c9eb2 Mon Sep 17 00:00:00 2001 From: Manuel Luypaert Date: Tue, 25 Jul 2023 16:44:18 +0100 Subject: [PATCH 14/48] Unified search endpoint labels and removed elasticsearch references --- .../curation_api/interfaces/base/BaseCurieCrudInterface.java | 4 ++-- .../curation_api/interfaces/base/BaseIdCrudInterface.java | 4 ++-- .../curation_api/interfaces/base/BaseIdDocumentInterface.java | 2 +- .../curation_api/interfaces/crud/AlleleCrudInterface.java | 4 ++-- .../curation_api/interfaces/crud/GeneCrudInterface.java | 4 ++-- .../interfaces/crud/ResourceDescriptorPageCrudInterface.java | 2 +- .../interfaces/crud/VocabularyTermCrudInterface.java | 2 +- .../interfaces/crud/VocabularyTermSetCrudInterface.java | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java index d4540b372..05581c52e 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java @@ -56,13 +56,13 @@ public interface BaseCurieCrudInterface { @POST @Path("/find") - @Tag(name = "Database Search Endpoints") + @Tag(name = "Relational Database Browsing Endpoints") @JsonView(View.FieldsAndLists.class) public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @POST @Path("/search") - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") @JsonView({ View.FieldsAndLists.class }) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java index 5bd02bfaa..ee4efe134 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java @@ -56,13 +56,13 @@ public interface BaseIdCrudInterface { @POST @Path("/find") - @Tag(name = "Database Search Endpoints") + @Tag(name = "Relational Database Browsing Endpoints") @JsonView(View.FieldsAndLists.class) public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @POST @Path("/search") - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") @JsonView({ View.FieldsAndLists.class }) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdDocumentInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdDocumentInterface.java index f4874eac0..7751b48bc 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdDocumentInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdDocumentInterface.java @@ -32,7 +32,7 @@ public interface BaseIdDocumentInterface { @POST @Path("/search") - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") @JsonView({ View.FieldsAndLists.class }) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java index d84ea85c9..5e2d0a579 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java @@ -59,14 +59,14 @@ public interface AlleleCrudInterface extends BaseCurieCrudInterface, Bas @Override @POST @Path("/find") - @Tag(name = "Database Search Endpoints") + @Tag(name = "Relational Database Browsing Endpoints") @JsonView(View.AlleleView.class) public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @Override @POST @Path("/search") - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") @JsonView({ View.AlleleView.class }) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java index 1c64f82ea..a6fda6079 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java @@ -59,14 +59,14 @@ public interface GeneCrudInterface extends BaseCurieCrudInterface, BaseDTO @Override @POST @Path("/find") - @Tag(name = "Database Search Endpoints") + @Tag(name = "Relational Database Browsing Endpoints") @JsonView(View.GeneView.class) public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @Override @POST @Path("/search") - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") @JsonView({ View.GeneView.class }) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ResourceDescriptorPageCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ResourceDescriptorPageCrudInterface.java index 7af80fb04..ca4653579 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ResourceDescriptorPageCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ResourceDescriptorPageCrudInterface.java @@ -28,7 +28,7 @@ public interface ResourceDescriptorPageCrudInterface extends BaseIdCrudInterface @POST @Path("/search") @JsonView(View.ResourceDescriptorPageView.class) - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermCrudInterface.java index 4cbb4f741..32f6c4fc8 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermCrudInterface.java @@ -34,7 +34,7 @@ public interface VocabularyTermCrudInterface extends BaseIdCrudInterface search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermSetCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermSetCrudInterface.java index 765d7234b..d80accaa7 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermSetCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VocabularyTermSetCrudInterface.java @@ -56,7 +56,7 @@ public interface VocabularyTermSetCrudInterface extends BaseIdCrudInterface find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @@ -64,7 +64,7 @@ public SearchResponse find(@DefaultValue("0") @QueryParam("pa @Override @POST @Path("/search") - @Tag(name = "Elastic Search Endpoints") + @Tag(name = "Search Database Browsing Endpoints") @JsonView({ View.VocabularyTermSetView.class }) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); From b30ce0d961e540368021f58caa022fa8cb4389fa Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Tue, 4 Jul 2023 15:33:54 +0200 Subject: [PATCH 15/48] SCRUM-2784 add shortCitation to literature table and database --- src/main/cliapp/src/constants/FilterFields.js | 5 +++++ .../referencePage/LiteratureReferenceTable.js | 17 +++++++++++++++++ .../model/document/LiteratureReference.java | 3 +++ .../curation_api/model/entities/Reference.java | 5 +++++ .../ReferenceSynchronisationHelper.java | 3 ++- .../migration/v0.22.0.2__add_short_citation.sql | 1 + 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/db/migration/v0.22.0.2__add_short_citation.sql diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index 11f07eee5..e145ceb1a 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -68,6 +68,10 @@ export const FIELD_SETS = Object.freeze({ filterName: "citationFilter", fields: ["citation"], }, + shortCitationFieldSet: { + filterName: "shortCitationFilter", + fields: ["shortCitation"], + }, conditionAnatomyFieldSet: { filterName: "conditionAnatomyFilter", fields: ["conditionAnatomy.curie", "conditionAnatomy.name"], @@ -417,6 +421,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]}, conditionAnatomyFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.conditionAnatomyFieldSet] }, conditionChemicalFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.conditionChemicalFieldSet] }, conditionClassFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.conditionClassFieldSet] }, diff --git a/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js b/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js index 5a5b02b50..bc7752c37 100644 --- a/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js +++ b/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js @@ -56,6 +56,17 @@ export const LiteratureReferenceTable = () => { ); }; + const shortCitationTemplate = (rowData) => { + return ( + <> + + {rowData.shortCitation} + + + + ); + }; + const citationTemplate = (rowData) => { return ( <> @@ -101,6 +112,12 @@ export const LiteratureReferenceTable = () => { filter: true, body : citationTemplate, filterConfig: FILTER_CONFIGS.citationFilterConfig, + }, { + field: "shortCitation", + header: "Short Citation", + sortable: { isEnabled }, + filter: true, + filterConfig: FILTER_CONFIGS.shortCitationFilterConfig, } ]; const defaultColumnNames = columns.map((col) => { diff --git a/src/main/java/org/alliancegenome/curation_api/model/document/LiteratureReference.java b/src/main/java/org/alliancegenome/curation_api/model/document/LiteratureReference.java index 4bba18762..f58b610cb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/document/LiteratureReference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/document/LiteratureReference.java @@ -40,6 +40,9 @@ public class LiteratureReference extends BaseDocument { @JsonView({ View.FieldsOnly.class }) public String citation; + @JsonView({ View.FieldsOnly.class }) + public String citationShort; + @JsonView({ View.FieldsOnly.class }) public List cross_references; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java index 82e9093f6..64efe1d9b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java @@ -47,6 +47,11 @@ public class Reference extends InformationContentEntity { @EqualsAndHashCode.Include private List crossReferences; + @IndexedEmbedded(includeDepth = 1) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @JsonView({View.FieldsOnly.class}) + private String shortCitation; + /** * Retrieve PMID if available in the crossReference collection otherwise MOD ID */ diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java index 9aac33feb..2fef43dfb 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java @@ -90,7 +90,7 @@ protected Reference copyLiteratureReferenceFields(LiteratureReference litRef, Re } ref.setObsolete(false); - List xrefs = new ArrayList(); + List xrefs = new ArrayList<>(); for (LiteratureCrossReference litXref : litRef.getCross_references()) { SearchResponse xrefResponse = crossReferenceDAO.findByField("referencedCurie", litXref.getCurie()); CrossReference xref; @@ -109,6 +109,7 @@ protected Reference copyLiteratureReferenceFields(LiteratureReference litRef, Re if (CollectionUtils.isNotEmpty(xrefs)) ref.setCrossReferences(xrefs); + ref.setShortCitation(litRef.citationShort); if (!ref.getCurie().equals(originalCurie) && originalCurie != null) { referenceDAO.updateReferenceForeignKeys(originalCurie, ref.getCurie()); referenceDAO.remove(originalCurie); diff --git a/src/main/resources/db/migration/v0.22.0.2__add_short_citation.sql b/src/main/resources/db/migration/v0.22.0.2__add_short_citation.sql new file mode 100644 index 000000000..9305b9d9b --- /dev/null +++ b/src/main/resources/db/migration/v0.22.0.2__add_short_citation.sql @@ -0,0 +1 @@ +ALTER TABLE reference add column shortCitation text; From 17b3bd8eaaf4a91d7864d52e160e867306e9e81d Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Tue, 4 Jul 2023 15:39:57 +0200 Subject: [PATCH 16/48] SCRUM-2784 remove unused template --- .../referencePage/LiteratureReferenceTable.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js b/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js index bc7752c37..8259ee0de 100644 --- a/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js +++ b/src/main/cliapp/src/containers/referencePage/LiteratureReferenceTable.js @@ -56,17 +56,6 @@ export const LiteratureReferenceTable = () => { ); }; - const shortCitationTemplate = (rowData) => { - return ( - <> - - {rowData.shortCitation} - - - - ); - }; - const citationTemplate = (rowData) => { return ( <> From 79a91ab7bfd0cb89ce936f68cd087a47d818ac48 Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Wed, 26 Jul 2023 12:16:13 +0200 Subject: [PATCH 17/48] shortCitation attribute a string-like indeing for keywordField and FullTextField --- .../curation_api/model/entities/Reference.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java index 64efe1d9b..e56d8cdeb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java @@ -13,12 +13,18 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.enums.CrossReferencePrefix; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.bridges.FreeTextValueBridge; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.envers.Audited; +import org.hibernate.search.engine.backend.types.Aggregable; +import org.hibernate.search.engine.backend.types.Searchable; +import org.hibernate.search.engine.backend.types.Sortable; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; +import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.ValueBridgeRef; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -28,6 +34,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; @Audited @@ -47,9 +54,9 @@ public class Reference extends InformationContentEntity { @EqualsAndHashCode.Include private List crossReferences; - @IndexedEmbedded(includeDepth = 1) - @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @JsonView({View.FieldsOnly.class}) + @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") + @KeywordField(name = "shortCitation_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") private String shortCitation; /** From b74d600df1a32576d988c9565e84f2041fdf1780 Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Wed, 26 Jul 2023 12:31:23 +0200 Subject: [PATCH 18/48] SCRUM-2784 rename flyway script --- ..._add_short_citation.sql => v0.22.0.10__add_short_citation.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/db/migration/{v0.22.0.2__add_short_citation.sql => v0.22.0.10__add_short_citation.sql} (100%) diff --git a/src/main/resources/db/migration/v0.22.0.2__add_short_citation.sql b/src/main/resources/db/migration/v0.22.0.10__add_short_citation.sql similarity index 100% rename from src/main/resources/db/migration/v0.22.0.2__add_short_citation.sql rename to src/main/resources/db/migration/v0.22.0.10__add_short_citation.sql From 2a9bdf7d3e6f5d4b937cf650d878dad345160478 Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Thu, 27 Jul 2023 16:32:47 +0200 Subject: [PATCH 19/48] add new column to audit table reference_aud --- .../resources/db/migration/v0.22.0.10__add_short_citation.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/db/migration/v0.22.0.10__add_short_citation.sql b/src/main/resources/db/migration/v0.22.0.10__add_short_citation.sql index 9305b9d9b..7549d3971 100644 --- a/src/main/resources/db/migration/v0.22.0.10__add_short_citation.sql +++ b/src/main/resources/db/migration/v0.22.0.10__add_short_citation.sql @@ -1 +1,3 @@ ALTER TABLE reference add column shortCitation text; + +ALTER TABLE reference_AUD add column shortCitation text; From 32ec78823d336f82442f76b0fa4b43b9c476f9c7 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 3 Aug 2023 10:45:28 +0100 Subject: [PATCH 20/48] Fail load when URL invalid --- .../curation_api/jobs/BulkLoadURLProcessor.java | 12 +++++++++--- .../curation_api/util/FileTransferHelper.java | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java b/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java index 52555ac5c..e2cc135e2 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java @@ -20,9 +20,15 @@ public void processBulkURLLoad(Message load) { if (bulkURLLoad.getBulkloadUrl() != null && bulkURLLoad.getBulkloadUrl().length() > 0) { String filePath = fileHelper.saveIncomingURLFile(bulkURLLoad.getBulkloadUrl()); - String localFilePath = fileHelper.compressInputFile(filePath); - processFilePath(bulkURLLoad, localFilePath); - endLoad(bulkURLLoad, null, JobStatus.FINISHED); + String localFilePath; + try { + localFilePath = fileHelper.compressInputFile(filePath); + processFilePath(bulkURLLoad, localFilePath); + endLoad(bulkURLLoad, null, JobStatus.FINISHED); + } catch (NullPointerException e) { + endLoad(bulkURLLoad, "Load: " + bulkURLLoad.getName() + " failed: URL is invalid", JobStatus.FAILED); + } + } else { log.info("Load: " + bulkURLLoad.getName() + " failed: URL is missing"); endLoad(bulkURLLoad, "Load: " + bulkURLLoad.getName() + " failed: URL is missing", JobStatus.FAILED); diff --git a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java index 18915dc90..88a9c42c6 100644 --- a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java @@ -81,7 +81,7 @@ public String saveIncomingFile(MultipartFormDataInput input, String formField) { } - public String compressInputFile(String fullFilePath) { + public String compressInputFile(String fullFilePath) throws NullPointerException { try { GZIPInputStream gs = new GZIPInputStream(new FileInputStream(new File(fullFilePath))); @@ -104,6 +104,9 @@ public String compressInputFile(String fullFilePath) { inFilePath.delete(); return outFilePath.getAbsolutePath(); + } catch (NullPointerException e) { + log.error(e.getMessage()); + throw e; } } From d9723f6641d027786a0fdecc0bf020e4cda272dc Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 3 Aug 2023 10:48:27 +0100 Subject: [PATCH 21/48] Move string declaration --- .../alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java b/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java index e2cc135e2..8cb0a7c3b 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java @@ -20,9 +20,8 @@ public void processBulkURLLoad(Message load) { if (bulkURLLoad.getBulkloadUrl() != null && bulkURLLoad.getBulkloadUrl().length() > 0) { String filePath = fileHelper.saveIncomingURLFile(bulkURLLoad.getBulkloadUrl()); - String localFilePath; try { - localFilePath = fileHelper.compressInputFile(filePath); + String localFilePath = fileHelper.compressInputFile(filePath); processFilePath(bulkURLLoad, localFilePath); endLoad(bulkURLLoad, null, JobStatus.FINISHED); } catch (NullPointerException e) { From 85f13e8aab8dea5123447194dea9838e20391adb Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 3 Aug 2023 08:24:46 -0400 Subject: [PATCH 22/48] Alternative fix for file stuff --- .../jobs/BulkLoadURLProcessor.java | 14 ++++++++----- .../curation_api/util/FileTransferHelper.java | 20 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java b/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java index 8cb0a7c3b..3733193ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/BulkLoadURLProcessor.java @@ -20,14 +20,18 @@ public void processBulkURLLoad(Message load) { if (bulkURLLoad.getBulkloadUrl() != null && bulkURLLoad.getBulkloadUrl().length() > 0) { String filePath = fileHelper.saveIncomingURLFile(bulkURLLoad.getBulkloadUrl()); - try { - String localFilePath = fileHelper.compressInputFile(filePath); + String localFilePath = fileHelper.compressInputFile(filePath); + + if(filePath == null) { + log.info("Load: " + bulkURLLoad.getName() + " failed"); + endLoad(bulkURLLoad, "Load: " + bulkURLLoad.getName() + " failed: to download URL: " + bulkURLLoad.getBulkloadUrl(), JobStatus.FAILED); + } else if(localFilePath == null) { + log.info("Load: " + bulkURLLoad.getName() + " failed"); + endLoad(bulkURLLoad, "Load: " + bulkURLLoad.getName() + " failed: to save local file: " + filePath, JobStatus.FAILED); + } else { processFilePath(bulkURLLoad, localFilePath); endLoad(bulkURLLoad, null, JobStatus.FINISHED); - } catch (NullPointerException e) { - endLoad(bulkURLLoad, "Load: " + bulkURLLoad.getName() + " failed: URL is invalid", JobStatus.FAILED); } - } else { log.info("Load: " + bulkURLLoad.getName() + " failed: URL is missing"); endLoad(bulkURLLoad, "Load: " + bulkURLLoad.getName() + " failed: URL is missing", JobStatus.FAILED); diff --git a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java index 88a9c42c6..36f4ba69a 100644 --- a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java @@ -5,7 +5,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; import java.util.List; @@ -46,6 +45,11 @@ public String saveIncomingURLFile(String url) { URL redirectUrl = response.url(); log.info("Saving file to local filesystem: " + saveFilePath.getAbsolutePath()); FileUtils.copyURLToFile(redirectUrl, saveFilePath); + if(!saveFilePath.exists() || saveFilePath.length() == 0) { + log.error("Downloading URL failed: " + url); + saveFilePath.delete(); + return null; + } } catch (Exception e) { log.error(e.getMessage()); log.info("Deleting old file: " + saveFilePath); @@ -83,8 +87,15 @@ public String saveIncomingFile(MultipartFormDataInput input, String formField) { public String compressInputFile(String fullFilePath) throws NullPointerException { + File inFilePath = new File(fullFilePath); + + if(!inFilePath.exists() || inFilePath.length() == 0) { + log.error("Input file does not exist"); + return null; + } + try { - GZIPInputStream gs = new GZIPInputStream(new FileInputStream(new File(fullFilePath))); + GZIPInputStream gs = new GZIPInputStream(new FileInputStream(inFilePath)); gs.close(); log.info("Input stream is compressed not compressing"); return new File(fullFilePath).getAbsolutePath(); @@ -93,8 +104,6 @@ public String compressInputFile(String fullFilePath) throws NullPointerException File outFilePath = generateFilePath(); - File inFilePath = new File(fullFilePath); - if (!compressGzipFile(inFilePath, outFilePath)) { return null; } @@ -104,9 +113,6 @@ public String compressInputFile(String fullFilePath) throws NullPointerException inFilePath.delete(); return outFilePath.getAbsolutePath(); - } catch (NullPointerException e) { - log.error(e.getMessage()); - throw e; } } From 8827ce025c37408e0ec8c1d2972e63664b71a255 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 3 Aug 2023 08:28:23 -0400 Subject: [PATCH 23/48] Fix for redirect url --- .../alliancegenome/curation_api/util/FileTransferHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java index 36f4ba69a..71f25314c 100644 --- a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java @@ -46,7 +46,7 @@ public String saveIncomingURLFile(String url) { log.info("Saving file to local filesystem: " + saveFilePath.getAbsolutePath()); FileUtils.copyURLToFile(redirectUrl, saveFilePath); if(!saveFilePath.exists() || saveFilePath.length() == 0) { - log.error("Downloading URL failed: " + url); + log.error("Downloading URL failed: " + redirectUrl); saveFilePath.delete(); return null; } From eb554df88bb877fe30069b41a2cb48fc4df2f750 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 3 Aug 2023 09:41:48 -0400 Subject: [PATCH 24/48] Fix for null --- .../curation_api/util/FileTransferHelper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java index 71f25314c..fe15339f3 100644 --- a/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/util/FileTransferHelper.java @@ -85,8 +85,12 @@ public String saveIncomingFile(MultipartFormDataInput input, String formField) { } - public String compressInputFile(String fullFilePath) throws NullPointerException { + public String compressInputFile(String fullFilePath) { + if(fullFilePath == null) { + return null; + } + File inFilePath = new File(fullFilePath); if(!inFilePath.exists() || inFilePath.length() == 0) { From 30639884e54c884d0835fd2bcadf41b8004bf854 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 4 Aug 2023 14:56:40 +0100 Subject: [PATCH 25/48] Display status of latest file for load --- .../dataLoadsPage/DataLoadsComponent.js | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/src/main/cliapp/src/containers/dataLoadsPage/DataLoadsComponent.js b/src/main/cliapp/src/containers/dataLoadsPage/DataLoadsComponent.js index c81ce240e..a7bb9c28f 100644 --- a/src/main/cliapp/src/containers/dataLoadsPage/DataLoadsComponent.js +++ b/src/main/cliapp/src/containers/dataLoadsPage/DataLoadsComponent.js @@ -323,7 +323,7 @@ export const DataLoadsComponent = () => { return ret; }; - const bulkloadStatusTemplate = (rowData) => { + const bulkloadFileStatusTemplate = (rowData) => { let styleClass = 'p-button-text p-button-plain'; if (rowData.bulkloadStatus === 'FAILED') { styleClass = "p-button-danger"; } if (rowData.bulkloadStatus && ( @@ -337,6 +337,26 @@ export const DataLoadsComponent = () => { ); }; + const bulkloadStatusTemplate = (rowData) => { + let sortedFiles = []; + if (rowData.loadFiles) { + sortedFiles = sortFilesByDate(rowData.loadFiles); + } + let latestStatus = sortedFiles[0].bulkloadStatus; + let latestError = sortedFiles[0].errorMessage; + let styleClass = 'p-button-text p-button-plain'; + if (latestStatus === 'FAILED') { styleClass = "p-button-danger"; } + if (latestStatus && ( + latestStatus.endsWith('STARTED') || + latestStatus.endsWith('RUNNING') || + latestStatus.endsWith('PENDING') + )) { styleClass = "p-button-success"; } + + return ( +