galaxy-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 15302 discussions
commit/galaxy-central: carlfeberhard: Fix to 264657d: make infomessage and persistent across states; Style tweaks
by commits-noreply@bitbucket.org 13 Aug '14
by commits-noreply@bitbucket.org 13 Aug '14
13 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9b2dc0bd882a/
Changeset: 9b2dc0bd882a
User: carlfeberhard
Date: 2014-08-13 16:03:29
Summary: Fix to 264657d: make infomessage and persistent across states; Style tweaks
Affected #: 4 files
diff -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 -r 9b2dc0bd882a0432809f455acce191c333b8df02 static/scripts/mvc/dataset/dataset-li.js
--- a/static/scripts/mvc/dataset/dataset-li.js
+++ b/static/scripts/mvc/dataset/dataset-li.js
@@ -4,7 +4,13 @@
"utils/localization"
], function( STATES, BASE_MVC, _l ){
/* global Backbone */
-//==============================================================================
+/*==============================================================================
+TODO:
+ straighten out state rendering and templates used
+ inaccessible/STATES.NOT_VIEWABLE is a special case
+ simplify button rendering
+
+==============================================================================*/
var _super = BASE_MVC.ListItemView;
/** @class Read only list view for either LDDAs, HDAs, or HDADCEs.
* Roughly, any DatasetInstance (and not a raw Dataset).
@@ -196,9 +202,16 @@
*/
_renderDetails : function(){
//TODO: generalize to be allow different details for each state
+
+ // no access - render nothing but a message
+ if( this.model.get( 'state' ) === STATES.NOT_VIEWABLE ){
+ return $( this.templates.noAccess( this.model.toJSON(), this ) );
+ }
+
var $details = _super.prototype._renderDetails.call( this );
$details.find( '.actions .left' ).empty().append( this._renderSecondaryActions() );
- $details.find( '.summary' ).html( this._renderSummary() );
+ $details.find( '.summary' ).html( this._renderSummary() )
+ .prepend( this._renderDetailMessages() );
$details.find( '.display-applications' ).html( this._renderDisplayApplications() );
//TODO: double tap
@@ -214,6 +227,18 @@
return summaryRenderFn( json, this );
},
+ /** Render messages to be displayed only when the details are shown */
+ _renderDetailMessages : function(){
+ var view = this,
+ $warnings = $( '<div class="detail-messages"></div>' ),
+ json = view.model.toJSON();
+//TODO:! unordered (map)
+ _.each( view.templates.detailMessages, function( templateFn ){
+ $warnings.append( $( templateFn( json, view ) ) );
+ });
+ return $warnings;
+ },
+
/** Render the external display application links */
_renderDisplayApplications : function(){
if( this.model.isDeletedOrPurged() ){ return ''; }
@@ -369,6 +394,14 @@
'</div>'
], 'dataset' );
+ var noAccessTemplate = BASE_MVC.wrapTemplate([
+ '<div class="details">',
+ '<div class="summary">',
+ _l( 'You do not have permission to view this dataset' ),
+ '</div>',
+ '</div>'
+ ], 'dataset' );
+
//TODO: still toooooooooooooo complex - rework
var summaryTemplates = {};
summaryTemplates[ STATES.OK ] = summaryTemplates[ STATES.FAILED_METADATA ] = BASE_MVC.wrapTemplate([
@@ -410,22 +443,10 @@
'<div>', _l( 'The job creating this dataset was cancelled before completion' ), '</div>'
], 'dataset' );
summaryTemplates[ STATES.QUEUED ] = BASE_MVC.wrapTemplate([
- '<div>',
- '<% if( dataset.resubmitted ){ %>',
- _l( 'The job creating this dataset has been resubmitted is now waiting to run' ),
- '<% } else { %>',
- _l( 'This job is waiting to run' ),
- '<% } %>',
- '</div>'
+ '<div>', _l( 'This job is waiting to run' ), '</div>'
], 'dataset' );
summaryTemplates[ STATES.RUNNING ] = BASE_MVC.wrapTemplate([
- '<div>',
- '<% if( dataset.resubmitted ){ %>',
- _l( 'The job creating this dataset has been resubmitted is now running' ),
- '<% } else { %>',
- _l( 'This job is currently running' ),
- '<% } %>',
- '</div>'
+ '<div>', _l( 'This job is currently running' ), '</div>'
], 'dataset' );
summaryTemplates[ STATES.UPLOAD ] = BASE_MVC.wrapTemplate([
'<div>', _l( 'This dataset is currently uploading' ), '</div>'
@@ -450,6 +471,18 @@
'<div>Error: unknown dataset state: "<%- dataset.state %>"</div>'
], 'dataset' );
+ // messages to be displayed only within the details section ('below the fold')
+ var detailMessageTemplates = {
+ resubmitted : BASE_MVC.wrapTemplate([
+ // deleted not purged
+ '<% if( model.resubmitted ){ %>',
+ '<div class="resubmitted-msg infomessagesmall">',
+ _l( 'The job creating this dataset has been resubmitted' ),
+ '</div>',
+ '<% } %>'
+ ])
+ };
+
// this is applied to both old and new style display apps
var displayApplicationsTemplate = BASE_MVC.wrapTemplate([
'<% _.each( apps, function( app ){ %>',
@@ -469,7 +502,9 @@
return _.extend( {}, _super.prototype.templates, {
warnings : warnings,
details : detailsTemplate,
+ noAccess : noAccessTemplate,
summaries : summaryTemplates,
+ detailMessages : detailMessageTemplates,
displayApplications : displayApplicationsTemplate
});
}());
diff -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 -r 9b2dc0bd882a0432809f455acce191c333b8df02 static/scripts/packed/mvc/dataset/dataset-li.js
--- a/static/scripts/packed/mvc/dataset/dataset-li.js
+++ b/static/scripts/packed/mvc/dataset/dataset-li.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var e=b.ListItemView;var d=e.extend({className:e.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(f){if(f.logger){this.logger=this.model.logger=f.logger}this.log(this+".initialize:",f);e.prototype.initialize.call(this,f);this.linkTarget=f.linkTarget||"_blank";this._setUpListeners()},_setUpListeners:function(){this.on("selectable",function(f){if(f){this.$(".primary-actions").hide()}else{this.$(".primary-actions").show()}});this.model.on("change",function(g,f){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this);this.on("all",function(f){this.log(f)},this)},_fetchModelDetails:function(){var f=this;if(f.model.inReadyState()&&!f.model.hasDetails()){return f.model.fetch({silent:true})}return jQuery.when()},remove:function(g,h){var f=this;g=g||this.fxSpeed;this.$el.fadeOut(g,function(){Backbone.View.prototype.remove.call(f);if(h){h.call(f)}})},render:function(f){return e.prototype.render.call(this,f)},_swapNewRender:function(f){e.prototype._swapNewRender.call(this,f);if(this.model.has("state")){this.$el.addClass("state-"+this.model.get("state"))}return this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var h=this.model.get("state");if((h===a.NOT_VIEWABLE)||(h===a.DISCARDED)||(!this.model.get("accessible"))){return null}var g={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged")){g.disabled=true;g.title=c("Cannot display datasets removed from disk")}else{if(h===a.UPLOAD){g.disabled=true;g.title=c("This dataset must finish uploading before it can be viewed")}else{if(h===a.NEW){g.disabled=true;g.title=c("This dataset is not yet viewable")}else{g.title=c("View data");g.href=this.model.urls.display;var f=this;g.onclick=function(i){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+f.model.get("name"),type:"other",content:function(j){var k=new DATA.TabularDataset({id:f.model.get("id")});$.when(k.fetch()).then(function(){DATA.createTabularDatasetChunkedView({model:k,parent_elt:j,embedded:true,height:"100%"})})}});i.preventDefault()}}}}}g.faIcon="fa-eye";return faIconButton(g)},_renderDetails:function(){var f=e.prototype._renderDetails.call(this);f.find(".actions .left").empty().append(this._renderSecondaryActions());f.find(".summary").html(this._renderSummary());f.find(".display-applications").html(this._renderDisplayApplications());this._setUpBehaviors(f);return f},_renderSummary:function(){var f=this.model.toJSON(),g=this.templates.summaries[f.state];g=g||this.templates.summaries.unknown;return g(f,this)},_renderDisplayApplications:function(){if(this.model.isDeletedOrPurged()){return""}return[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){this.debug("_renderSecondaryActions");switch(this.model.get("state")){case a.NOT_VIEWABLE:return[];case a.OK:case a.FAILED_METADATA:case a.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return faIconButton({title:c("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}if(!_.isEmpty(this.model.get("meta_files"))){return this._renderMetaFileDownloadButton()}return $(['<a class="download-btn icon-btn" href="',this.model.urls.download,'" title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))},_renderMetaFileDownloadButton:function(){var f=this.model.urls;return $(['<div class="metafile-dropdown dropdown">','<a class="download-btn icon-btn" href="javascript:void(0)" data-toggle="dropdown"',' title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>",'<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">','<li><a href="'+f.download+'">',c("Download dataset"),"</a></li>",_.map(this.model.get("meta_files"),function(g){return['<li><a href="',f.meta_download+g.file_type,'">',c("Download")," ",g.file_type,"</a></li>"].join("")}).join("\n"),"</ul>","</div>"].join("\n"))},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"DatasetListItemView("+f+")"}});d.prototype.templates=(function(){var g=_.extend({},e.prototype.templates.warnings,{failed_metadata:b.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','<div class="warningmessagesmall">',c("An error occurred setting the metadata for this dataset"),"</div>","<% } %>"]),error:b.wrapTemplate(["<% if( model.error ){ %>",'<div class="errormessagesmall">',c("There was an error getting the data for this dataset"),": <%- model.error %>","</div>","<% } %>"]),purged:b.wrapTemplate(["<% if( model.purged ){ %>",'<div class="purged-msg warningmessagesmall">',c("This dataset has been deleted and removed from disk"),"</div>","<% } %>"]),deleted:b.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',c("This dataset has been deleted"),"</div>","<% } %>"])});var h=b.wrapTemplate(['<div class="details">','<div class="summary"></div>','<div class="actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !dataset.deleted && !dataset.purged ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="display-applications"></div>',"<% if( dataset.peek ){ %>",'<pre class="dataset-peek"><%= dataset.peek %></pre>',"<% } %>","<% } %>","</div>"],"dataset");var i={};i[a.OK]=i[a.FAILED_METADATA]=b.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'<div class="blurb">','<span class="value"><%- dataset.misc_blurb %></span>',"</div>","<% } %>","<% if( dataset.data_type ){ %>",'<div class="datatype">','<label class="prompt">',c("format"),"</label>",'<span class="value"><%- dataset.data_type %></span>',"</div>","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'<div class="dbkey">','<label class="prompt">',c("database"),"</label>",'<span class="value">',"<%- dataset.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( dataset.misc_info ){ %>",'<div class="info">','<span class="value"><%- dataset.misc_info %></span>',"</div>","<% } %>"],"dataset");i[a.NEW]=b.wrapTemplate(["<div>",c("This is a new dataset and not all of its data are available yet"),"</div>"],"dataset");i[a.NOT_VIEWABLE]=b.wrapTemplate(["<div>",c("You do not have permission to view this dataset"),"</div>"],"dataset");i[a.DISCARDED]=b.wrapTemplate(["<div>",c("The job creating this dataset was cancelled before completion"),"</div>"],"dataset");i[a.QUEUED]=b.wrapTemplate(["<div>","<% if( dataset.resubmitted ){ %>",c("The job creating this dataset has been resubmitted is now waiting to run"),"<% } else { %>",c("This job is waiting to run"),"<% } %>","</div>"],"dataset");i[a.RUNNING]=b.wrapTemplate(["<div>","<% if( dataset.resubmitted ){ %>",c("The job creating this dataset has been resubmitted is now running"),"<% } else { %>",c("This job is currently running"),"<% } %>","</div>"],"dataset");i[a.UPLOAD]=b.wrapTemplate(["<div>",c("This dataset is currently uploading"),"</div>"],"dataset");i[a.SETTING_METADATA]=b.wrapTemplate(["<div>",c("Metadata is being auto-detected"),"</div>"],"dataset");i[a.PAUSED]=b.wrapTemplate(["<div>",c('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"</div>"],"dataset");i[a.ERROR]=b.wrapTemplate(["<% if( !dataset.purged ){ %>","<div><%- dataset.misc_blurb %></div>","<% } %>",'<span class="help-text">',c("An error occurred with this dataset"),":</span>",'<div class="job-error-text"><%- dataset.misc_info %></div>'],"dataset");i[a.EMPTY]=b.wrapTemplate(["<div>",c("No data"),": <i><%- dataset.misc_blurb %></i></div>"],"dataset");i.unknown=b.wrapTemplate(['<div>Error: unknown dataset state: "<%- dataset.state %>"</div>'],"dataset");var f=b.wrapTemplate(["<% _.each( apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>"],"apps");return _.extend({},e.prototype.templates,{warnings:g,details:h,summaries:i,displayApplications:f})}());return{DatasetListItemView:d}});
\ No newline at end of file
+define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var e=b.ListItemView;var d=e.extend({className:e.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(f){if(f.logger){this.logger=this.model.logger=f.logger}this.log(this+".initialize:",f);e.prototype.initialize.call(this,f);this.linkTarget=f.linkTarget||"_blank";this._setUpListeners()},_setUpListeners:function(){this.on("selectable",function(f){if(f){this.$(".primary-actions").hide()}else{this.$(".primary-actions").show()}});this.model.on("change",function(g,f){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this);this.on("all",function(f){this.log(f)},this)},_fetchModelDetails:function(){var f=this;if(f.model.inReadyState()&&!f.model.hasDetails()){return f.model.fetch({silent:true})}return jQuery.when()},remove:function(g,h){var f=this;g=g||this.fxSpeed;this.$el.fadeOut(g,function(){Backbone.View.prototype.remove.call(f);if(h){h.call(f)}})},render:function(f){return e.prototype.render.call(this,f)},_swapNewRender:function(f){e.prototype._swapNewRender.call(this,f);if(this.model.has("state")){this.$el.addClass("state-"+this.model.get("state"))}return this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var h=this.model.get("state");if((h===a.NOT_VIEWABLE)||(h===a.DISCARDED)||(!this.model.get("accessible"))){return null}var g={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged")){g.disabled=true;g.title=c("Cannot display datasets removed from disk")}else{if(h===a.UPLOAD){g.disabled=true;g.title=c("This dataset must finish uploading before it can be viewed")}else{if(h===a.NEW){g.disabled=true;g.title=c("This dataset is not yet viewable")}else{g.title=c("View data");g.href=this.model.urls.display;var f=this;g.onclick=function(i){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+f.model.get("name"),type:"other",content:function(j){var k=new DATA.TabularDataset({id:f.model.get("id")});$.when(k.fetch()).then(function(){DATA.createTabularDatasetChunkedView({model:k,parent_elt:j,embedded:true,height:"100%"})})}});i.preventDefault()}}}}}g.faIcon="fa-eye";return faIconButton(g)},_renderDetails:function(){if(this.model.get("state")===a.NOT_VIEWABLE){return $(this.templates.noAccess(this.model.toJSON(),this))}var f=e.prototype._renderDetails.call(this);f.find(".actions .left").empty().append(this._renderSecondaryActions());f.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages());f.find(".display-applications").html(this._renderDisplayApplications());this._setUpBehaviors(f);return f},_renderSummary:function(){var f=this.model.toJSON(),g=this.templates.summaries[f.state];g=g||this.templates.summaries.unknown;return g(f,this)},_renderDetailMessages:function(){var f=this,h=$('<div class="detail-messages"></div>'),g=f.model.toJSON();_.each(f.templates.detailMessages,function(i){h.append($(i(g,f)))});return h},_renderDisplayApplications:function(){if(this.model.isDeletedOrPurged()){return""}return[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){this.debug("_renderSecondaryActions");switch(this.model.get("state")){case a.NOT_VIEWABLE:return[];case a.OK:case a.FAILED_METADATA:case a.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return faIconButton({title:c("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}if(!_.isEmpty(this.model.get("meta_files"))){return this._renderMetaFileDownloadButton()}return $(['<a class="download-btn icon-btn" href="',this.model.urls.download,'" title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))},_renderMetaFileDownloadButton:function(){var f=this.model.urls;return $(['<div class="metafile-dropdown dropdown">','<a class="download-btn icon-btn" href="javascript:void(0)" data-toggle="dropdown"',' title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>",'<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">','<li><a href="'+f.download+'">',c("Download dataset"),"</a></li>",_.map(this.model.get("meta_files"),function(g){return['<li><a href="',f.meta_download+g.file_type,'">',c("Download")," ",g.file_type,"</a></li>"].join("")}).join("\n"),"</ul>","</div>"].join("\n"))},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"DatasetListItemView("+f+")"}});d.prototype.templates=(function(){var h=_.extend({},e.prototype.templates.warnings,{failed_metadata:b.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','<div class="warningmessagesmall">',c("An error occurred setting the metadata for this dataset"),"</div>","<% } %>"]),error:b.wrapTemplate(["<% if( model.error ){ %>",'<div class="errormessagesmall">',c("There was an error getting the data for this dataset"),": <%- model.error %>","</div>","<% } %>"]),purged:b.wrapTemplate(["<% if( model.purged ){ %>",'<div class="purged-msg warningmessagesmall">',c("This dataset has been deleted and removed from disk"),"</div>","<% } %>"]),deleted:b.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',c("This dataset has been deleted"),"</div>","<% } %>"])});var i=b.wrapTemplate(['<div class="details">','<div class="summary"></div>','<div class="actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !dataset.deleted && !dataset.purged ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="display-applications"></div>',"<% if( dataset.peek ){ %>",'<pre class="dataset-peek"><%= dataset.peek %></pre>',"<% } %>","<% } %>","</div>"],"dataset");var g=b.wrapTemplate(['<div class="details">','<div class="summary">',c("You do not have permission to view this dataset"),"</div>","</div>"],"dataset");var j={};j[a.OK]=j[a.FAILED_METADATA]=b.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'<div class="blurb">','<span class="value"><%- dataset.misc_blurb %></span>',"</div>","<% } %>","<% if( dataset.data_type ){ %>",'<div class="datatype">','<label class="prompt">',c("format"),"</label>",'<span class="value"><%- dataset.data_type %></span>',"</div>","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'<div class="dbkey">','<label class="prompt">',c("database"),"</label>",'<span class="value">',"<%- dataset.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( dataset.misc_info ){ %>",'<div class="info">','<span class="value"><%- dataset.misc_info %></span>',"</div>","<% } %>"],"dataset");j[a.NEW]=b.wrapTemplate(["<div>",c("This is a new dataset and not all of its data are available yet"),"</div>"],"dataset");j[a.NOT_VIEWABLE]=b.wrapTemplate(["<div>",c("You do not have permission to view this dataset"),"</div>"],"dataset");j[a.DISCARDED]=b.wrapTemplate(["<div>",c("The job creating this dataset was cancelled before completion"),"</div>"],"dataset");j[a.QUEUED]=b.wrapTemplate(["<div>",c("This job is waiting to run"),"</div>"],"dataset");j[a.RUNNING]=b.wrapTemplate(["<div>",c("This job is currently running"),"</div>"],"dataset");j[a.UPLOAD]=b.wrapTemplate(["<div>",c("This dataset is currently uploading"),"</div>"],"dataset");j[a.SETTING_METADATA]=b.wrapTemplate(["<div>",c("Metadata is being auto-detected"),"</div>"],"dataset");j[a.PAUSED]=b.wrapTemplate(["<div>",c('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"</div>"],"dataset");j[a.ERROR]=b.wrapTemplate(["<% if( !dataset.purged ){ %>","<div><%- dataset.misc_blurb %></div>","<% } %>",'<span class="help-text">',c("An error occurred with this dataset"),":</span>",'<div class="job-error-text"><%- dataset.misc_info %></div>'],"dataset");j[a.EMPTY]=b.wrapTemplate(["<div>",c("No data"),": <i><%- dataset.misc_blurb %></i></div>"],"dataset");j.unknown=b.wrapTemplate(['<div>Error: unknown dataset state: "<%- dataset.state %>"</div>'],"dataset");var k={resubmitted:b.wrapTemplate(["<% if( model.resubmitted ){ %>",'<div class="resubmitted-msg infomessagesmall">',c("The job creating this dataset has been resubmitted"),"</div>","<% } %>"])};var f=b.wrapTemplate(["<% _.each( apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>"],"apps");return _.extend({},e.prototype.templates,{warnings:h,details:i,noAccess:g,summaries:j,detailMessages:k,displayApplications:f})}());return{DatasetListItemView:d}});
\ No newline at end of file
diff -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 -r 9b2dc0bd882a0432809f455acce191c333b8df02 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1684,13 +1684,13 @@
.dataset .details .actions .left .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.dataset .details .actions .left .icon-btn:only-child{margin:0px;border-radius:3px}
.dataset .details .actions .left .icon-btn{margin-right:2px}
-.dataset .details .actions .left:not(:empty){margin-bottom:8px}
.dataset .details .actions .left .icon-btn.visualization-btn{margin-left:0px;border-radius:0px 3px 3px 0px;border-right:1px solid #bfbfbf}
.dataset .details .actions .right{display:inline-block;float:right}.dataset .details .actions .right .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.dataset .details .actions .right .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.dataset .details .actions .right .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.dataset .details .actions .right .icon-btn:only-child{margin:0px;border-radius:3px}
.dataset .details .actions .right .icon-btn{margin-left:2px}
+.dataset .details .actions:not(:last-child){margin-bottom:8px}
.dataset .details .tags-display{display:none;margin-bottom:8px}.dataset .details .tags-display .select2-container{min-width:0px}.dataset .details .tags-display .select2-container .select2-choices{border-radius:3px}
.dataset .details .annotation-display{display:none;margin-bottom:8px}.dataset .details .annotation-display .annotation{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;white-space:pre-line;overflow:auto}
.dataset .details .annotation-display .annotation:empty:after{position:relative;top:-4px;font-size:10px;font-style:italic;color:grey;content:'Click here to edit annotation'}
diff -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 -r 9b2dc0bd882a0432809f455acce191c333b8df02 static/style/src/less/history.less
--- a/static/style/src/less/history.less
+++ b/static/style/src/less/history.less
@@ -356,11 +356,6 @@
.icon-btn {
margin-right: @icon-btn-margin;
}
- &:not(:empty) {
- // can't use :empty on dataset-actions - will always have left & right, so
- // add gap to left (more likely to have children)
- .list-item .vertical-spacing;
- }
// have to reapply here - dropdown wrapped in div
.icon-btn.visualization-btn {
margin-left: 0px;
@@ -375,6 +370,9 @@
margin-left: @icon-btn-margin;
}
}
+ &:not(:last-child) {
+ .list-item .vertical-spacing;
+ }
}
//TODO: move these out
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: natefoo: Controller updates for the resubmitted dataset instance state (thanks Carl!)
by commits-noreply@bitbucket.org 13 Aug '14
by commits-noreply@bitbucket.org 13 Aug '14
13 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d301ac50aa86/
Changeset: d301ac50aa86
User: natefoo
Date: 2014-08-12 21:21:40
Summary: Controller updates for the resubmitted dataset instance state (thanks Carl!)
Affected #: 2 files
diff -r d30b580ffbc5cdb5f9fe8fcefe7261152fab1303 -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -940,10 +940,9 @@
def mark_as_resubmitted( self ):
job = self.get_job()
self.sa_session.refresh( job )
- # TODO: Enable this code once a UI for resubmitted datasets exists
- #for dataset in [ dataset_assoc.dataset for dataset_assoc in job.output_datasets + job.output_library_datasets ]:
- # dataset._state = model.Dataset.states.RESUBMITTED
- # self.sa_session.add( dataset )
+ for dataset in [ dataset_assoc.dataset for dataset_assoc in job.output_datasets + job.output_library_datasets ]:
+ dataset._state = model.Dataset.states.RESUBMITTED
+ self.sa_session.add( dataset )
job.state = model.Job.states.RESUBMITTED
self.sa_session.add( job )
self.sa_session.flush()
diff -r d30b580ffbc5cdb5f9fe8fcefe7261152fab1303 -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -131,15 +131,20 @@
"""
api_type = "file"
encoded_id = trans.security.encode_id( hda.id )
+ # TODO: handle failed_metadata here as well
+ state = hda.state
+ if state == trans.app.model.Dataset.states.RESUBMITTED:
+ state = hda.dataset.state
return {
'id' : encoded_id,
'history_id' : encoded_history_id,
'name' : hda.name,
'type' : api_type,
- 'state' : hda.state,
+ 'state' : state,
'deleted': hda.deleted,
'visible': hda.visible,
'purged': hda.purged,
+ 'resubmitted': hda._state == trans.app.model.Dataset.states.RESUBMITTED,
'hid' : hda.hid,
'history_content_type' : hda.history_content_type,
'url' : url_for( 'history_content_typed', history_id=encoded_history_id, id=encoded_id, type="dataset" ),
@@ -157,6 +162,9 @@
hda_dict = self.get_hda_dict( trans, hda )
hda_dict[ 'display_types' ] = self.get_old_display_applications( trans, hda )
hda_dict[ 'display_apps' ] = self.get_display_apps( trans, hda )
+ if hda_dict[ 'state' ] == trans.app.model.Dataset.states.RESUBMITTED:
+ hda_dict[ 'state' ] = hda.dataset.state
+ hda_dict[ 'resubmitted' ] = True
return hda_dict
except Exception, exc:
# catch error here - returning a briefer hda_dict with an error attribute
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: greg: Do not include invalid tools when checking for "orphan" tool dependencies in the Tool Shed.
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d30b580ffbc5/
Changeset: d30b580ffbc5
User: greg
Date: 2014-08-12 20:15:00
Summary: Do not include invalid tools when checking for "orphan" tool dependencies in the Tool Shed.
Affected #: 1 file
diff -r 264657dfe72d2aa1c2ec1f5ff1aa1f5c1ac16f91 -r d30b580ffbc5cdb5f9fe8fcefe7261152fab1303 lib/tool_shed/galaxy_install/dependency_display.py
--- a/lib/tool_shed/galaxy_install/dependency_display.py
+++ b/lib/tool_shed/galaxy_install/dependency_display.py
@@ -153,7 +153,7 @@
# Updating should cause no problems here since a tool dependency cannot be included
# in both dictionaries.
tool_dependencies.update( orphan_tool_dependencies )
- if tool_dependencies and ( tools or invalid_tools ):
+ if tool_dependencies and tools:
for td_key, requirements_dict in tool_dependencies.items():
if td_key == 'set_environment':
# "set_environment": [{"name": "R_SCRIPT_PATH", "type": "set_environment"}]
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: Datset list item: add resubmitted message; pack scripts
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/264657dfe72d/
Changeset: 264657dfe72d
User: carlfeberhard
Date: 2014-08-12 19:56:26
Summary: Datset list item: add resubmitted message; pack scripts
Affected #: 3 files
diff -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 -r 264657dfe72d2aa1c2ec1f5ff1aa1f5c1ac16f91 static/scripts/mvc/dataset/dataset-li.js
--- a/static/scripts/mvc/dataset/dataset-li.js
+++ b/static/scripts/mvc/dataset/dataset-li.js
@@ -35,6 +35,7 @@
/** event listeners */
_setUpListeners : function(){
+//TODO:?? may want to move this to ListItemView (although this is only needed in the *narrow* panel views (current))
// hide the primary actions in the title bar when selectable
this.on( 'selectable', function( isSelectable ){
if( isSelectable ){
@@ -207,9 +208,10 @@
/** Defer to the appropo summary rendering fn based on state */
_renderSummary : function(){
- var summaryRenderFn = this.templates.summaries[ this.model.get( 'state' ) ];
+ var json = this.model.toJSON(),
+ summaryRenderFn = this.templates.summaries[ json.state ];
summaryRenderFn = summaryRenderFn || this.templates.summaries.unknown;
- return summaryRenderFn( this.model.toJSON(), this );
+ return summaryRenderFn( json, this );
},
/** Render the external display application links */
@@ -408,7 +410,22 @@
'<div>', _l( 'The job creating this dataset was cancelled before completion' ), '</div>'
], 'dataset' );
summaryTemplates[ STATES.QUEUED ] = BASE_MVC.wrapTemplate([
- '<div>', _l( 'This job is waiting to run' ), '</div>'
+ '<div>',
+ '<% if( dataset.resubmitted ){ %>',
+ _l( 'The job creating this dataset has been resubmitted is now waiting to run' ),
+ '<% } else { %>',
+ _l( 'This job is waiting to run' ),
+ '<% } %>',
+ '</div>'
+ ], 'dataset' );
+ summaryTemplates[ STATES.RUNNING ] = BASE_MVC.wrapTemplate([
+ '<div>',
+ '<% if( dataset.resubmitted ){ %>',
+ _l( 'The job creating this dataset has been resubmitted is now running' ),
+ '<% } else { %>',
+ _l( 'This job is currently running' ),
+ '<% } %>',
+ '</div>'
], 'dataset' );
summaryTemplates[ STATES.UPLOAD ] = BASE_MVC.wrapTemplate([
'<div>', _l( 'This dataset is currently uploading' ), '</div>'
@@ -416,9 +433,6 @@
summaryTemplates[ STATES.SETTING_METADATA ] = BASE_MVC.wrapTemplate([
'<div>', _l( 'Metadata is being auto-detected' ), '</div>'
], 'dataset' );
- summaryTemplates[ STATES.RUNNING ] = BASE_MVC.wrapTemplate([
- '<div>', _l( 'This job is currently running' ), '</div>'
- ], 'dataset' );
summaryTemplates[ STATES.PAUSED ] = BASE_MVC.wrapTemplate([
'<div>', _l( 'This job is paused. Use the "Resume Paused Jobs" in the history menu to resume' ), '</div>'
], 'dataset' );
diff -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 -r 264657dfe72d2aa1c2ec1f5ff1aa1f5c1ac16f91 static/scripts/packed/mvc/collection/collection-li.js
--- a/static/scripts/packed/mvc/collection/collection-li.js
+++ b/static/scripts/packed/mvc/collection/collection-li.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/dataset-li","mvc/base-mvc","utils/localization"],function(h,d,f){var c=d.ListItemView;var a=c.extend({className:c.prototype.className+" dataset-collection",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+"(DCListItemView).initialize:",i);c.prototype.initialize.call(this,i)},expand:function(){var i=this;return i._fetchModelDetails().always(function(){i.trigger("expanded",i)})},_renderSubtitle:function(){var i=$('<div class="subtitle"></div>');switch(this.model.get("collection_type")){case"list":return i.text(f("a list of datasets"));case"paired":return i.text(f("a pair of datasets"));case"list:paired":return i.text(f("a list of paired datasets"))}return i},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCListItemView("+i+")"}});a.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- collection.element_identifier || collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},c.prototype.templates,{titleBar:i})}());var b=c.extend({logger:console,className:c.prototype.className+" dataset-collection-element",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DCEListItemView.initialize:",i);c.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCEListItemView("+i+")"}});b.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"element");return _.extend({},c.prototype.templates,{titleBar:i})}());var e=h.DatasetListItemView.extend({className:h.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DatasetDCEListItemView.initialize:",i);h.DatasetListItemView.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DatasetDCEListItemView("+i+")"}});e.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>","</div>"],"element");return _.extend({},h.DatasetListItemView.prototype.templates,{titleBar:i})}());var g=a.extend({className:a.prototype.className+" dataset-collection-element",_swapNewRender:function(i){a.prototype._swapNewRender.call(this,i);var j=this.model.get("state")||"ok";this.$el.addClass("state-"+j);return this.$el},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"NestedDCDCEListItemView("+i+")"}});return{DCListItemView:a,DCEListItemView:b,DatasetDCEListItemView:e,NestedDCDCEListItemView:g}});
\ No newline at end of file
+define(["mvc/dataset/dataset-li","mvc/base-mvc","utils/localization"],function(h,d,f){var c=d.ListItemView;var a=c.extend({className:c.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+"(DCListItemView).initialize:",i);c.prototype.initialize.call(this,i)},expand:function(){var i=this;return i._fetchModelDetails().always(function(){i.trigger("expanded",i)})},_renderSubtitle:function(){var i=$('<div class="subtitle"></div>');switch(this.model.get("collection_type")){case"list":return i.text(f("a list of datasets"));case"paired":return i.text(f("a pair of datasets"));case"list:paired":return i.text(f("a list of paired datasets"))}return i},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCListItemView("+i+")"}});a.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- collection.element_identifier || collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},c.prototype.templates,{titleBar:i})}());var b=c.extend({logger:console,className:c.prototype.className+" dataset-collection-element",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DCEListItemView.initialize:",i);c.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCEListItemView("+i+")"}});b.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"element");return _.extend({},c.prototype.templates,{titleBar:i})}());var e=h.DatasetListItemView.extend({className:h.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DatasetDCEListItemView.initialize:",i);h.DatasetListItemView.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DatasetDCEListItemView("+i+")"}});e.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>","</div>"],"element");return _.extend({},h.DatasetListItemView.prototype.templates,{titleBar:i})}());var g=a.extend({className:a.prototype.className+" dataset-collection-element",_swapNewRender:function(i){a.prototype._swapNewRender.call(this,i);var j=this.model.get("state")||"ok";this.$el.addClass("state-"+j);return this.$el},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"NestedDCDCEListItemView("+i+")"}});return{DCListItemView:a,DCEListItemView:b,DatasetDCEListItemView:e,NestedDCDCEListItemView:g}});
\ No newline at end of file
diff -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 -r 264657dfe72d2aa1c2ec1f5ff1aa1f5c1ac16f91 static/scripts/packed/mvc/dataset/dataset-li.js
--- a/static/scripts/packed/mvc/dataset/dataset-li.js
+++ b/static/scripts/packed/mvc/dataset/dataset-li.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var e=b.ListItemView;var d=e.extend({className:e.prototype.className+" dataset",initialize:function(f){if(f.logger){this.logger=this.model.logger=f.logger}this.log(this+".initialize:",f);e.prototype.initialize.call(this,f);this.linkTarget=f.linkTarget||"_blank";this._setUpListeners()},_setUpListeners:function(){this.on("selectable",function(f){if(f){this.$(".primary-actions").hide()}else{this.$(".primary-actions").show()}});this.model.on("change",function(g,f){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this);this.on("all",function(f){this.log(f)},this)},_fetchModelDetails:function(){var f=this;if(f.model.inReadyState()&&!f.model.hasDetails()){return f.model.fetch({silent:true})}return jQuery.when()},remove:function(g,h){var f=this;g=g||this.fxSpeed;this.$el.fadeOut(g,function(){Backbone.View.prototype.remove.call(f);if(h){h.call(f)}})},render:function(f){return e.prototype.render.call(this,f)},_swapNewRender:function(f){e.prototype._swapNewRender.call(this,f);if(this.model.has("state")){this.$el.addClass("state-"+this.model.get("state"))}return this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var h=this.model.get("state");if((h===a.NOT_VIEWABLE)||(h===a.DISCARDED)||(!this.model.get("accessible"))){return null}var g={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged")){g.disabled=true;g.title=c("Cannot display datasets removed from disk")}else{if(h===a.UPLOAD){g.disabled=true;g.title=c("This dataset must finish uploading before it can be viewed")}else{if(h===a.NEW){g.disabled=true;g.title=c("This dataset is not yet viewable")}else{g.title=c("View data");g.href=this.model.urls.display;var f=this;g.onclick=function(i){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+f.model.get("name"),type:"other",content:function(j){var k=new DATA.TabularDataset({id:f.model.get("id")});$.when(k.fetch()).then(function(){DATA.createTabularDatasetChunkedView({model:k,parent_elt:j,embedded:true,height:"100%"})})}});i.preventDefault()}}}}}g.faIcon="fa-eye";return faIconButton(g)},_renderDetails:function(){var f=e.prototype._renderDetails.call(this);f.find(".actions .left").empty().append(this._renderSecondaryActions());f.find(".summary").html(this._renderSummary());f.find(".display-applications").html(this._renderDisplayApplications());this._setUpBehaviors(f);return f},_renderSummary:function(){var f=this.templates.summaries[this.model.get("state")];f=f||this.templates.summaries.unknown;return f(this.model.toJSON(),this)},_renderDisplayApplications:function(){if(this.model.isDeletedOrPurged()){return""}return[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){this.debug("_renderSecondaryActions");switch(this.model.get("state")){case a.NOT_VIEWABLE:return[];case a.OK:case a.FAILED_METADATA:case a.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return faIconButton({title:c("View details"),classes:"dataset-params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}if(!_.isEmpty(this.model.get("meta_files"))){return this._renderMetaFileDownloadButton()}return $(['<a class="download-btn icon-btn" href="',this.model.urls.download,'" title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))},_renderMetaFileDownloadButton:function(){var f=this.model.urls;return $(['<div class="metafile-dropdown dropdown">','<a class="download-btn icon-btn" href="javascript:void(0)" data-toggle="dropdown"',' title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>",'<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">','<li><a href="'+f.download+'">',c("Download dataset"),"</a></li>",_.map(this.model.get("meta_files"),function(g){return['<li><a href="',f.meta_download+g.file_type,'">',c("Download")," ",g.file_type,"</a></li>"].join("")}).join("\n"),"</ul>","</div>"].join("\n"))},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"DatasetListItemView("+f+")"}});d.prototype.templates=(function(){var g=_.extend({},e.prototype.templates.warnings,{failed_metadata:b.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','<div class="warningmessagesmall">',c("An error occurred setting the metadata for this dataset"),"</div>","<% } %>"]),error:b.wrapTemplate(["<% if( model.error ){ %>",'<div class="errormessagesmall">',c("There was an error getting the data for this dataset"),": <%- model.error %>","</div>","<% } %>"]),purged:b.wrapTemplate(["<% if( model.purged ){ %>",'<div class="purged-msg warningmessagesmall">',c("This dataset has been deleted and removed from disk"),"</div>","<% } %>"]),deleted:b.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',c("This dataset has been deleted"),"</div>","<% } %>"])});var h=b.wrapTemplate(['<div class="details">','<div class="summary"></div>','<div class="actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !dataset.deleted && !dataset.purged ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="display-applications"></div>',"<% if( dataset.peek ){ %>",'<pre class="dataset-peek"><%= dataset.peek %></pre>',"<% } %>","<% } %>","</div>"],"dataset");var i={};i[a.OK]=i[a.FAILED_METADATA]=b.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'<div class="blurb">','<span class="value"><%- dataset.misc_blurb %></span>',"</div>","<% } %>","<% if( dataset.data_type ){ %>",'<div class="datatype">','<label class="prompt">',c("format"),"</label>",'<span class="value"><%- dataset.data_type %></span>',"</div>","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'<div class="dbkey">','<label class="prompt">',c("database"),"</label>",'<span class="value">',"<%- dataset.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( dataset.misc_info ){ %>",'<div class="info">','<span class="value"><%- dataset.misc_info %></span>',"</div>","<% } %>"],"dataset");i[a.NEW]=b.wrapTemplate(["<div>",c("This is a new dataset and not all of its data are available yet"),"</div>"],"dataset");i[a.NOT_VIEWABLE]=b.wrapTemplate(["<div>",c("You do not have permission to view this dataset"),"</div>"],"dataset");i[a.DISCARDED]=b.wrapTemplate(["<div>",c("The job creating this dataset was cancelled before completion"),"</div>"],"dataset");i[a.QUEUED]=b.wrapTemplate(["<div>",c("This job is waiting to run"),"</div>"],"dataset");i[a.UPLOAD]=b.wrapTemplate(["<div>",c("This dataset is currently uploading"),"</div>"],"dataset");i[a.SETTING_METADATA]=b.wrapTemplate(["<div>",c("Metadata is being auto-detected"),"</div>"],"dataset");i[a.RUNNING]=b.wrapTemplate(["<div>",c("This job is currently running"),"</div>"],"dataset");i[a.PAUSED]=b.wrapTemplate(["<div>",c('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"</div>"],"dataset");i[a.ERROR]=b.wrapTemplate(["<% if( !dataset.purged ){ %>","<div><%- dataset.misc_blurb %></div>","<% } %>",'<span class="help-text">',c("An error occurred with this dataset"),":</span>",'<div class="job-error-text"><%- dataset.misc_info %></div>'],"dataset");i[a.EMPTY]=b.wrapTemplate(["<div>",c("No data"),": <i><%- dataset.misc_blurb %></i></div>"],"dataset");i.unknown=b.wrapTemplate(['<div>Error: unknown dataset state: "<%- dataset.state %>"</div>'],"dataset");var f=b.wrapTemplate(["<% _.each( apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>"],"apps");return _.extend({},e.prototype.templates,{warnings:g,details:h,summaries:i,displayApplications:f})}());return{DatasetListItemView:d}});
\ No newline at end of file
+define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var e=b.ListItemView;var d=e.extend({className:e.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(f){if(f.logger){this.logger=this.model.logger=f.logger}this.log(this+".initialize:",f);e.prototype.initialize.call(this,f);this.linkTarget=f.linkTarget||"_blank";this._setUpListeners()},_setUpListeners:function(){this.on("selectable",function(f){if(f){this.$(".primary-actions").hide()}else{this.$(".primary-actions").show()}});this.model.on("change",function(g,f){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this);this.on("all",function(f){this.log(f)},this)},_fetchModelDetails:function(){var f=this;if(f.model.inReadyState()&&!f.model.hasDetails()){return f.model.fetch({silent:true})}return jQuery.when()},remove:function(g,h){var f=this;g=g||this.fxSpeed;this.$el.fadeOut(g,function(){Backbone.View.prototype.remove.call(f);if(h){h.call(f)}})},render:function(f){return e.prototype.render.call(this,f)},_swapNewRender:function(f){e.prototype._swapNewRender.call(this,f);if(this.model.has("state")){this.$el.addClass("state-"+this.model.get("state"))}return this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var h=this.model.get("state");if((h===a.NOT_VIEWABLE)||(h===a.DISCARDED)||(!this.model.get("accessible"))){return null}var g={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged")){g.disabled=true;g.title=c("Cannot display datasets removed from disk")}else{if(h===a.UPLOAD){g.disabled=true;g.title=c("This dataset must finish uploading before it can be viewed")}else{if(h===a.NEW){g.disabled=true;g.title=c("This dataset is not yet viewable")}else{g.title=c("View data");g.href=this.model.urls.display;var f=this;g.onclick=function(i){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+f.model.get("name"),type:"other",content:function(j){var k=new DATA.TabularDataset({id:f.model.get("id")});$.when(k.fetch()).then(function(){DATA.createTabularDatasetChunkedView({model:k,parent_elt:j,embedded:true,height:"100%"})})}});i.preventDefault()}}}}}g.faIcon="fa-eye";return faIconButton(g)},_renderDetails:function(){var f=e.prototype._renderDetails.call(this);f.find(".actions .left").empty().append(this._renderSecondaryActions());f.find(".summary").html(this._renderSummary());f.find(".display-applications").html(this._renderDisplayApplications());this._setUpBehaviors(f);return f},_renderSummary:function(){var f=this.model.toJSON(),g=this.templates.summaries[f.state];g=g||this.templates.summaries.unknown;return g(f,this)},_renderDisplayApplications:function(){if(this.model.isDeletedOrPurged()){return""}return[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){this.debug("_renderSecondaryActions");switch(this.model.get("state")){case a.NOT_VIEWABLE:return[];case a.OK:case a.FAILED_METADATA:case a.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return faIconButton({title:c("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}if(!_.isEmpty(this.model.get("meta_files"))){return this._renderMetaFileDownloadButton()}return $(['<a class="download-btn icon-btn" href="',this.model.urls.download,'" title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))},_renderMetaFileDownloadButton:function(){var f=this.model.urls;return $(['<div class="metafile-dropdown dropdown">','<a class="download-btn icon-btn" href="javascript:void(0)" data-toggle="dropdown"',' title="'+c("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>",'<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">','<li><a href="'+f.download+'">',c("Download dataset"),"</a></li>",_.map(this.model.get("meta_files"),function(g){return['<li><a href="',f.meta_download+g.file_type,'">',c("Download")," ",g.file_type,"</a></li>"].join("")}).join("\n"),"</ul>","</div>"].join("\n"))},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"DatasetListItemView("+f+")"}});d.prototype.templates=(function(){var g=_.extend({},e.prototype.templates.warnings,{failed_metadata:b.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','<div class="warningmessagesmall">',c("An error occurred setting the metadata for this dataset"),"</div>","<% } %>"]),error:b.wrapTemplate(["<% if( model.error ){ %>",'<div class="errormessagesmall">',c("There was an error getting the data for this dataset"),": <%- model.error %>","</div>","<% } %>"]),purged:b.wrapTemplate(["<% if( model.purged ){ %>",'<div class="purged-msg warningmessagesmall">',c("This dataset has been deleted and removed from disk"),"</div>","<% } %>"]),deleted:b.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',c("This dataset has been deleted"),"</div>","<% } %>"])});var h=b.wrapTemplate(['<div class="details">','<div class="summary"></div>','<div class="actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !dataset.deleted && !dataset.purged ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="display-applications"></div>',"<% if( dataset.peek ){ %>",'<pre class="dataset-peek"><%= dataset.peek %></pre>',"<% } %>","<% } %>","</div>"],"dataset");var i={};i[a.OK]=i[a.FAILED_METADATA]=b.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'<div class="blurb">','<span class="value"><%- dataset.misc_blurb %></span>',"</div>","<% } %>","<% if( dataset.data_type ){ %>",'<div class="datatype">','<label class="prompt">',c("format"),"</label>",'<span class="value"><%- dataset.data_type %></span>',"</div>","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'<div class="dbkey">','<label class="prompt">',c("database"),"</label>",'<span class="value">',"<%- dataset.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( dataset.misc_info ){ %>",'<div class="info">','<span class="value"><%- dataset.misc_info %></span>',"</div>","<% } %>"],"dataset");i[a.NEW]=b.wrapTemplate(["<div>",c("This is a new dataset and not all of its data are available yet"),"</div>"],"dataset");i[a.NOT_VIEWABLE]=b.wrapTemplate(["<div>",c("You do not have permission to view this dataset"),"</div>"],"dataset");i[a.DISCARDED]=b.wrapTemplate(["<div>",c("The job creating this dataset was cancelled before completion"),"</div>"],"dataset");i[a.QUEUED]=b.wrapTemplate(["<div>","<% if( dataset.resubmitted ){ %>",c("The job creating this dataset has been resubmitted is now waiting to run"),"<% } else { %>",c("This job is waiting to run"),"<% } %>","</div>"],"dataset");i[a.RUNNING]=b.wrapTemplate(["<div>","<% if( dataset.resubmitted ){ %>",c("The job creating this dataset has been resubmitted is now running"),"<% } else { %>",c("This job is currently running"),"<% } %>","</div>"],"dataset");i[a.UPLOAD]=b.wrapTemplate(["<div>",c("This dataset is currently uploading"),"</div>"],"dataset");i[a.SETTING_METADATA]=b.wrapTemplate(["<div>",c("Metadata is being auto-detected"),"</div>"],"dataset");i[a.PAUSED]=b.wrapTemplate(["<div>",c('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"</div>"],"dataset");i[a.ERROR]=b.wrapTemplate(["<% if( !dataset.purged ){ %>","<div><%- dataset.misc_blurb %></div>","<% } %>",'<span class="help-text">',c("An error occurred with this dataset"),":</span>",'<div class="job-error-text"><%- dataset.misc_info %></div>'],"dataset");i[a.EMPTY]=b.wrapTemplate(["<div>",c("No data"),": <i><%- dataset.misc_blurb %></i></div>"],"dataset");i.unknown=b.wrapTemplate(['<div>Error: unknown dataset state: "<%- dataset.state %>"</div>'],"dataset");var f=b.wrapTemplate(["<% _.each( apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>"],"apps");return _.extend({},e.prototype.templates,{warnings:g,details:h,summaries:i,displayApplications:f})}());return{DatasetListItemView: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: carlfeberhard: QA, qunit: update HDA, history contents tests
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bdfef8f7d523/
Changeset: bdfef8f7d523
User: carlfeberhard
Date: 2014-08-12 18:48:28
Summary: QA, qunit: update HDA, history contents tests
Affected #: 2 files
diff -r f926988f8e0a480c09d3462002f482b5ac806682 -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 test/qunit/tests/hda-base.js
--- a/test/qunit/tests/hda-base.js
+++ b/test/qunit/tests/hda-base.js
@@ -1,14 +1,13 @@
// This file isn't really testing anything useful yet, it is just testing
// (or demonstrating) qunit+backbone interactions.
define([
- "mvc/dataset/hda-model",
- "mvc/dataset/hda-base",
+ "mvc/history/hda-model",
+ "mvc/history/hda-li",
"jquery",
- "sinon-qunit",
- "utils/localization"
+ "sinon-qunit"
], function(
- hdaModel,
- hdaBase,
+ HDA_MODEL,
+ HDA_BASE,
$,
sinon
){
@@ -18,10 +17,10 @@
module( "HDA base backbone view tests" );
test( "Base HDA view default construction, initialize", function() {
- var hda = new hdaModel.HistoryDatasetAssociation({
+ var hda = new HDA_MODEL.HistoryDatasetAssociation({
id : '123'
}),
- view = new hdaBase.HDABaseView({ model: hda });
+ view = new HDA_BASE.HDAListItemView({ model: hda });
strictEqual( view.model, hda );
@@ -30,6 +29,6 @@
equal( view.selected, false );
equal( view.expanded, false );
equal( view.draggable, false );
- equal( view.id(), 'hda-123' );
+ equal( view.id(), 'dataset-123' );
});
});
diff -r f926988f8e0a480c09d3462002f482b5ac806682 -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 test/qunit/tests/history_contents_model_tests.js
--- a/test/qunit/tests/history_contents_model_tests.js
+++ b/test/qunit/tests/history_contents_model_tests.js
@@ -1,46 +1,45 @@
// This file isn't really testing anything useful yet, it is just testing
// (or demonstrating) qunit+backbone interactions.
define([
- "mvc/dataset/hda-model",
+ "mvc/history/hda-model",
"jquery",
"sinon-qunit"
], function(
- hdaModel,
+ HDA_MODEL,
$,
sinon
){
module( "History Contents Model Tests" );
test( "HDA Constructions with Default Attributes", function() {
- var hda = new hdaModel.HistoryDatasetAssociation();
- expect( 2 );
+ var hda = new HDA_MODEL.HistoryDatasetAssociation({});
equal( hda.get( 'name' ), "(unnamed dataset)" );
equal( hda.get( 'state' ), "new" );
} );
test( "HDA Construction with Supplied Attributes", function() {
- var hda = new hdaModel.HistoryDatasetAssociation( {
- name: "my dataset",
- state: "ok",
- } );
- expect( 2 );
-
+ var hda = new HDA_MODEL.HistoryDatasetAssociation({
+ history_content_type : 'dataset',
+ name: "my dataset",
+ state: "ok"
+ });
equal( hda.get( 'name' ), "my dataset" );
equal( hda.get( 'state' ), "ok" );
} );
test( "HDA Deletion", function() {
- var hda = new hdaModel.HistoryDatasetAssociation( {
- id: "hda1",
- history_id: "h1",
- deleted: false,
- } );
-
- // Demonstrate sinon stubbing out of Ajax queries...
+ var hda = new HDA_MODEL.HistoryDatasetAssociation({
+ history_content_type : 'dataset',
+ id: "hda1",
+ history_id: "h1",
+ deleted: false
+ });
equal( hda.get( 'deleted' ), false );
sinon.stub( $, "ajax" );
- hda.delete();
+ hda[ 'delete' ]();
equal( hda.get( 'deleted' ), true );
- ok( $.ajax.calledWithMatch( { url: "/api/histories/h1/contents/hda1" } ) );
- } );
-} );
+ // to get the url sinon used:
+ //console.debug( $.ajax.lastCall.args[0].url )
+ ok( $.ajax.calledWithMatch( { url: "/api/histories/h1/contents/datasets/hda1" } ) );
+ });
+});
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: QA, casperjs: fix selectors changed in 7005608
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f926988f8e0a/
Changeset: f926988f8e0a
User: carlfeberhard
Date: 2014-08-12 17:42:03
Summary: QA, casperjs: fix selectors changed in 7005608
Affected #: 5 files
diff -r 3aad77adffba5e3cbb8910ca21387c3effefc429 -r f926988f8e0a480c09d3462002f482b5ac806682 static/scripts/mvc/collection/collection-li.js
--- a/static/scripts/mvc/collection/collection-li.js
+++ b/static/scripts/mvc/collection/collection-li.js
@@ -16,7 +16,11 @@
//logger : console,
className : ListItemView.prototype.className + " dataset-collection",
- /** */
+ id : function(){
+ return [ 'dataset_collection', this.model.get( 'id' ) ].join( '-' );
+ },
+
+ /** jq speed for effects used */
fxSpeed : 'fast',
//TODO: ununsed
diff -r 3aad77adffba5e3cbb8910ca21387c3effefc429 -r f926988f8e0a480c09d3462002f482b5ac806682 static/scripts/mvc/dataset/dataset-li.js
--- a/static/scripts/mvc/dataset/dataset-li.js
+++ b/static/scripts/mvc/dataset/dataset-li.js
@@ -16,6 +16,10 @@
//logger : console,
className : _super.prototype.className + " dataset",
+ //TODO:?? doesn't exactly match an hda's type_id
+ id : function(){
+ return [ 'dataset', this.model.get( 'id' ) ].join( '-' );
+ },
/** Set up: instance vars, options, and event handlers */
initialize : function( attributes ){
@@ -240,7 +244,7 @@
// gen. safe to show in all cases
return faIconButton({
title : _l( 'View details' ),
- classes : 'dataset-params-btn',
+ classes : 'params-btn',
href : this.model.urls.show_params,
target : this.linkTarget,
faIcon : 'fa-info-circle'
diff -r 3aad77adffba5e3cbb8910ca21387c3effefc429 -r f926988f8e0a480c09d3462002f482b5ac806682 test/casperjs/hda-state-tests.js
--- a/test/casperjs/hda-state-tests.js
+++ b/test/casperjs/hda-state-tests.js
@@ -321,7 +321,7 @@
// set state directly through model, wait for re-render
//TODO: not ideal to test this
this.evaluate( function(){
- return Galaxy.currHistoryPanel.model.hdas.at( 0 ).set( 'state', 'new' );
+ return Galaxy.currHistoryPanel.model.contents.at( 0 ).set( 'state', 'new' );
});
this.wait( 1000, function(){
this.test.comment( 'HDAs in the "new" state should be well formed' );
@@ -359,7 +359,7 @@
var errorString = 'Blah!';
this.evaluate( function( errorString ){
- return Galaxy.currHistoryPanel.model.hdas.getByHid( 1 ).set( 'error', errorString );
+ return Galaxy.currHistoryPanel.model.contents.getByHid( 1 ).set( 'error', errorString );
}, errorString );
// wait for re-render
@@ -382,8 +382,8 @@
this.historypanel.thenCollapseHda( uploadSelector, function(){
this.evaluate( function(){
- Galaxy.currHistoryPanel.model.hdas.getByHid( 1 ).unset( 'error' );
- return Galaxy.currHistoryPanel.model.hdas.at( 0 ).set( 'state', 'ok' );
+ Galaxy.currHistoryPanel.model.contents.getByHid( 1 ).unset( 'error' );
+ return Galaxy.currHistoryPanel.model.contents.at( 0 ).set( 'state', 'ok' );
});
});
this.wait( 1000 );
diff -r 3aad77adffba5e3cbb8910ca21387c3effefc429 -r f926988f8e0a480c09d3462002f482b5ac806682 test/casperjs/history-panel-tests.js
--- a/test/casperjs/history-panel-tests.js
+++ b/test/casperjs/history-panel-tests.js
@@ -230,6 +230,7 @@
// broken in webkit w/ jq 1.7
spaceghost.historypanel.waitForHdas( function(){
this.test.comment( 'HDAs can be expanded by clicking on the name' );
+ this.debug( this.jsonStr( testUploadInfo ) );
var uploadedSelector = '#' + testUploadInfo.hdaElement.attributes.id;
this.click( uploadedSelector + ' ' + this.historypanel.data.selectors.hda.title );
diff -r 3aad77adffba5e3cbb8910ca21387c3effefc429 -r f926988f8e0a480c09d3462002f482b5ac806682 test/casperjs/modules/historypanel.js
--- a/test/casperjs/modules/historypanel.js
+++ b/test/casperjs/modules/historypanel.js
@@ -63,7 +63,7 @@
* @returns {Object|null} ElementInfo of the historyItemWrapper found, null if not found
*/
HistoryPanel.prototype.hdaElementInfoByTitle = function hdaElementInfoByTitle( title ){
- var wrapperXpath = xpath( '//span[@class="dataset-name" and contains(text(),"' + title + '")]/../../..' );
+ var wrapperXpath = xpath( '//span[@class="name" and contains(text(),"' + title + '")]/../../..' );
return this.spaceghost.elementInfoOrNull( wrapperXpath );
};
@@ -138,9 +138,13 @@
if( state !== 'ok' ){ return false; }
var hdaOpacity = this.evaluate( function( name ){
- return $( '.dataset-name:contains("' + name + '")' ).parents( '.hda' ).css( 'opacity' );
+ // locate the hda by name and return its opacity
+ console.debug( name );
+ console.debug( $( '.name:contains("' + name + '")' ) );
+ console.debug( $( '.name:contains("' + name + '")' ).parents( '.hda' ) );
+ return $( '.name:contains("' + name + '")' ).parents( '.dataset' ).css( 'opacity' );
}, hdaName );
- this.debug( 'fading in: ' + hdaOpacity );
+ //this.debug( 'fading in: ' + hdaOpacity );
return hdaOpacity >= 1;
},
function _then(){ then.call( this, hdaElement ); },
@@ -310,19 +314,19 @@
hdaTitleButtons : {
// mixing text and selectors here
display : {
- selector : '.icon-btn.dataset-display',
+ selector : '.icon-btn.display-btn',
tooltip : 'View data',
hrefTpl : '/datasets/%s/display',
nodeName : 'a'
},
edit : {
- selector : '.icon-btn.dataset-edit',
+ selector : '.icon-btn.edit-btn',
tooltip : 'Edit attributes',
hrefTpl : '/datasets/%s/edit',
nodeName : 'a'
},
'delete' : {
- selector : '.icon-btn.dataset-delete',
+ selector : '.icon-btn.delete-btn',
tooltip : 'Delete',
hrefTpl : 'javascript:void(0);',
nodeName : 'a'
@@ -330,19 +334,19 @@
},
hdaPrimaryActionButtons : {
download : {
- selector : '.icon-btn.dataset-download-btn',
+ selector : '.icon-btn.download-btn',
tooltip : 'Download',
hrefTpl : '/datasets/%s/display?to_ext=',
nodeName : 'a'
},
info : {
- selector : '.icon-btn.dataset-params-btn',
+ selector : '.icon-btn.params-btn',
tooltip : 'View details',
hrefTpl : '/datasets/%s/show_params',
nodeName : 'a'
},
rerun : {
- selector : '.icon-btn.dataset-rerun-btn',
+ selector : '.icon-btn.rerun-btn',
tooltip : 'Run this job again',
hrefTpl : '/tool_runner/rerun?id=%s',
nodeName : 'a'
@@ -365,7 +369,7 @@
},
hda : {
wrapper : {
- itemClass : '.hda',
+ itemClass : '.history-content.dataset',
stateClasses : {
prefix : 'state-',
ok : 'state-ok',
@@ -374,18 +378,18 @@
},
errorMessage : '.errormessagesmall',
- title : '.dataset-title',
- titleButtonArea : '.dataset-primary-actions',
- summary : '.dataset-summary',
- dbkey : '.dataset-dbkey .value',
- info : '.dataset-info',
- body : '.dataset-body',
+ title : '.title',
+ titleButtonArea : '.primary-actions',
+ summary : '.summary',
+ dbkey : '.dbkey .value',
+ info : '.info',
+ body : '.details',
- primaryActionButtons : '.dataset-actions .left',
- secondaryActionButtons : '.dataset-actions .right',
+ primaryActionButtons : '.actions .left',
+ secondaryActionButtons : '.actions .right',
- undeleteLink : '.dataset-undelete',
- purgeLink : '.dataset-purge',
+ undeleteLink : '.undelete-link',
+ purgeLink : '.purge-link',
peek : '.dataset-peek'
}
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: dannon: Update tool_list.py to indicate the correct tool_conf.xml (not sample)
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3aad77adffba/
Changeset: 3aad77adffba
User: dannon
Date: 2014-08-12 17:28:08
Summary: Update tool_list.py to indicate the correct tool_conf.xml (not sample)
Affected #: 1 file
diff -r 18e8ddfb9c3c7407daae21b49d64300e4edf7cc4 -r 3aad77adffba5e3cbb8910ca21387c3effefc429 tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -1,6 +1,6 @@
import os,sys
-#--------read tool_conf.xml.sample to get all the tool xml file names-----------
+#--------read tool_conf.xml to get all the tool xml file names-----------
onoff = 1
tool_list = []
for line in open("tool_conf.xml", "r"):
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: dannon: Merged in peterjc/galaxy-central/tool_list_fix (pull request #456)
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/18e8ddfb9c3c/
Changeset: 18e8ddfb9c3c
User: dannon
Date: 2014-08-12 17:25:22
Summary: Merged in peterjc/galaxy-central/tool_list_fix (pull request #456)
tool_list.py should now use tool_conf.xml not tool_conf.xml.sample
Affected #: 1 file
diff -r a94473459ebb4749a375420492d6da9a948ccd3a -r 18e8ddfb9c3c7407daae21b49d64300e4edf7cc4 tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -3,7 +3,7 @@
#--------read tool_conf.xml.sample to get all the tool xml file names-----------
onoff = 1
tool_list = []
-for line in open("tool_conf.xml.sample", "r"):
+for line in open("tool_conf.xml", "r"):
if line.find("<!--") != -1:
onoff = 0
if line.find("file") != -1 and onoff==1:
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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/82a9821e0fbb/
Changeset: 82a9821e0fbb
Branch: tool_list_fix
User: peterjc
Date: 2014-08-12 17:13:05
Summary: Created new branch tool_list_fix
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/24d8995c3568/
Changeset: 24d8995c3568
Branch: tool_list_fix
User: peterjc
Date: 2014-08-12 17:15:04
Summary: tool_list.py should now use tool_conf.xml not tool_conf.xml.sample
See a94473459ebb4749a375420492d6da9a948ccd3a where the rest of the run_functional_tests.sh system was updated.
Affected #: 1 file
diff -r 82a9821e0fbb3b4c9387152e48be189cc2829a45 -r 24d8995c35689fc42e96d6f02dc222cbf75531ed tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -3,7 +3,7 @@
#--------read tool_conf.xml.sample to get all the tool xml file names-----------
onoff = 1
tool_list = []
-for line in open("tool_conf.xml.sample", "r"):
+for line in open("tool_conf.xml", "r"):
if line.find("<!--") != -1:
onoff = 0
if line.find("file") != -1 and onoff==1:
https://bitbucket.org/galaxy/galaxy-central/commits/18e8ddfb9c3c/
Changeset: 18e8ddfb9c3c
User: dannon
Date: 2014-08-12 17:25:22
Summary: Merged in peterjc/galaxy-central/tool_list_fix (pull request #456)
tool_list.py should now use tool_conf.xml not tool_conf.xml.sample
Affected #: 1 file
diff -r a94473459ebb4749a375420492d6da9a948ccd3a -r 18e8ddfb9c3c7407daae21b49d64300e4edf7cc4 tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -3,7 +3,7 @@
#--------read tool_conf.xml.sample to get all the tool xml file names-----------
onoff = 1
tool_list = []
-for line in open("tool_conf.xml.sample", "r"):
+for line in open("tool_conf.xml", "r"):
if line.find("<!--") != -1:
onoff = 0
if line.find("file") != -1 and onoff==1:
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 panel: clean up and documentation
by commits-noreply@bitbucket.org 12 Aug '14
by commits-noreply@bitbucket.org 12 Aug '14
12 Aug '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a94473459ebb/
Changeset: a94473459ebb
User: carlfeberhard
Date: 2014-08-12 16:45:26
Summary: History panel: clean up and documentation
Affected #: 19 files
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/collection/collection-li-edit.js
--- a/static/scripts/mvc/collection/collection-li-edit.js
+++ b/static/scripts/mvc/collection/collection-li-edit.js
@@ -13,7 +13,8 @@
var _super = DC_LI.DCListItemView;
/** @class Editing view for DatasetCollectionElement.
*/
-var DCEListItemEdit = _super.extend({
+var DCEListItemEdit = _super.extend(
+/** @lends DCEListItemEdit.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/collection/collection-li.js
--- a/static/scripts/mvc/collection/collection-li.js
+++ b/static/scripts/mvc/collection/collection-li.js
@@ -8,7 +8,8 @@
var ListItemView = BASE_MVC.ListItemView;
/** @class Read only view for DatasetCollection.
*/
-var DCListItemView = ListItemView.extend({
+var DCListItemView = ListItemView.extend(
+/** @lends DCListItemView.prototype */{
//TODO: may not be needed
/** logger used to record this.log messages, commonly set to console */
@@ -26,7 +27,7 @@
ListItemView.prototype.initialize.call( this, attributes );
},
- /** In this override, don't show`or render any details (no need to do anything here)
+ /** In this override, don't show or render any details (no need to do anything here)
* - currently the parent control will load a panel for this collection over itself
* @fires expanded when a body has been expanded
*/
@@ -87,7 +88,8 @@
//==============================================================================
/** @class Read only view for DatasetCollectionElement.
*/
-var DCEListItemView = ListItemView.extend({
+var DCEListItemView = ListItemView.extend(
+/** @lends DCEListItemView.prototype */{
//TODO: this might be expendable - compacted with HDAListItemView
/** logger used to record this.log messages, commonly set to console */
@@ -99,7 +101,7 @@
/** jq fx speed for this view */
fxSpeed : 'fast',
- /** */
+ /** set up */
initialize : function( attributes ){
if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
this.log( 'DCEListItemView.initialize:', attributes );
@@ -138,14 +140,15 @@
/** @class Read only view for a DatasetCollectionElement that is also an DatasetAssociation
* (a dataset contained in a dataset collection).
*/
-var DatasetDCEListItemView = DATASET_LI.DatasetListItemView.extend({
+var DatasetDCEListItemView = DATASET_LI.DatasetListItemView.extend(
+/** @lends DatasetDCEListItemView.prototype */{
className : DATASET_LI.DatasetListItemView.prototype.className + " dataset-collection-element",
/** logger used to record this.log messages, commonly set to console */
//logger : console,
- /** */
+ /** set up */
initialize : function( attributes ){
if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
this.log( 'DatasetDCEListItemView.initialize:', attributes );
@@ -185,7 +188,8 @@
/** @class Read only view for a DatasetCollectionElement that is also a DatasetCollection
* (a nested DC).
*/
-var NestedDCDCEListItemView = DCListItemView.extend({
+var NestedDCDCEListItemView = DCListItemView.extend(
+/** @lends NestedDCDCEListItemView.prototype */{
className : DCListItemView.prototype.className + " dataset-collection-element",
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/collection/collection-model.js
--- a/static/scripts/mvc/collection/collection-model.js
+++ b/static/scripts/mvc/collection/collection-model.js
@@ -47,7 +47,7 @@
* When collection elements are passed from the API, the underlying element is
* in a sub-object 'object' (IOW, a DCE representing an HDA will have HDA json in element.object).
* This mixin uses the constructor and parse methods to merge that JSON with the DCE attribtues
- * effectively changing a DCE from a container to a subclass.
+ * effectively changing a DCE from a container to a subclass (has a --> is a).
*/
var DatasetCollectionElementMixin = {
@@ -82,7 +82,7 @@
};
//TODO: unused?
-/** Concrete class of Generic DatasetCollectionElement */
+/** @class Concrete class of Generic DatasetCollectionElement */
var DatasetCollectionElement = Backbone.Model
.extend( BASE_MVC.LoggableMixin )
.extend( DatasetCollectionElementMixin );
@@ -94,7 +94,6 @@
/** @lends DCECollection.prototype */{
model: DatasetCollectionElement,
- // comment this out to suppress log output
/** logger used to record this.log messages, commonly set to console */
//logger : console,
@@ -124,7 +123,10 @@
/** logger used to record this.log messages, commonly set to console */
//logger : console,
- defaults : _.extend( {}, DATASET_MODEL.DatasetAssociation.prototype.defaults, DatasetCollectionElementMixin.defaults ),
+ defaults : _.extend( {},
+ DATASET_MODEL.DatasetAssociation.prototype.defaults,
+ DatasetCollectionElementMixin.defaults
+ ),
// because all objects have constructors (as this hashmap would even if this next line wasn't present)
// the constructor in hcontentMixin won't be attached by BASE_MVC.mixin to this model
@@ -162,7 +164,7 @@
//logger : console,
//TODO: unused?
- /** */
+ /** set up */
initialize : function( attributes, options ){
this.debug( this + '(DatasetDCECollection).initialize:', attributes, options );
DCECollection.prototype.initialize.call( this, attributes, options );
@@ -203,7 +205,7 @@
/** Which class to use for elements */
collectionClass : DCECollection,
- /** */
+ /** set up: create elements instance var and (on changes to elements) update them */
initialize : function( model, options ){
this.debug( this + '(DatasetCollection).initialize:', model, options, this );
//historyContent.HistoryContent.prototype.initialize.call( this, attrs, options );
@@ -269,6 +271,7 @@
},
// ........................................................................ searchable
+ /** searchable attributes for collections */
searchAttributes : [
'name'
],
@@ -291,6 +294,7 @@
/** logger used to record this.log messages, commonly set to console */
//logger : console,
+ /** override since we know the collection will only contain datasets */
collectionClass : DatasetDCECollection,
//TODO: unused?
@@ -368,10 +372,11 @@
/** logger used to record this.log messages, commonly set to console */
//logger : console,
+ /** This is a collection of nested collections */
model: NestedDCDCE,
//TODO: unused?
- /** */
+ /** set up */
initialize : function( attrs, options ){
this.debug( this + '(NestedDCDCECollection).initialize:', attrs, options );
DCECollection.prototype.initialize.call( this, attrs, options );
@@ -394,7 +399,10 @@
/** logger used to record this.log messages, commonly set to console */
//logger : console,
- /** */
+ // because all objects have constructors (as this hashmap would even if this next line wasn't present)
+ // the constructor in hcontentMixin won't be attached by BASE_MVC.mixin to this model
+ // - re-apply manually it now
+ /** This is both a collection and a collection element - call the constructor */
constructor : function( attributes, options ){
this.debug( '\t NestedPairDCDCE.constructor:', attributes, options );
//DatasetCollection.constructor.call( this, attributes, options );
@@ -418,10 +426,11 @@
/** logger used to record this.log messages, commonly set to console */
//logger : console,
+ /** We know this collection is composed of only nested pair collections */
model: NestedPairDCDCE,
//TODO: unused?
- /** */
+ /** set up */
initialize : function( attrs, options ){
this.debug( this + '(NestedPairDCDCECollection).initialize:', attrs, options );
NestedDCDCECollection.prototype.initialize.call( this, attrs, options );
@@ -443,11 +452,11 @@
/** logger used to record this.log messages, commonly set to console */
//logger : console,
- // list:paired is the only collection that itself contains collections
+ /** list:paired is the only collection that itself contains collections */
collectionClass : NestedPairDCDCECollection,
//TODO: unused?
- /** */
+ /** set up */
initialize : function( attributes, options ){
this.debug( this + '(ListPairedDatasetCollection).initialize:', attributes, options );
DatasetCollection.prototype.initialize.call( this, attributes, options );
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/collection/collection-panel.js
--- a/static/scripts/mvc/collection/collection-panel.js
+++ b/static/scripts/mvc/collection/collection-panel.js
@@ -24,7 +24,9 @@
/** (in ms) that jquery effects will use */
fxSpeed : 'fast',
+ /** sub view class used for datasets */
DatasetDCEViewClass : DC_LI.DatasetDCEListItemView,
+ /** sub view class used for nested collections */
NestedDCDCEViewClass : DC_LI.NestedDCDCEListItemView,
// ......................................................................... SET UP
@@ -229,7 +231,7 @@
}
},
- /** */
+ /** When a sub-collection is clicked, hide the current panel and render the sub-collection in its own panel */
_addCollectionPanel : function( collectionView ){
//TODO: a bit hackish
var currPanel = this,
@@ -333,9 +335,11 @@
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection. */
-var ListCollectionPanel = CollectionPanel.extend({
+var ListCollectionPanel = CollectionPanel.extend(
+/** @lends ListCollectionPanel.prototype */{
//TODO: not strictly needed - due to switch in CollectionPanel._getContentClass
+ /** sub view class used for datasets */
DatasetDCEViewClass : DC_LI.DatasetDCEListItemView,
// ........................................................................ misc
@@ -348,7 +352,8 @@
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection. */
-var PairCollectionPanel = ListCollectionPanel.extend({
+var PairCollectionPanel = ListCollectionPanel.extend(
+/** @lends PairCollectionPanel.prototype */{
// ........................................................................ misc
/** string rep */
@@ -360,9 +365,11 @@
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection. */
-var ListOfPairsCollectionPanel = CollectionPanel.extend({
+var ListOfPairsCollectionPanel = CollectionPanel.extend(
+/** @lends ListOfPairsCollectionPanel.prototype */{
//TODO: not strictly needed - due to switch in CollectionPanel._getContentClass
+ /** sub view class used for nested collections */
NestedDCDCEViewClass : DC_LI.NestedDCDCEListItemView,
// ........................................................................ misc
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/dataset/dataset-model.js
--- a/static/scripts/mvc/dataset/dataset-model.js
+++ b/static/scripts/mvc/dataset/dataset-model.js
@@ -10,7 +10,7 @@
* The DA's are made searchable (by attribute) by mixing in SearchableModelMixin.
*/
var DatasetAssociation = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
- BASE_MVC.mixin( searchableMixin, {
+ BASE_MVC.mixin( searchableMixin, /** @lends DatasetAssociation.prototype */{
/** default attributes for a model */
defaults : {
@@ -43,8 +43,10 @@
//annotation : ''
},
- initialize : function( attrs, options ){
- this.debug( 'Dataset.initialize', attrs, options );
+ /** instance vars and listeners */
+ initialize : function( attributes, options ){
+ this.debug( this + '(Dataset).initialize', attributes, options );
+
//!! this state is not in trans.app.model.Dataset.states - set it here -
if( !this.get( 'accessible' ) ){
this.set( 'state', STATES.NOT_VIEWABLE );
@@ -62,7 +64,6 @@
var id = this.get( 'id' );
if( !id ){ return {}; }
var urls = {
-//TODO: how many of these are still used?
'purge' : 'datasets/' + id + '/purge_async',
'display' : 'datasets/' + id + '/display/?preview=True',
'edit' : 'datasets/' + id + '/edit',
@@ -146,6 +147,7 @@
return this.save( { deleted: false }, options );
},
+ /** remove the file behind this dataset from the filesystem (if permitted) */
purge : function _purge( options ){
//TODO: use, override model.destroy, HDA.delete({ purge: true })
if( this.get( 'purged' ) ){ return jQuery.when(); }
@@ -160,7 +162,7 @@
// }, options ));
//
//xhr.done( function( response ){
- // console.debug( 'response', response );
+ // hda.debug( 'response', response );
// //hda.set({ deleted: true, purged: true });
// hda.set( response );
//});
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/dataset/states.js
--- a/static/scripts/mvc/dataset/states.js
+++ b/static/scripts/mvc/dataset/states.js
@@ -27,8 +27,9 @@
PAUSED : 'paused',
/** metadata discovery/setting failed or errored (but otherwise ok) */
FAILED_METADATA : 'failed_metadata',
+//TODO: not in trans.app.model.Dataset.states - is in database
/** not accessible to the current user (i.e. due to permissions) */
- NOT_VIEWABLE : 'noPermission', // not in trans.app.model.Dataset.states
+ NOT_VIEWABLE : 'noPermission',
/** deleted while uploading */
DISCARDED : 'discarded',
/** the tool producing this dataset failed */
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/hdca-li-edit.js
--- a/static/scripts/mvc/history/hdca-li-edit.js
+++ b/static/scripts/mvc/history/hdca-li-edit.js
@@ -7,7 +7,8 @@
var _super = HDCA_LI.HDCAListItemView;
/** @class Editing view for HistoryDatasetCollectionAssociation.
*/
-var HDCAListItemEdit = _super.extend({
+var HDCAListItemEdit = _super.extend(
+/** @lends HDCAListItemEdit.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/hdca-li.js
--- a/static/scripts/mvc/history/hdca-li.js
+++ b/static/scripts/mvc/history/hdca-li.js
@@ -9,13 +9,12 @@
var _super = DC_LI.DCListItemView;
/** @class Read only view for HistoryDatasetCollectionAssociation (a dataset collection inside a history).
*/
-var HDCAListItemView = _super.extend({
+var HDCAListItemView = _super.extend(
+/** @lends HDCAListItemView.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
-//TODO: not a dataset
- /** */
className : _super.prototype.className + " history-content",
/** In this override, add the state as a class for use with state-based CSS */
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/hdca-model.js
--- a/static/scripts/mvc/history/hdca-model.js
+++ b/static/scripts/mvc/history/hdca-model.js
@@ -19,7 +19,6 @@
//==============================================================================
/** @class Backbone model for List Dataset Collection within a History.
- * @constructs
*/
var HistoryListDatasetCollection = ListDC.extend( hcontentMixin ).extend(
/** @lends HistoryListDatasetCollection.prototype */{
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/history-content-model.js
--- a/static/scripts/mvc/history/history-content-model.js
+++ b/static/scripts/mvc/history/history-content-model.js
@@ -34,20 +34,24 @@
// Build a new id (type_id) that prefixes the history_content_type so the bbone collection can differentiate
idAttribute : 'type_id',
+ /** override constructor to build type_id and insert into original attributes */
constructor : function( attrs, options ){
attrs.type_id = typeIdStr( attrs.history_content_type, attrs.id );
this.debug( 'HistoryContentMixin.constructor:', attrs.type_id );
Backbone.Model.apply( this, arguments );
},
+ /** object level fn for building the type_id string */
_typeIdStr : function(){
return typeIdStr( this.get( 'history_content_type' ), this.get( 'id' ) );
},
+ /** add listener to re-create type_id when the id changes */
initialize : function( attrs, options ){
this.on( 'change:id', this._createTypeId );
},
+ /** set the type_id in the model attributes */
_createTypeId : function(){
this.set( 'type_id', this._typeIdStr() );
},
@@ -90,12 +94,12 @@
return url;
},
- /** save this HDA as not visible */
+ /** save this content as not visible */
hide : function( options ){
if( !this.get( 'visible' ) ){ return jQuery.when(); }
return this.save( { visible: false }, options );
},
- /** save this HDA as visible */
+ /** save this content as visible */
unhide : function( options ){
if( this.get( 'visible' ) ){ return jQuery.when(); }
return this.save( { visible: true }, options );
@@ -114,6 +118,7 @@
//==============================================================================
+//TODO: needed?
/** @class (Concrete/non-mixin) base model for content items.
*/
var HistoryContent = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend( HistoryContentMixin );
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/history-contents.js
--- a/static/scripts/mvc/history/history-contents.js
+++ b/static/scripts/mvc/history/history-contents.js
@@ -26,7 +26,6 @@
/** since history content is a mix, override model fn into a factory, creating based on history_content_type */
model : function( attrs, options ) {
- //console.debug( 'HistoryContents.model:', attrs, options );
//TODO: can we move the type_id stuff here?
//attrs.type_id = typeIdStr( attrs );
@@ -70,24 +69,25 @@
},
// ........................................................................ common queries
- /** Get the ids of every hda in this collection
+ /** Get the ids of every item in this collection
* @returns array of encoded ids
*/
ids : function(){
- return this.map( function( hda ){ return hda.get('id'); });
+//TODO: is this still useful since type_id
+ return this.map( function( item ){ return item.get('id'); });
},
- /** Get hdas that are not ready
- * @returns array of HDAs
+ /** Get contents that are not ready
+ * @returns array of content models
*/
notReady : function(){
- return this.filter( function( hda ){
- return !hda.inReadyState();
+ return this.filter( function( content ){
+ return !content.inReadyState();
});
},
- /** Get the id of every hda in this collection not in a 'ready' state (running).
- * @returns an array of hda ids
+ /** Get the id of every model in this collection not in a 'ready' state (running).
+ * @returns an array of model ids
* @see HistoryDatasetAssociation#inReadyState
*/
running : function(){
@@ -95,24 +95,26 @@
this.each( function( item ){
var isRunning = !item.inReadyState();
if( isRunning ){
+//TODO: is this still correct since type_id
idList.push( item.get( 'id' ) );
}
});
return idList;
},
- /** Get the hda with the given hid
+ /** Get the model with the given hid
* @param {Int} hid the hid to search for
- * @returns {HistoryDatasetAssociation} the hda with the given hid or undefined if not found
+ * @returns {HistoryDatasetAssociation} the model with the given hid or undefined if not found
*/
getByHid : function( hid ){
- return _.first( this.filter( function( hda ){ return hda.get( 'hid' ) === hid; }) );
+ return _.first( this.filter( function( content ){ return content.get( 'hid' ) === hid; }) );
},
- /** Get every 'shown' hda in this collection based on show_deleted/hidden
- * @param {Boolean} show_deleted are we showing deleted hdas?
- * @param {Boolean} show_hidden are we showing hidden hdas?
- * @returns array of hda models
+ //TODO:?? this may belong in the containing view
+ /** Get every 'shown' model in this collection based on show_deleted/hidden
+ * @param {Boolean} show_deleted are we showing deleted content?
+ * @param {Boolean} show_hidden are we showing hidden content?
+ * @returns array of content models
* @see HistoryDatasetAssociation#isVisible
*/
getVisible : function( show_deleted, show_hidden, filters ){
@@ -131,13 +133,13 @@
return filteredHdas;
},
- /** return true if any hdas don't have details */
+ /** return true if any contents don't have details */
haveDetails : function(){
- return this.all( function( hda ){ return hda.hasDetails(); });
+ return this.all( function( content ){ return content.hasDetails(); });
},
// ........................................................................ ajax
- /** fetch detailed model data for all HDAs in this collection */
+ /** fetch detailed model data for all contents in this collection */
fetchAllDetails : function( options ){
options = options || {};
var detailsFlag = { details: 'all' };
@@ -145,8 +147,8 @@
return this.fetch( options );
},
- /** using a queue, perform hdaAjaxFn on each of the hdas in this collection */
- ajaxQueue : function( hdaAjaxFn, options ){
+ /** using a queue, perform ajaxFn on each of the models in this collection */
+ ajaxQueue : function( ajaxFn, options ){
var deferred = jQuery.Deferred(),
startingLength = this.length,
responses = [];
@@ -157,12 +159,12 @@
}
// use reverse order (stylistic choice)
- var ajaxFns = this.chain().reverse().map( function( hda, i ){
+ var ajaxFns = this.chain().reverse().map( function( content, i ){
return function(){
- var xhr = hdaAjaxFn.call( hda, options );
+ var xhr = ajaxFn.call( content, options );
// if successful, notify using the deferred to allow tracking progress
xhr.done( function( response ){
- deferred.notify({ curr: i, total: startingLength, response: response, model: hda });
+ deferred.notify({ curr: i, total: startingLength, response: response, model: content });
});
// (regardless of previous error or success) if not last ajax call, shift and call the next
// if last fn, resolve deferred
@@ -183,17 +185,18 @@
},
// ........................................................................ sorting/filtering
- /** return a new collection of HDAs whose attributes contain the substring matchesWhat */
+ /** return a new collection of contents whose attributes contain the substring matchesWhat */
matches : function( matchesWhat ){
- return this.filter( function( hda ){
- return hda.matches( matchesWhat );
+ return this.filter( function( content ){
+ return content.matches( matchesWhat );
});
},
// ........................................................................ misc
+ /** override to get a correct/smarter merge when incoming data is partial */
set : function( models, options ){
// arrrrrrrrrrrrrrrrrg...
- // override to get a correct/smarter merge when incoming data is partial (e.g. stupid backbone)
+ // (e.g. stupid backbone)
// w/o this partial models from the server will fill in missing data with model defaults
// and overwrite existing data on the client
// see Backbone.Collection.set and _prepareModel
@@ -213,7 +216,7 @@
Backbone.Collection.prototype.set.call( this, models, options );
},
- /** Convert this ad-hoc collection of HDAs to a formal collection tracked
+ /** Convert this ad-hoc collection of hdas to a formal collection tracked
by the server.
**/
promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/history-panel-annotated.js
--- a/static/scripts/mvc/history/history-panel-annotated.js
+++ b/static/scripts/mvc/history/history-panel-annotated.js
@@ -23,7 +23,7 @@
* @constructs
*/
var AnnotatedHistoryPanel = _super.extend(
-/** @lends HistoryPanel.prototype */{
+/** @lends AnnotatedHistoryPanel.prototype */{
/** logger used to record this.log messages, commonly set to console */
// comment this out to suppress log output
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/history-panel-edit-current.js
--- a/static/scripts/mvc/history/history-panel-edit-current.js
+++ b/static/scripts/mvc/history/history-panel-edit-current.js
@@ -7,7 +7,8 @@
// ============================================================================
/** session storage for history panel preferences (and to maintain state)
*/
-var HistoryPanelPrefs = BASE_MVC.SessionStorageModel.extend({
+var HistoryPanelPrefs = BASE_MVC.SessionStorageModel.extend(
+/** @lends HistoryPanelPrefs.prototype */{
defaults : {
/** is the panel currently showing the search/filter controls? */
searching : false,
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/history-panel-edit.js
--- a/static/scripts/mvc/history/history-panel-edit.js
+++ b/static/scripts/mvc/history/history-panel-edit.js
@@ -333,9 +333,9 @@
// maintain a list of hdas that are selected
hdaView.on( 'selected', function( hdaView, event ){
if( !event ){ return; }
- //console.debug( 'selected', event );
+ //this.debug( 'selected', event );
var selectedIds = [];
- //console.debug( historyView.lastSelectedViewId, historyView.hdaViews[ historyView.lastSelectedViewId ] );
+ //this.debug( historyView.lastSelectedViewId, historyView.hdaViews[ historyView.lastSelectedViewId ] );
// shift will select a range, but not set lastSelectedViewId
if( ( event.shiftKey )
@@ -348,19 +348,19 @@
} else {
var id = hdaView.model.id;
historyView.lastSelectedViewId = id;
- //console.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
+ //this.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
selectedIds = [ id ];
}
- //console.debug( 'selectedIds:', selectedIds );
+ //this.debug( 'selectedIds:', selectedIds );
historyView.selectedHdaIds = _.union( historyView.selectedHdaIds, selectedIds );
//TODO: might want to use getSelectedHdaViews instead managing these lists with ops
- //console.debug( 'selected', historyView.selectedHdaIds );
+ //this.debug( 'selected', historyView.selectedHdaIds );
});
hdaView.on( 'de-selected', function( hdaView, event ){
- //console.debug( 'de-selected', event );
+ //this.debug( 'de-selected', event );
var id = hdaView.model.id;
historyView.selectedHdaIds = _.without( historyView.selectedHdaIds, id );
- //console.debug( 'de-selected', historyView.selectedHdaIds );
+ //this.debug( 'de-selected', historyView.selectedHdaIds );
});
},
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -8,7 +8,9 @@
], function( HISTORY_MODEL, HDA_LI, HDCA_LI, USER, BASE_MVC, _l ){
// ============================================================================
/** session storage for individual history preferences */
-var HistoryPrefs = BASE_MVC.SessionStorageModel.extend({
+var HistoryPrefs = BASE_MVC.SessionStorageModel.extend(
+/** @lends HistoryPrefs.prototype */{
+
defaults : {
//TODO:?? expandedHdas to array?
expandedHdas : {},
@@ -85,6 +87,7 @@
/** class to use for constructing the HDA views */
HDAViewClass : HDA_LI.HDAListItemView,
+ /** class to use for constructing the HDCA views */
HDCAViewClass : HDCA_LI.HDCAListItemView,
tagName : 'div',
@@ -753,17 +756,17 @@
this.storage.get( 'show_hidden' ),
this.filters
).each( function( hda ){
- //console.debug( 'checking: ', hda.get( 'name' ) );
+ //panel.debug( 'checking: ', hda.get( 'name' ) );
if( withinSet ){
- //console.debug( '\t\t adding: ', hda.get( 'name' ) );
+ //panel.debug( '\t\t adding: ', hda.get( 'name' ) );
set.push( panel.hdaViews[ hda.id ] );
if( hda === viewA.model || hda === viewB.model ){
- //console.debug( '\t found last: ', hda.get( 'name' ) );
+ //panel.debug( '\t found last: ', hda.get( 'name' ) );
withinSet = false;
}
} else {
if( hda === viewA.model || hda === viewB.model ){
- //console.debug( 'found first: ', hda.get( 'name' ) );
+ //panel.debug( 'found first: ', hda.get( 'name' ) );
withinSet = true;
set.push( panel.hdaViews[ hda.id ] );
}
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/packed/mvc/collection/collection-panel.js
--- a/static/scripts/packed/mvc/collection/collection-panel.js
+++ b/static/scripts/packed/mvc/collection/collection-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/collection/collection-model","mvc/collection/collection-li","mvc/base-mvc","utils/localization"],function(h,f,a,e){var d=Backbone.View.extend(a.LoggableMixin).extend({tagName:"div",className:"dataset-collection-panel",fxSpeed:"fast",DatasetDCEViewClass:f.DatasetDCEListItemView,NestedDCDCEViewClass:f.NestedDCDCEListItemView,initialize:function(i){i=i||{};if(i.logger){this.logger=i.logger}this.log(this+".initialize:",i);this.linkTarget=i.linkTarget||"_blank";this.hasUser=i.hasUser;this.panelStack=[];this.parentName=i.parentName;window.collectionPanel=this},_setUpListeners:function(){this.on("all",function(i){this.log(this+"",arguments)},this);return this},_setUpModelEventHandlers:function(){return this},render:function(k,l){this.log("render:",k,l);k=(k===undefined)?(this.fxSpeed):(k);var i=this,j;if(!this.model){return this}j=this.renderModel();$(i).queue("fx",[function(m){if(k&&i.$el.is(":visible")){i.$el.fadeOut(k,m)}else{m()}},function(m){i.$el.empty();if(j){i.$el.append(j.children())}m()},function(m){if(k&&!i.$el.is(":visible")){i.$el.fadeIn(k,m)}else{m()}},function(m){if(l){l.call(this)}i.trigger("rendered",this);m()}]);return this},renderModel:function(){var k=this.model.get("collection_type")||this.model.object.get("collection_type"),j=_.extend(this.model.toJSON(),{parentName:this.parentName,type:k}),i=$("<div/>").append(this.templates.panel(j));this._setUpBehaviours(i);this.renderContents(i);return i},_setUpBehaviours:function(i){i=i||this.$el;i.find("[title]").tooltip({placement:"bottom"});return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(i){return(i||this.$el).find(".datasets-list")},renderContents:function(j){j=j||this.$el;this.warn(this+".renderContents:, model:",this.model);var i=this,l={},k=this.model.getVisibleContents();this.$datasetsList(j).empty();if(k&&k.length){k.each(function(n){var o=n.id,m=i._createContentView(n);l[o]=m;i._attachContentView(m.render(),j)})}this.contentViews=l;return this.contentViews},_createContentView:function(k){var j=null,i=this._getContentClass(k);j=new i({model:k,linkTarget:this.linkTarget,hasUser:this.hasUser,logger:this.logger});this._setUpContentListeners(j);return j},_getContentClass:function(i){switch(i.get("element_type")){case"hda":return this.DatasetDCEViewClass;case"dataset_collection":return this.NestedDCDCEViewClass}throw new TypeError("Unknown element type:",i.get("element_type"))},_setUpContentListeners:function(j){var i=this;if(j.model.get("element_type")==="dataset_collection"){j.on("expanded",function(k){i.info("expanded",k);i._addCollectionPanel(k)})}},_addCollectionPanel:function(k){var l=this,i=k.model;var j=new c({model:i,parentName:this.model.get("name"),linkTarget:this.linkTarget});l.panelStack.push(j);l.$(".controls").add(".datasets-list").hide();l.$el.append(j.$el);j.on("close",function(){l.render();k.collapse();l.panelStack.pop()});if(!j.model.hasDetails()){var m=j.model.fetch();m.done(function(){j.render()})}else{j.render()}},_attachContentView:function(k,j){j=j||this.$el;var i=this.$datasetsList(j);i.append(k.$el);return this},events:{"click .navigation .back":"close"},close:function(i){this.$el.remove();this.trigger("close")},toString:function(){return"CollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});d.templates=d.prototype.templates=(function(){var i=_.template(['<div class="controls">','<div class="navigation">','<a class="back" href="javascript:void(0)">','<span class="fa fa-icon fa-angle-left"></span>',e("Back to "),"<%- collection.parentName %>","</a>","</div>",'<div class="title">','<div class="name"><%- collection.name || collection.element_identifier %></div>','<div class="subtitle">','<% if( collection.type === "list" ){ %>',e("a list of datasets"),'<% } else if( collection.type === "paired" ){ %>',e("a pair of datasets"),'<% } else if( collection.type === "list:paired" ){ %>',e("a list of paired datasets"),"<% } %>","</div>","</div>","</div>",'<div class="datasets-list"></div>'].join(""));return{panel:function(j){return i({_l:e,collection:j})}}}());var b=d.extend({DatasetDCEViewClass:f.DatasetDCEListItemView,toString:function(){return"ListCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var c=b.extend({toString:function(){return"PairCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var g=d.extend({NestedDCDCEViewClass:f.NestedDCDCEListItemView,toString:function(){return"ListOfPairsCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CollectionPanel:d,ListCollectionPanel:b,PairCollectionPanel:c,ListOfPairsCollectionPanel:g}});
\ No newline at end of file
+define(["mvc/collection/collection-model","mvc/collection/collection-li","mvc/base-mvc","utils/localization"],function(h,f,a,e){var d=Backbone.View.extend(a.LoggableMixin).extend({tagName:"div",className:"dataset-collection-panel",fxSpeed:"fast",DatasetDCEViewClass:f.DatasetDCEListItemView,NestedDCDCEViewClass:f.NestedDCDCEListItemView,initialize:function(i){i=i||{};if(i.logger){this.logger=i.logger}this.log(this+".initialize:",i);this.linkTarget=i.linkTarget||"_blank";this.hasUser=i.hasUser;this.panelStack=[];this.parentName=i.parentName},_setUpListeners:function(){this.on("all",function(i){this.log(this+"",arguments)},this);return this},_setUpModelEventHandlers:function(){return this},render:function(k,l){this.log("render:",k,l);k=(k===undefined)?(this.fxSpeed):(k);var i=this,j;if(!this.model){return this}j=this.renderModel();$(i).queue("fx",[function(m){if(k&&i.$el.is(":visible")){i.$el.fadeOut(k,m)}else{m()}},function(m){i.$el.empty();if(j){i.$el.append(j.children())}m()},function(m){if(k&&!i.$el.is(":visible")){i.$el.fadeIn(k,m)}else{m()}},function(m){if(l){l.call(this)}i.trigger("rendered",this);m()}]);return this},renderModel:function(){var k=this.model.get("collection_type")||this.model.object.get("collection_type"),j=_.extend(this.model.toJSON(),{parentName:this.parentName,type:k}),i=$("<div/>").append(this.templates.panel(j));this._setUpBehaviours(i);this.renderContents(i);return i},_setUpBehaviours:function(i){i=i||this.$el;i.find("[title]").tooltip({placement:"bottom"});return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(i){return(i||this.$el).find(".datasets-list")},renderContents:function(j){j=j||this.$el;this.warn(this+".renderContents:, model:",this.model);var i=this,l={},k=this.model.getVisibleContents();this.$datasetsList(j).empty();if(k&&k.length){k.each(function(n){var o=n.id,m=i._createContentView(n);l[o]=m;i._attachContentView(m.render(),j)})}this.contentViews=l;return this.contentViews},_createContentView:function(k){var j=null,i=this._getContentClass(k);j=new i({model:k,linkTarget:this.linkTarget,hasUser:this.hasUser,logger:this.logger});this._setUpContentListeners(j);return j},_getContentClass:function(i){switch(i.get("element_type")){case"hda":return this.DatasetDCEViewClass;case"dataset_collection":return this.NestedDCDCEViewClass}throw new TypeError("Unknown element type:",i.get("element_type"))},_setUpContentListeners:function(j){var i=this;if(j.model.get("element_type")==="dataset_collection"){j.on("expanded",function(k){i.info("expanded",k);i._addCollectionPanel(k)})}},_addCollectionPanel:function(k){var l=this,i=k.model;var j=new c({model:i,parentName:this.model.get("name"),linkTarget:this.linkTarget});l.panelStack.push(j);l.$(".controls").add(".datasets-list").hide();l.$el.append(j.$el);j.on("close",function(){l.render();k.collapse();l.panelStack.pop()});if(!j.model.hasDetails()){var m=j.model.fetch();m.done(function(){j.render()})}else{j.render()}},_attachContentView:function(k,j){j=j||this.$el;var i=this.$datasetsList(j);i.append(k.$el);return this},events:{"click .navigation .back":"close"},close:function(i){this.$el.remove();this.trigger("close")},toString:function(){return"CollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});d.templates=d.prototype.templates=(function(){var i=_.template(['<div class="controls">','<div class="navigation">','<a class="back" href="javascript:void(0)">','<span class="fa fa-icon fa-angle-left"></span>',e("Back to "),"<%- collection.parentName %>","</a>","</div>",'<div class="title">','<div class="name"><%- collection.name || collection.element_identifier %></div>','<div class="subtitle">','<% if( collection.type === "list" ){ %>',e("a list of datasets"),'<% } else if( collection.type === "paired" ){ %>',e("a pair of datasets"),'<% } else if( collection.type === "list:paired" ){ %>',e("a list of paired datasets"),"<% } %>","</div>","</div>","</div>",'<div class="datasets-list"></div>'].join(""));return{panel:function(j){return i({_l:e,collection:j})}}}());var b=d.extend({DatasetDCEViewClass:f.DatasetDCEListItemView,toString:function(){return"ListCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var c=b.extend({toString:function(){return"PairCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var g=d.extend({NestedDCDCEViewClass:f.NestedDCDCEListItemView,toString:function(){return"ListOfPairsCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CollectionPanel:d,ListCollectionPanel:b,PairCollectionPanel:c,ListOfPairsCollectionPanel:g}});
\ No newline at end of file
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/packed/mvc/dataset/dataset-model.js
--- a/static/scripts/packed/mvc/dataset/dataset-model.js
+++ b/static/scripts/packed/mvc/dataset/dataset-model.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var f=b.SearchableModelMixin;var e=Backbone.Model.extend(b.LoggableMixin).extend(b.mixin(f,{defaults:{state:a.NEW,deleted:false,purged:false,name:"(unnamed dataset)",accessible:true,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(h,g){this.debug("Dataset.initialize",h,g);if(!this.get("accessible")){this.set("state",a.NOT_VIEWABLE)}this.urls=this._generateUrls();this._setUpListeners()},_generateUrls:function(){var i=this.get("id");if(!i){return{}}var h={purge:"datasets/"+i+"/purge_async",display:"datasets/"+i+"/display/?preview=True",edit:"datasets/"+i+"/edit",download:"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:"dataset/errors?id="+i,rerun:"tool_runner/rerun?id="+i,show_params:"datasets/"+i+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};var g=(galaxy_config&&galaxy_config.root)?(galaxy_config.root):("/");_.each(h,function(k,j){h[j]=g+k});this.urls=h;return h},_setUpListeners:function(){this.on("change:state",function(h,g){this.log(this+" has changed state:",h,g);if(this.inReadyState()){this.trigger("state:ready",h,g,this.previous("state"))}});this.on("change:id change:file_ext",function(g){this._generateUrls()})},toJSON:function(){var g=Backbone.Model.prototype.toJSON.call(this);return _.extend(g,{urls:this.urls})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var g=_.contains(a.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||g)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function(g){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},g)},undelete:function(g){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},g)},purge:function d(g){if(this.get("purged")){return jQuery.when()}g=g||{};g.url=this.urls.purge;var h=this,i=jQuery.ajax(g);i.done(function(l,j,k){h.set({deleted:true,purged:true})});i.fail(function(n,j,m){var k=c("Unable to purge dataset");var l=("Removal of datasets by users is not allowed in this Galaxy instance");if(n.responseJSON&&n.responseJSON.error){k=n.responseJSON.error}else{if(n.responseText.indexOf(l)!==-1){k=l}}n.responseText=k;h.trigger("error",h,n,g,c(k),{error:k})});return i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var g=this.get("id")||"";if(this.get("name")){g='"'+this.get("name")+'",'+g}return"Dataset("+g+")"}}));return{DatasetAssociation:e}});
\ No newline at end of file
+define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var f=b.SearchableModelMixin;var e=Backbone.Model.extend(b.LoggableMixin).extend(b.mixin(f,{defaults:{state:a.NEW,deleted:false,purged:false,name:"(unnamed dataset)",accessible:true,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(g,h){this.debug(this+"(Dataset).initialize",g,h);if(!this.get("accessible")){this.set("state",a.NOT_VIEWABLE)}this.urls=this._generateUrls();this._setUpListeners()},_generateUrls:function(){var i=this.get("id");if(!i){return{}}var h={purge:"datasets/"+i+"/purge_async",display:"datasets/"+i+"/display/?preview=True",edit:"datasets/"+i+"/edit",download:"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:"dataset/errors?id="+i,rerun:"tool_runner/rerun?id="+i,show_params:"datasets/"+i+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};var g=(galaxy_config&&galaxy_config.root)?(galaxy_config.root):("/");_.each(h,function(k,j){h[j]=g+k});this.urls=h;return h},_setUpListeners:function(){this.on("change:state",function(h,g){this.log(this+" has changed state:",h,g);if(this.inReadyState()){this.trigger("state:ready",h,g,this.previous("state"))}});this.on("change:id change:file_ext",function(g){this._generateUrls()})},toJSON:function(){var g=Backbone.Model.prototype.toJSON.call(this);return _.extend(g,{urls:this.urls})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var g=_.contains(a.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||g)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function(g){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},g)},undelete:function(g){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},g)},purge:function d(g){if(this.get("purged")){return jQuery.when()}g=g||{};g.url=this.urls.purge;var h=this,i=jQuery.ajax(g);i.done(function(l,j,k){h.set({deleted:true,purged:true})});i.fail(function(n,j,m){var k=c("Unable to purge dataset");var l=("Removal of datasets by users is not allowed in this Galaxy instance");if(n.responseJSON&&n.responseJSON.error){k=n.responseJSON.error}else{if(n.responseText.indexOf(l)!==-1){k=l}}n.responseText=k;h.trigger("error",h,n,g,c(k),{error:k})});return i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var g=this.get("id")||"";if(this.get("name")){g='"'+this.get("name")+'",'+g}return"Dataset("+g+")"}}));return{DatasetAssociation:e}});
\ No newline at end of file
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/packed/mvc/history/history-contents.js
--- a/static/scripts/packed/mvc/history/history-contents.js
+++ b/static/scripts/packed/mvc/history/history-contents.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-content-model","mvc/history/hda-model","mvc/history/hdca-model","mvc/base-mvc","utils/localization"],function(g,e,b,a,c){var f=Backbone.Collection.extend(a.LoggableMixin).extend({model:function(i,h){if(i.history_content_type==="dataset"){return new e.HistoryDatasetAssociation(i,h)}else{if(i.history_content_type==="dataset_collection"){switch(i.collection_type){case"list":return new b.HistoryListDatasetCollection(i,h);case"paired":return new b.HistoryPairDatasetCollection(i,h);case"list:paired":return new b.HistoryListPairedDatasetCollection(i,h)}throw new TypeError("Unknown collection_type: "+i.collection_type)}}throw new TypeError("Unknown history_content_type: "+i.history_content_type)},initialize:function(i,h){h=h||{};this.historyId=h.historyId;this.on("all",function(){this.debug(this+".event:",arguments)})},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},ids:function(){return this.map(function(h){return h.get("id")})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(j){var i=!j.inReadyState();if(i){h.push(j.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];this.debug("checking isVisible");var i=new f(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new f(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(m){var l=m.attributes||m,n=g.typeIdStr(l.history_content_type,l.id),o=i.get(n);if(!o){return m}var k=o.toJSON();_.extend(k,m);return k});Backbone.Collection.prototype.set.call(this,j,h)},promoteToHistoryDatasetCollection:function d(m,k,i){i=i||{};i.url=this.url();i.type="POST";var o=k;var l=[],h=null;if(k==="list"){this.chain().each(function(r){var p=r.attributes.name;var s=r.get("id");var q=r.attributes.history_content_type;if(q==="dataset"){if(o!=="list"){this.log("Invalid collection type")}l.push({name:p,src:"hda",id:s})}else{if(o==="list"){o="list:"+r.attributes.collection_type}else{if(o!=="list:"+r.attributes.collection_type){this.log("Invalid collection type")}}l.push({name:p,src:"hdca",id:s})}});h="New Dataset List"}else{if(k==="paired"){var j=this.ids();if(j.length!==2){}l.push({name:"forward",src:"hda",id:j[0]});l.push({name:"reverse",src:"hda",id:j[1]});h="New Dataset Pair"}}i.data={type:"dataset_collection",name:h,collection_type:o,element_identifiers:JSON.stringify(l)};var n=jQuery.ajax(i);n.done(function(r,p,q){m.refresh()});n.fail(function(r,p,q){if(r.responseJSON&&r.responseJSON.error){error=r.responseJSON.error}else{error=r.responseJSON}r.responseText=error});return n},print:function(){var h=this;h.each(function(i){h.debug(i);if(i.elements){h.debug("\t elements:",i.elements)}})},toString:function(){return(["HistoryContents(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryContents:f}});
\ No newline at end of file
+define(["mvc/history/history-content-model","mvc/history/hda-model","mvc/history/hdca-model","mvc/base-mvc","utils/localization"],function(g,e,b,a,c){var f=Backbone.Collection.extend(a.LoggableMixin).extend({model:function(i,h){if(i.history_content_type==="dataset"){return new e.HistoryDatasetAssociation(i,h)}else{if(i.history_content_type==="dataset_collection"){switch(i.collection_type){case"list":return new b.HistoryListDatasetCollection(i,h);case"paired":return new b.HistoryPairDatasetCollection(i,h);case"list:paired":return new b.HistoryListPairedDatasetCollection(i,h)}throw new TypeError("Unknown collection_type: "+i.collection_type)}}throw new TypeError("Unknown history_content_type: "+i.history_content_type)},initialize:function(i,h){h=h||{};this.historyId=h.historyId;this.on("all",function(){this.debug(this+".event:",arguments)})},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},ids:function(){return this.map(function(h){return h.get("id")})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(j){var i=!j.inReadyState();if(i){h.push(j.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];this.debug("checking isVisible");var i=new f(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new f(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(m,j){var i=jQuery.Deferred(),h=this.length,l=[];if(!h){i.resolve([]);return i}var k=this.chain().reverse().map(function(o,n){return function(){var p=m.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){l.push(q);if(k.length){k.shift()()}else{i.resolve(l)}})}}).value();k.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(m){var l=m.attributes||m,n=g.typeIdStr(l.history_content_type,l.id),o=i.get(n);if(!o){return m}var k=o.toJSON();_.extend(k,m);return k});Backbone.Collection.prototype.set.call(this,j,h)},promoteToHistoryDatasetCollection:function d(m,k,i){i=i||{};i.url=this.url();i.type="POST";var o=k;var l=[],h=null;if(k==="list"){this.chain().each(function(r){var p=r.attributes.name;var s=r.get("id");var q=r.attributes.history_content_type;if(q==="dataset"){if(o!=="list"){this.log("Invalid collection type")}l.push({name:p,src:"hda",id:s})}else{if(o==="list"){o="list:"+r.attributes.collection_type}else{if(o!=="list:"+r.attributes.collection_type){this.log("Invalid collection type")}}l.push({name:p,src:"hdca",id:s})}});h="New Dataset List"}else{if(k==="paired"){var j=this.ids();if(j.length!==2){}l.push({name:"forward",src:"hda",id:j[0]});l.push({name:"reverse",src:"hda",id:j[1]});h="New Dataset Pair"}}i.data={type:"dataset_collection",name:h,collection_type:o,element_identifiers:JSON.stringify(l)};var n=jQuery.ajax(i);n.done(function(r,p,q){m.refresh()});n.fail(function(r,p,q){if(r.responseJSON&&r.responseJSON.error){error=r.responseJSON.error}else{error=r.responseJSON}r.responseText=error});return n},print:function(){var h=this;h.each(function(i){h.debug(i);if(i.elements){h.debug("\t elements:",i.elements)}})},toString:function(){return(["HistoryContents(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryContents:f}});
\ No newline at end of file
diff -r 588c521575605b698ee15376f3b919f6a2cda20c -r a94473459ebb4749a375420492d6da9a948ccd3a static/scripts/packed/mvc/history/history-panel-annotated.js
--- a/static/scripts/packed/mvc/history/history-panel-annotated.js
+++ b/static/scripts/packed/mvc/history/history-panel-annotated.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-panel","mvc/history/hda-li","utils/localization"],function(e,b,a){var d=e.ReadOnlyHistoryPanel;var c=d.extend({className:"annotated-history-panel",HDAViewClass:b.HDAReadonlyListItemView,renderModel:function(){this.$el.addClass(this.className);var h=d.prototype.renderModel.call(this),f=this.$datasetsList(h),g=$("<table/>").addClass("datasets-list datasets-table");g.append(f.children());f.replaceWith(g);h.find(".history-subtitle").after(this.renderHistoryAnnotation());h.find(".history-search-btn").hide();h.find(".history-controls").after(h.find(".history-search-controls").show());return h},renderHistoryAnnotation:function(){var f=this.model.get("annotation");if(!f){return null}return $(['<div class="history-annotation">',f,"</div>"].join(""))},renderHdas:function(g){g=g||this.$el;var f=d.prototype.renderHdas.call(this,g);this.$datasetsList(g).prepend($("<tr/>").addClass("headers").append([$("<th/>").text(a("Dataset")),$("<th/>").text(a("Annotation"))]));return f},attachContentView:function(i,g){g=g||this.$el;var j=_.find(i.el.classList,function(k){return(/^state\-/).test(k)}),f=i.model.get("annotation")||"",h=$("<tr/>").addClass("dataset-row").append([$("<td/>").addClass("dataset-container").append(i.$el).addClass(j?j.replace("-","-color-"):""),$("<td/>").addClass("additional-info").text(f)]);this.$datasetsList(g).append(h)},events:_.extend(_.clone(d.prototype.events),{"click tr":function(f){$(f.currentTarget).find(".dataset-title-bar").click()},"click .icon-btn":function(f){f.stopPropagation()}}),toString:function(){return"AnnotatedHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{AnnotatedHistoryPanel:c}});
\ No newline at end of file
+define(["mvc/history/history-panel","mvc/history/hda-li","utils/localization"],function(e,b,a){var d=e.ReadOnlyHistoryPanel;var c=d.extend({className:"annotated-history-panel",renderModel:function(){this.$el.addClass(this.className);var h=d.prototype.renderModel.call(this),f=this.$datasetsList(h),g=$("<table/>").addClass("datasets-list datasets-table");g.append(f.children());f.replaceWith(g);h.find(".history-subtitle").after(this.renderHistoryAnnotation());h.find(".history-search-btn").hide();h.find(".history-controls").after(h.find(".history-search-controls").show());return h},renderHistoryAnnotation:function(){var f=this.model.get("annotation");if(!f){return null}return $(['<div class="history-annotation">',f,"</div>"].join(""))},renderHdas:function(g){g=g||this.$el;var f=d.prototype.renderHdas.call(this,g);this.$datasetsList(g).prepend($("<tr/>").addClass("headers").append([$("<th/>").text(a("Dataset")),$("<th/>").text(a("Annotation"))]));return f},attachContentView:function(i,g){g=g||this.$el;var j=_.find(i.el.classList,function(k){return(/^state\-/).test(k)}),f=i.model.get("annotation")||"",h=$("<tr/>").addClass("dataset-row").append([$("<td/>").addClass("dataset-container").append(i.$el).addClass(j?j.replace("-","-color-"):""),$("<td/>").addClass("additional-info").text(f)]);this.$datasetsList(g).append(h)},events:_.extend(_.clone(d.prototype.events),{"click tr":function(f){$(f.currentTarget).find(".dataset-title-bar").click()},"click .icon-btn":function(f){f.stopPropagation()}}),toString:function(){return"AnnotatedHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{AnnotatedHistoryPanel:c}});
\ 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