mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
UI, Pair creator: handle invalid selections better, clean up, document; revert history.mako as a test bed
This commit is contained in:
@@ -9,6 +9,11 @@ define([
|
||||
"ui/hoverhighlight"
|
||||
], function( HDCA, STATES, BASE_MVC, UI_MODAL, naturalSort, _l ){
|
||||
/*==============================================================================
|
||||
TODO:
|
||||
use proper Element model and not just json
|
||||
straighten out createFn, collection.createHDCA
|
||||
possibly stop using modals for this
|
||||
It would be neat to do a drag and drop
|
||||
|
||||
==============================================================================*/
|
||||
/** A view for both DatasetDCEs and NestedDCDCEs
|
||||
@@ -327,15 +332,7 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
|
||||
|
||||
/** build and show an alert describing any elements that could not be included due to problems */
|
||||
_invalidElementsAlert : function(){
|
||||
var message = _l( 'The following selections could not be included due to problems' ) + ':';
|
||||
message += '<ul>';
|
||||
message += this.invalidElements.map( function( problem ){
|
||||
return [
|
||||
'<li><b>', problem.element.name, '</b>: ', problem.text, '</li>'
|
||||
].join( '' );
|
||||
}).join( '' );
|
||||
message += '</ul>';
|
||||
this._showAlert( message, 'alert-warning' );
|
||||
this._showAlert( this.templates.invalidElements({ problems: this.invalidElements }), 'alert-warning' );
|
||||
},
|
||||
|
||||
/** add (or clear if clear is truthy) a validation warning to the DOM element described in what */
|
||||
@@ -445,12 +442,7 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
|
||||
|
||||
/** render a message in the list that no elements remain to create a collection */
|
||||
_renderNoElementsLeft : function(){
|
||||
var $message = $( '<li class="no-elements-left-message empty-message"></li>' );
|
||||
$message.html([
|
||||
_l( 'No elements left' ), '<br />', _l( 'Would you like to ' ),
|
||||
'<a class="reset" href="javascript:void(0)">', _l( 'start over' ), '</a>?'
|
||||
].join( '' ));
|
||||
this.$( '.collection-elements' ).append( $message );
|
||||
this.$( '.collection-elements' ).append( this.templates.noElementsLeft() );
|
||||
},
|
||||
|
||||
/** render a message in the list that no valid elements were found to create a collection */
|
||||
@@ -782,7 +774,7 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
|
||||
main : _.template([
|
||||
'<div class="header flex-row no-flex"></div>',
|
||||
'<div class="middle flex-row flex-row-container"></div>',
|
||||
'<div class="footer flex-row no-flex">'
|
||||
'<div class="footer flex-row no-flex"></div>'
|
||||
].join('')),
|
||||
|
||||
/** the header (not including help text) */
|
||||
@@ -880,6 +872,14 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
|
||||
].join( '' )), '</p>'
|
||||
].join('')),
|
||||
|
||||
/** shown in list when all elements are discarded */
|
||||
invalidElements : _.template([
|
||||
_l( 'The following selections could not be included due to problems' ),
|
||||
'<ul><% _.each( problems, function( problem ){ %>',
|
||||
'<li><b><%= problem.element.name %></b>: <%= problem.text %></li>',
|
||||
'<% }); %></ul>'
|
||||
].join('')),
|
||||
|
||||
/** shown in list when all elements are discarded */
|
||||
noElementsLeft : _.template([
|
||||
'<li class="no-elements-left-message empty-message">',
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
define([
|
||||
"mvc/collection/list-collection-creator",
|
||||
"mvc/history/hdca-model",
|
||||
"mvc/ui/error-modal",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( LIST_CREATOR, HDCA, errorModal, BASE_MVC, _l ){
|
||||
], function( LIST_CREATOR, HDCA, BASE_MVC, _l ){
|
||||
/*==============================================================================
|
||||
TODO:
|
||||
the paired creator doesn't really mesh with the list creator as parent
|
||||
it may be better to make an abstract super class for both
|
||||
composites may inherit from this (or vis-versa)
|
||||
PairedDatasetCollectionElementView doesn't make a lot of sense
|
||||
|
||||
==============================================================================*/
|
||||
/** */
|
||||
@@ -58,53 +62,75 @@ var PairCollectionCreator = _super.extend({
|
||||
collectionClass : HDCA.HistoryPairDatasetCollection,
|
||||
className : 'pair-collection-creator collection-creator flex-row-container',
|
||||
|
||||
/** mangle duplicate names using a mac-like '(counter)' addition to any duplicates */
|
||||
_mangleDuplicateNames : function(){
|
||||
/** override to no-op */
|
||||
_mangleDuplicateNames : function(){},
|
||||
|
||||
// TODO: this whole pattern sucks. There needs to be two classes of problem area:
|
||||
// bad inital choices and
|
||||
// when the user has painted his/her self into a corner during creation/use-of-the-creator
|
||||
/** render the entire interface */
|
||||
render : function( speed, callback ){
|
||||
var elementsLength = this.workingElements.length;
|
||||
if( elementsLength === 2 ){
|
||||
return _super.prototype.render.call( this, speed, callback );
|
||||
}
|
||||
return this._renderInvalid( speed, callback );
|
||||
},
|
||||
|
||||
/** render a simplified interface aimed at telling the user why they can't move forward */
|
||||
_renderInvalid : function( speed, callback ){
|
||||
//this.debug( '-- _render' );
|
||||
this.$el.empty().html( this.templates.invalidInitial({
|
||||
problems: this.invalidElements,
|
||||
elements: this.workingElements,
|
||||
}));
|
||||
if( typeof this.oncancel === 'function' ){
|
||||
this.$( '.cancel-create.btn' ).show();
|
||||
}
|
||||
this.trigger( 'rendered', this );
|
||||
return this;
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ rendering elements
|
||||
/** render the elements in order (or a warning if no elements found) */
|
||||
/** render forward/reverse */
|
||||
_renderList : function( speed, callback ){
|
||||
//this.debug( '-- _renderList' );
|
||||
//precondition: there are two valid elements in workingElements
|
||||
var creator = this,
|
||||
$tmp = jQuery( '<div/>' );
|
||||
$tmp = jQuery( '<div/>' ),
|
||||
$list = creator.$list();
|
||||
|
||||
// lose the original views, create the new, append all at once, then call their renders
|
||||
_.each( this.elementViews, function( view ){
|
||||
view.destroy();
|
||||
creator.removeElementView( view );
|
||||
});
|
||||
|
||||
if( this.workingElements.length < 2 ){
|
||||
this._renderNoValidElements();
|
||||
return;
|
||||
}
|
||||
$tmp.append( creator._createForwardElementView().$el );
|
||||
$tmp.append( creator._createReverseElementView().$el );
|
||||
creator.$list().empty().append( $tmp.children() );
|
||||
$list.empty().append( $tmp.children() );
|
||||
_.invoke( creator.elementViews, 'render' );
|
||||
},
|
||||
|
||||
/** create the forward element view */
|
||||
_createForwardElementView : function(){
|
||||
var element = this.workingElements[0],
|
||||
view = this._createElementView( element );
|
||||
view.identifier = _l( 'Forward' );
|
||||
return view;
|
||||
return this._createElementView( this.workingElements[0], { identifier: 'forward' } );
|
||||
},
|
||||
|
||||
/** create the forward element view */
|
||||
_createReverseElementView : function(){
|
||||
var element = this.workingElements[1],
|
||||
view = this._createElementView( element );
|
||||
view.identifier = _l( 'Reverse' );
|
||||
return view;
|
||||
return this._createElementView( this.workingElements[1], { identifier: 'reverse' } );
|
||||
},
|
||||
|
||||
/** listen to any element events */
|
||||
_listenToElementView : function( view ){
|
||||
// var creator = this;
|
||||
// creator.listenTo( view, {
|
||||
// });
|
||||
/** create an element view, cache in elementViews, and return */
|
||||
_createElementView : function( element, options ){
|
||||
var elementView = new this.elementViewClass( _.extend( options, {
|
||||
element : element,
|
||||
}));
|
||||
this.elementViews.push( elementView );
|
||||
return elementView;
|
||||
},
|
||||
|
||||
/** swap the forward, reverse elements and re-render */
|
||||
swap : function(){
|
||||
this.workingElements = [
|
||||
this.workingElements[1],
|
||||
@@ -114,7 +140,7 @@ var PairCollectionCreator = _super.extend({
|
||||
},
|
||||
|
||||
events : _.extend( _.clone( _super.prototype.events ), {
|
||||
'click .swap' : 'swap',
|
||||
'click .swap' : 'swap',
|
||||
}),
|
||||
|
||||
// ------------------------------------------------------------------------ templates
|
||||
@@ -155,7 +181,45 @@ var PairCollectionCreator = _super.extend({
|
||||
'Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ',
|
||||
'click <i data-target=".create-collection">"Create list"</i>.'
|
||||
].join( '' )), '</p>'
|
||||
].join(''))
|
||||
].join('')),
|
||||
|
||||
/** a simplified page communicating what went wrong and why the user needs to reselect something else */
|
||||
invalidInitial : _.template([
|
||||
'<div class="header flex-row no-flex">',
|
||||
'<div class="alert alert-warning" style="display: block">',
|
||||
'<span class="alert-message">',
|
||||
'<% if( _.size( problems ) ){ %>',
|
||||
_l( 'The following selections could not be included due to problems' ),
|
||||
'<ul><% _.each( problems, function( problem ){ %>',
|
||||
'<li><b><%= problem.element.name %></b>: <%= problem.text %></li>',
|
||||
'<% }); %></ul>',
|
||||
'<% } else if( _.size( elements ) < 2 ){ %>',
|
||||
_l( 'Not enough datasets were selected' ), ': <%= _.size( elements ) %>',
|
||||
'<% } else if( _.size( elements ) > 2 ){ %>',
|
||||
_l( 'Too many datasets were selected' ), ': <%= _.pluck( elements, "name" ) %>',
|
||||
'<% } %>',
|
||||
'</span>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'<div class="middle flex-row flex-row-container">',
|
||||
'<div class="collection-elements scroll-container flex-row">',
|
||||
'<li class="pair-needs-2-message empty-message">',
|
||||
_l( 'Two (and only two) elements are needed for the pair' ), '. ',
|
||||
_l( 'You may need to ' ),
|
||||
'<a class="cancel-create" href="javascript:void(0)">', _l( 'cancel' ), '</a> ',
|
||||
_l( 'and reselect new elements' ), '.',
|
||||
'</li>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'<div class="footer flex-row no-flex">',
|
||||
'<div class="actions clear vertically-spaced">',
|
||||
'<div class="other-options pull-left">',
|
||||
'<button class="cancel-create btn" tabindex="-1">', _l( 'Cancel' ), '</button>',
|
||||
// _l( 'Create a different kind of collection' ),
|
||||
'</div>',
|
||||
'</div>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
}),
|
||||
|
||||
// ------------------------------------------------------------------------ misc
|
||||
@@ -178,14 +242,6 @@ var pairCollectionCreatorModal = function _pairCollectionCreatorModal( elements,
|
||||
* @returns {Deferred} resolved when the collection is added to the history.
|
||||
*/
|
||||
function createPairCollection( contents ){
|
||||
if( contents.length !== 2 ){
|
||||
errorModal(
|
||||
'When pairing datasets, select only two datasets: one forward and one reverse.',
|
||||
'Not a valid pair'
|
||||
);
|
||||
return jQuery.Deferred().reject( 'invalid pair' );
|
||||
}
|
||||
|
||||
var elements = contents.toJSON(),
|
||||
promise = pairCollectionCreatorModal( elements, {
|
||||
creationFn : function( elements, name ){
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"pair-collection-creator.js","sources":["../../../src/mvc/collection/pair-collection-creator.js"],"names":["define","LIST_CREATOR","HDCA","errorModal","BASE_MVC","_l","createPairCollection","contents","length","jQuery","Deferred","reject","elements","toJSON","promise","pairCollectionCreatorModal","creationFn","name","src","id","createHDCA","PairedDatasetCollectionElementView","Backbone","View","extend","LoggableMixin","tagName","className","initialize","attributes","this","element","identifier","render","$el","attr","html","template","_","join","destroy","off","remove","toString","_super","ListCollectionCreator","PairCollectionCreator","elementViewClass","collectionClass","HistoryPairDatasetCollection","_mangleDuplicateNames","_renderList","creator","$tmp","each","elementViews","view","removeElementView","workingElements","_renderNoValidElements","append","_createForwardElementView","_createReverseElementView","$list","empty","children","invoke","_createElementView","_listenToElementView","swap","events","clone","prototype","click .swap","templates","middle","helpContent","options","title","collectionCreatorModal"],"mappings":"AAAAA,QACI,yCACA,yBACA,qBACA,eACA,sBACD,SAAUC,EAAcC,EAAMC,EAAYC,EAAUC,GA6KvD,QAASC,GAAsBC,GAC3B,GAAwB,IAApBA,EAASC,OAKT,MAJAL,GACI,gFACA,oBAEGM,OAAOC,WAAWC,OAAQ,eAGrC,IAAIC,GAAWL,EAASM,SACpBC,EAAUC,EAA4BH,GAClCI,WAAa,SAAUJ,EAAUK,GAK7B,MAJAL,KACMK,KAAM,UAAWC,IAAK,MAAOC,GAAIP,EAAS,GAAGO,KAC7CF,KAAM,UAAWC,IAAK,MAAOC,GAAIP,EAAS,GAAGO,KAE5CZ,EAASa,WAAYR,EAAU,SAAUK,KAG5D,OAAOH,GA3LX,GAAIO,GAAqCC,SAASC,KAAKC,OAAQpB,EAASqB,eAAgBD,QAEpFE,QAAc,KACdC,UAAc,qBAEdC,WAAa,SAAUC,GACnBC,KAAKC,QAAUF,EAAWE,YAC1BD,KAAKE,WAAaH,EAAWG,YAGjC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AYpC,EAAEd,OAAQc,EAAEiC,MAAO3B,EAAO4B,UAAUE,YAE5CC,OAASrC,EAAED,UACP,6CACI,qDAAsDhC,EAAI,qCAAuC,KAC7FA,EAAI,QACR,OACJ,SACA,8DACA,UACFkC,KAAK,KAGPqC,YAActC,EAAED,UACZ,MAAOhC,GACH,oGACA,8FACA,oFACA,+EACFkC,KAAM,KAAO,OACf,OACI,OAAQlC,GACJ,6FACA,oCACFkC,KAAM,KAAO,QACf,OAAQlC,GACJ,wFACFkC,KAAM,KAAO,QACnB,cACA,MAAOlC,GACH,4FACA,gEACFkC,KAAM,KAAO,QACjBA,KAAK,OAKXI,SAAW,WAAY,MAAO,2BAM9B5B,EAA6B,SAAsCH,EAAUiE,GAG7E,MAFAA,GAAUA,MACVA,EAAQC,MAAQzE,EAAI,+CACbJ,EAAa8E,uBAAwBnE,EAAUiE,EAAS/B,GA+B/D,QACIA,sBAA8BA,EAC9B/B,2BAA8BA,EAC9BT,qBAA8BA"}
|
||||
{"version":3,"file":"pair-collection-creator.js","sources":["../../../src/mvc/collection/pair-collection-creator.js"],"names":["define","LIST_CREATOR","HDCA","BASE_MVC","_l","createPairCollection","contents","elements","toJSON","promise","pairCollectionCreatorModal","creationFn","name","src","id","createHDCA","PairedDatasetCollectionElementView","Backbone","View","extend","LoggableMixin","tagName","className","initialize","attributes","this","element","identifier","render","$el","attr","html","template","_","join","destroy","off","remove","toString","_super","ListCollectionCreator","PairCollectionCreator","elementViewClass","collectionClass","HistoryPairDatasetCollection","_mangleDuplicateNames","speed","callback","elementsLength","workingElements","length","prototype","call","_renderInvalid","empty","templates","invalidInitial","problems","invalidElements","oncancel","$","show","trigger","_renderList","creator","$tmp","jQuery","$list","each","elementViews","view","removeElementView","append","_createForwardElementView","_createReverseElementView","children","invoke","_createElementView","options","elementView","push","swap","events","clone","click .swap","middle","helpContent","title","collectionCreatorModal"],"mappings":"AAAAA,QACI,yCACA,yBACA,eACA,sBACD,SAAUC,EAAcC,EAAMC,EAAU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,KAAK,KAGPsB,eAAiBvB,EAAED,UACf,wCACI,2DACI,+BACI,kCACI5B,EAAI,kEACJ,mDACI,mEACJ,iBACJ,6CACIA,EAAI,qCAAuC,8BAC/C,6CACIA,EAAI,mCAAqC,uCAC7C,UACJ,UACJ,SACJ,SACA,mDACI,8DACI,kDACIA,EAAI,uDAAyD,KAC7DA,EAAI,oBACJ,sDAAuDA,EAAI,UAAY,QACvEA,EAAI,6BAA+B,IACvC,QACJ,SACJ,SACA,wCACI,gDACI,wCACI,mDAAoDA,EAAI,UAAY,YAExE,SACJ,SACJ,UACF8B,KAAK,OAKXI,SAAW,WAAY,MAAO,2BAM9B5B,EAA6B,SAAsCH,EAAUuE,GAG7E,MAFAA,GAAUA,MACVA,EAAQS,MAAQnF,EAAI,+CACbH,EAAauF,uBAAwBjF,EAAUuE,EAASrC,GAuB/D,QACIA,sBAA8BA,EAC9B/B,2BAA8BA,EAC9BL,qBAA8BA"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -16,65 +16,32 @@ $(function(){
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
## <%def name="javascript_app()">
|
||||
## <script type="text/javascript">
|
||||
## define( 'app', function(){
|
||||
## require([
|
||||
## //'mvc/history/history-panel'
|
||||
## //'mvc/history/history-panel-annotated'
|
||||
## 'mvc/history/history-panel-edit'
|
||||
## //'mvc/history/history-panel-edit-current'
|
||||
## ], function( historyPanel ){
|
||||
## $(function(){
|
||||
## // history module is already in the dpn chain from the panel. We can re-scope it here.
|
||||
## var historyModel = require( 'mvc/history/history-model' );
|
||||
## //window.panel = new historyPanel.HistoryPanel({
|
||||
## //window.panel = new historyPanel.AnnotatedHistoryPanel({
|
||||
## window.panel = new historyPanel.HistoryPanelEdit({
|
||||
## //window.panel = new historyPanel.CurrentHistoryPanel({
|
||||
## show_deleted : bootstrapped.show_deleted,
|
||||
## show_hidden : bootstrapped.show_hidden,
|
||||
## purgeAllowed : Galaxy.config.allow_user_dataset_purge,
|
||||
## model : new historyModel.History( bootstrapped.history, bootstrapped.hdas )
|
||||
## });
|
||||
## panel.render().$el.appendTo( 'body' );
|
||||
## //$( 'body' ).css( 'padding', '10px' );
|
||||
## });
|
||||
## });
|
||||
## });
|
||||
## </script>
|
||||
## ${ galaxy_client.load( app='app', history=history, hdas=hdas, show_deleted=show_deleted, show_hidden=show_hidden ) }
|
||||
## </%def>
|
||||
|
||||
<%def name="javascript_app()">
|
||||
<script type="text/javascript">
|
||||
define( 'app', function(){
|
||||
require([
|
||||
'mvc/history/history-contents',
|
||||
// 'mvc/collection/list-collection-creator'
|
||||
'mvc/collection/pair-collection-creator'
|
||||
// ], function( HISTORY_CONTENTS, LCC ){
|
||||
], function( HISTORY_CONTENTS, PCC ){
|
||||
$(function(){
|
||||
var hdas = bootstrapped.hdas.filter( function( hda ){
|
||||
return ( hda.state === 'ok' )
|
||||
&& !( hda.deleted || hda.purged );
|
||||
});
|
||||
hdas = hdas.slice( 0, 2 )
|
||||
console.debug( hdas );
|
||||
var collection = new HISTORY_CONTENTS.HistoryContents( hdas, { historyId : bootstrapped.history.id })
|
||||
|
||||
// LCC.listCollectionCreatorModal( hdas )
|
||||
PCC.createPairCollection( collection )
|
||||
.done( function( response ){
|
||||
console.info( 'creation succeeded:', arguments );
|
||||
})
|
||||
.fail( function( response ){
|
||||
console.error( 'creation failed:', arguments );
|
||||
});
|
||||
define( 'app', function(){
|
||||
require([
|
||||
//'mvc/history/history-panel'
|
||||
//'mvc/history/history-panel-annotated'
|
||||
'mvc/history/history-panel-edit'
|
||||
//'mvc/history/history-panel-edit-current'
|
||||
], function( historyPanel ){
|
||||
$(function(){
|
||||
// history module is already in the dpn chain from the panel. We can re-scope it here.
|
||||
var historyModel = require( 'mvc/history/history-model' );
|
||||
//window.panel = new historyPanel.HistoryPanel({
|
||||
//window.panel = new historyPanel.AnnotatedHistoryPanel({
|
||||
window.panel = new historyPanel.HistoryPanelEdit({
|
||||
//window.panel = new historyPanel.CurrentHistoryPanel({
|
||||
show_deleted : bootstrapped.show_deleted,
|
||||
show_hidden : bootstrapped.show_hidden,
|
||||
purgeAllowed : Galaxy.config.allow_user_dataset_purge,
|
||||
model : new historyModel.History( bootstrapped.history, bootstrapped.hdas )
|
||||
});
|
||||
panel.render().$el.appendTo( 'body' );
|
||||
//$( 'body' ).css( 'padding', '10px' );
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
${ galaxy_client.load( app='app', history=history, hdas=hdas, show_deleted=show_deleted, show_hidden=show_hidden ) }
|
||||
</%def>
|
||||
|
||||
Reference in New Issue
Block a user