diff --git a/ChangeLog.md b/ChangeLog.md index 5ef5c755f7..5116d99cfa 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -10,6 +10,7 @@ Features - Added UUID lookup and link [2539](https://github.com/GMOD/Apollo/pull/2539/). - Added status filter for recent annotations [2543](https://github.com/GMOD/Apollo/pull/2543/). - Add feature name `loc` to loadLink [2544](https://github.com/GMOD/Apollo/issues/2544). +- `loc` loadLink now supports UUID and ID popup provides link [2549](https://github.com/GMOD/Apollo/issues/2549). Bug Fixes @@ -18,6 +19,7 @@ Bug Fixes - Now able to resize terminators by dragging [2521](https://github.com/GMOD/Apollo/issues/2521). - Added missing GO annotations [2535](https://github.com/GMOD/Apollo/pull/2535). - findAllOrganism webserver failed when user is not an admin and no session is present [2540](https://github.com/GMOD/Apollo/issues/2540). +- Provide minor UI and bug fixes [2548](https://github.com/GMOD/Apollo/pull/2548). Infrastructure Changes diff --git a/docs/Configure.md b/docs/Configure.md index c6f088e1b0..963ab07db4 100644 --- a/docs/Configure.md +++ b/docs/Configure.md @@ -638,8 +638,7 @@ http://demo.genomearchitect.org/Apollo2/3836/jbrowse/index.html?loc=Group1.31:28 //annotator/loadLink?loc=&organism=&tracks= -- `location` = :.. it can also be the annotated feature name as well -- `uuid` = The uniquename of the feature. It replaces the feature and does not require an organism argument. It is used inplace of the `loc` option. +- `location` = :.. it can also be the annotated feature `name` if an organims is provided or the `uniqueName` (see the ID in the annotation detail window), which is typically a UUID and does not require an organism. - `organism` is the organism id or common name if unique. - `tracks` are url-encoded tracks separated by a comma diff --git a/grails-app/controllers/org/bbop/apollo/AnnotatorController.groovy b/grails-app/controllers/org/bbop/apollo/AnnotatorController.groovy index ce26e63a19..2f822916dd 100644 --- a/grails-app/controllers/org/bbop/apollo/AnnotatorController.groovy +++ b/grails-app/controllers/org/bbop/apollo/AnnotatorController.groovy @@ -85,7 +85,14 @@ class AnnotatorController { organism = featureLocation.sequence.organism } - if (!allowedOrganisms.contains(organism)) { + if (Feature.countByUniqueName(params.loc)>0) { + Feature feature = Feature.findByUniqueName(params.loc) + FeatureLocation featureLocation = feature.featureLocation + params.loc = featureLocation.sequence.name + ":" + featureLocation.fmin + ".." + featureLocation.fmax + organism = featureLocation.sequence.organism + } + + if (!allowedOrganisms.contains(organism)) { log.error("Can not load organism ${organism?.commonName} so loading ${allowedOrganisms.first().commonName} instead.") params.loc = null organism = allowedOrganisms.first() @@ -94,10 +101,12 @@ class AnnotatorController { log.debug "loading organism: ${organism}" preferenceService.setCurrentOrganism(permissionService.currentUser, organism, clientToken) String location = params.loc - // assume that the lookup is a symbol lookup value and not a location + + // assume that the lookup is a symbol lookup value and not a location if (location) { int colonIndex = location.indexOf(':') int ellipseIndex = location.indexOf('..') + if(colonIndex > 0 && colonIndex < ellipseIndex){ String[] splitString = location.split(':') log.debug "splitString : ${splitString}" @@ -127,6 +136,9 @@ class AnnotatorController { int fmax = featureLocation.fmax preferenceService.setCurrentSequenceLocation(sequence.name, fmin, fmax, clientToken) } + else{ + log.error("Failed to process load process loadLink string") + } } } diff --git a/src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java b/src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java index ad84c99371..ab465ee7b9 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java +++ b/src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java @@ -1034,8 +1034,7 @@ public void updateStatus(ChangeEvent changeEvent){ @UiHandler(value = {"annotationLinkButton"}) public void showAnnotationLink(ClickEvent clickEvent){ - String url = MainPanel.getInstance().generateApolloUrl(selectedAnnotationInfo.getUniqueName()); - String link = ""+url+""; + String link =MainPanel.getInstance().generateApolloLink(selectedAnnotationInfo.getUniqueName()); new LinkDialog("Link to '"+selectedAnnotationInfo.getName()+"'",link,true); } diff --git a/src/gwt/org/bbop/apollo/gwt/client/GeneDetailPanel.java b/src/gwt/org/bbop/apollo/gwt/client/GeneDetailPanel.java index 16c9337ea2..31c90ec5d4 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/GeneDetailPanel.java +++ b/src/gwt/org/bbop/apollo/gwt/client/GeneDetailPanel.java @@ -267,7 +267,7 @@ public void updateData(AnnotationInfo annotationInfo) { @UiHandler("annotationIdButton") void getAnnotationInfo(ClickEvent clickEvent) { - Bootbox.alert(internalAnnotationInfo.getUniqueName()); + new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true); } @UiHandler("gotoAnnotation") diff --git a/src/gwt/org/bbop/apollo/gwt/client/MainPanel.java b/src/gwt/org/bbop/apollo/gwt/client/MainPanel.java index aafc993927..bba6163b77 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/MainPanel.java +++ b/src/gwt/org/bbop/apollo/gwt/client/MainPanel.java @@ -953,6 +953,11 @@ public String generateApolloUrl() { return generateApolloUrl(null); } + public String generateApolloLink(String uuid) { + String url = generateApolloUrl(uuid); + return ""+url+""; + } + public String generateApolloUrl(String uuid) { String url = Annotator.getRootUrl(); url += "annotator/loadLink"; @@ -964,7 +969,7 @@ public String generateApolloUrl(String uuid) { } } else{ - url += "?uuid="+uuid; + url += "?loc="+uuid; } url += "&organism=" + currentOrganism.getId(); url += "&tracks="; diff --git a/src/gwt/org/bbop/apollo/gwt/client/RepeatRegionDetailPanel.java b/src/gwt/org/bbop/apollo/gwt/client/RepeatRegionDetailPanel.java index 4e13733794..495b6ed952 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/RepeatRegionDetailPanel.java +++ b/src/gwt/org/bbop/apollo/gwt/client/RepeatRegionDetailPanel.java @@ -32,7 +32,7 @@ */ public class RepeatRegionDetailPanel extends Composite { private AnnotationInfo internalAnnotationInfo; - + interface AnnotationDetailPanelUiBinder extends UiBinder { } @@ -74,7 +74,7 @@ public RepeatRegionDetailPanel() { @UiHandler("annotationIdButton") void getAnnotationInfo(ClickEvent clickEvent) { - Bootbox.alert(internalAnnotationInfo.getUniqueName()); + new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true); } @UiHandler("gotoAnnotation") @@ -184,7 +184,7 @@ void handleNameChange(ChangeEvent e) { internalAnnotationInfo.setName(updatedName); updateEntity(); } - + @UiHandler("descriptionField") void handleDescriptionChange(ChangeEvent e) { String updatedDescription = descriptionField.getText(); @@ -204,7 +204,7 @@ private void enableFields(boolean enabled) { descriptionField.setEnabled(enabled); synonymsField.setEnabled(enabled); } - + private void updateEntity() { final AnnotationInfo updatedInfo = this.internalAnnotationInfo; enableFields(false); @@ -227,7 +227,7 @@ public void onError(Request request, Throwable exception) { data.put(FeatureStringEnum.ORGANISM.getValue(),new JSONString(MainPanel.getInstance().getCurrentOrganism().getId())); RestService.sendRequest(requestCallback, "annotator/updateFeature/", data); } - + public void updateData(AnnotationInfo annotationInfo) { GWT.log("Updating entity"); this.internalAnnotationInfo = annotationInfo; @@ -305,4 +305,4 @@ public void setEditable(boolean editable) { synonymsField.setEnabled(editable); deleteAnnotation.setEnabled(editable); } -} \ No newline at end of file +} diff --git a/src/gwt/org/bbop/apollo/gwt/client/TranscriptDetailPanel.java b/src/gwt/org/bbop/apollo/gwt/client/TranscriptDetailPanel.java index 83fd0f7b87..0594934afb 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/TranscriptDetailPanel.java +++ b/src/gwt/org/bbop/apollo/gwt/client/TranscriptDetailPanel.java @@ -159,7 +159,7 @@ public void callback(boolean result) { @UiHandler("annotationIdButton") void getAnnotationInfo(ClickEvent clickEvent) { - Bootbox.alert(internalAnnotationInfo.getUniqueName()); + new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true); } @UiHandler("gotoAnnotation") diff --git a/src/gwt/org/bbop/apollo/gwt/client/VariantDetailPanel.java b/src/gwt/org/bbop/apollo/gwt/client/VariantDetailPanel.java index 77ccd58381..48f0fcdea4 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/VariantDetailPanel.java +++ b/src/gwt/org/bbop/apollo/gwt/client/VariantDetailPanel.java @@ -155,7 +155,7 @@ public void callback(boolean result) { @UiHandler("annotationIdButton") void getAnnotationInfo(ClickEvent clickEvent) { - Bootbox.alert(internalAnnotationInfo.getUniqueName()); + new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true); } @UiHandler("gotoAnnotation") @@ -315,4 +315,4 @@ public void onError(Request request, Throwable exception) { public static boolean isValidDNA(String bases) { return bases.matches("^[ATCGN]+$"); } -} \ No newline at end of file +}