mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
UI, History: use copy dialog in history/view for import, minor fixes
This commit is contained in:
@@ -155,7 +155,7 @@ var CopyDialog = {
|
||||
* Subclass CopyDialog to use the import language.
|
||||
*/
|
||||
var ImportDialog = _.extend( {}, CopyDialog, {
|
||||
defaultName : _.template( "imported: '<%- name %>" ),
|
||||
defaultName : _.template( "imported: <%- name %>" ),
|
||||
title : _.template( _l( 'Importing history' ) + ' "<%- name %>"' ),
|
||||
submitLabel : _l( 'Import' ),
|
||||
errorMessage : _l( 'History could not be imported' ),
|
||||
@@ -178,7 +178,7 @@ var ImportDialog = _.extend( {}, CopyDialog, {
|
||||
* (this object is also passed to the modal used to display the dialog and accepts modal options)
|
||||
* {Function} nameFn if defined, use this to build the default name shown to the user
|
||||
* (the fn is passed: {name: <original history's name>})
|
||||
* {bool} import if true, use the 'import' language (instead of Copy)
|
||||
* {bool} useImport if true, use the 'import' language (instead of Copy)
|
||||
* {bool} allowAll if true, allow the user to choose between copying all datasets and
|
||||
* only non-deleted datasets
|
||||
* {String} allDatasets default initial checked radio button: 'copy-all' or 'copy-non-deleted',
|
||||
@@ -187,7 +187,7 @@ var historyCopyDialog = function( history, options ){
|
||||
options = options || {};
|
||||
// create our own modal if Galaxy doesn't have one (mako tab without use_panels)
|
||||
var modal = window.parent.Galaxy.modal || new MODAL.View({});
|
||||
return options.import?
|
||||
return options.useImport?
|
||||
ImportDialog.dialog( modal, history, options ):
|
||||
CopyDialog.dialog( modal, history, options );
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"copy-dialog.js","sources":["../../../src/mvc/history/copy-dialog.js"],"names":["define","MODAL","_l","CopyDialog","defaultName","_","template","title","submitLabel","errorMessage","progressive","activeLabel","allLabel","anonWarning","_template","join","_showAjaxIndicator","indicator","this","modal","$","empty","append","css","margin-top","dialog","history","options","checkNameAndCopy","name","val","show","copyAllDatasets","prop","copy","done","response","deferred","resolve","fail","alert","rejectWith","arguments","always","hide","jQuery","Deferred","defaultCopyNameFn","nameFn","defaultCopyName","get","defaultCopyWhat","allDatasets","allowAll","isUndefined","originalClosingCallback","closing_callback","extend","body","isAnon","Galaxy","user","isAnonymous","copyWhat","buttons","object","height","closing_events","cancelled","reject","focus","select","on","ev","keyCode","preventDefault","ImportDialog","historyCopyDialog","window","parent","View","import"],"mappings":"AAAAA,QACI,kBACA,sBACD,SAAUC,EAAOC,GAEpB,YAOA,IAAIC,IAGAC,YAAkBC,EAAEC,SAAU,yBAC9BC,MAAkBF,EAAEC,SAAUJ,EAAI,mBAAsB,kBACxDM,YAAkBN,EAAI,QACtBO,aAAkBP,EAAI,+BACtBQ,YAAkBR,EAAI,mBACtBS,YAAkBT,EAAI,8CACtBU,SAAkBV,EAAI,4CACtBW,YAAkBX,EAAI,2FACJA,EAAI,gCAGtBY,UAAYT,EAAEC,UAGV,sBACI,+BACI,qBACAJ,EAAI,WACJ,0BAA2BA,EAAI,cAAgB,QAASA,EAAI,MAAQ,IACpE,2BAA4BA,EAAI,iBAAmB,QACvD,SACJ,UACA,SACI,iCACIA,EAAI,qCAAuC,IAC/C,iBAGA,+FACA,iGACIA,EAAI,sCACR,OAEA,wBACI,SACA,MAAOA,EAAI,+DAAiE,OAE5E,uFACI,uEACJ,4DACA,SACA,uEACI,+DACJ,iDACJ,UACJ,WACFa,KAAM,KAGRC,mBAAqB,WACjB,GAAIC,GAAY,kDAAoDC,KAAKR,YAAc,SACvFQ,MAAKC,MAAMC,EAAG,eAAgBC,QAAQC,OAAQL,GAAYM,KAAMC,aAAc,SAKlFC,OAAS,SAAkBN,EAAOO,EAASC,GAevC,QAASC,KACL,GAAIC,GAAOV,EAAMC,EAAG,qBAAsBU,KAC1C,KAAKD,EAED,WADAV,GAAMC,EAAG,kBAAmBW,MAIhC,IAAIC,GAAyE,aAAvDb,EAAMC,EAAG,mCAAoCU,KACnEX,GAAMC,EAAG,UAAWa,KAAM,YAAY,GACtCR,EAAOT,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I,qBAAwB,kBAC1DM,YAAkBN,EAAI,UACtBO,aAAkBP,EAAI,iCACtBQ,YAAkBR,EAAI,qBACtBS,YAAkBT,EAAI,gDACtBU,SAAkBV,EAAI,8CACtBW,YAAkBX,EAAI,2FACJA,EAAI,oCAoBtB2E,EAAoB,SAAUnD,EAASC,GACvCA,EAAUA,KAEV,IAAIR,GAAQ2D,OAAOC,OAAOnB,OAAOzC,OAAS,GAAIlB,GAAM+E,QACpD,OAAOrD,GAAQsD,OACXL,EAAanD,OAAQN,EAAOO,EAASC,GACrCxB,EAAWsB,OAAQN,EAAOO,EAASC,GAKvC,OAAOkD"}
|
||||
{"version":3,"file":"copy-dialog.js","sources":["../../../src/mvc/history/copy-dialog.js"],"names":["define","MODAL","_l","CopyDialog","defaultName","_","template","title","submitLabel","errorMessage","progressive","activeLabel","allLabel","anonWarning","_template","join","_showAjaxIndicator","indicator","this","modal","$","empty","append","css","margin-top","dialog","history","options","checkNameAndCopy","name","val","show","copyAllDatasets","prop","copy","done","response","deferred","resolve","fail","alert","rejectWith","arguments","always","hide","jQuery","Deferred","defaultCopyNameFn","nameFn","defaultCopyName","get","defaultCopyWhat","allDatasets","allowAll","isUndefined","originalClosingCallback","closing_callback","extend","body","isAnon","Galaxy","user","isAnonymous","copyWhat","buttons","object","height","closing_events","cancelled","reject","focus","select","on","ev","keyCode","preventDefault","ImportDialog","historyCopyDialog","window","parent","View","useImport"],"mappings":"AAAAA,QACI,kBACA,sBACD,SAAUC,EAAOC,GAEpB,YAOA,IAAIC,IAGAC,YAAkBC,EAAEC,SAAU,yBAC9BC,MAAkBF,EAAEC,SAAUJ,EAAI,mBAAsB,kBACxDM,YAAkBN,EAAI,QACtBO,aAAkBP,EAAI,+BACtBQ,YAAkBR,EAAI,mBACtBS,YAAkBT,EAAI,8CACtBU,SAAkBV,EAAI,4CACtBW,YAAkBX,EAAI,2FACJA,EAAI,gCAGtBY,UAAYT,EAAEC,UAGV,sBACI,+BACI,qBACAJ,EAAI,WACJ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OAAQsB,KAAMH,EAAQwB,IAAK,UAC1CQ,KAAUtC,EAAGK,EAAOX,WACZe,KAAcoB,EACdU,OAAcC,OAAOC,KAAKC,cAC1BT,SAAcA,EACdU,SAAcZ,EACdxC,YAAcO,KAAKP,YACnBC,SAAcM,KAAKN,SACnBC,YAAcK,KAAKL,eAE3BmD,QAAU3D,EAAE4D,SACF/D,EAAI,UAAc,WAAYiB,EAAMyB,UACpC1B,KAAKV,YAAaoB,KAE5BsC,OAAkB,OAClBC,gBAAkB,EAClBX,iBAAkB,SAA4BY,GAClCA,GACA/B,EAASgC,QAASD,WAAY,IAE9Bb,GACAA,EAAyBa,OAMzCjD,EAAMC,EAAG,qBAAsBkD,QAAQC,SACvCpD,EAAMC,EAAG,qBAAsBoD,GAAI,UAAW,SAAUC,GACjC,KAAfA,EAAGC,UACHD,EAAGE,iBACH/C,OAIDS,IASXuC,EAAevE,EAAEoD,UAAYtD,GAC7BC,YAAkBC,EAAEC,SAAU,yBAC9BC,MAAkBF,EAAEC,SAAUJ,EAAI,qBAAwB,kBAC1DM,YAAkBN,EAAI,UACtBO,aAAkBP,EAAI,iCACtBQ,YAAkBR,EAAI,qBACtBS,YAAkBT,EAAI,gDACtBU,SAAkBV,EAAI,8CACtBW,YAAkBX,EAAI,2FACJA,EAAI,oCAoBtB2E,EAAoB,SAAUnD,EAASC,GACvCA,EAAUA,KAEV,IAAIR,GAAQ2D,OAAOC,OAAOnB,OAAOzC,OAAS,GAAIlB,GAAM+E,QACpD,OAAOrD,GAAQsD,UACXL,EAAanD,OAAQN,EAAOO,EAASC,GACrCxB,EAAWsB,OAAQN,EAAOO,EAASC,GAKvC,OAAOkD"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["mvc/ui/ui-modal","utils/localization"],function(a,b){"use strict";var c={defaultName:_.template("Copy of '<%- name %>'"),title:_.template(b("Copying history")+' "<%- name %>"'),submitLabel:b("Copy"),errorMessage:b("History could not be copied"),progressive:b("Copying history"),activeLabel:b("Copy only the active, non-deleted datasets"),allLabel:b("Copy all datasets including deleted ones"),anonWarning:b("As an anonymous user, unless you login or register, you will lose your current history ")+b("after copying this history. "),_template:_.template(["<% if( isAnon ){ %>",'<div class="warningmessage">',"<%- anonWarning %>",b("You can"),' <a href="/user/login">',b("login here"),"</a> ",b("or")," ",' <a href="/user/create">',b("register here"),"</a>.","</div>","<% } %>","<form>",'<label for="copy-modal-title">',b("Enter a title for the new history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="<%= name %>" />','<p class="invalid-title bg-danger" style="color: red; margin: 8px 0px 8px 0px; display: none">',b("Please enter a valid history title"),"</p>","<% if( allowAll ){ %>","<br />","<p>",b("Choose which datasets from the original history to include:"),"</p>",'<input name="copy-what" type="radio" id="copy-non-deleted" value="copy-non-deleted" ','<% if( copyWhat === "copy-non-deleted" ){ print( "checked" ); } %>/>','<label for="copy-non-deleted"> <%- activeLabel %></label>',"<br />",'<input name="copy-what" type="radio" id="copy-all" value="copy-all" ','<% if( copyWhat === "copy-all" ){ print( "checked" ); } %>/>','<label for="copy-all"> <%- allLabel %></label>',"<% } %>","</form>"].join("")),_showAjaxIndicator:function(){var a='<p><span class="fa fa-spinner fa-spin"></span> '+this.progressive+"...</p>";this.modal.$(".modal-body").empty().append(a).css({"margin-top":"8px"})},dialog:function(a,c,d){function e(){var d=a.$("#copy-modal-title").val();if(!d)return void a.$(".invalid-title").show();var e="copy-all"===a.$('input[name="copy-what"]:checked').val();a.$("button").prop("disabled",!0),f._showAjaxIndicator(),c.copy(!0,d,e).done(function(a){g.resolve(a)}).fail(function(){alert([this.errorMessage,b("Please contact a Galaxy administrator")].join(". ")),g.rejectWith(g,arguments)}).always(function(){a.hide()})}d=d||{};var f=this,g=jQuery.Deferred(),h=d.nameFn||this.defaultName,i=h({name:c.get("name")}),j=d.allDatasets?"copy-all":"copy-non-deleted",k=_.isUndefined(d.allowAll)?!0:d.allowAll;this.modal=a;var l=d.closing_callback;return a.show(_.extend(d,{title:this.title({name:c.get("name")}),body:$(f._template({name:i,isAnon:Galaxy.user.isAnonymous(),allowAll:k,copyWhat:j,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:_.object([[b("Cancel"),function(){a.hide()}],[this.submitLabel,e]]),height:"auto",closing_events:!0,closing_callback:function(a){a&&g.reject({cancelled:!0}),l&&l(a)}})),a.$("#copy-modal-title").focus().select(),a.$("#copy-modal-title").on("keydown",function(a){13===a.keyCode&&(a.preventDefault(),e())}),g}},d=_.extend({},c,{defaultName:_.template("imported: '<%- name %>"),title:_.template(b("Importing history")+' "<%- name %>"'),submitLabel:b("Import"),errorMessage:b("History could not be imported"),progressive:b("Importing history"),activeLabel:b("Import only the active, non-deleted datasets"),allLabel:b("Import all datasets including deleted ones"),anonWarning:b("As an anonymous user, unless you login or register, you will lose your current history ")+b("after importing this history. ")}),e=function(b,e){e=e||{};var f=window.parent.Galaxy.modal||new a.View({});return e.import?d.dialog(f,b,e):c.dialog(f,b,e)};return e});
|
||||
define(["mvc/ui/ui-modal","utils/localization"],function(a,b){"use strict";var c={defaultName:_.template("Copy of '<%- name %>'"),title:_.template(b("Copying history")+' "<%- name %>"'),submitLabel:b("Copy"),errorMessage:b("History could not be copied"),progressive:b("Copying history"),activeLabel:b("Copy only the active, non-deleted datasets"),allLabel:b("Copy all datasets including deleted ones"),anonWarning:b("As an anonymous user, unless you login or register, you will lose your current history ")+b("after copying this history. "),_template:_.template(["<% if( isAnon ){ %>",'<div class="warningmessage">',"<%- anonWarning %>",b("You can"),' <a href="/user/login">',b("login here"),"</a> ",b("or")," ",' <a href="/user/create">',b("register here"),"</a>.","</div>","<% } %>","<form>",'<label for="copy-modal-title">',b("Enter a title for the new history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="<%= name %>" />','<p class="invalid-title bg-danger" style="color: red; margin: 8px 0px 8px 0px; display: none">',b("Please enter a valid history title"),"</p>","<% if( allowAll ){ %>","<br />","<p>",b("Choose which datasets from the original history to include:"),"</p>",'<input name="copy-what" type="radio" id="copy-non-deleted" value="copy-non-deleted" ','<% if( copyWhat === "copy-non-deleted" ){ print( "checked" ); } %>/>','<label for="copy-non-deleted"> <%- activeLabel %></label>',"<br />",'<input name="copy-what" type="radio" id="copy-all" value="copy-all" ','<% if( copyWhat === "copy-all" ){ print( "checked" ); } %>/>','<label for="copy-all"> <%- allLabel %></label>',"<% } %>","</form>"].join("")),_showAjaxIndicator:function(){var a='<p><span class="fa fa-spinner fa-spin"></span> '+this.progressive+"...</p>";this.modal.$(".modal-body").empty().append(a).css({"margin-top":"8px"})},dialog:function(a,c,d){function e(){var d=a.$("#copy-modal-title").val();if(!d)return void a.$(".invalid-title").show();var e="copy-all"===a.$('input[name="copy-what"]:checked').val();a.$("button").prop("disabled",!0),f._showAjaxIndicator(),c.copy(!0,d,e).done(function(a){g.resolve(a)}).fail(function(){alert([this.errorMessage,b("Please contact a Galaxy administrator")].join(". ")),g.rejectWith(g,arguments)}).always(function(){a.hide()})}d=d||{};var f=this,g=jQuery.Deferred(),h=d.nameFn||this.defaultName,i=h({name:c.get("name")}),j=d.allDatasets?"copy-all":"copy-non-deleted",k=_.isUndefined(d.allowAll)?!0:d.allowAll;this.modal=a;var l=d.closing_callback;return a.show(_.extend(d,{title:this.title({name:c.get("name")}),body:$(f._template({name:i,isAnon:Galaxy.user.isAnonymous(),allowAll:k,copyWhat:j,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:_.object([[b("Cancel"),function(){a.hide()}],[this.submitLabel,e]]),height:"auto",closing_events:!0,closing_callback:function(a){a&&g.reject({cancelled:!0}),l&&l(a)}})),a.$("#copy-modal-title").focus().select(),a.$("#copy-modal-title").on("keydown",function(a){13===a.keyCode&&(a.preventDefault(),e())}),g}},d=_.extend({},c,{defaultName:_.template("imported: <%- name %>"),title:_.template(b("Importing history")+' "<%- name %>"'),submitLabel:b("Import"),errorMessage:b("History could not be imported"),progressive:b("Importing history"),activeLabel:b("Import only the active, non-deleted datasets"),allLabel:b("Import all datasets including deleted ones"),anonWarning:b("As an anonymous user, unless you login or register, you will lose your current history ")+b("after importing this history. ")}),e=function(b,e){e=e||{};var f=window.parent.Galaxy.modal||new a.View({});return e.useImport?d.dialog(f,b,e):c.dialog(f,b,e)};return e});
|
||||
//# sourceMappingURL=../../../maps/mvc/history/copy-dialog.js.map
|
||||
@@ -60,7 +60,7 @@
|
||||
history = new historyModel.History( historyJSON, contentsJSON, {});
|
||||
|
||||
$( '.history-copy-link' ).click( function( ev ){
|
||||
historyCopyDialog( history, { import: true, allowAll: false })
|
||||
historyCopyDialog( history, { useImport: true, allowAll: false })
|
||||
.done( function(){
|
||||
window.location.href = Galaxy.root;
|
||||
});
|
||||
|
||||
@@ -71,9 +71,6 @@ a.btn {
|
||||
## ----------------------------------------------------------------------------
|
||||
<%def name="center_panel()">
|
||||
<%
|
||||
imp_with_deleted_url = h.url_for( controller='history', action='imp', id=history[ 'id' ], all_datasets=True )
|
||||
imp_without_deleted_url = h.url_for( controller='history', action='imp', id=history[ 'id' ] )
|
||||
|
||||
structure_url = h.url_for( controller='history', action='display_structured', id=history[ 'id' ] )
|
||||
|
||||
switch_to_url = h.url_for( controller='history', action='switch_to_history', hist_id=history[ 'id' ] )
|
||||
@@ -91,7 +88,7 @@ a.btn {
|
||||
<div class="pull-left">
|
||||
%if not history[ 'purged' ]:
|
||||
%if not user_is_owner:
|
||||
<button id="import" class="btn btn-default"></button>
|
||||
<button id="import" class="btn btn-default">${ _( 'Import and start using history' ) }</button>
|
||||
%elif not history_is_current:
|
||||
<button id="switch" class="btn btn-default">${ _( 'Switch to this history' ) }</button>
|
||||
%endif
|
||||
@@ -117,11 +114,6 @@ a.btn {
|
||||
{ mode: 'showing_deleted', html: _l( 'Exclude deleted' ) },
|
||||
{ mode: 'not_showing_deleted', html: _l( 'Include deleted' ) }
|
||||
]
|
||||
}).click( function(){
|
||||
// allow the 'include/exclude deleted' button to control whether the 'import' button includes deleted
|
||||
// datasets when importing or not; when deleted datasets are shown, they'll be imported
|
||||
$( '#import' ).modeButton( 'setMode',
|
||||
$( this ).modeButton( 'current' ) === 'showing_deleted'? 'with_deleted': 'without_deleted' );
|
||||
});
|
||||
|
||||
$( '#toggle-hidden' ).modeButton({
|
||||
@@ -136,7 +128,7 @@ a.btn {
|
||||
//##HACK:ity hack hack
|
||||
//##TODO: remove when out of iframe
|
||||
var hview = Galaxy.currHistoryPanel
|
||||
|| ( top.Galaxy && top.Galaxy.currHistoryPanel )? top.Galaxy.currHistoryPanel : null;
|
||||
|| ( top.Galaxy && top.Galaxy.currHistoryPanel )? top.Galaxy.currHistoryPanel : null;
|
||||
if( hview ){
|
||||
hview.switchToHistory( "${ history[ 'id' ] }" );
|
||||
} else {
|
||||
@@ -144,22 +136,6 @@ a.btn {
|
||||
}
|
||||
});
|
||||
|
||||
$( '#import' ).modeButton({
|
||||
switchModesOnClick : false,
|
||||
initialMode : "${ 'with_deleted' if show_deleted else 'without_deleted' }",
|
||||
modes: [
|
||||
{ mode: 'with_deleted', html: _l( 'Import with deleted datasets and start using history' ),
|
||||
onclick: function importWithDeleted(){
|
||||
window.location = '${imp_with_deleted_url}';
|
||||
}
|
||||
},
|
||||
{ mode: 'without_deleted', html: _l( 'Import and start using history' ),
|
||||
onclick: function importWithoutDeleted(){
|
||||
window.location = '${imp_without_deleted_url}';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
// use_panels effects where the the center_panel() is rendered:
|
||||
@@ -183,11 +159,13 @@ a.btn {
|
||||
})([
|
||||
'mvc/user/user-model',
|
||||
viewToUse.location,
|
||||
'mvc/history/copy-dialog',
|
||||
'utils/localization',
|
||||
'ui/mode-button'
|
||||
], function( user, viewMod, _l ){
|
||||
], function( user, viewMod, historyCopyDialog, _l ){
|
||||
$(function(){
|
||||
setUpBehaviors();
|
||||
|
||||
if( hasMasthead ){
|
||||
$( '#center' ).css( 'overflow', 'auto' );
|
||||
}
|
||||
@@ -197,6 +175,21 @@ a.btn {
|
||||
HISTORY = require( 'mvc/history/history-model' ),
|
||||
historyModel = new HISTORY.History( historyJSON, contentsJSON );
|
||||
|
||||
// attach the copy dialog to the import button now that we have a history
|
||||
$( '#import' ).click( function( ev ){
|
||||
historyCopyDialog( historyModel, {
|
||||
useImport : true,
|
||||
// use default datasets option to match the toggle-deleted button
|
||||
allDatasets : $( '#toggle-deleted' ).modeButton( 'getMode' ).mode === 'showing_deleted',
|
||||
}).done( function(){
|
||||
if( window === window.parent ){
|
||||
window.location = Galaxy.root;
|
||||
} else if( Galaxy.currHistoryPanel ){
|
||||
Galaxy.currHistoryPanel.loadCurrentHistory();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.historyView = new viewClass({
|
||||
show_deleted : ${show_deleted_json},
|
||||
show_hidden : ${show_hidden_json},
|
||||
|
||||
Reference in New Issue
Block a user