galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
February 2014
- 1 participants
- 192 discussions
commit/galaxy-central: carlfeberhard: Fix to persistance between page loads of tags, annotations shown/hidden in history panel
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5d7c48b9d167/
Changeset: 5d7c48b9d167
User: carlfeberhard
Date: 2014-02-20 20:03:21
Summary: Fix to persistance between page loads of tags, annotations shown/hidden in history panel
Affected #: 4 files
diff -r b90d953f77fa633f0c4a46e177118562191bc1b7 -r 5d7c48b9d16761daaac1ecf7674812e440558f18 static/scripts/mvc/history/current-history-panel.js
--- a/static/scripts/mvc/history/current-history-panel.js
+++ b/static/scripts/mvc/history/current-history-panel.js
@@ -206,11 +206,39 @@
},
renderBasedOnPrefs : function(){
+ console.debug( 'renderBasedOnPrefs', this.preferences.toJSON() )
if( this.preferences.get( 'searching' ) ){
this.showSearchControls( 0 );
}
},
+ _renderTags : function( $where ){
+ var panel = this;
+ // render tags and show/hide based on preferences
+ hpanel.HistoryPanel.prototype._renderTags.call( this, $where );
+ if( this.preferences.get( 'tagsEditorShown' ) ){
+ this.tagsEditor.toggle( true );
+ }
+ // store preference when shown or hidden
+ this.tagsEditor.on( 'hiddenUntilActivated:shown hiddenUntilActivated:hidden',
+ function( tagsEditor ){
+ panel.preferences.set( 'tagsEditorShown', tagsEditor.hidden );
+ });
+ },
+ _renderAnnotation : function( $where ){
+ var panel = this;
+ // render annotation and show/hide based on preferences
+ hpanel.HistoryPanel.prototype._renderAnnotation.call( this, $where );
+ if( this.preferences.get( 'annotationEditorShown' ) ){
+ this.annotationEditor.toggle( true );
+ }
+ // store preference when shown or hidden
+ this.annotationEditor.on( 'hiddenUntilActivated:shown hiddenUntilActivated:hidden',
+ function( annotationEditor ){
+ panel.preferences.set( 'annotationEditorShown', annotationEditor.hidden );
+ });
+ },
+
// ........................................................................ external objects/MVC
//TODO: remove quota meter from panel and remove this
/** add listeners to an external quota meter (mvc/user/user-quotameter.js) */
diff -r b90d953f77fa633f0c4a46e177118562191bc1b7 -r 5d7c48b9d16761daaac1ecf7674812e440558f18 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -255,8 +255,8 @@
selectable : this.selecting,
hasUser : this.model.ownedByCurrUser(),
logger : this.logger,
- tagsEditorShown : ( this.tagsEditor && !this.tagsEditor.isHidden() ),
- annotationEditorShown : ( this.annotationEditor && !this.annotationEditor.isHidden() )
+ tagsEditorShown : ( this.tagsEditor && !this.tagsEditor.hidden ),
+ annotationEditorShown : ( this.annotationEditor && !this.annotationEditor.hidden )
});
this._setUpHdaListeners( hdaView );
return hdaView;
diff -r b90d953f77fa633f0c4a46e177118562191bc1b7 -r 5d7c48b9d16761daaac1ecf7674812e440558f18 static/scripts/packed/mvc/history/current-history-panel.js
--- a/static/scripts/packed/mvc/history/current-history-panel.js
+++ b/static/scripts/packed/mvc/history/current-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-edit","mvc/history/history-panel"],function(b,e){var c=SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});c.storageKey=function d(){return("history-panel")};var a=e.HistoryPanel.extend({HDAViewClass:b.HDAEditView,emptyMsg:_l("This history is empty. Click 'Get Data' on the left pane to start"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};this.preferences=new c(_.extend({id:c.storageKey()},_.pick(f,_.keys(c.prototype.defaults))));e.HistoryPanel.prototype.initialize.call(this,f);if(this.model){console.debug(this.model);this.model.checkForUpdates()}},loadCurrentHistory:function(g){var f=this;return this.loadHistoryWithHDADetails("current",g).then(function(i,h){f.trigger("current-history",f)})},switchToHistory:function(i,h){var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories/"+i+"/set_as_current")};return this.loadHistoryWithHDADetails(i,h,g).then(function(k,j){f.trigger("switched-history",f)})},createNewHistory:function(h){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,h,g).then(function(j,i){f.trigger("new-history",f)})},setModel:function(h,f,g){g=g||{};e.HistoryPanel.prototype.setModel.call(this,h,f,g);this.model.checkForUpdates();return this},_setUpModelEventHandlers:function(){e.HistoryPanel.prototype._setUpModelEventHandlers.call(this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("state:ready",function(g,h,f){if((!g.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[g.id])}},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children());f.renderBasedOnPrefs()}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderBasedOnPrefs:function(){if(this.preferences.get("searching")){this.showSearchControls(0)}},connectToQuotaMeter:function(f){if(!f){return this}this.listenTo(f,"quota:over",this.showQuotaMessage);this.listenTo(f,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(f&&f.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var f=this.$el.find(".quota-message");if(f.is(":hidden")){f.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var f=this.$el.find(".quota-message");if(!f.is(":hidden")){f.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(f){if(!f){return this}this.on("new-storage",function(h,g){if(f&&h){f.findItemByHtml(_l("Include Deleted Datasets")).checked=h.get("show_deleted");f.findItemByHtml(_l("Include Hidden Datasets")).checked=h.get("show_hidden")}});return this},toString:function(){return"CurrentHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CurrentHistoryPanel:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-edit","mvc/history/history-panel"],function(b,e){var c=SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});c.storageKey=function d(){return("history-panel")};var a=e.HistoryPanel.extend({HDAViewClass:b.HDAEditView,emptyMsg:_l("This history is empty. Click 'Get Data' on the left pane to start"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};this.preferences=new c(_.extend({id:c.storageKey()},_.pick(f,_.keys(c.prototype.defaults))));e.HistoryPanel.prototype.initialize.call(this,f);if(this.model){console.debug(this.model);this.model.checkForUpdates()}},loadCurrentHistory:function(g){var f=this;return this.loadHistoryWithHDADetails("current",g).then(function(i,h){f.trigger("current-history",f)})},switchToHistory:function(i,h){var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories/"+i+"/set_as_current")};return this.loadHistoryWithHDADetails(i,h,g).then(function(k,j){f.trigger("switched-history",f)})},createNewHistory:function(h){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,h,g).then(function(j,i){f.trigger("new-history",f)})},setModel:function(h,f,g){g=g||{};e.HistoryPanel.prototype.setModel.call(this,h,f,g);this.model.checkForUpdates();return this},_setUpModelEventHandlers:function(){e.HistoryPanel.prototype._setUpModelEventHandlers.call(this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("state:ready",function(g,h,f){if((!g.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[g.id])}},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children());f.renderBasedOnPrefs()}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderBasedOnPrefs:function(){console.debug("renderBasedOnPrefs",this.preferences.toJSON());if(this.preferences.get("searching")){this.showSearchControls(0)}},_renderTags:function(f){var g=this;e.HistoryPanel.prototype._renderTags.call(this,f);if(this.preferences.get("tagsEditorShown")){this.tagsEditor.toggle(true)}this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("tagsEditorShown",h.hidden)})},_renderAnnotation:function(f){var g=this;e.HistoryPanel.prototype._renderAnnotation.call(this,f);if(this.preferences.get("annotationEditorShown")){this.annotationEditor.toggle(true)}this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("annotationEditorShown",h.hidden)})},connectToQuotaMeter:function(f){if(!f){return this}this.listenTo(f,"quota:over",this.showQuotaMessage);this.listenTo(f,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(f&&f.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var f=this.$el.find(".quota-message");if(f.is(":hidden")){f.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var f=this.$el.find(".quota-message");if(!f.is(":hidden")){f.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(f){if(!f){return this}this.on("new-storage",function(h,g){if(f&&h){f.findItemByHtml(_l("Include Deleted Datasets")).checked=h.get("show_deleted");f.findItemByHtml(_l("Include Hidden Datasets")).checked=h.get("show_hidden")}});return this},toString:function(){return"CurrentHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CurrentHistoryPanel:a}});
\ No newline at end of file
diff -r b90d953f77fa633f0c4a46e177118562191bc1b7 -r 5d7c48b9d16761daaac1ecf7674812e440558f18 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel"],function(c,a,b){var d=b.ReadOnlyHistoryPanel.extend({HDAViewClass:a.HDAEditView,initialize:function(e){e=e||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=e.selecting||false;this.annotationEditorShown=e.annotationEditorShown||false;this.tagsEditorShown=e.tagsEditorShown||false;b.ReadOnlyHistoryPanel.prototype.initialize.call(this,e)},_setUpModelEventHandlers:function(){b.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(e){this.model.fetch()},this)},renderModel:function(){var e=$("<div/>");e.append(d.templates.historyPanel(this.model.toJSON()));if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(e);this._renderAnnotation(e)}e.find(".history-secondary-actions").prepend(this._renderSelectButton());e.find(".history-dataset-actions").toggle(this.selecting);e.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(e);this.renderHdas(e);return e},_renderTags:function(e){var f=this;this.tagsEditor=new TagsEditor({model:this.model,el:e.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){f.toggleHDATagEditors(true,f.fxSpeed)},onhide:function(){f.toggleHDATagEditors(false,f.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".history-secondary-actions"))})},_renderAnnotation:function(e){var f=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:e.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){f.toggleHDAAnnotationEditors(true,f.fxSpeed)},onhide:function(){f.toggleHDAAnnotationEditors(false,f.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".history-secondary-actions"))})},_renderSelectButton:function(e){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(e){e=e||this.$el;e.find("[title]").tooltip({placement:"bottom"});if(!this.model){return}this._setUpDatasetActionsPopup(e);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var f=this;e.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(g){var h=f.model.get("name");if(g&&g!==h){f.$el.find(".history-name").text(g);f.model.save({name:g}).fail(function(){f.$el.find(".history-name").text(f.model.previous("name"))})}else{f.$el.find(".history-name").text(h)}}})},_setUpDatasetActionsPopup:function(e){var f=this;(new PopupMenu(e.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.hide;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Unhide datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.unhide;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Delete datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype["delete"];f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Undelete datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.undelete;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var g=c.HistoryDatasetAssociation.prototype.purge;f.getSelectedHdaCollection().ajaxQueue(g)}}}]))},handleHdaDeletionChange:function(e){if(e.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[e.id])}},handleHdaVisibleChange:function(e){if(e.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[e.id])}},createHdaView:function(f){var e=f.get("id"),g=new this.HDAViewClass({model:f,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[e],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.isHidden()),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.isHidden())});this._setUpHdaListeners(g);return g},_setUpHdaListeners:function(f){var e=this;b.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,f);f.on("selected",function(g){var h=g.model.get("id");e.selectedHdaIds=_.union(e.selectedHdaIds,[h])});f.on("de-selected",function(g){var h=g.model.get("id");e.selectedHdaIds=_.without(e.selectedHdaIds,h)})},toggleHDATagEditors:function(e){var f=arguments;_.each(this.hdaViews,function(g){if(g.tagsEditor){g.tagsEditor.toggle.apply(g.tagsEditor,f)}})},toggleHDAAnnotationEditors:function(e){var f=arguments;_.each(this.hdaViews,function(g){if(g.annotationEditor){g.annotationEditor.toggle.apply(g.annotationEditor,f)}})},removeHdaView:function(f){if(!f){return}var e=this;f.$el.fadeOut(e.fxSpeed,function(){f.off();f.remove();delete e.hdaViews[f.model.id];if(_.isEmpty(e.hdaViews)){e.$el.find(e.emptyMsgSelector).fadeIn(e.fxSpeed,function(){e.trigger("empty-history",e)})}})},events:_.extend(_.clone(b.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":function(f){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(e){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(e);_.each(this.hdaViews,function(f){f.showSelector(e)});this.selectedHdaIds=[]},hideSelectors:function(e){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(e);_.each(this.hdaViews,function(f){f.hideSelector(e)});this.selectedHdaIds=[]},toggleSelectors:function(e){if(!this.selecting){this.showSelectors(e)}else{this.hideSelectors(e)}},selectAllDatasets:function(e){_.each(this.hdaViews,function(f){f.select(e)})},deselectAllDatasets:function(e){_.each(this.hdaViews,function(f){f.deselect(e)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(e){return e.selected})},getSelectedHdaCollection:function(){return new c.HDACollection(_.map(this.getSelectedHdaViews(),function(e){return e.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:d}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel"],function(c,a,b){var d=b.ReadOnlyHistoryPanel.extend({HDAViewClass:a.HDAEditView,initialize:function(e){e=e||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=e.selecting||false;this.annotationEditorShown=e.annotationEditorShown||false;this.tagsEditorShown=e.tagsEditorShown||false;b.ReadOnlyHistoryPanel.prototype.initialize.call(this,e)},_setUpModelEventHandlers:function(){b.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(e){this.model.fetch()},this)},renderModel:function(){var e=$("<div/>");e.append(d.templates.historyPanel(this.model.toJSON()));if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(e);this._renderAnnotation(e)}e.find(".history-secondary-actions").prepend(this._renderSelectButton());e.find(".history-dataset-actions").toggle(this.selecting);e.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(e);this.renderHdas(e);return e},_renderTags:function(e){var f=this;this.tagsEditor=new TagsEditor({model:this.model,el:e.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){f.toggleHDATagEditors(true,f.fxSpeed)},onhide:function(){f.toggleHDATagEditors(false,f.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".history-secondary-actions"))})},_renderAnnotation:function(e){var f=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:e.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){f.toggleHDAAnnotationEditors(true,f.fxSpeed)},onhide:function(){f.toggleHDAAnnotationEditors(false,f.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".history-secondary-actions"))})},_renderSelectButton:function(e){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(e){e=e||this.$el;e.find("[title]").tooltip({placement:"bottom"});if(!this.model){return}this._setUpDatasetActionsPopup(e);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var f=this;e.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(g){var h=f.model.get("name");if(g&&g!==h){f.$el.find(".history-name").text(g);f.model.save({name:g}).fail(function(){f.$el.find(".history-name").text(f.model.previous("name"))})}else{f.$el.find(".history-name").text(h)}}})},_setUpDatasetActionsPopup:function(e){var f=this;(new PopupMenu(e.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.hide;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Unhide datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.unhide;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Delete datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype["delete"];f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Undelete datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.undelete;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var g=c.HistoryDatasetAssociation.prototype.purge;f.getSelectedHdaCollection().ajaxQueue(g)}}}]))},handleHdaDeletionChange:function(e){if(e.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[e.id])}},handleHdaVisibleChange:function(e){if(e.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[e.id])}},createHdaView:function(f){var e=f.get("id"),g=new this.HDAViewClass({model:f,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[e],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(g);return g},_setUpHdaListeners:function(f){var e=this;b.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,f);f.on("selected",function(g){var h=g.model.get("id");e.selectedHdaIds=_.union(e.selectedHdaIds,[h])});f.on("de-selected",function(g){var h=g.model.get("id");e.selectedHdaIds=_.without(e.selectedHdaIds,h)})},toggleHDATagEditors:function(e){var f=arguments;_.each(this.hdaViews,function(g){if(g.tagsEditor){g.tagsEditor.toggle.apply(g.tagsEditor,f)}})},toggleHDAAnnotationEditors:function(e){var f=arguments;_.each(this.hdaViews,function(g){if(g.annotationEditor){g.annotationEditor.toggle.apply(g.annotationEditor,f)}})},removeHdaView:function(f){if(!f){return}var e=this;f.$el.fadeOut(e.fxSpeed,function(){f.off();f.remove();delete e.hdaViews[f.model.id];if(_.isEmpty(e.hdaViews)){e.$el.find(e.emptyMsgSelector).fadeIn(e.fxSpeed,function(){e.trigger("empty-history",e)})}})},events:_.extend(_.clone(b.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":function(f){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(e){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(e);_.each(this.hdaViews,function(f){f.showSelector(e)});this.selectedHdaIds=[]},hideSelectors:function(e){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(e);_.each(this.hdaViews,function(f){f.hideSelector(e)});this.selectedHdaIds=[]},toggleSelectors:function(e){if(!this.selecting){this.showSelectors(e)}else{this.hideSelectors(e)}},selectAllDatasets:function(e){_.each(this.hdaViews,function(f){f.select(e)})},deselectAllDatasets:function(e){_.each(this.hdaViews,function(f){f.deselect(e)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(e){return e.selected})},getSelectedHdaCollection:function(){return new c.HDACollection(_.map(this.getSelectedHdaViews(),function(e){return e.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:d}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Fix default parameter in universe config
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b90d953f77fa/
Changeset: b90d953f77fa
User: guerler
Date: 2014-02-20 19:27:57
Summary: Fix default parameter in universe config
Affected #: 1 file
diff -r c36dc4155beb0ae5e117ca33e0ad231535186d6d -r b90d953f77fa633f0c4a46e177118562191bc1b7 universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -183,7 +183,7 @@
#datatypes_config_file = datatypes_conf.xml
# Disable the 'Auto-detect' option for file uploads
-#datatypes_disable_auto = True
+#datatypes_disable_auto = False
# Visualizations config directory: where to look for individual visualization plugins.
# The path is relative to the Galaxy root dir. To use an absolute path begin the path
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Fix for server error caused by unicode substitution in url_for.
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1480f00e6bdc/
Changeset: 1480f00e6bdc
Branch: stable
User: dan
Date: 2014-02-18 21:09:46
Summary: Fix for server error caused by unicode substitution in url_for.
Affected #: 1 file
diff -r 15e8a74a95215bf2cc775e9848ca4a5ecc7e945f -r 1480f00e6bdcebe043b695fa1daaa0220fc0c086 templates/webapps/galaxy/mobile/history/detail.mako
--- a/templates/webapps/galaxy/mobile/history/detail.mako
+++ b/templates/webapps/galaxy/mobile/history/detail.mako
@@ -12,7 +12,7 @@
if data.state in ['no state','',None]:
data_state = "queued"
else:
- data_state = data.state
+ data_state = str( data.state )
%><li id="historyItemContainer-${data.id}">
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c36dc4155beb/
Changeset: c36dc4155beb
User: dannon
Date: 2014-02-20 19:10:00
Summary: Add PyYAML 3.10 egg.
Affected #: 1 file
diff -r c7fa535a805f0cc654984fe9344ba70c90238a15 -r c36dc4155beb0ae5e117ca33e0ad231535186d6d eggs.ini
--- a/eggs.ini
+++ b/eggs.ini
@@ -25,6 +25,7 @@
pysam = 0.4.2
pysqlite = 2.5.6
python_lzo = 1.08_2.03_static
+PyYAML = 3.10
threadframe = 0.2
guppy = 0.1.10
SQLAlchemy = 0.7.9
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Browser tests: update empty history message
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c7fa535a805f/
Changeset: c7fa535a805f
User: carlfeberhard
Date: 2014-02-20 17:56:45
Summary: Browser tests: update empty history message
Affected #: 2 files
diff -r baf2a8cc97ed720e10b6148254d7dd7478d8e839 -r c7fa535a805f0cc654984fe9344ba70c90238a15 test/casperjs/history-panel-tests.js
--- a/test/casperjs/history-panel-tests.js
+++ b/test/casperjs/history-panel-tests.js
@@ -95,7 +95,7 @@
this.test.assertExists( emptyMsgSelector, emptyMsgSelector + ' exists' );
this.test.assertVisible( emptyMsgSelector, 'Empty history message is visible' );
this.test.assertSelectorHasText( emptyMsgSelector, emptyMsgStr,
- 'Message contains "' + emptyMsgStr + '"' );
+ 'Message contains\n"' + emptyMsgStr + '":\n"' + this.fetchText( emptyMsgSelector ) + '"' );
});
// ------------------------------------------------------------------- name editing
@@ -157,7 +157,7 @@
spaceghost.tools.uploadFile( filepathToUpload, function uploadCallback( _uploadInfo ){
this.test.comment( 'uploaded file should appear in history' );
- this.debug( 'uploaded HDA info: ' + this.jsonStr( _uploadInfo ) );
+ //this.debug( 'uploaded HDA info: ' + this.jsonStr( _uploadInfo ) );
var hasHda = _uploadInfo.hdaElement,
hasClass = _uploadInfo.hdaElement.attributes[ 'class' ],
hasOkClass = _uploadInfo.hdaElement.attributes[ 'class' ].indexOf( wrapperOkClassName ) !== -1;
diff -r baf2a8cc97ed720e10b6148254d7dd7478d8e839 -r c7fa535a805f0cc654984fe9344ba70c90238a15 test/casperjs/modules/historypanel.js
--- a/test/casperjs/modules/historypanel.js
+++ b/test/casperjs/modules/historypanel.js
@@ -388,7 +388,7 @@
},
newName : 'Unnamed history',
newSize : '0 bytes',
- emptyMsg : "Your history is empty. Click 'Get Data' on the left pane to start"
+ emptyMsg : "This history is empty. Click 'Get Data' on the left pane to start"
},
hda : {
datasetFetchErrorMsg : 'There was an error getting the data for this dataset'
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Fix for ToolEvaluator with optional Dataset Input selected with multiple inputs.
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/baf2a8cc97ed/
Changeset: baf2a8cc97ed
User: dan
Date: 2014-02-20 17:52:52
Summary: Fix for ToolEvaluator with optional Dataset Input selected with multiple inputs.
Affected #: 1 file
diff -r d01fc0370afece3ef77b63a116fd9a1c2105c2e4 -r baf2a8cc97ed720e10b6148254d7dd7478d8e839 lib/galaxy/tools/evaluation.py
--- a/lib/galaxy/tools/evaluation.py
+++ b/lib/galaxy/tools/evaluation.py
@@ -232,10 +232,11 @@
tool=self,
name=name,
)
- real_path = data.file_name
- if real_path in input_dataset_paths:
- dataset_path = input_dataset_paths[ real_path ]
- wrapper_kwds[ 'dataset_path' ] = dataset_path
+ if data:
+ real_path = data.file_name
+ if real_path in input_dataset_paths:
+ dataset_path = input_dataset_paths[ real_path ]
+ wrapper_kwds[ 'dataset_path' ] = dataset_path
param_dict[name] = DatasetFilenameWrapper( data, **wrapper_kwds )
if data:
for child in data.children:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: clayton_turner: Added ignore lines starting with specific characters to group tool
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ad5156120f53/
Changeset: ad5156120f53
User: clayton_turner
Date: 2014-02-10 22:00:30
Summary: Added ignore lines starting with specific characters to group tool
Affected #: 2 files
diff -r c458a0fe1ba816098fed03370f425f346bb1df68 -r ad5156120f533aeecc1dc69d92ef19ec68a6223b tools/stats/grouping.py
--- a/tools/stats/grouping.py
+++ b/tools/stats/grouping.py
@@ -37,7 +37,22 @@
round_val = []
data_ary = []
- for var in sys.argv[5:]:
+ if sys.argv[5] != "None":
+ oldfile = open(inputfile,'r')
+ oldfilelines = oldfile.readlines()
+ newinputfile = inputfile+'2'
+ newfile = open(newinputfile,'w')
+ asciitodelete = sys.argv[5].split(',')
+ for i in range(len(asciitodelete)):
+ asciitodelete[i] = chr(int(asciitodelete[i]))
+ for line in oldfilelines:
+ if line[0] not in asciitodelete:
+ newfile.write(line)
+ oldfile.close()
+ newfile.close()
+ inputfile = newinputfile
+
+ for var in sys.argv[6:]:
op, col, do_round = var.split()
ops.append(op)
cols.append(col)
diff -r c458a0fe1ba816098fed03370f425f346bb1df68 -r ad5156120f533aeecc1dc69d92ef19ec68a6223b tools/stats/grouping.xml
--- a/tools/stats/grouping.xml
+++ b/tools/stats/grouping.xml
@@ -6,6 +6,7 @@
$input1
$groupcol
$ignorecase
+ $ignorelines
#for $op in $operations
'${op.optype}
${op.opcol}
@@ -18,6 +19,24 @@
<param name="ignorecase" type="boolean" truevalue="1" falsevalue="0"><label>Ignore case while grouping?</label></param>
+ <param name="ignorelines" type="select" display="checkboxes" multiple="True" label="Ignore lines beginning with these characters" help="lines beginning with these are not grouped">
+ <option value="62">></option>
+ <option value="64">@</option>
+ <option value="43">+</option>
+ <option value="60"><</option>
+ <option value="42">*</option>
+ <option value="45">-</option>
+ <option value="61">=</option>
+ <option value="124">|</option>
+ <option value="63">?</option>
+ <option value="36">$</option>
+ <option value="46">.</option>
+ <option value="58">:</option>
+ <option value="38">&</option>
+ <option value="37">%</option>
+ <option value="94">^</option>
+ <option value="35">#</option>
+ </param><repeat name="operations" title="Operation"><param name="optype" type="select" label="Type"><option value="mean">Mean</option>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: History published/shared/display as slug: use annotated-history-panel, search open by default, preserve whitespace in annotations, replace import button with 'switch to' if owned by user viewing; Annotated History Panel: panel view of history that shows datasets as a table with additional dataset info in a left cell
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8e4196a87a2b/
Changeset: 8e4196a87a2b
User: carlfeberhard
Date: 2014-02-20 17:34:19
Summary: History published/shared/display as slug: use annotated-history-panel, search open by default, preserve whitespace in annotations, replace import button with 'switch to' if owned by user viewing; Annotated History Panel: panel view of history that shows datasets as a table with additional dataset info in a left cell
Affected #: 10 files
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -760,7 +760,9 @@
return self.get_inaccessible_hda_dict( trans, hda )
hda_dict[ 'accessible' ] = True
+ #TODO: I'm unclear as to which access pattern is right
hda_dict[ 'annotation' ] = hda.get_item_annotation_str( trans.sa_session, trans.user, hda )
+ #annotation = getattr( hda, 'annotation', hda.get_item_annotation_str( trans.sa_session, trans.user, hda ) )
# ---- return here if deleted AND purged OR can't access
purged = ( hda.purged or hda.dataset.purged )
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -904,8 +904,9 @@
@web.expose
def display_by_username_and_slug( self, trans, username, slug ):
- """ Display history based on a username and slug. """
-
+ """
+ Display history based on a username and slug.
+ """
# Get history.
session = trans.sa_session
user = session.query( model.User ).filter_by( username=username ).first()
@@ -931,7 +932,19 @@
user_item_rating = 0
ave_item_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, history )
+ # create ownership flag for template, dictify models
+ # note: adding original annotation since this is published - get_dict returns user-based annos
+ user_is_owner = trans.user == history.user
+ hda_dicts = []
+ for hda in datasets:
+ hda_dict = self.get_hda_dict( trans, hda )
+ hda_dict[ 'annotation' ] = hda.annotation
+ hda_dicts.append( hda_dict )
+ history_dict = self.get_history_dict( trans, history, hda_dictionaries=hda_dicts )
+ history_dict[ 'annotation' ] = history.annotation
+
return trans.stream_template_mako( "history/display.mako", item=history, item_data=datasets,
+ user_is_owner=user_is_owner, history_dict=history_dict, hda_dicts=hda_dicts,
user_item_rating = user_item_rating, ave_item_rating=ave_item_rating, num_ratings=num_ratings )
@web.expose
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 static/scripts/mvc/history/annotated-history-panel.js
--- /dev/null
+++ b/static/scripts/mvc/history/annotated-history-panel.js
@@ -0,0 +1,118 @@
+define([
+ "mvc/dataset/hda-model",
+ "mvc/dataset/hda-base",
+ "mvc/history/readonly-history-panel"
+], function( hdaModel, hdaBase, readonlyPanel ){
+/* =============================================================================
+TODO:
+
+============================================================================= */
+/** @class View/Controller for a tabular view of the history model.
+ * @name AnnotatedHistoryPanel
+ *
+ * As ReadOnlyHistoryPanel, but with:
+ * history annotation always shown
+ * datasets displayed in a table:
+ * datasets in left cells, dataset annotations in the right
+ *
+ * @augments Backbone.View
+ * @borrows LoggableMixin#logger as #logger
+ * @borrows LoggableMixin#log as #log
+ * @constructs
+ */
+var AnnotatedHistoryPanel = readonlyPanel.ReadOnlyHistoryPanel.extend(
+/** @lends HistoryPanel.prototype */{
+
+ ///** logger used to record this.log messages, commonly set to console */
+ //// comment this out to suppress log output
+ //logger : console,
+
+ className : 'annotated-history-panel',
+
+ /** class to use for constructing the HDA views */
+ HDAViewClass : hdaBase.HDABaseView,
+
+ // ------------------------------------------------------------------------ panel rendering
+ renderModel : function( ){
+ // huh?
+ this.$el.addClass( this.className );
+ var $newRender = readonlyPanel.ReadOnlyHistoryPanel.prototype.renderModel.call( this ),
+ // move datasets from div to table
+ $datasetsList = $newRender.find( this.datasetsSelector ),
+ $datasetsTable = $( '<table/>' ).addClass( 'datasets-list datasets-table' );
+ $datasetsTable.append( $datasetsList.children() );
+ $newRender.find( this.datasetsSelector ).replaceWith( $datasetsTable );
+ //TODO: it's possible to do this with css only, right?
+
+ // add history annotation under subtitle
+ $newRender.find( '.history-subtitle' ).after( this.renderHistoryAnnotation() );
+
+ // hide search button, move search bar beneath controls (instead of above title), show, and set up
+ $newRender.find( '.history-search-btn' ).hide();
+ $newRender.find( '.history-controls' ).after( $newRender.find( '.history-search-controls' ).show() );
+ this.setUpSearchInput( $newRender.find( '.history-search-input' ) );
+
+ return $newRender;
+ },
+
+ renderHistoryAnnotation : function(){
+ var annotation = this.model.get( 'annotation' );
+ if( !annotation ){ return null; }
+ return $([
+ '<div class="history-annotation">', annotation, '</div>'
+ ].join( '' ));
+ },
+
+ renderHdas : function( $whereTo ){
+ $whereTo = $whereTo || this.$el;
+ var hdaViews = readonlyPanel.ReadOnlyHistoryPanel.prototype.renderHdas.call( this, $whereTo );
+ $whereTo.find( this.datasetsSelector ).prepend( $( '<tr/>' ).addClass( 'headers' ).append([
+ $( '<th/>' ).text( _l( 'Dataset' ) ),
+ $( '<th/>' ).text( _l( 'Annotation' ) )
+ ]));
+ return hdaViews;
+ },
+
+ // ------------------------------------------------------------------------ hda sub-views
+ attachHdaView : function( hdaView, $whereTo ){
+ $whereTo = $whereTo || this.$el;
+ // build a row around the dataset with the std hdaView in the first cell and the annotation in the next
+ var stateClass = _.find( hdaView.el.classList, function( c ){ return ( /^state\-/ ).test( c ); }),
+ annotation = hdaView.model.get( 'annotation' ) || '',
+ $tr = $( '<tr/>' ).addClass( 'dataset-row' ).append([
+ $( '<td/>' ).addClass( 'dataset-container' ).append( hdaView.$el )
+ // visually match the cell bg to the dataset at runtime (prevents the empty space)
+ // (getting bg via jq on hidden elem doesn't work on chrome/webkit - so use states)
+ //.css( 'background-color', hdaView.$el.css( 'background-color' ) ),
+ .addClass( stateClass? stateClass.replace( '-', '-color-' ): '' ),
+ $( '<td/>' ).addClass( 'additional-info' ).text( annotation )
+ ]);
+ $whereTo.find( this.datasetsSelector ).append( $tr );
+ },
+
+ // ------------------------------------------------------------------------ panel events
+ /** event map */
+ events : _.extend( _.clone( readonlyPanel.ReadOnlyHistoryPanel.prototype.events ), {
+ 'click tr' : function( ev ){
+ //if( !ev.target.hasAttribute( 'href' ) ){
+ $( ev.currentTarget ).find( '.dataset-title-bar' ).click();
+ //}
+ },
+ // prevent propagation on icon btns so they won't bubble up to tr and toggleBodyVisibility
+ 'click .icon-btn' : function( ev ){
+ ev.stopPropagation();
+ }
+ }),
+
+ // ........................................................................ misc
+ /** Return a string rep of the history */
+ toString : function(){
+ return 'AnnotatedHistoryPanel(' + (( this.model )?( this.model.get( 'name' )):( '' )) + ')';
+ }
+});
+
+//==============================================================================
+ return {
+ AnnotatedHistoryPanel : AnnotatedHistoryPanel
+ };
+});
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 static/scripts/mvc/history/readonly-history-panel.js
--- a/static/scripts/mvc/history/readonly-history-panel.js
+++ b/static/scripts/mvc/history/readonly-history-panel.js
@@ -526,7 +526,6 @@
$whereTo = $whereTo || this.$el;
var historyView = this,
newHdaViews = {},
- $datasetsList = $whereTo.find( this.datasetsSelector ),
// only render the shown hdas
//TODO: switch to more general filtered pattern
visibleHdas = this.model.hdas.getVisible(
@@ -536,7 +535,7 @@
);
//console.debug( 'renderHdas, visibleHdas:', visibleHdas, $whereTo );
//TODO: prepend to sep div, add as one
- $datasetsList.empty();
+ $whereTo.find( this.datasetsSelector ).empty();
if( visibleHdas.length ){
visibleHdas.each( function( hda ){
@@ -547,7 +546,7 @@
if( _.contains( historyView.selectedHdaIds, hdaId ) ){
hdaView.selected = true;
}
- $datasetsList.prepend( hdaView.render().$el );
+ historyView.attachHdaView( hdaView.render(), $whereTo );
});
$whereTo.find( this.emptyMsgSelector ).hide();
@@ -561,6 +560,12 @@
return this.hdaViews;
},
+ attachHdaView : function( hdaView, $whereTo ){
+ $whereTo = $whereTo || this.$el;
+ var $datasetsList = $whereTo.find( this.datasetsSelector );
+ $datasetsList.prepend( hdaView.$el );
+ },
+
/** Add an hda view to the panel for the given hda
* @param {HistoryDatasetAssociation} hda
*/
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 static/scripts/packed/mvc/history/annotated-history-panel.js
--- /dev/null
+++ b/static/scripts/packed/mvc/history/annotated-history-panel.js
@@ -0,0 +1,1 @@
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/history/readonly-history-panel"],function(c,a,b){var d=b.ReadOnlyHistoryPanel.extend({className:"annotated-history-panel",HDAViewClass:a.HDABaseView,renderModel:function(){this.$el.addClass(this.className);var g=b.ReadOnlyHistoryPanel.prototype.renderModel.call(this),e=g.find(this.datasetsSelector),f=$("<table/>").addClass("datasets-list datasets-table");f.append(e.children());g.find(this.datasetsSelector).replaceWith(f);g.find(".history-subtitle").after(this.renderHistoryAnnotation());g.find(".history-search-btn").hide();g.find(".history-controls").after(g.find(".history-search-controls").show());this.setUpSearchInput(g.find(".history-search-input"));return g},renderHistoryAnnotation:function(){var e=this.model.get("annotation");if(!e){return null}return $(['<div class="history-annotation">',e,"</div>"].join(""))},renderHdas:function(f){f=f||this.$el;var e=b.ReadOnlyHistoryPanel.prototype.renderHdas.call(this,f);f.find(this.datasetsSelector).prepend($("<tr/>").addClass("headers").append([$("<th/>").text(_l("Dataset")),$("<th/>").text(_l("Annotation"))]));return e},attachHdaView:function(h,f){f=f||this.$el;var i=_.find(h.el.classList,function(j){return(/^state\-/).test(j)}),e=h.model.get("annotation")||"",g=$("<tr/>").addClass("dataset-row").append([$("<td/>").addClass("dataset-container").append(h.$el).addClass(i?i.replace("-","-color-"):""),$("<td/>").addClass("additional-info").text(e)]);f.find(this.datasetsSelector).append(g)},events:_.extend(_.clone(b.ReadOnlyHistoryPanel.prototype.events),{"click tr":function(e){$(e.currentTarget).find(".dataset-title-bar").click()},"click .icon-btn":function(e){e.stopPropagation()}}),toString:function(){return"AnnotatedHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{AnnotatedHistoryPanel:d}});
\ No newline at end of file
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 static/scripts/packed/mvc/history/readonly-history-panel.js
--- a/static/scripts/packed/mvc/history/readonly-history-panel.js
+++ b/static/scripts/packed/mvc/history/readonly-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/dataset/hda-base"],function(e,a){var d=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(f){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([f],[true])))},removeExpandedHda:function(f){this.save("expandedHdas",_.omit(this.get("expandedHdas"),f))},toString:function(){return"HistoryPrefs("+this.id+")"}});d.historyStorageKey=function c(f){if(!f){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+f)}return("history:"+f)};var b=Backbone.View.extend(LoggableMixin).extend({HDAViewClass:a.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",msgsSelector:".message-container",emptyMsgSelector:".empty-history-message",emptyMsg:_l("This history is empty"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};if(f.logger){this.logger=f.logger}this.log(this+".initialize:",f);this.linkTarget=f.linkTarget||"_blank";this.fxSpeed=_.has(f,"fxSpeed")?(f.fxSpeed):(this.fxSpeed);this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];this.searchFor="";this._setUpListeners();if(this.model){this._setUpWebStorage(f.initiallyExpanded,f.show_deleted,f.show_hidden);this._setUpModelEventHandlers()}if(f.onready){f.onready.call(this)}},_setUpListeners:function(){this.on("error",function(g,j,f,i,h){this.errorHandler(g,j,f,i,h)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this.hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(f){this.log(this+"",arguments)},this)}},errorHandler:function(h,k,g,j,i){var f=this._parseErrorMessage(h,k,g,j,i);if(k&&k.status===0&&k.readyState===0){}else{if(k&&k.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",f.message,f.details)})}else{this.displayMessage("error",f.message,f.details)}}}},_parseErrorMessage:function(i,m,h,l,k){var g=Galaxy.currUser,f={message:this._bePolite(l),details:{user:(g instanceof User)?(g.toJSON()):(g+""),source:(i instanceof Backbone.Model)?(i.toJSON()):(i+""),xhr:m,options:(m)?(_.omit(h,"xhr")):(h)}};_.extend(f.details,k||{});if(m&&_.isFunction(m.getAllResponseHeaders)){var j=m.getAllResponseHeaders();j=_.compact(j.split("\n"));j=_.map(j,function(n){return n.split(": ")});f.details.xhr.responseHeaders=_.object(j)}return f},_bePolite:function(f){f=f||_l("An error occurred while getting updates from the server");return f+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadHistoryWithHDADetails:function(i,h,g,k){var f=this,j=function(l){return f.getExpandedHdaIds(l.id)};return this.loadHistory(i,h,g,k,j)},loadHistory:function(i,h,g,l,j){this.trigger("loading-history",this);h=h||{};var f=this;var k=e.History.getHistoryData(i,{historyFn:g,hdaFn:l,hdaDetailIds:h.initiallyExpanded||j});return this._loadHistoryFromXHR(k,h).fail(function(o,m,n){f.trigger("error",f,o,h,_l("An error was encountered while "+m),{historyId:i,history:n||{}})}).always(function(){f.trigger("loading-done",f)})},_loadHistoryFromXHR:function(h,g){var f=this;h.then(function(i,j){f.setModel(i,j,g)});h.fail(function(j,i){f.render()});return h},setModel:function(h,f,g){g=g||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){h.user=Galaxy.currUser.toJSON()}this.model=new e.History(h,f,g);this._setUpWebStorage(g.initiallyExpanded,g.show_deleted,g.show_hidden);this._setUpModelEventHandlers();this.selectedHdaIds=[];this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(g,f,h){this.storage=new d({id:d.historyStorageKey(this.model.get("id"))});if(_.isObject(g)){this.storage.set("exandedHdas",g)}if(_.isBoolean(f)){this.storage.set("show_deleted",f)}if(_.isBoolean(h)){this.storage.set("show_hidden",h)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var f in sessionStorage){if(f.indexOf("history:")===0){sessionStorage.removeItem(f)}}},getStoredOptions:function(g){if(!g||g==="current"){return(this.storage)?(this.storage.get()):({})}var f=sessionStorage.getItem(d.historyStorageKey(g));return(f===null)?({}):(JSON.parse(f))},getExpandedHdaIds:function(f){var g=this.getStoredOptions(f).expandedHdas;return((_.isEmpty(g))?([]):(_.keys(g)))},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addHdaView,this);this.model.on("error error:hdas",function(g,i,f,h){this.errorHandler(g,i,f,h)},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children())}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderWithoutModel:function(){var f=$("<div/>"),g=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return f.append(g)},renderModel:function(){var f=$("<div/>");f.append(b.templates.historyPanel(this.model.toJSON()));f.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(f);this.renderHdas(f);return f},_renderSearchButton:function(f){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(f){f=f||this.$el;f.find("[title]").tooltip({placement:"bottom"})},createHdaView:function(g){var f=g.get("id"),h=new this.HDAViewClass({model:g,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[f],hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(h);return h},_setUpHdaListeners:function(g){var f=this;g.on("body-expanded",function(h){f.storage.addExpandedHda(h)});g.on("body-collapsed",function(h){f.storage.removeExpandedHda(h)});g.on("error",function(i,k,h,j){f.errorHandler(i,k,h,j)})},renderHdas:function(h){h=h||this.$el;var g=this,j={},f=h.find(this.datasetsSelector),i=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);f.empty();if(i.length){i.each(function(l){var k=l.get("id"),m=g.createHdaView(l);j[k]=m;if(_.contains(g.selectedHdaIds,k)){m.selected=true}f.prepend(m.render().$el)});h.find(this.emptyMsgSelector).hide()}else{h.find(this.emptyMsgSelector).text((this.model.hdas.length&&this.searchFor)?(this.noneFoundMsg):(this.emptyMsg)).show()}this.hdaViews=j;return this.hdaViews},addHdaView:function(i){this.log("add."+this,i);var g=this;if(!i.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function h(k){var j=g.$el.find(g.emptyMsgSelector);if(j.is(":visible")){j.fadeOut(g.fxSpeed,k)}else{k()}},function f(k){g.scrollToTop();var j=g.$el.find(g.datasetsSelector),l=g.createHdaView(i);g.hdaViews[i.id]=l;l.render().$el.hide().prependTo(j).slideDown(g.fxSpeed)}])},refreshHdas:function(g,f){if(this.model){return this.model.refresh(g,f)}return $.when()},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(f){f.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},setUpSearchInput:function(g){var h=this,k=".history-search-input";function j(l){h.searchFor=l;h.filters=[function(m){return m.matchesAll(h.searchFor)}];h.trigger("search:searching",l,h);h.renderHdas()}function f(l){if(h.model.hdas.haveDetails()){j(l);return}h.$el.find(k).searchInput("toggle-loading");h.model.hdas.fetchAllDetails({silent:true}).always(function(){h.$el.find(k).searchInput("toggle-loading")}).done(function(){j(l)})}function i(){h.searchFor="";h.filters=[];h.trigger("search:clear",h);h.renderHdas()}g.searchInput({initialVal:h.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:f,onsearch:j,onclear:i});return g},showSearchControls:function(g){g=(g===undefined)?(this.fxSpeed):(g);var f=this.$el.find(".history-search-controls"),h=f.find(".history-search-input");if(!h.children().size()){this.setUpSearchInput(h)}f.slideDown(g,function(){$(this).find("input").focus()})},hideSearchControls:function(f){f=(f===undefined)?(this.fxSpeed):(f);this.$el.find(".history-search-controls").slideUp(f)},toggleSearchControls:function(f){speed=(jQuery.type(f)==="number")?(f):(this.fxSpeed);if(this.$el.find(".history-search-controls").is(":visible")){this.hideSearchControls(speed)}else{this.showSearchControls(speed)}},showLoadingIndicator:function(g,f,h){f=(f!==undefined)?(f):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,h)}else{this.$el.fadeOut(f);this.indicator.show(g,f,h)}},hideLoadingIndicator:function(f,g){f=(f!==undefined)?(f):(this.fxSpeed);if(this.indicator){this.indicator.hide(f,g)}},displayMessage:function(k,l,j){var h=this;this.scrollToTop();var i=this.$el.find(this.msgsSelector),f=$("<div/>").addClass(k+"message").html(l);if(!_.isEmpty(j)){var g=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(h._messageToModalOptions(k,l,j));return false});f.append(" ",g)}return i.html(f)},_messageToModalOptions:function(j,l,i){var f=this,k=$("<div/>"),h={title:"Details"};function g(m){m=_.omit(m,_.functions(m));return["<table>",_.map(m,function(o,n){o=(_.isObject(o))?(g(o)):(o);return'<tr><td style="vertical-align: top; color: grey">'+n+'</td><td style="padding-left: 8px">'+o+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(i)){h.body=k.append(g(i))}else{h.body=k.html(i)}h.buttons={Ok:function(){Galaxy.modal.hide();f.clearMessages()}};return h},clearMessages:function(){var f=this.$el.find(this.msgsSelector);f.empty()},scrollPosition:function(){return this.$el.scrollTop()},scrollTo:function(f){this.$el.scrollTop(f);return this},scrollToTop:function(){this.$el.scrollTop(0);return this},scrollIntoView:function(k,g){if(g===undefined){this.scrollTo(k);return this}var f=window,j=this.$el.parent(),i=$(f).innerHeight(),h=(i/2)-(g/2);this.scrollTo(k-h);return this},scrollToId:function(g){if((!g)||(!this.hdaViews[g])){return this}var f=this.hdaViews[g].$el;this.scrollIntoView(f.offset().top,f.outerHeight());return this},scrollToHid:function(f){var g=this.model.hdas.getByHid(f);if(!g){return this}return this.scrollToId(g.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});b.templates={historyPanel:Handlebars.templates["template-history-historyPanel"]};return{ReadOnlyHistoryPanel:b}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/dataset/hda-base"],function(e,a){var d=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(f){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([f],[true])))},removeExpandedHda:function(f){this.save("expandedHdas",_.omit(this.get("expandedHdas"),f))},toString:function(){return"HistoryPrefs("+this.id+")"}});d.historyStorageKey=function c(f){if(!f){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+f)}return("history:"+f)};var b=Backbone.View.extend(LoggableMixin).extend({HDAViewClass:a.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",msgsSelector:".message-container",emptyMsgSelector:".empty-history-message",emptyMsg:_l("This history is empty"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};if(f.logger){this.logger=f.logger}this.log(this+".initialize:",f);this.linkTarget=f.linkTarget||"_blank";this.fxSpeed=_.has(f,"fxSpeed")?(f.fxSpeed):(this.fxSpeed);this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];this.searchFor="";this._setUpListeners();if(this.model){this._setUpWebStorage(f.initiallyExpanded,f.show_deleted,f.show_hidden);this._setUpModelEventHandlers()}if(f.onready){f.onready.call(this)}},_setUpListeners:function(){this.on("error",function(g,j,f,i,h){this.errorHandler(g,j,f,i,h)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this.hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(f){this.log(this+"",arguments)},this)}},errorHandler:function(h,k,g,j,i){var f=this._parseErrorMessage(h,k,g,j,i);if(k&&k.status===0&&k.readyState===0){}else{if(k&&k.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",f.message,f.details)})}else{this.displayMessage("error",f.message,f.details)}}}},_parseErrorMessage:function(i,m,h,l,k){var g=Galaxy.currUser,f={message:this._bePolite(l),details:{user:(g instanceof User)?(g.toJSON()):(g+""),source:(i instanceof Backbone.Model)?(i.toJSON()):(i+""),xhr:m,options:(m)?(_.omit(h,"xhr")):(h)}};_.extend(f.details,k||{});if(m&&_.isFunction(m.getAllResponseHeaders)){var j=m.getAllResponseHeaders();j=_.compact(j.split("\n"));j=_.map(j,function(n){return n.split(": ")});f.details.xhr.responseHeaders=_.object(j)}return f},_bePolite:function(f){f=f||_l("An error occurred while getting updates from the server");return f+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadHistoryWithHDADetails:function(i,h,g,k){var f=this,j=function(l){return f.getExpandedHdaIds(l.id)};return this.loadHistory(i,h,g,k,j)},loadHistory:function(i,h,g,l,j){this.trigger("loading-history",this);h=h||{};var f=this;var k=e.History.getHistoryData(i,{historyFn:g,hdaFn:l,hdaDetailIds:h.initiallyExpanded||j});return this._loadHistoryFromXHR(k,h).fail(function(o,m,n){f.trigger("error",f,o,h,_l("An error was encountered while "+m),{historyId:i,history:n||{}})}).always(function(){f.trigger("loading-done",f)})},_loadHistoryFromXHR:function(h,g){var f=this;h.then(function(i,j){f.setModel(i,j,g)});h.fail(function(j,i){f.render()});return h},setModel:function(h,f,g){g=g||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){h.user=Galaxy.currUser.toJSON()}this.model=new e.History(h,f,g);this._setUpWebStorage(g.initiallyExpanded,g.show_deleted,g.show_hidden);this._setUpModelEventHandlers();this.selectedHdaIds=[];this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(g,f,h){this.storage=new d({id:d.historyStorageKey(this.model.get("id"))});if(_.isObject(g)){this.storage.set("exandedHdas",g)}if(_.isBoolean(f)){this.storage.set("show_deleted",f)}if(_.isBoolean(h)){this.storage.set("show_hidden",h)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var f in sessionStorage){if(f.indexOf("history:")===0){sessionStorage.removeItem(f)}}},getStoredOptions:function(g){if(!g||g==="current"){return(this.storage)?(this.storage.get()):({})}var f=sessionStorage.getItem(d.historyStorageKey(g));return(f===null)?({}):(JSON.parse(f))},getExpandedHdaIds:function(f){var g=this.getStoredOptions(f).expandedHdas;return((_.isEmpty(g))?([]):(_.keys(g)))},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addHdaView,this);this.model.on("error error:hdas",function(g,i,f,h){this.errorHandler(g,i,f,h)},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children())}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderWithoutModel:function(){var f=$("<div/>"),g=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return f.append(g)},renderModel:function(){var f=$("<div/>");f.append(b.templates.historyPanel(this.model.toJSON()));f.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(f);this.renderHdas(f);return f},_renderSearchButton:function(f){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(f){f=f||this.$el;f.find("[title]").tooltip({placement:"bottom"})},createHdaView:function(g){var f=g.get("id"),h=new this.HDAViewClass({model:g,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[f],hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(h);return h},_setUpHdaListeners:function(g){var f=this;g.on("body-expanded",function(h){f.storage.addExpandedHda(h)});g.on("body-collapsed",function(h){f.storage.removeExpandedHda(h)});g.on("error",function(i,k,h,j){f.errorHandler(i,k,h,j)})},renderHdas:function(g){g=g||this.$el;var f=this,i={},h=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);g.find(this.datasetsSelector).empty();if(h.length){h.each(function(k){var j=k.get("id"),l=f.createHdaView(k);i[j]=l;if(_.contains(f.selectedHdaIds,j)){l.selected=true}f.attachHdaView(l.render(),g)});g.find(this.emptyMsgSelector).hide()}else{g.find(this.emptyMsgSelector).text((this.model.hdas.length&&this.searchFor)?(this.noneFoundMsg):(this.emptyMsg)).show()}this.hdaViews=i;return this.hdaViews},attachHdaView:function(h,g){g=g||this.$el;var f=g.find(this.datasetsSelector);f.prepend(h.$el)},addHdaView:function(i){this.log("add."+this,i);var g=this;if(!i.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function h(k){var j=g.$el.find(g.emptyMsgSelector);if(j.is(":visible")){j.fadeOut(g.fxSpeed,k)}else{k()}},function f(k){g.scrollToTop();var j=g.$el.find(g.datasetsSelector),l=g.createHdaView(i);g.hdaViews[i.id]=l;l.render().$el.hide().prependTo(j).slideDown(g.fxSpeed)}])},refreshHdas:function(g,f){if(this.model){return this.model.refresh(g,f)}return $.when()},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(f){f.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},setUpSearchInput:function(g){var h=this,k=".history-search-input";function j(l){h.searchFor=l;h.filters=[function(m){return m.matchesAll(h.searchFor)}];h.trigger("search:searching",l,h);h.renderHdas()}function f(l){if(h.model.hdas.haveDetails()){j(l);return}h.$el.find(k).searchInput("toggle-loading");h.model.hdas.fetchAllDetails({silent:true}).always(function(){h.$el.find(k).searchInput("toggle-loading")}).done(function(){j(l)})}function i(){h.searchFor="";h.filters=[];h.trigger("search:clear",h);h.renderHdas()}g.searchInput({initialVal:h.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:f,onsearch:j,onclear:i});return g},showSearchControls:function(g){g=(g===undefined)?(this.fxSpeed):(g);var f=this.$el.find(".history-search-controls"),h=f.find(".history-search-input");if(!h.children().size()){this.setUpSearchInput(h)}f.slideDown(g,function(){$(this).find("input").focus()})},hideSearchControls:function(f){f=(f===undefined)?(this.fxSpeed):(f);this.$el.find(".history-search-controls").slideUp(f)},toggleSearchControls:function(f){speed=(jQuery.type(f)==="number")?(f):(this.fxSpeed);if(this.$el.find(".history-search-controls").is(":visible")){this.hideSearchControls(speed)}else{this.showSearchControls(speed)}},showLoadingIndicator:function(g,f,h){f=(f!==undefined)?(f):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,h)}else{this.$el.fadeOut(f);this.indicator.show(g,f,h)}},hideLoadingIndicator:function(f,g){f=(f!==undefined)?(f):(this.fxSpeed);if(this.indicator){this.indicator.hide(f,g)}},displayMessage:function(k,l,j){var h=this;this.scrollToTop();var i=this.$el.find(this.msgsSelector),f=$("<div/>").addClass(k+"message").html(l);if(!_.isEmpty(j)){var g=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(h._messageToModalOptions(k,l,j));return false});f.append(" ",g)}return i.html(f)},_messageToModalOptions:function(j,l,i){var f=this,k=$("<div/>"),h={title:"Details"};function g(m){m=_.omit(m,_.functions(m));return["<table>",_.map(m,function(o,n){o=(_.isObject(o))?(g(o)):(o);return'<tr><td style="vertical-align: top; color: grey">'+n+'</td><td style="padding-left: 8px">'+o+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(i)){h.body=k.append(g(i))}else{h.body=k.html(i)}h.buttons={Ok:function(){Galaxy.modal.hide();f.clearMessages()}};return h},clearMessages:function(){var f=this.$el.find(this.msgsSelector);f.empty()},scrollPosition:function(){return this.$el.scrollTop()},scrollTo:function(f){this.$el.scrollTop(f);return this},scrollToTop:function(){this.$el.scrollTop(0);return this},scrollIntoView:function(k,g){if(g===undefined){this.scrollTo(k);return this}var f=window,j=this.$el.parent(),i=$(f).innerHeight(),h=(i/2)-(g/2);this.scrollTo(k-h);return this},scrollToId:function(g){if((!g)||(!this.hdaViews[g])){return this}var f=this.hdaViews[g].$el;this.scrollIntoView(f.offset().top,f.outerHeight());return this},scrollToHid:function(f){var g=this.model.hdas.getByHid(f);if(!g){return this}return this.scrollToId(g.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});b.templates={historyPanel:Handlebars.templates["template-history-historyPanel"]};return{ReadOnlyHistoryPanel:b}});
\ No newline at end of file
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1684,6 +1684,19 @@
.dataset.state-discarded{background:#eee}.dataset.state-discarded .state-icon:before{content:"\f014"}
.dataset.state-noPermission{background:#eee;filter:alpha(opacity=60);-moz-opacity:.60;opacity:.60}.dataset.state-noPermission .state-icon{font-size:20px}.dataset.state-noPermission .state-icon:before{content:"\f023"}
.dataset.state-new{background:#eee}.dataset.state-new .state-icon:before{content:"\f06a"}
+.annotated-history-panel{padding-top:10px}.annotated-history-panel [class$=messagesmall]{margin:8px 0px 8px 0px}
+.annotated-history-panel .history-controls{margin:0px 0px 16px 4px;padding:0px}.annotated-history-panel .history-controls .history-name{font-size:150%}
+.annotated-history-panel .history-controls .history-subtitle{margin:0px;padding:0px 0px 0px 4px;padding-left:4px}
+.annotated-history-panel .history-controls .history-annotation{border:1px solid lightgrey;border-width:1px 0px 0px 0px;padding:4px 0px 4px 0px;margin:4px;white-space:pre-wrap}
+.annotated-history-panel .history-controls .history-annotation:empty{display:none}
+.annotated-history-panel .history-controls .history-search-controls{padding:16px 0px 0px 0px}
+.annotated-history-panel table.datasets-list{width:100%;table-layout:fixed}.annotated-history-panel table.datasets-list .headers{border-bottom:2px solid grey}
+.annotated-history-panel table.datasets-list .headers th{padding:8px}
+.annotated-history-panel table.datasets-list .dataset-row{cursor:pointer;border-bottom:1px solid grey}
+.annotated-history-panel table.datasets-list .dataset-row>td{margin:0px;padding:0px;vertical-align:top}
+.annotated-history-panel table.datasets-list .dataset-row>td:nth-child(1){width:50%}
+.annotated-history-panel table.datasets-list .dataset-row>td:nth-child(2){padding:8px 16px 8px 16px;white-space:pre-wrap}
+.annotated-history-panel table.datasets-list .dataset-row .dataset{border:0px}
.hda .hda-hid:after{content:':'}
body.historyPage{background:#dfe5f9;color:#000;margin:5px;border:0;padding:0}
div.historyLinks{margin:5px 5px}
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 static/style/src/less/history.less
--- a/static/style/src/less/history.less
+++ b/static/style/src/less/history.less
@@ -688,6 +688,78 @@
}
+// ---------------------------------------------------------------------------- annotated-history-panel
+.annotated-history-panel {
+ //TODO: most of these styles are specific to history/display.mako and not to this type of panel in general
+ //TODO: some of these styles are also overrides of history-panel - remove those from hpanel and revisit this
+ padding-top: 10px;
+
+ [class$=messagesmall] {
+ margin: 8px 0px 8px 0px;
+ }
+
+ .history-controls {
+ margin: 0px 0px 16px 4px;
+ padding: 0px;
+
+ .history-name {
+ font-size: 150%;
+ }
+ .history-subtitle {
+ margin: 0px;
+ padding: 0px 0px 0px 4px;
+ padding-left: 4px;
+ }
+
+ .history-annotation {
+ border: 1px solid lightgrey;
+ border-width: 1px 0px 0px 0px;
+ padding: 4px 0px 4px 0px;
+ margin: 4px;
+ white-space: pre-wrap;
+ }
+ .history-annotation:empty {
+ display: none;
+ }
+
+ .history-search-controls {
+ padding: 16px 0px 0px 0px;
+ }
+ }
+
+ table.datasets-list {
+ width: 100%;
+ table-layout: fixed;
+
+ .headers {
+ border-bottom: 2px solid grey;
+ }
+ .headers th {
+ padding: 8px;
+ }
+ .dataset-row {
+ cursor: pointer;
+ border-bottom: 1px solid grey;
+ }
+ .dataset-row > td {
+ margin: 0px;
+ padding: 0px;
+ vertical-align: top;
+ }
+ .dataset-row > td:nth-child(1) {
+ width: 50%;
+ }
+ .dataset-row > td:nth-child(2) {
+ /* top and bottom should be <= title-bar padding */
+ padding: 8px 16px 8px 16px;
+ white-space: pre-wrap;
+ }
+ .dataset-row .dataset {
+ border: 0px;
+ }
+ }
+}
+
// ---------------------------------------------------------------------------- hdas
.hda .hda-hid:after {
content: ':';
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 templates/display_base.mako
--- a/templates/display_base.mako
+++ b/templates/display_base.mako
@@ -85,7 +85,7 @@
});
// Init history boxes.
- init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
+ //init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
// Init user item rating.
$('.user_rating_star').rating({
@@ -115,7 +115,7 @@
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "autocomplete_tagging", "embed_item", "jquery.rating" )}
- ${h.css( "history", "autocomplete_tagging", "trackster", "library",
+ ${h.css( "autocomplete_tagging", "trackster", "library",
"jquery-ui/smoothness/jquery-ui" )}
<style type="text/css">
diff -r 32eadec01e3ebeb076b68938269e22f45fb202bb -r 8e4196a87a2b78521241adf104f524a5ea05caa1 templates/webapps/galaxy/history/display.mako
--- a/templates/webapps/galaxy/history/display.mako
+++ b/templates/webapps/galaxy/history/display.mako
@@ -1,84 +1,74 @@
<%inherit file="/display_base.mako"/>
-<%namespace file="/root/history_common.mako" import="render_dataset" />
+<%namespace file="history_panel.mako" import="history_panel_javascripts" />
## Set vars so that there's no need to change the code below.
-<%
+<%
history = published_item
datasets = published_item_data
%><%def name="javascripts()">
${parent.javascripts()}
+ ${history_panel_javascripts()}
</%def><%def name="stylesheets()">
${parent.stylesheets()}
- ${h.css( "history" )}
<style type="text/css">
- .historyItemBody {
- display: none;
- }
- .column {
- float: left;
- padding: 10px;
- margin: 20px;
- background: #666;
- border: 5px solid #ccc;
- width: 300px;
- }
</style>
-
- <noscript>
- <style>
- .historyItemBody {
- display: block;
- }
- </style>
- </noscript></%def><%def name="render_item_links( history )">
- <a
- href="${h.url_for( controller='/history', action='imp', id=trans.security.encode_id(history.id) )}"
- class="icon-button import"
- ## Needed to overwide initial width so that link is floated left appropriately.
- style="width: 100%"
- title="Import history">Import history</a>
+<%
+ encoded_history_id = history_dict[ 'id' ]
+ import_url = h.url_for( controller='history', action='imp', id=encoded_history_id )
+ switch_url = h.url_for( controller='history', action='switch_to_history', hist_id=encoded_history_id )
+%>
+ ## Needed to overwide initial width so that link is floated left appropriately.
+ %if not user_is_owner:
+ <a href="${import_url}" style="width: 100%" title="${_('Make a copy of this history and switch to it')}">
+ ${_('Import history')}
+ </a>
+ %else:
+ <a href="${switch_url}" style="width: 100%" title="${_('Make this history your current history')}">
+ ${_('Switch to this history')}
+ </a>
+ %endif
+</%def>
+
+<%def name="render_item_header( item )"></%def><%def name="render_item( history, datasets )">
- %if history.deleted:
- <div class="warningmessagesmall">
- ${_('You are currently viewing a deleted history!')}
- </div>
- <p></p>
- %endif
- %if not datasets:
- <div class="infomessagesmall" id="emptyHistoryMessage">
- %else:
- ## Render requested datasets, ordered from newest to oldest, including annotations.
- <table class="annotated-item">
- <tr><th>Dataset</th><th class="annotation">Annotation</th></tr>
- %for data in datasets:
- <tr>
- %if data.visible:
- <td>
- <div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
- </div>
- </td>
- <td class="annotation">
- %if hasattr( data, "annotation") and data.annotation is not None:
- ${data.annotation}
- %endif
- </td>
- %endif
- </tr>
- %endfor
- </table>
- <div class="infomessagesmall" id="emptyHistoryMessage" style="display:none;">
- %endif
- ${_("This history is empty.")}
- </div>
+<div id="history-${ history_dict[ 'id' ] }" class="history-panel">
+</div>
+<script type="text/javascript">
+ var debugging = JSON.parse( sessionStorage.getItem( 'debugging' ) ) || false,
+ historyJSON = ${h.to_json_string( history_dict )},
+ hdaJSON = ${h.to_json_string( hda_dicts )};
+ //window.historyJSON = historyJSON;
+ window.hdaJSON = hdaJSON;
+
+ require.config({
+ baseUrl : "${h.url_for( '/static/scripts' )}"
+ })([ 'mvc/history/annotated-history-panel' ], function( panelMod ){
+ // history module is already in the dpn chain from the panel. We can re-scope it here.
+ var historyModel = require( 'mvc/history/history-model' ),
+ hdaBaseView = require( 'mvc/dataset/hda-base' ),
+ history = new historyModel.History( historyJSON, hdaJSON, {
+ logger: ( debugging )?( console ):( null )
+ });
+
+ window.historyPanel = new panelMod.AnnotatedHistoryPanel({
+ show_deleted : false,
+ show_hidden : false,
+ el : $( "#history-" + historyJSON.id ),
+ model : history,
+ onready : function(){
+ this.render();
+ }
+ });
+ });
+</script></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Rework logic for setting selection of DataToolParameter. Fixes issue seen with rerun where incorrect options were selected.
by commits-noreply@bitbucket.org 20 Feb '14
by commits-noreply@bitbucket.org 20 Feb '14
20 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/32eadec01e3e/
Changeset: 32eadec01e3e
User: dan
Date: 2014-02-20 17:31:07
Summary: Rework logic for setting selection of DataToolParameter. Fixes issue seen with rerun where incorrect options were selected.
Affected #: 1 file
diff -r 01a572fb8b4c463efa1b2091298fad3ec7ea2958 -r 32eadec01e3ebeb076b68938269e22f45fb202bb lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1621,7 +1621,7 @@
if type( value ) != list:
value = [ value ]
field = form_builder.SelectField( self.name, self.multiple, None, self.refresh_on_change, refresh_on_change_values=self.refresh_on_change_values )
-
+
# CRUCIAL: the dataset_collector function needs to be local to DataToolParameter.get_html_field()
def dataset_collector( hdas, parent_hid ):
current_user_roles = trans.get_current_user_roles()
@@ -1659,20 +1659,18 @@
# Also collect children via association object
dataset_collector( hda.children, hid )
dataset_collector( history.active_datasets_children_and_roles, None )
- some_data = bool( field.options )
- if some_data:
- if value is None or len( field.options ) == 1:
- # Ensure that the last item is always selected
- a, b, c = field.options[-1]
- if self.optional:
- field.options[-1] = a, b, False
- else:
- field.options[-1] = a, b, True
+
+ set_selected = field.get_selected( return_label=True, return_value=True, multi=False ) is not None
+ # Ensure than an item is always selected
if self.optional:
- if not value:
+ if set_selected:
+ field.add_option( "Selection is Optional", 'None', False )
+ else:
field.add_option( "Selection is Optional", 'None', True )
- else:
- field.add_option( "Selection is Optional", 'None', False )
+ elif not set_selected and bool( field.options ):
+ # Select the last item
+ a, b, c = field.options[-1]
+ field.options[-1] = a, b, True
return field
def get_initial_value( self, trans, context, history=None ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/01a572fb8b4c/
Changeset: 01a572fb8b4c
User: inithello
Date: 2014-02-20 17:18:30
Summary: Enable specifying the install database connection when executing the install and test framework.
Affected #: 2 files
diff -r 952558f0dc0ba52355e87ef2d0ccef37f7f51bec -r 01a572fb8b4c463efa1b2091298fad3ec7ea2958 test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py
@@ -412,6 +412,13 @@
database_connection = os.environ[ 'GALAXY_INSTALL_TEST_DBURI' ]
else:
database_connection = 'sqlite:///' + os.path.join( galaxy_db_path, 'install_and_test_repositories.sqlite' )
+ if 'GALAXY_INSTALL_TEST_INSTALL_DBURI' in os.environ:
+ install_database_connection = os.environ[ 'GALAXY_INSTALL_TEST_INSTALL_DBURI' ]
+ elif asbool( os.environ.get( 'GALAXY_TEST_INSTALL_DB_MERGED', default_install_db_merged ) ):
+ install_database_connection = galaxy_database_connection
+ else:
+ install_db_path = os.path.join( galaxy_db_path, 'install.sqlite' )
+ install_database_connection = 'sqlite:///%s' % install_galaxy_db_path
kwargs = {}
for dir in [ galaxy_test_tmp_dir ]:
try:
@@ -419,6 +426,7 @@
except OSError:
pass
print "Database connection: ", database_connection
+ print "Install database connection: ", install_database_connection
# Generate the shed_tool_data_table_conf.xml file.
file( shed_tool_data_table_conf_file, 'w' ).write( install_and_test_base_util.tool_data_table_conf_xml_template )
os.environ[ 'GALAXY_INSTALL_TEST_SHED_TOOL_DATA_TABLE_CONF' ] = shed_tool_data_table_conf_file
@@ -446,6 +454,7 @@
datatype_converters_config_file = "datatype_converters_conf.xml.sample",
file_path = galaxy_file_path,
id_secret = install_and_test_base_util.galaxy_encode_secret,
+ install_database_connection = install_database_connection,
job_config_file = galaxy_job_conf_file,
job_queue_workers = 5,
log_destination = "stdout",
diff -r 952558f0dc0ba52355e87ef2d0ccef37f7f51bec -r 01a572fb8b4c463efa1b2091298fad3ec7ea2958 test/install_and_test_tool_shed_repositories/tool_dependency_definitions/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/tool_dependency_definitions/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/tool_dependency_definitions/functional_tests.py
@@ -264,6 +264,13 @@
database_connection = os.environ[ 'GALAXY_INSTALL_TEST_DBURI' ]
else:
database_connection = 'sqlite:///' + os.path.join( galaxy_db_path, 'install_and_test_repositories.sqlite' )
+ if 'GALAXY_INSTALL_TEST_INSTALL_DBURI' in os.environ:
+ install_database_connection = os.environ[ 'GALAXY_INSTALL_TEST_INSTALL_DBURI' ]
+ elif asbool( os.environ.get( 'GALAXY_TEST_INSTALL_DB_MERGED', default_install_db_merged ) ):
+ install_database_connection = galaxy_database_connection
+ else:
+ install_db_path = os.path.join( galaxy_db_path, 'install.sqlite' )
+ install_database_connection = 'sqlite:///%s' % install_galaxy_db_path
kwargs = {}
for dir in [ galaxy_test_tmp_dir ]:
try:
@@ -271,6 +278,7 @@
except OSError:
pass
print "Database connection: ", database_connection
+ print "Install database connection: ", install_database_connection
# Generate the shed_tool_data_table_conf.xml file.
file( shed_tool_data_table_conf_file, 'w' ).write( install_and_test_base_util.tool_data_table_conf_xml_template )
os.environ[ 'GALAXY_INSTALL_TEST_SHED_TOOL_DATA_TABLE_CONF' ] = shed_tool_data_table_conf_file
@@ -298,6 +306,7 @@
datatype_converters_config_file = "datatype_converters_conf.xml.sample",
file_path = galaxy_file_path,
id_secret = install_and_test_base_util.galaxy_encode_secret,
+ install_database_connection = install_database_connection,
job_config_file = galaxy_job_conf_file,
job_queue_workers = 5,
log_destination = "stdout",
https://bitbucket.org/galaxy/galaxy-central/commits/6674cb6ced26/
Changeset: 6674cb6ced26
Branch: trevorw/specify-thirdparty-cookies-must-not-be-b-1392909850239
User: inithello
Date: 2014-02-20 17:19:23
Summary: Close branch trevorw/specify-thirdparty-cookies-must-not-be-b-1392909850239.
Affected #: 2 files
diff -r c4145b92bc2a9e63778950aef4d53723bcd353ee -r 6674cb6ced267ba83d543f98fe1fe0b7e7de7324 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -4,9 +4,14 @@
import logging
import os
import shutil
+import sys
import tempfile
-import shutil
import td_common_util
+import time
+import shlex
+
+from subprocess import PIPE, Popen
+from threading import Thread
from contextlib import contextmanager
from galaxy.util import unicodify
from galaxy.util.template import fill_template
@@ -16,12 +21,19 @@
eggs.require( 'paramiko' )
eggs.require( 'Fabric' )
+from fabric import state
from fabric.api import env
from fabric.api import hide
from fabric.api import lcd
from fabric.api import local
from fabric.api import settings
from fabric.api import prefix
+from fabric.operations import _AttributeString
+
+try:
+ from Queue import Queue, Empty
+except ImportError:
+ from queue import Queue, Empty
log = logging.getLogger( __name__ )
@@ -120,6 +132,22 @@
if int( version.split( "." )[ 0 ] ) < 1:
raise NotImplementedError( "Install Fabric version 1.0 or later." )
+def enqueue_output( stdout, stdout_queue, stderr, stderr_queue ):
+ stdout_logger = logging.getLogger( 'fabric_util.STDOUT' )
+ stderr_logger = logging.getLogger( 'fabric_util.STDERR' )
+ for line in iter( stdout.readline, b'' ):
+ output = line.rstrip()
+ stdout_logger.debug( output )
+ stdout_queue.put( output )
+ stdout.close()
+ stdout_queue.put(None)
+ for line in iter( stderr.readline, b'' ):
+ output = line.rstrip()
+ stderr_logger.debug( output )
+ stderr_queue.put( output )
+ stderr.close()
+ stderr_queue.put(None)
+
def file_append( text, file_path, skip_if_contained=True, make_executable=True ):
'''
Append a line to a file unless skip_if_contained is True and the line already exists in the file. This method creates the file
@@ -168,10 +196,9 @@
for shell_file_path in shell_file_paths:
env_file_builder.append_line( action="source", value=shell_file_path )
-def handle_command( app, tool_dependency, install_dir, cmd, return_output=False ):
+def handle_command( app, tool_dependency, install_dir, cmd, return_output=False, use_fabric=False ):
context = app.install_model.context
- with settings( warn_only=True ):
- output = local( cmd, capture=True )
+ output = run_local_command( cmd, capture_output=True, stream_output=True )
log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
if output.return_code:
tool_dependency.status = app.install_model.ToolDependency.installation_status.ERROR
@@ -263,7 +290,7 @@
set_prior_environment_commands.append( 'echo "%s: $%s"' % ( inherited_env_var_name, inherited_env_var_name ) )
command = ' ; '.join( set_prior_environment_commands )
# Run the command and capture the output.
- command_return = handle_command( app, tool_dependency, install_dir, command, return_output=True )
+ command_return = handle_command( app, tool_dependency, install_dir, command, return_output=True, use_fabric=True )
# And extract anything labeled with the name of the environment variable we're populating here.
if '%s: ' % inherited_env_var_name in command_return:
environment_variable_value = command_return.split( '\n' )
@@ -370,7 +397,7 @@
filtered_actions = actions[ 1: ]
return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
if return_code:
- return tool_dependency
+ return tool_dependency
dir = package_name
elif action_type == 'download_file':
# <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action>
@@ -645,7 +672,7 @@
elif action_type == 'shell_command':
with settings( warn_only=True ):
cmd = install_environment.build_command( action_dict[ 'command' ] )
- return_code = handle_command( app, tool_dependency, install_dir, cmd )
+ return_code = handle_command( app, tool_dependency, install_dir, cmd, use_fabric=False )
if return_code:
return tool_dependency
elif action_type == 'template_command':
@@ -755,6 +782,31 @@
if os.path.exists( work_dir ):
local( 'rm -rf %s' % work_dir )
+def run_local_command( command, capture_output=True, stream_output=True ):
+ wrapped_command = shlex.split( "/bin/sh -c '%s'" % command )
+ log.debug( 'Executing command %s in path %s.' % ( command, state.env['lcwd'] ) )
+ stdout_queue = Queue()
+ stderr_queue = Queue()
+ process_handle = Popen( wrapped_command, stdout=PIPE, stderr=PIPE, bufsize=1, close_fds=False, cwd=state.env['lcwd'] )
+ stdio_thread = Thread( target=enqueue_output, args=( process_handle.stdout, stdout_queue, process_handle.stderr, stderr_queue ) )
+ stdio_thread.daemon = True
+ stdio_thread.start()
+ stdout, stderr = wait_for_process( process_handle, stream_output, stdout_queue, stderr_queue )
+ # Handle error condition (deal with stdout being None, too)
+ output = _AttributeString( stdout.strip() if stdout else "" )
+ errors = _AttributeString( stderr.strip() if stderr else "" )
+ output.failed = False
+ output.return_code = process_handle.returncode
+ output.stderr = errors
+ if process_handle.returncode not in env.ok_ret_codes:
+ output.failed = True
+ message = "local() encountered an error (return code %s) while executing '%s'" % ( process_handle.returncode, command )
+ log.error( message )
+ output.succeeded = not output.failed
+ # If we were capturing, this will be a string; otherwise it will be None.
+ if capture_output:
+ return output
+
def set_galaxy_environment( galaxy_user, tool_dependency_dir, host='localhost', shell='/bin/bash -l -c' ):
"""General Galaxy environment configuration. This method is not currently used."""
env.user = galaxy_user
@@ -764,3 +816,21 @@
env.use_sudo = False
env.safe_cmd = local
return env
+
+def wait_for_process( process_handle, stream_output, stdout_queue, stderr_queue ):
+ standard_out = []
+ standard_err = []
+ process_handle.wait()
+ while True:
+ line = stdout_queue.get()
+ if line is None:
+ break
+ standard_out.append(line)
+ while True:
+ line = stderr_queue.get()
+ if line is None:
+ break
+ standard_err.append(line)
+ stdout = '\n'.join( standard_out )
+ stderr = '\n'.join( standard_err )
+ return stdout, stderr
diff -r c4145b92bc2a9e63778950aef4d53723bcd353ee -r 6674cb6ced267ba83d543f98fe1fe0b7e7de7324 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1719,7 +1719,7 @@
"""
if text:
if app.name == 'galaxy':
- route_to_images = 'admin_toolshed/static/images/%s' % encoded_repository_id
+ route_to_images = '/admin_toolshed/static/images/%s' % encoded_repository_id
else:
# We're in the tool shed.
route_to_images = '/repository/static/images/%s' % encoded_repository_id
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0