From 4d9d1271ebc6fe466e6f33682b44b3a55db0ebce Mon Sep 17 00:00:00 2001 From: Valerio Arnaboldi Date: Mon, 6 May 2024 10:05:31 -0700 Subject: [PATCH 1/3] Added textpresso rewrites and redirects Added to production and stage --- cdk/amplify-production-stack.ts | 13 +++++++++++-- cdk/amplify-stage-stack.ts | 13 ++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cdk/amplify-production-stack.ts b/cdk/amplify-production-stack.ts index 88fd3b705..d88e90916 100644 --- a/cdk/amplify-production-stack.ts +++ b/cdk/amplify-production-stack.ts @@ -41,7 +41,7 @@ export class AmplifyProductionStack extends cdk.Stack { { source: '/jbrowse/worms/jbrowse2', target: 'https://www.alliancegenome.org/jbrowse/worms/jbrowse2/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/jbrowse/worms/jbrowse2/', target: 'https://main.d2jjb0xowet5mr.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/jbrowse2/<*>', target: 'https://main.d2jjb0xowet5mr.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, - + { source: '/agr_simplemine.cgi', target: 'https://caltech-curation.textpressolab.com/pub/cgi-bin/forms/agr_simplemine.cgi', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/<*>', target: 'https://prod-alb.alliancegenome.org/jbrowse/<*>', status: amplify.RedirectStatus.REWRITE }, @@ -65,10 +65,19 @@ export class AmplifyProductionStack extends cdk.Stack { { source: '/textpresso/wb', target: 'https://www.alliancegenome.org/textpresso/wb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/textpresso/wb/', target: 'https://www.alliancegenome.org/textpresso/wb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/textpresso/wb/<*>', target: 'https://wb-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/mgi', target: 'https://www.alliancegenome.org/textpresso/mgi/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/mgi/', target: 'https://www.alliancegenome.org/textpresso/mgi/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/mgi/<*>', target: 'https://mgi-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/zfin', target: 'https://www.alliancegenome.org/textpresso/zfin/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/zfin/', target: 'https://www.alliancegenome.org/textpresso/zfin/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/zfin/<*>', target: 'https://zfin-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/fb', target: 'https://www.alliancegenome.org/textpresso/fb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/fb/', target: 'https://www.alliancegenome.org/textpresso/fb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/fb/<*>', target: 'https://fb-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/<*>', target: '/index.html', status: amplify.RedirectStatus.NOT_FOUND_REWRITE }, { source: '', target: '/index.html', status: amplify.RedirectStatus.REWRITE } - + ]; const amplifyApp = new amplify.App(this, 'agr-ui-production', { diff --git a/cdk/amplify-stage-stack.ts b/cdk/amplify-stage-stack.ts index 5b329b4ad..702b80b84 100644 --- a/cdk/amplify-stage-stack.ts +++ b/cdk/amplify-stage-stack.ts @@ -19,7 +19,7 @@ export class AmplifyStageStack extends cdk.Stack { { source: '/api/<*>', target: 'https://stage-api.alliancegenome.org/api/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse2', target: 'https://stage.alliancegenome.org/jbrowse2/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/jbrowse2/', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, - { source: '/jbrowse2/<*>', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2/<*>', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowsedata/XenBaseXTJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xt9_1/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowsedata/XenBaseXLJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xl9_2/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowsedata/XenBaseData/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/<*>', status: amplify.RedirectStatus.REWRITE }, @@ -51,12 +51,23 @@ export class AmplifyStageStack extends cdk.Stack { { source: '/bluegenes', target: 'https://stage.alliancegenome.org/bluegenes/alliancemine', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/bluegenes/', target: 'https://stage.alliancegenome.org/bluegenes/alliancemine', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/bluegenes/<*>', target: 'https://stage-alliancemine.alliancegenome.org:444/bluegenes/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/sgd', target: 'https://stage.alliancegenome.org/textpresso/sgd/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/textpresso/sgd/', target: 'https://stage.alliancegenome.org/textpresso/sgd/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/textpresso/sgd/<*>', target: 'https://sgd-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/textpresso/wb', target: 'https://stage.alliancegenome.org/textpresso/wb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/textpresso/wb/', target: 'https://stage.alliancegenome.org/textpresso/wb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/textpresso/wb/<*>', target: 'https://wb-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/mgi', target: 'https://stage.alliancegenome.org/textpresso/mgi/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/mgi/', target: 'https://stage.alliancegenome.org/textpresso/mgi/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/mgi/<*>', target: 'https://mgi-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/zfin', target: 'https://stage.alliancegenome.org/textpresso/zfin/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/zfin/', target: 'https://stage.alliancegenome.org/textpresso/zfin/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/zfin/<*>', target: 'https://zfin-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/fb', target: 'https://stage.alliancegenome.org/textpresso/fb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/fb/', target: 'https://stage.alliancegenome.org/textpresso/fb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/fb/<*>', target: 'https://fb-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/<*>', target: '/index.html', status: amplify.RedirectStatus.NOT_FOUND_REWRITE }, { source: '', target: '/index.html', status: amplify.RedirectStatus.REWRITE } ]; From c11579fafd378590f90c788dce8fd12b6ad2176d Mon Sep 17 00:00:00 2001 From: Valerio Arnaboldi Date: Mon, 6 May 2024 10:12:17 -0700 Subject: [PATCH 2/3] Added textpresso rewrites to test --- cdk/amplify-test-stack.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cdk/amplify-test-stack.ts b/cdk/amplify-test-stack.ts index 7b02d2f41..a13af5dcb 100644 --- a/cdk/amplify-test-stack.ts +++ b/cdk/amplify-test-stack.ts @@ -55,6 +55,22 @@ export class AmplifyTestStack extends cdk.Stack { { source: '/swagger-ui/<*>', target: 'https://test-alb.alliancegenome.org/swagger-ui/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/openapi', target: 'https://test-alb.alliancegenome.org/openapi', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/sgd', target: 'https://test.alliancegenome.org/textpresso/sgd/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/sgd/', target: 'https://test.alliancegenome.org/textpresso/sgd/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/sgd/<*>', target: 'https://sgd-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/wb', target: 'https://test.alliancegenome.org/textpresso/wb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/wb/', target: 'https://test.alliancegenome.org/textpresso/wb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/wb/<*>', target: 'https://wb-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/mgi', target: 'https://test.alliancegenome.org/textpresso/mgi/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/mgi/', target: 'https://test.alliancegenome.org/textpresso/mgi/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/mgi/<*>', target: 'https://mgi-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/zfin', target: 'https://test.alliancegenome.org/textpresso/zfin/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/zfin/', target: 'https://test.alliancegenome.org/textpresso/zfin/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/zfin/<*>', target: 'https://zfin-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/textpresso/fb', target: 'https://test.alliancegenome.org/textpresso/fb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/fb/', target: 'https://test.alliancegenome.org/textpresso/fb/tpc', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/textpresso/fb/<*>', target: 'https://fb-textpresso.alliancegenome.org/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/<*>', target: '/index.html', status: amplify.RedirectStatus.NOT_FOUND_REWRITE }, { source: '', target: '/index.html', status: amplify.RedirectStatus.REWRITE } ]; From 6929eee1ef945501a0dbae8f2dae260929532496 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 6 May 2024 12:42:38 -0500 Subject: [PATCH 3/3] SCRUM-4012 add reference name lookup for mod references --- src/components/dataTable/AnnotatedEntitiesPopupCuration.js | 6 +++++- src/components/dataTable/GeneticModifiersCellCuration.js | 2 +- src/components/dataTable/getResourceUrl.js | 2 +- src/components/dataTable/utils.js | 7 ++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index 3558ccf9c..dc14bf115 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -27,7 +27,11 @@ import StrainBackground from './StrainBackground'; function renderLink(entity) { const curie = getIdentifier(entity.diseaseAnnotationSubject); - const url = getResourceUrl(curie, entity.diseaseAnnotationSubject.type, entity.diseaseAnnotationSubject.subtype) + const url = getResourceUrl({ + curie, + type: entity.diseaseAnnotationSubject.type, + subtype: entity.diseaseAnnotationSubject.subtype + }) if (entity.type === 'AlleleDiseaseAnnotation') { const innerText = entity.diseaseAnnotationSubject.alleleSymbol ? entity.diseaseAnnotationSubject.alleleSymbol.displayText : entity.diseaseAnnotationSubject.name; diff --git a/src/components/dataTable/GeneticModifiersCellCuration.js b/src/components/dataTable/GeneticModifiersCellCuration.js index 80923132b..af2e9ed60 100644 --- a/src/components/dataTable/GeneticModifiersCellCuration.js +++ b/src/components/dataTable/GeneticModifiersCellCuration.js @@ -26,7 +26,7 @@ function GeneticModifierLink(modifier) { } break; case 'AffectedGenomicModel': - let url = getResourceUrl(identifier, modifier.type, modifier.subtype); + let url = getResourceUrl({ curie: identifier, type: modifier.type, subtype: modifier.subtype}); if (url && modifier.name) { return ( diff --git a/src/components/dataTable/getResourceUrl.js b/src/components/dataTable/getResourceUrl.js index b85adcb45..2b58a02b1 100644 --- a/src/components/dataTable/getResourceUrl.js +++ b/src/components/dataTable/getResourceUrl.js @@ -1,6 +1,6 @@ import { resourceDescriptors } from "../../resourceDescriptors"; -export const getResourceUrl = (curie, type, subtype ) => { +export const getResourceUrl = ({ curie, type, subtype }) => { const [prefix, id] = curie.split(':'); let resource; diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 23ddaab65..2f6f4738f 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -28,7 +28,12 @@ export const getIsViaOrthology = (annotation) => { }; export const getSingleReferenceUrl = (pubModId) => { - const url = getResourceUrl(pubModId); + let url; + if(pubModId.includes("PMID")){ + url = getResourceUrl({curie: pubModId}); + } else { + url = getResourceUrl({curie: pubModId, type: "reference"}); + } return {pubModId, url}; }