From edcce00aab11d2eaaa3c0e5dcab8a3985a6b4d0a Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Mon, 3 Jun 2019 11:54:14 -0400 Subject: [PATCH 1/3] Fix multipanel history search. --- client/galaxy/scripts/mvc/history/multi-panel.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/galaxy/scripts/mvc/history/multi-panel.js b/client/galaxy/scripts/mvc/history/multi-panel.js index 7df50251f15..80157a2a5b7 100644 --- a/client/galaxy/scripts/mvc/history/multi-panel.js +++ b/client/galaxy/scripts/mvc/history/multi-panel.js @@ -835,7 +835,6 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ /** Set up any view plugins */ setUpBehaviors: function() { this._moreOptionsPopover(); - // input to search histories this.$("#search-histories").searchInput({ name: "search-histories", @@ -850,10 +849,14 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ }); }, onsearch: searchFor => { + const multipanel = this; this.historySearch = searchFor; this.filters = [ - () => { - return this.model.matchesAll(this.historySearch); + function() { + // This is intentionally a function where 'this' gets + // bound, applying the filter to the model of the + // caller. + return this.model.matchesAll(multipanel.historySearch); } ]; this.renderColumns(0); From b732950c709b6c0efecb162bd06edb44941669b8 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 4 Jun 2019 11:45:36 -0400 Subject: [PATCH 2/3] Actually search in onfirstsearch of history search in multipanel --- .../galaxy/scripts/mvc/history/multi-panel.js | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/client/galaxy/scripts/mvc/history/multi-panel.js b/client/galaxy/scripts/mvc/history/multi-panel.js index 80157a2a5b7..627f137eabb 100644 --- a/client/galaxy/scripts/mvc/history/multi-panel.js +++ b/client/galaxy/scripts/mvc/history/multi-panel.js @@ -756,7 +756,6 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ "click .order .set-order": "_chooseOrder", "click #toggle-deleted": "_clickToggleDeletedDatasets", "click #toggle-hidden": "_clickToggleHiddenDatasets" - //'dragstart .list-item .title-bar' : function( e ){ console.debug( 'ok' ); } }, close: function(ev) { @@ -768,6 +767,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ this.toggleDeletedHistories($(ev.currentTarget).is(":checked")); this.toggleOptionsPopover(); }, + /** Include deleted histories in the collection */ toggleDeletedHistories: function(show) { if (show) { @@ -835,20 +835,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ /** Set up any view plugins */ setUpBehaviors: function() { this._moreOptionsPopover(); - // input to search histories - this.$("#search-histories").searchInput({ - name: "search-histories", - placeholder: _l("search histories"), - - onfirstsearch: searchFor => { - this.$("#search-histories").searchInput("toggle-loading"); - this.renderInfo(_l("loading all histories for search")); - this.collection.fetchAll().done(() => { - this.$("#search-histories").searchInput("toggle-loading"); - this.renderInfo(""); - }); - }, - onsearch: searchFor => { + const searchHistories = searchFor => { const multipanel = this; this.historySearch = searchFor; this.filters = [ @@ -860,7 +847,23 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ } ]; this.renderColumns(0); + }; + // input to search histories + this.$("#search-histories").searchInput({ + name: "search-histories", + placeholder: _l("search histories"), + + onfirstsearch: searchFor => { + this.$("#search-histories").searchInput("toggle-loading"); + this.renderInfo(_l("loading all histories for search")); + this.collection.fetchAll().done(() => { + this.$("#search-histories").searchInput("toggle-loading"); + this.renderInfo(""); + searchHistories(searchFor); + }); }, + + onsearch: searchHistories, onclear: searchFor => { this.historySearch = null; //TODO: remove specifically not just reset From 8edffb118ae4eaa43990e328bd4d8b434b49a3eb Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 4 Jun 2019 11:47:21 -0400 Subject: [PATCH 3/3] const, formatting --- .../galaxy/scripts/mvc/history/multi-panel.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/client/galaxy/scripts/mvc/history/multi-panel.js b/client/galaxy/scripts/mvc/history/multi-panel.js index 627f137eabb..431b3b47419 100644 --- a/client/galaxy/scripts/mvc/history/multi-panel.js +++ b/client/galaxy/scripts/mvc/history/multi-panel.js @@ -473,7 +473,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ /** create a column and its panel and set up any listeners to them */ createColumn: function createColumn(history, options) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); // options passed can be re-used, so extend them before adding the model to prevent pollution for the next options = _.extend({}, options, { model: history, @@ -836,17 +836,17 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ setUpBehaviors: function() { this._moreOptionsPopover(); const searchHistories = searchFor => { - const multipanel = this; - this.historySearch = searchFor; - this.filters = [ - function() { - // This is intentionally a function where 'this' gets - // bound, applying the filter to the model of the - // caller. - return this.model.matchesAll(multipanel.historySearch); - } - ]; - this.renderColumns(0); + const multipanel = this; + this.historySearch = searchFor; + this.filters = [ + function() { + // This is intentionally a function where 'this' gets + // bound, applying the filter to the model of the + // caller. + return this.model.matchesAll(multipanel.historySearch); + } + ]; + this.renderColumns(0); }; // input to search histories this.$("#search-histories").searchInput({