Skip to content

Commit

Permalink
Merge branch 'release_15.10' into dev
Browse files Browse the repository at this point in the history
Conflicts:
	lib/galaxy/web/framework/middleware/remoteuser.py
  • Loading branch information
martenson committed Oct 9, 2015
2 parents f10047c + 38b9ca3 commit fae21e3
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 38 deletions.
20 changes: 20 additions & 0 deletions client/galaxy/scripts/mvc/collection/collection-li-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ var DCEListItemEdit = DCEListItemView.extend(


//==============================================================================
// NOTE: this does not inherit from DatasetDCEListItemView as you would expect
//TODO: but should - if we can find something simpler than using diamond
/** @class Editable view for a DatasetCollectionElement that is also an DatasetAssociation
* (a dataset contained in a dataset collection).
*/
Expand All @@ -70,6 +72,24 @@ var DatasetDCEListItemEdit = DATASET_LI_EDIT.DatasetListItemEdit.extend(
DATASET_LI_EDIT.DatasetListItemEdit.prototype.initialize.call( this, attributes );
},

// NOTE: this does not inherit from DatasetDCEListItemView - so we duplicate this here
//TODO: fix
/** In this override, only get details if in the ready state.
* Note: fetch with no 'change' event triggering to prevent automatic rendering.
*/
_fetchModelDetails : function(){
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });
}
return jQuery.when();
},

/** Override to remove delete button */
_renderDeleteButton : function(){
return null;
},

// ......................................................................... misc
/** String representation */
toString : function(){
Expand Down
11 changes: 11 additions & 0 deletions client/galaxy/scripts/mvc/collection/collection-li.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ var DatasetDCEListItemView = DATASET_LI.DatasetListItemView.extend(
DATASET_LI.DatasetListItemView.prototype.initialize.call( this, attributes );
},

/** In this override, only get details if in the ready state.
* Note: fetch with no 'change' event triggering to prevent automatic rendering.
*/
_fetchModelDetails : function(){
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });
}
return jQuery.when();
},

// ......................................................................... misc
/** String representation */
toString : function(){
Expand Down
20 changes: 15 additions & 5 deletions client/galaxy/scripts/mvc/collection/collection-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,16 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend( BASE_MVC.mixin( Datase
/** logger used to record this.log messages, commonly set to console */
//logger : console,

/** root api url */
urlRoot : (( window.galaxy_config && galaxy_config.root )?( galaxy_config.root ):( '/' )) + 'api/datasets',

/** url fn */
url : function(){
return this.urlRoot + '/' + this.id;
var galaxyRoot = (( window.galaxy_config && galaxy_config.root )?( galaxy_config.root ):( '/' ));
// won't always be an hda
if( !this.has( 'history_id' ) ){
console.warn( 'no endpoint for non-hdas within a collection yet' );
// (a little silly since this api endpoint *also* points at hdas)
return galaxyRoot + 'api/datasets';
}
return galaxyRoot + 'api/histories/' + this.get( 'history_id' ) + '/contents/' + this.get( 'id' );
},

defaults : _.extend( {},
Expand All @@ -141,7 +145,7 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend( BASE_MVC.mixin( Datase

// 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
// - re-apply manually for now
/** call the mixin constructor */
constructor : function( attributes, options ){
this.debug( '\t DatasetDCE.constructor:', attributes, options );
Expand All @@ -156,6 +160,12 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend( BASE_MVC.mixin( Datase
DATASET_MODEL.DatasetAssociation.prototype.initialize.call( this, attributes, options );
},

/** Does this model already contain detailed data (as opposed to just summary level data)? */
hasDetails : function(){
// dataset collection api does return genome_build but doesn't return annotation
return _.has( this.attributes, 'annotation' );
},

/** String representation. */
toString : function(){
var objStr = this.get( 'element_identifier' );
Expand Down
19 changes: 0 additions & 19 deletions client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,6 @@ var DatasetListItemEdit = _super.extend(
},

// ......................................................................... details
/** In this override, only get details if in the ready state, get rerunnable if in other states.
* Note: fetch with no 'change' event triggering to prevent automatic rendering.
*/
_fetchModelDetails : function(){
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });

// special case the need for the rerunnable and creating_job attributes
// needed for rendering re-run button on queued, running datasets
} else if( !view.model.has( 'rerunnable' ) ){
return view.model.fetch({ silent: true, data: {
// only fetch rerunnable and creating_job to keep overhead down
keys: [ 'rerunnable', 'creating_job' ].join(',')
}});
}
return jQuery.when();
},

/** In this override, add tags and annotations controls, make the ? dbkey a link to editing page */
_renderDetails : function(){
//TODO: generalize to be allow different details for each state
Expand Down
21 changes: 19 additions & 2 deletions client/galaxy/scripts/mvc/history/hda-li-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,30 @@ var HDAListItemEdit = _super.extend(

className : _super.prototype.className + " history-content",

// ......................................................................... events
/** In this override, only get details if in the ready state, get rerunnable if in other states.
* Note: fetch with no 'change' event triggering to prevent automatic rendering.
*/
_fetchModelDetails : function(){
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });

// special case the need for the rerunnable and creating_job attributes
// needed for rendering re-run button on queued, running datasets
} else if( !view.model.has( 'rerunnable' ) ){
return view.model.fetch({ silent: true, data: {
// only fetch rerunnable and creating_job to keep overhead down
keys: [ 'rerunnable', 'creating_job' ].join(',')
}});
}
return jQuery.when();
},

/** event map */
events : _.extend( _.clone( _super.prototype.events ), {
'click .unhide-link' : function( ev ){ this.model.unhide(); return false; }
}),

// ......................................................................... misc
/** string rep */
toString : function(){
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/collection/collection-li-edit.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/maps/mvc/collection/collection-li.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fae21e3

Please sign in to comment.